-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding authenticator class and tests #6
Conversation
@@ -12,7 +12,7 @@ | |||
"format": "prettier -c .prettierrc --write \"**/*.{ts,js,cjs,json,md}\"", | |||
"format-check": "prettier -c .prettierrc --check \"**/*.{ts,js,cjs,json,md}\"", | |||
"check": "tsc --noEmit", | |||
"test": "NODE_OPTIONS=--experimental-vm-modules npx jest --no-cache", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this prefix prevents to run jest so removing it
url: "https://api.cdp.coinbase.com/platform/v1/users/me", | ||
headers: {} as AxiosHeaders, | ||
}; | ||
const authenticator = new CoinbaseAuthenticator("api_key", "private_key"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use the authenticator with the valid api key and private key here to ensures that the error being thrown on authenticateRequest
is coming from the invalid config and not prom the invalid private key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM! A few comments about documentation / class method access privacy.
Have we confirmed connectivity using this JWT builder?
src/coinbase/authenticator.ts
Outdated
private apiKey: string; | ||
private privateKey: string; | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* | |
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the starting lines have to be double asterisk
What changed? Why?
Adding authenticator class and unit tests