ready to get a real token

This commit is contained in:
Bel LaPointe
2025-05-23 21:09:26 -06:00
parent 7a946b7604
commit c38e8529af
5 changed files with 28 additions and 1 deletions

View File

@@ -22,6 +22,8 @@ var (
certificate []byte
//go:embed private_key.pem
privateKey []byte
//go:embed token.txt
Token string
)
func New() (Client, error) {
@@ -54,7 +56,7 @@ func (c Client) get(ctx context.Context, url string, ptr interface{}) error {
if err != nil {
return err
}
req.SetBasicAuth("test_token_bfu2cyvq3il6o", "") // TODO
req.SetBasicAuth(Token, "")
req = req.WithContext(ctx)
resp, err := httpc.Do(req)

View File

@@ -10,6 +10,8 @@ import (
)
func Test(t *testing.T) {
teller.Token = "test_token_bfu2cyvq3il6o"
c, err := teller.New()
if err != nil {
t.Fatal(err)

View File

@@ -8,9 +8,13 @@ import (
"net/http"
"testing"
"time"
"gogs.inhome.blapointe.com/ana-ledger/src/bank/teller"
)
func TestIntegration(t *testing.T) {
teller.Token = "test_token_bfu2cyvq3il6o"
//curl --cert certificate.pem --cert-key private_key.pem --auth test_token_bfu2cyvq3il6o: https://api.teller.io/accounts
cert, err := tls.LoadX509KeyPair("./certificate.pem", "./private_key.pem")
if err != nil {

View File

@@ -0,0 +1 @@