fix(config-api): user birthday not displayed when fetched #12799 by pujavs · Pull Request #12803 · JanssenProject/jans (original) (raw)
📝 Walkthrough
Walkthrough
This pull request adds comprehensive transaction token (tx_token) support to the API configuration schema and fixes a bug where user birthday attributes are not returned in GET requests by modifying birthdate attribute parsing logic in the user management service.
Changes
| Cohort / File(s) | Summary |
|---|---|
| API Configuration Update jans-config-api/docs/jans-config-api-swagger.yaml | Extended OpenAPI/Swagger configuration to support transaction tokens across multiple sections. Added tx_token to response types, token types, and OAuth client configurations. Introduced new Client schema properties: txTokenLifetime, txTokenSignedResponseAlg, txTokenEncryptedResponseAlg, txTokenEncryptedResponseEnc. Extended TokenEntity, Scope, CustomScope, and UmaResource schemas with transaction token attributes. Added feature flags and configuration options for transaction token handling, including signing/encryption algorithms and lifetime controls throughout ApiAppConfiguration. |
| User Management Bug Fix jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/rest/UserResource.java, jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/service/UserMgmtService.java | Removed per-user birthdate normalization during search results in UserResource. Modified UserMgmtService.parseBirthDateAttribute() to guard against null values and improve error handling. Enhanced logging in removeInActiveCustomAttribute() with intermediate variable for detailed attribute data logging. These changes enable proper birthdate attribute retrieval in GET requests. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
- Swagger YAML schema extensions: While the configuration file is large with many additions, the changes follow consistent patterns for transaction token support across multiple schema definitions. Review can focus on structural correctness and consistency.
- Birthdate attribute handling logic: The modifications in
UserMgmtService.parseBirthDateAttribute()require careful verification to ensure null-safety improvements and the logging enhancements correctly address the reported bug. The removal of birthdate parsing fromUserResource.doSearch()needs validation against the fix intent. - Integration validation: Confirm that moving birthdate parsing responsibility from
UserResourcetoUserMgmtServicedoesn't inadvertently affect other code paths or introduce regressions in attribute handling.
Pre-merge checks and finishing touches
❌ Failed checks (2 warnings, 1 inconclusive)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Out of Scope Changes check | ⚠️ Warning | The PR includes significant out-of-scope changes: extensive Swagger YAML modifications for transaction token support (tx_token) and various schema enhancements are unrelated to fixing the birthday display issue. | Remove transaction token and other unrelated changes from this PR. Create a separate PR for the tx_token feature additions to maintain clear scope and review focus. |
| 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. |
| Description check | ❓ Inconclusive | The PR description includes the required sections (Target issue, Implementation Details) and correctly references issue #12799. However, all testing and documentation checklist items remain unchecked, indicating incomplete verification. | Complete the pre-submission checklist by confirming static analysis has been run, tests have been added/updated, and documentation impact has been assessed. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly and accurately summarizes the main change: fixing the issue where user birthday is not displayed when fetched, referencing the specific issue #12799. |
| Linked Issues check | ✅ Passed | The PR addresses the core requirement in #12799 by fixing the date parsing logic that prevented birthday from being returned in GET requests, aligning with the expected behavior. |
✨ 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-config-12799
📜 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 f045fba and 677a44b.
📒 Files selected for processing (3)
jans-config-api/docs/jans-config-api-swagger.yaml(4 hunks)jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/rest/UserResource.java(0 hunks)jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/service/UserMgmtService.java(3 hunks) 💤 Files with no reviewable changes (1)- jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/rest/UserResource.java 🧰 Additional context used 🧠 Learnings (1) 📚 Learning: 2025-11-19T12:55:01.596Z
Learnt from: yuriyz
Repo: JanssenProject/jans PR: 12596
File: docs/janssen-server/auth-server/tokens/oauth-tx-tokens.md:146-257
Timestamp: 2025-11-19T12:55:01.596Z
Learning: In the Janssen project, the TxToken custom script documentation is intentionally duplicated in both `docs/janssen-server/auth-server/tokens/oauth-tx-tokens.md` and `docs/script-catalog/tx_token/txtoken.md` to provide easy access from both the transaction token documentation and the script catalog.
Applied to files:
jans-config-api/docs/jans-config-api-swagger.yaml⏰ 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). (7)- GitHub Check: sonar scan (jans-link)
- GitHub Check: sonar scan (jans-auth-server)
- GitHub Check: sonar scan (jans-orm)
- GitHub Check: sonar scan (jans-config-api)
- GitHub Check: sonar scan (jans-linux-setup)
- GitHub Check: sonar scan (jans-core)
- GitHub Check: cleanup 🔇 Additional comments (2)
jans-config-api/docs/jans-config-api-swagger.yaml (2)
4796-4802: ⚠️ Critical mismatch: PR objectives and code do not align.The PR objectives state the fix removes date parsing code that was throwing errors when handling user birthdays (issue #12799). However, the file provided contains only OpenAPI schema additions for
tx_tokensupport, with no birthday-related changes or user management service modifications.Either:
- The wrong file was provided for review, or
- The PR description does not accurately reflect the code changes, or
- Additional files containing the actual birthday parsing fix are missing from this review.
Please confirm that all files implementing the birthday bug fix are included in this PR review.
Also applies to: 17057-17063
14949-14968: Clarify the scope and context of property additions.Hunk 2 adds eight boolean properties (
selected,whitePagesCanView,adminCanAccess,userCanEdit,adminCanEdit,userCanAccess,userCanView,adminCanView) to what appears to be an attribute schema.Without schema context (parent object name, purpose), it's unclear whether:
- These properties relate to the tx_token feature or an unrelated feature
- They represent access control for a specific entity (user, ldap configuration, etc.)
- They are part of the PR objectives
Please provide context for these additions or clarify their relationship to the birthday bug fix stated in the PR objectives.
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.