Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict shared apps to only use shared roles when shared apps are accessed #6419

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ShanChathusanda93
Copy link
Contributor

Proposed changes in this pull request

  • $subject

@ShanChathusanda93 ShanChathusanda93 force-pushed the shared-role-to-shared-apps-branch branch 3 times, most recently from be942a5 to 5008aea Compare February 3, 2025 07:58
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 45.96%. Comparing base (5938f4d) to head (e392420).
Report is 225 commits behind head on master.

Files with missing lines Patch % Lines
...ty/role/v2/mgt/core/RoleManagementServiceImpl.java 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6419      +/-   ##
============================================
- Coverage     46.35%   45.96%   -0.40%     
- Complexity    15171    15549     +378     
============================================
  Files          1744     1748       +4     
  Lines        108113   111927    +3814     
  Branches      19567    20716    +1149     
============================================
+ Hits          50120    51448    +1328     
- Misses        50863    53116    +2253     
- Partials       7130     7363     +233     
Flag Coverage Δ
unit 30.54% <0.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ShanChathusanda93 ShanChathusanda93 force-pushed the shared-role-to-shared-apps-branch branch from 5008aea to b4a3e8b Compare February 3, 2025 10:15
private static boolean isFragmentApplication() {

boolean isFragmentApp = false;
if (IdentityUtil.threadLocalProperties.get().get(ApplicationConstants.IS_FRAGMENT_APP) != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From where this threadlocal set and unset

return;
}

filterAndRemoveNonSharedRoles(roleIds, tenantDomain);
Copy link
Contributor

@SujanSanjula96 SujanSanjula96 Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be better to implement this logic in getAssociatedRolesOfApplication method in ApplicationManagementService which is used in getRolesAssociatedWithApplication method in AppAssociatedRolesResolverImpl.java. Relying on thread local properties in service level will not be an ideal approach since we can't guarantee setting thread local properties in every place that this service is used.

Copy link

sonarqubecloud bot commented Feb 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants