[TT-14359] fix nested scopes for identity base field#7522
Conversation
|
API Changes no api changes detected |
🔍 Code Analysis ResultsThis PR introduces support for nested JWT claims for identity and policy fields, allowing for more flexible integration with identity providers that issue tokens with complex, structured data. The core of this change is enabling the To ensure full backward compatibility, the implementation introduces a two-step lookup process encapsulated in a new
The functions Files Changed Analysis
Architecture & Impact Assessment
JWT Claim Resolution FlowThe diagram below illustrates the updated logic for resolving a claim value. graph TD
A[Start Claim Resolution] --> B[getClaimValue(claims, fieldName)];
B --> C{Attempt Literal Lookup: claims[fieldName]};
C --> D{Found & Not Empty String?};
D -- Yes --> E[Return Value];
D -- No --> F{Field Name contains "."?};
F -- No --> G[Claim Not Found / Fallback];
F -- Yes --> H[Perform Nested Lookup];
H --> I{Found & Not Empty String?};
I -- Yes --> E;
I -- No --> G;
E --> Z[End];
G --> Z[End];
Scope Discovery & Context Expansion
Metadata
Powered by Visor from Probelabs Last updated: 2025-11-10T10:01:20.082Z | Triggered by: synchronize | Commit: 2d93816 💡 TIP: You can chat with Visor using |
🔍 Code Analysis ResultsSecurity Issues (1)
Architecture Issues (1)
Performance Issues (1)
Quality Issues (2)
✅ Dependency Check PassedNo dependency issues found – changes LGTM. ✅ Connectivity Check PassedNo connectivity issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2025-11-10T10:01:21.091Z | Triggered by: synchronize | Commit: 2d93816 💡 TIP: You can chat with Visor using |
…dentity-base-field' into TT-14359-fix-nested-scopes-for-identity-base-field
|



Description
This PR fixes TT-14359 by adding support for nested JWT claims in the JWTIdentityBaseField and JWTPolicyFieldName configuration fields, allowing users to specify claim paths like user.id or
authorization.policy to extract values from nested JSON structures in JWT tokens. The implementation maintains full backward compatibility by first checking for literal claim keys (including keys that
contain actual dots in their names) before attempting nested lookup, and includes proper fallback behavior to the sub claim when nested identity fields are not found. The changes extend the existing
nestedMapLookup function (previously only used for scopes) to also support identity base field and policy field resolution, with comprehensive test coverage including single-level nesting, multi-level
nesting, fallback scenarios, empty string handling, non-string value handling, multiple policy claim priority, backward compatibility verification, and the specific customer scenario from the ticket
where claims are nested under a test object.
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
Ticket Details
TT-14359
Generated at: 2025-11-10 09:55:12