-
Notifications
You must be signed in to change notification settings - Fork 0
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
add a default client as a temporary solution #9
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Warning Rate limit exceeded@markusahlstrand has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 31 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request introduces updates to the Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 4
🧹 Outside diff range and nitpick comments (1)
packages/authhero/CHANGELOG.md (1)
3-7
: Enhance the changelog entry with more details.The changelog entry for version 0.19.0 could be more informative. Consider adding:
- The rationale behind adding a fallback client
- The intended duration of this temporary solution
- Any migration steps or impacts on existing implementations
Example enhancement:
## 0.19.0 ### Minor Changes - - add a fallback client as a temporary solution + - Added a fallback client as a temporary solution to handle <describe the specific use case> + - This is a temporary measure until <describe the permanent solution> + - No migration steps required for existing implementations
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
apps/demo/CHANGELOG.md
(1 hunks)apps/demo/package.json
(2 hunks)packages/authhero/CHANGELOG.md
(1 hunks)packages/authhero/package.json
(1 hunks)packages/authhero/src/authentication-flows/authorization-code.ts
(2 hunks)packages/authhero/src/helpers/client.ts
(1 hunks)packages/authhero/test/routes/oauth2/token.spec.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/authhero/package.json
🔇 Additional comments (4)
apps/demo/package.json (2)
4-4
: Version bump to 0.4.0 approved.
The version update accurately reflects the new changes introduced.
13-13
: Dependency update to 'authhero' version '^0.19.0' approved.
The dependency update is appropriate. Ensure compatibility tests are performed with the new version.
apps/demo/CHANGELOG.md (1)
3-13
: Changelog updated correctly for version 0.4.0.
The changelog entries appropriately document the new features and dependency updates.
packages/authhero/test/routes/oauth2/token.spec.ts (1)
339-339
: LGTM! Improved error message clarity.
The change from "Invalid client credentials" to "Client not found" makes the error message more specific and accurate, helping developers better understand the exact cause of the authentication failure.
packages/authhero/src/authentication-flows/authorization-code.ts
Outdated
Show resolved
Hide resolved
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.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
packages/authhero/src/helpers/client.ts (1)
5-12
: Consider using 404 status code for "not found" scenarios.The current implementation uses a 403 (Forbidden) status code when a client is not found. HTTP 404 (Not Found) would be more semantically correct for this scenario.
Additionally, consider adding input validation for the
clientId
parameter.- throw new HTTPException(403, { message: "Client not found" }); + if (!clientId?.trim()) { + throw new HTTPException(400, { message: "Invalid client ID" }); + } + throw new HTTPException(404, { message: "Client not found" });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
packages/authhero/src/authentication-flows/authorization-code.ts
(2 hunks)packages/authhero/src/helpers/client.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/authhero/src/authentication-flows/authorization-code.ts
🔇 Additional comments (2)
packages/authhero/src/helpers/client.ts (2)
24-34
:
Fix potential error when spreading undefined defaultConnection
.
The spreading of potentially undefined values could cause runtime errors.
Apply this diff to fix the issue:
const mergedConnection = connectionSchema.parse({
- ...defaultConnection,
+ ...(defaultConnection || {}),
...connection,
options: {
- ...defaultConnection?.options,
+ ...(defaultConnection?.options || {}),
...connection.options,
},
});
38-61
: Document the merging behavior and handle undefined spreads consistently.
The order of merging properties from default and specific clients affects the final result. This should be documented, and undefined spreads should be handled consistently.
Consider adding JSDoc comments to explain the merging behavior:
/**
* Merges client properties with a default client if it exists.
* Properties from the specific client take precedence over the default client,
* except for arrays which are concatenated.
*/
Also verify the merging behavior is consistent across the codebase:
Summary by CodeRabbit
New Features
@authhero/demo
andauthhero
packages.Bug Fixes
Documentation
Tests