Improve token validation for sub organization applications#3153
Improve token validation for sub organization applications#3153ShanChathusanda93 wants to merge 1 commit intowso2-extensions:masterfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
| introspectionRequest.setRequiredClaimURIs(claimsUris); | ||
| OAuth2TokenValidationRequestDTO.TokenValidationContextParam contextParam = |
There was a problem hiding this comment.
Log Improvement Suggestion No: 1
| introspectionRequest.setRequiredClaimURIs(claimsUris); | |
| OAuth2TokenValidationRequestDTO.TokenValidationContextParam contextParam = | |
| introspectionRequest.setRequiredClaimURIs(claimsUris); | |
| log.debug("Setting introspection context parameter for token validation"); | |
| OAuth2TokenValidationRequestDTO.TokenValidationContextParam contextParam = |
| new OAuth2TokenValidationRequestDTO.TokenValidationContextParam[]{contextParam}); | ||
|
|
There was a problem hiding this comment.
Log Improvement Suggestion No: 2
| new OAuth2TokenValidationRequestDTO.TokenValidationContextParam[]{contextParam}); | |
| new OAuth2TokenValidationRequestDTO.TokenValidationContextParam[]{contextParam}); | |
| log.info("Initiating OAuth2 token introspection request"); |
| .getVerifiedAccessToken(validationRequest.getAccessToken().getIdentifier(), false); | ||
| OAuth2TokenValidationRequestDTO.TokenValidationContextParam[] validationContextParam = | ||
| validationRequest.getContext(); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 3
| .getVerifiedAccessToken(validationRequest.getAccessToken().getIdentifier(), false); | |
| OAuth2TokenValidationRequestDTO.TokenValidationContextParam[] validationContextParam = | |
| validationRequest.getContext(); | |
| OAuth2TokenValidationRequestDTO.TokenValidationContextParam[] validationContextParam = | |
| validationRequest.getContext(); | |
| log.debug("Starting token validation for introspection request"); |
| int appResidentTenantId = accessTokenDO.getAppResidentTenantId(); | ||
| String accessingOrgIdFromPath = PrivilegedCarbonContext.getThreadLocalCarbonContext(). | ||
| getAccessingOrganizationId(); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 4
| int appResidentTenantId = accessTokenDO.getAppResidentTenantId(); | |
| String accessingOrgIdFromPath = PrivilegedCarbonContext.getThreadLocalCarbonContext(). | |
| getAccessingOrganizationId(); | |
| int appResidentTenantId = accessTokenDO.getAppResidentTenantId(); | |
| String accessingOrgIdFromPath = PrivilegedCarbonContext.getThreadLocalCarbonContext(). | |
| getAccessingOrganizationId(); | |
| log.debug("Validating introspection for sub-organization tokens. App resident tenant ID: " + | |
| appResidentTenantId); |
There was a problem hiding this comment.
AI Agent Log Improvement Checklist
- The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
- Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.
✅ Before merging this pull request:
- Review all AI-generated comments for accuracy and relevance.
- Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
| Comment | Accepted (Y/N) | Reason |
|---|---|---|
| #### Log Improvement Suggestion No: 1 | ||
| #### Log Improvement Suggestion No: 2 | ||
| #### Log Improvement Suggestion No: 3 | ||
| #### Log Improvement Suggestion No: 4 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3153 +/- ##
============================================
- Coverage 59.71% 57.07% -2.65%
- Complexity 10229 10880 +651
============================================
Files 709 709
Lines 55689 61666 +5977
Branches 13905 15123 +1218
============================================
+ Hits 33255 35196 +1941
- Misses 18055 21748 +3693
- Partials 4379 4722 +343
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Proposed changes in this pull request
[List all changes you want to add here. If you fixed an issue, please
add a reference to that issue as well.]
When should this PR be merged
[Please describe any preconditions that need to be addressed before we
can merge this pull request.]
Follow up actions
[List any possible follow-up actions here; for instance, testing data
migrations, software that we need to install on staging and production
environments.]
Developer Checklist (Mandatory)
product-isissue to track any behavioral change or migration impact.Checklist (for reviewing)
General
Functionality
Code
Tests
Security
Documentation