Skip to content
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

Merged
merged 4 commits into from
May 13, 2024

Conversation

erdimaden
Copy link
Contributor

What changed? Why?

Adding authenticator class and unit tests

@@ -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",
Copy link
Contributor Author

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

@erdimaden erdimaden marked this pull request as ready for review May 13, 2024 17:08
url: "https://api.cdp.coinbase.com/platform/v1/users/me",
headers: {} as AxiosHeaders,
};
const authenticator = new CoinbaseAuthenticator("api_key", "private_key");
Copy link
Contributor

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?

Copy link
Contributor

@John-peterson-coinbase John-peterson-coinbase left a 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 Show resolved Hide resolved
src/coinbase/authenticator.ts Outdated Show resolved Hide resolved
src/coinbase/authenticator.ts Outdated Show resolved Hide resolved
src/coinbase/authenticator.ts Outdated Show resolved Hide resolved
src/coinbase/authenticator.ts Outdated Show resolved Hide resolved
private apiKey: string;
private privateKey: string;

/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*
/**

Copy link
Contributor

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

@erdimaden erdimaden removed the request for review from yuga-cb May 13, 2024 18:54
@erdimaden erdimaden merged commit 7ca5e2e into master May 13, 2024
3 checks passed
@erdimaden erdimaden deleted the feature/authenticator-class branch June 21, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants