-
Notifications
You must be signed in to change notification settings - Fork 3
Add support for access token authentication #24
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
Conversation
ddd93c5 to
5721e12
Compare
n-older
left a comment
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.
Looks good apart from the Copilot suggestions.
5721e12 to
72cf6c6
Compare
72cf6c6 to
7d7fb31
Compare
- Added ability to specify api_key or access_token at request time - Fixed bug with `yarn test [file]` not running just that file because it was combined with `tsd`. Made them two separate tasks. - Improved tests to catch errors when they don't instead of relying on mocha timeout to fail the test. - Updated CI
7d7fb31 to
1f3f4ad
Compare
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.
Pull Request Overview
This PR enhances authentication by adding support for access tokens and refines testing and CI configurations.
- Added support for specifying an accessToken (or apiKey) at request time.
- Refactored promise error handling in tests and separated type testing in package.json.
- Updated documentation and CI to reflect the new authentication options.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/verify.spec.js | Added .catch(done) to promise chains in tests for consistent error handling. |
| test/emailable.test-d.ts | Added a new test for the account endpoint accepting an apiKey parameter. |
| test/batches.spec.js | Adjusted promise chains, but redundant .catch(done) calls were introduced in status tests. |
| test/authentication.spec.js | Introduced comprehensive tests for different authentication mechanisms. |
| test/account.spec.js | Updated error handling with .catch(done) affixed to promise chains. |
| package.json | Split type tests into a separate task and updated package manager settings. |
| lib/emailable.js | Modified constructor to support a default apiKey and updated the account method to accept options. |
| lib/client.js | Implemented support for accessToken by merging it with apiKey and applied request filtering. |
| README.md | Revised authentication documentation to cover both apiKey and accessToken usage. |
| .github/workflows/ci.yml | Expanded the Node.js version matrix and added a step to run type definition tests. |
yarn test [file]not running just that file because it was combined withtsd. Made them two separate tasks.