ready to get a real token
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
1
src/bank/teller/token.txt
Normal file
1
src/bank/teller/token.txt
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user