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

Refactor isOrganization check to service layer when fetching API resource by ID #6566

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

HasiniSama
Copy link
Contributor

@HasiniSama HasiniSama commented Feb 27, 2025

Proposed changes in this pull request

Fixes: wso2/product-is#23297

Refactor sub-organization logic check to the Service layer, before CacheBacked DAO layer, when fetching API resource by ID.

This ensures the cache only contains the root organization tenant domain cache entry.

Tested outflows:

  • Retrieve Organization API Resource using root organization access token (Allowed)
  • Retrieve Business API Resource using root organization access token (Allowed)
  • Retrieve System API Resource using root organization access token (Allowed)
  • Retrieve Tenant (Management) API Resource using root organization access token (Allowed)
  • Retrieve Console feature API Resource using root organization access token (Allowed)
  • Retrieve Organization API using a sub-organization access token (Allowed)
  • Retrieve Business API using a sub-organization access token (Allowed)
  • Retrieve System API Resource using sub-organization organization access token (Not Allowed)
  • Retrieve Tenant (Management) API Resource using sub-organization organization access token (Not Allowed)
  • Retrieve Console feature API Resource using sub-organization organization access token (Not Allowed)

Merged After

After: wso2/identity-organization-management-core#171

@HasiniSama HasiniSama force-pushed the fix-api-resource-cache-issue branch from 3bb80ff to c61fffa Compare February 28, 2025 04:34
Copy link

codecov bot commented Feb 28, 2025

Codecov Report

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

Project coverage is 47.28%. Comparing base (47429c7) to head (3275518).
Report is 30 commits behind head on master.

Files with missing lines Patch % Lines
...e/mgt/constant/APIResourceManagementConstants.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6566      +/-   ##
============================================
+ Coverage     47.26%   47.28%   +0.02%     
- Complexity    15408    15464      +56     
============================================
  Files          1751     1757       +6     
  Lines        105718   106136     +418     
  Branches      19961    20069     +108     
============================================
+ Hits          49965    50191     +226     
- Misses        48681    48851     +170     
- Partials       7072     7094      +22     
Flag Coverage Δ
unit 30.64% <95.23%> (+0.06%) ⬆️

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.

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/13585604265

ThaminduR
ThaminduR previously approved these changes Feb 28, 2025
@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/13585604265
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

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

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/13585604265

@SujanSanjula96 SujanSanjula96 merged commit 9671a41 into wso2:master Feb 28, 2025
5 checks passed
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.

Adding/Deleting scope from custom API in root org doesn’t get reflected in sub org
4 participants