-
Notifications
You must be signed in to change notification settings - Fork 145
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 specific claim management endpoints for sub-organizations #498
Restrict specific claim management endpoints for sub-organizations #498
Conversation
|
||
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); | ||
try { | ||
String organizationId = getOrganizationManager().resolveOrganizationId(tenantDomain); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use PrivilegedCarbonContext.getThreadLocalCarbonContext().getOrganizationId()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case the API is accessed via /t/ path, PrivilegedCarbonContext.getThreadLocalCarbonContext().getOrganizationId()
will not set.
So if org id not found need to resolve through tenant domain again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, ideally sub-orgs resources are meant to be accessed with /o/ paths. In case it was accessed with /t/ path, the mentioned concern is there. But we can first fetch orgId from carbon context, if not available resolve from tenant-domain.
Anyways, with future improvements for sub-organization resources will be accessed with /t/ with organization bound token. In such case, organizationId will be populated in the context and won't be null.
...a/org/wso2/carbon/identity/api/server/claim/management/common/ClaimManagementDataHolder.java
Outdated
Show resolved
Hide resolved
...mmon/src/main/java/org/wso2/carbon/identity/api/server/claim/management/common/Constant.java
Outdated
Show resolved
Hide resolved
...ity/api/server/claim/management/common/factory/OrganizationManagementOSGIServiceFactory.java
Show resolved
Hide resolved
...ity/api/server/claim/management/common/factory/OrganizationManagementOSGIServiceFactory.java
Outdated
Show resolved
Hide resolved
...2/carbon/identity/rest/api/server/claim/management/v1/core/ServerClaimManagementService.java
Outdated
Show resolved
Hide resolved
...2/carbon/identity/rest/api/server/claim/management/v1/core/ServerClaimManagementService.java
Outdated
Show resolved
Hide resolved
...erver.claim.management.v1/src/main/resources/META-INF/cxf/claim-management-server-v1-cxf.xml
Show resolved
Hide resolved
...mmon/src/main/java/org/wso2/carbon/identity/api/server/claim/management/common/Constant.java
Outdated
Show resolved
Hide resolved
f63cf15
to
825841d
Compare
...a/org/wso2/carbon/identity/api/server/claim/management/common/ClaimManagementDataHolder.java
Outdated
Show resolved
Hide resolved
0835f57
to
2d66920
Compare
...2/carbon/identity/rest/api/server/claim/management/v1/core/ServerClaimManagementService.java
Outdated
Show resolved
Hide resolved
2d66920
to
04cb15a
Compare
PR builder started |
PR builder completed |
There was a problem hiding this 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/6452362382
Purpose
Restricted the following claim management endpoints for sub organizations.
Related issue