Fixing #2233 by renewing Session time also in SessionFinder access. A…#2243
Conversation
…dding explicit exception into RefreshFlow for invalid tokens instead of NPE. (#2234) Co-authored-by: Mehmet Can Cömert <mehmet.coemert@kisters.de>
WalkthroughThree session getter methods in SessionFinder now call Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant TokenEndpoint
participant RefreshFlow
participant SessionFinder
participant Session
Client->>TokenEndpoint: POST /token (grant=refresh_token)
TokenEndpoint->>RefreshFlow: processWithParameters(...)
RefreshFlow->>SessionFinder: getSessionForRefreshToken(refreshToken)
alt session found
SessionFinder->>Session: retrieve & touch() %% touch on access
SessionFinder-->>RefreshFlow: session
RefreshFlow->>RefreshFlow: synchronized(session) { validate & issue token }
RefreshFlow-->>TokenEndpoint: success response
else session not found
SessionFinder-->>RefreshFlow: null
RefreshFlow-->>TokenEndpoint: return invalid_grant (fail fast)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
core/src/main/java/com/predic8/membrane/core/interceptor/oauth2/SessionFinder.java(1 hunks)core/src/main/java/com/predic8/membrane/core/interceptor/oauth2/request/tokenrequest/RefreshTokenFlow.java(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
core/src/main/java/com/predic8/membrane/core/interceptor/oauth2/request/tokenrequest/RefreshTokenFlow.java (1)
core/src/main/java/com/predic8/membrane/core/interceptor/oauth2/OAuth2Util.java (1)
OAuth2Util(30-89)
🔇 Additional comments (1)
core/src/main/java/com/predic8/membrane/core/interceptor/oauth2/SessionFinder.java (1)
63-91: LGTM! Session activity tracking implemented consistently.The addition of
session.touch()calls in all three getter methods (getSessionForCode,getSessionForToken,getSessionForRefreshToken) correctly updates session activity on access, which aligns with the PR objective of renewing session timeouts when sessions are retrieved. The pattern is consistent across all three methods and properly synchronized.
|
/ok-to-test |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
core/src/main/java/com/predic8/membrane/core/interceptor/oauth2/request/tokenrequest/RefreshTokenFlow.java(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
core/src/main/java/com/predic8/membrane/core/interceptor/oauth2/request/tokenrequest/RefreshTokenFlow.java (1)
core/src/main/java/com/predic8/membrane/core/interceptor/oauth2/OAuth2Util.java (1)
OAuth2Util(30-89)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Automated tests
- GitHub Check: Analyze (java)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
This pull request needs "/ok-to-test" from an authorized committer. |
…delivered-session-timeout-master
…dding explicit exception into RefreshFlow for invalid tokens instead of NPE. (#2234)
Summary by CodeRabbit
Bug Fixes
Chores