fix(jans-auth-server): ExternalTokenExchangeService.externalValidate returns null instead of result by yuriyz · Pull Request #12809 · JanssenProject/jans (original) (raw)
📝 Walkthrough
Walkthrough
Fixed a bug in ExternalTokenExchangeService.externalValidate() where the method was returning null instead of the computed result variable. The method now correctly returns the validation result from token exchange scripts instead of discarding it.
Changes
| Cohort / File(s) | Summary |
|---|---|
| Bug fix in token exchange validation jans-auth-server/server/src/main/java/io/jans/as/server/service/external/ExternalTokenExchangeService.java | Changed return statement from return null; to return result; in externalValidate() method to properly propagate script validation results |
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~2 minutes
- Single-line fix in one method
- Straightforward correction of incorrect return value
- No structural or logic changes involved
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title accurately describes the main bug fix: changing a return statement from null to the computed result variable in ExternalTokenExchangeService.externalValidate(). |
| Description check | ✅ Passed | The PR description includes the target issue reference (#12804) and confirms no documentation impact, meeting the template requirements. |
| Linked Issues check | ✅ Passed | The code change directly addresses issue #12804 by fixing the return statement in externalValidate() to return the computed result instead of null, as specified. |
| Out of Scope Changes check | ✅ Passed | The change is narrowly focused on fixing the single bug identified in issue #12804 with no additional unrelated modifications. |
✨ Finishing touches
- 📝 Generate docstrings 🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
jans-auth-server-12804
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between c9dc41a and 59aa6a2.
📒 Files selected for processing (1)
jans-auth-server/server/src/main/java/io/jans/as/server/service/external/ExternalTokenExchangeService.java(1 hunks) 🧰 Additional context used 🧠 Learnings (1) 📓 Common learnings
Learnt from: yuriyz
Repo: JanssenProject/jans PR: 12596
File: docs/script-catalog/tx_token/txtoken.md:21-27
Timestamp: 2025-11-19T13:23:56.185Z
Learning: In the Janssen project, yuriyz prefers to skip trivial improvements and nitpicks during code reviews.
⏰ 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: sonar scan (jans-auth-server)
- GitHub Check: cleanup 🔇 Additional comments (1)
jans-auth-server/server/src/main/java/io/jans/as/server/service/external/ExternalTokenExchangeService.java (1)
45-70: LGTM! Correctly fixes the null-return bug.The fix properly returns the
resultvariable instead of discarding it. The error handling remains sound—if an exception occurs duringvalidate(),resultstaysnull, correctly signaling failure to the caller at lines 36-39.
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.
❤️ Share
Comment @coderabbitai help to get the list of available commands and usage tips.