-
Notifications
You must be signed in to change notification settings - Fork 8
feat: added logout url to logout method #102
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
base: main
Are you sure you want to change the base?
feat: added logout url to logout method #102
Conversation
WalkthroughA new overloaded Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Servlet (KindeLogoutServlet)
participant Session (KindeClientSession)
participant Impl (KindeClientSessionImpl)
User->>Servlet: HTTP GET /logout[?redirect_uri=...]
Servlet->>Session: logout(redirect_uri) or logout()
Session->>Impl: logout(redirect_uri) or logout()
Impl->>Impl: Validate redirect_uri (if provided)
Impl->>Impl: Build AuthorizationUrl with redirect_uri
Impl-->>Session: AuthorizationUrl
Session-->>Servlet: AuthorizationUrl
Servlet->>User: Redirect to logout URL
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 0
🧹 Nitpick comments (1)
kinde-core/src/main/java/com/kinde/session/KindeClientSessionImpl.java (1)
167-174
: Proper implementation with input validation.The implementation correctly validates that the logoutRedirectUri parameter is neither null nor empty before constructing the logout URL. This prevents potential null pointer exceptions or invalid URLs.
Consider adding JavaDoc documentation to explain the purpose of this method, its parameters, and the exceptions it can throw. This would enhance API usability.
+ /** + * Logs out the current user session and redirects to the specified URI. + * + * @param logoutRedirectUri The URI to redirect to after logout + * @return AuthorizationUrl containing the complete logout URL + * @throws Exception if logoutRedirectUri is null or empty + */ @Override public AuthorizationUrl logout(String logoutRedirectUri) throws Exception {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
kinde-core/src/main/java/com/kinde/KindeClientSession.java
(1 hunks)kinde-core/src/main/java/com/kinde/session/KindeClientKindeTokenSessionImpl.java
(1 hunks)kinde-core/src/main/java/com/kinde/session/KindeClientSessionImpl.java
(1 hunks)kinde-j2ee/src/main/java/com/kinde/servlet/KindeLogoutServlet.java
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
kinde-j2ee/src/main/java/com/kinde/servlet/KindeLogoutServlet.java (1)
kinde-j2ee/src/main/java/com/kinde/servlet/KindeSingleton.java (1)
KindeSingleton
(7-32)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (4)
kinde-core/src/main/java/com/kinde/KindeClientSession.java (1)
27-28
: Good addition of the overloaded logout method.The new method signature allows for programmatically specifying a custom logout redirect URI, which aligns well with the PR objective.
kinde-core/src/main/java/com/kinde/session/KindeClientKindeTokenSessionImpl.java (1)
29-30
: Appropriate addition of necessary imports.These imports prepare the class to work with the enhanced logout mechanism, supporting the interface changes in
KindeClientSession
.kinde-j2ee/src/main/java/com/kinde/servlet/KindeLogoutServlet.java (1)
30-43
: Well-implemented logic for optional redirect URI parameter.The implementation correctly:
- Extracts the redirect_uri parameter
- Checks if it's valid (not null and not empty)
- Calls the appropriate logout method based on parameter presence
- Maintains the existing session invalidation and redirection logic
kinde-core/src/main/java/com/kinde/session/KindeClientSessionImpl.java (1)
162-165
: Good refactoring of the logout method.The existing method now correctly delegates to the new overloaded method, passing the configured redirect URI from the configuration. This maintains backward compatibility while enabling the new functionality.
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
17477796 | Triggered | JSON Web Token | 641d9fa | kinde-core/src/test/java/com/kinde/token/JwtValidatorTest.java | View secret |
17253219 | Triggered | JSON Web Token | 641d9fa | kinde-core/src/test/java/com/kinde/token/JwtValidatorTest.java | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Explain your changes
Added logout url to the log out methods. So it can be overidden at a code level.
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.