[Feature] Support IDP sharing and IDP retrieval via REST API - #1149
[Feature] Support IDP sharing and IDP retrieval via REST API#1149ashanthamara wants to merge 10 commits into
Conversation
…ervice to use the updated idpmanager methods
📝 WalkthroughSummary
WalkthroughThis change adds identity provider sharing and unsharing APIs, shared-organization retrieval with cursor pagination, and asynchronous success and error responses. Identity provider and authenticator retrieval now resolve shared connections and expose a read-only Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpSharingService.java (1)
400-416: 📐 Maintainability & Code Quality | 🔵 TrivialConsider unit tests for the policy-validation branching.
getPolicyEnumand the "share with all" policy restriction (ALL_EXISTING_ORGS_ONLY/ALL_EXISTING_AND_FUTURE_ORGSonly) are new business rules without accompanying tests in the provided scope. Test coverage would help lock in this validation behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpSharingService.java` around lines 400 - 416, Add unit tests covering getPolicyEnum for null, each supported PolicyEnum value, and unsupported policies producing the expected bad-request error; also test the share-with-all restriction to ensure only ALL_EXISTING_ORGS_ONLY and ALL_EXISTING_AND_FUTURE_ORGS are accepted while other policies are rejected.components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java (1)
2439-2460: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
resolveIsSharedConnectionis duplicated verbatim across two service classes. BothServerIdpManagementServiceandServerAuthenticatorManagementServiceadd the identical 11-line helper that scansIdentityProviderProperty[]forIdPManagementConstants.IS_SHARED_IDP_PROPERTY. Extracting this into a shared utility (e.g., a static helper inorg.wso2.carbon.identity.api.server.idp.common, if that module is already a shared dependency of both API modules, or otherwise a small shared utility) would avoid keeping two copies in sync.
components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java#L2439-L2460: keep as the canonical implementation, or delegate to a new shared utility method.components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/java/org/wso2/carbon/identity/api/server/authenticators/v1/core/ServerAuthenticatorManagementService.java#L539-L560: remove this copy and call the shared utility instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java` around lines 2439 - 2460, The resolveIsSharedConnection helper is duplicated across both service classes. In ServerIdpManagementService.java lines 2439-2460, retain the implementation or delegate it to a shared utility; in ServerAuthenticatorManagementService.java lines 539-560, remove the duplicate method and call that shared utility instead, preserving the existing property lookup and null behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpSharingService.java`:
- Around line 353-379: Update buildPaginationQueryParams to track whether a
query parameter has already been appended, so the first present parameter
follows “?” and subsequent parameters use “&”. Ensure links with limit == 0 and
any other parameter no longer begin with “?&”, while preserving the existing
parameter values and encoding behavior.
In
`@components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yaml`:
- Around line 3846-3857: Update the SharingMode.policy description in the
idp.yaml schema to include ALL_EXISTING_ORGS_ONLY in the documented possible
values, while preserving the existing policy entries.
- Around line 3926-3941: Update the policy description in
IdentityProviderShareAllRequestBody to document only ALL_EXISTING_ORGS_ONLY and
ALL_EXISTING_AND_FUTURE_ORGS, matching the values accepted by
ServerIdpSharingService#shareIdentityProviderWithAll; remove the SELECTED_ORG_*
entries.
---
Nitpick comments:
In
`@components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java`:
- Around line 2439-2460: The resolveIsSharedConnection helper is duplicated
across both service classes. In ServerIdpManagementService.java lines 2439-2460,
retain the implementation or delegate it to a shared utility; in
ServerAuthenticatorManagementService.java lines 539-560, remove the duplicate
method and call that shared utility instead, preserving the existing property
lookup and null behavior.
In
`@components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpSharingService.java`:
- Around line 400-416: Add unit tests covering getPolicyEnum for null, each
supported PolicyEnum value, and unsupported policies producing the expected
bad-request error; also test the share-with-all restriction to ensure only
ALL_EXISTING_ORGS_ONLY and ALL_EXISTING_AND_FUTURE_ORGS are accepted while other
policies are rejected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6e2441f7-e5e6-427b-961f-e8ac174d4c2c
⛔ Files ignored due to path filters (13)
components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/gen/java/org/wso2/carbon/identity/api/server/authenticators/v1/model/Authenticator.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/IdentityProvidersApi.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/IdentityProvidersApiService.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/BasicOrganizationResponse.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/IdentityProviderResponse.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/IdentityProviderShareAllRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/IdentityProviderShareSelectedRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/IdentityProviderUnshareAllRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/IdentityProviderUnshareSelectedRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/OrgShareConfig.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/ProcessSuccessResponse.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/SharedOrganizationsResponse.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/SharingMode.javais excluded by!**/gen/**
📒 Files selected for processing (12)
components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/java/org/wso2/carbon/identity/api/server/authenticators/v1/core/ServerAuthenticatorManagementService.javacomponents/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/resources/authenticators.yamlcomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/pom.xmlcomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/src/main/java/org/wso2/carbon/identity/api/server/idp/common/Constants.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/src/main/java/org/wso2/carbon/identity/api/server/idp/common/IdentityProviderServiceHolder.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/pom.xmlcomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpSharingService.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/factories/ServerIdpSharingServiceFactory.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/impl/IdentityProvidersApiServiceImpl.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yamlpom.xml
| private String buildPaginationQueryParams(String filter, int limit, Boolean recursive, String excludedAttributes, | ||
| String attributes) { | ||
|
|
||
| StringBuilder urlStringBuilder = new StringBuilder("?"); | ||
| if (limit != 0) { | ||
| urlStringBuilder.append(LIMIT_PARAM).append("=").append(limit); | ||
| } | ||
| if (recursive != null) { | ||
| urlStringBuilder.append("&").append(RECURSIVE_PARAM).append("=").append(recursive); | ||
| } | ||
| if (StringUtils.isNotBlank(filter)) { | ||
| try { | ||
| urlStringBuilder.append("&").append(FILTER_PARAM).append("=") | ||
| .append(URLEncoder.encode(filter, StandardCharsets.UTF_8.name())); | ||
| } catch (UnsupportedEncodingException e) { | ||
| throw handleException(Response.Status.INTERNAL_SERVER_ERROR, | ||
| Constants.ErrorMessage.ERROR_CODE_BUILDING_LINKS, e.getMessage()); | ||
| } | ||
| } | ||
| if (StringUtils.isNotBlank(excludedAttributes)) { | ||
| urlStringBuilder.append("&").append(EXCLUDED_ATTRIBUTES_PARAM).append("=").append(excludedAttributes); | ||
| } | ||
| if (StringUtils.isNotBlank(attributes)) { | ||
| urlStringBuilder.append("&").append(INCLUDED_ATTRIBUTES_PARAM).append("=").append(attributes); | ||
| } | ||
| return urlStringBuilder.toString(); | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Pagination query string can start with a malformed ?& when limit is omitted.
Only the limit branch appends without a leading &. If limit == 0 (the default when the caller doesn't pass one) but recursive, filter, excludedAttributes, or attributes is present, the built string starts with "?&", producing an empty leading query parameter in the generated next/previous links.
🔧 Suggested fix
private String buildPaginationQueryParams(String filter, int limit, Boolean recursive, String excludedAttributes,
String attributes) {
- StringBuilder urlStringBuilder = new StringBuilder("?");
- if (limit != 0) {
- urlStringBuilder.append(LIMIT_PARAM).append("=").append(limit);
- }
- if (recursive != null) {
- urlStringBuilder.append("&").append(RECURSIVE_PARAM).append("=").append(recursive);
- }
- if (StringUtils.isNotBlank(filter)) {
+ StringBuilder urlStringBuilder = new StringBuilder("?");
+ List<String> params = new ArrayList<>();
+ if (limit != 0) {
+ params.add(LIMIT_PARAM + "=" + limit);
+ }
+ if (recursive != null) {
+ params.add(RECURSIVE_PARAM + "=" + recursive);
+ }
+ if (StringUtils.isNotBlank(filter)) {
try {
- urlStringBuilder.append("&").append(FILTER_PARAM).append("=")
- .append(URLEncoder.encode(filter, StandardCharsets.UTF_8.name()));
+ params.add(FILTER_PARAM + "=" + URLEncoder.encode(filter, StandardCharsets.UTF_8.name()));
} catch (UnsupportedEncodingException e) {
throw handleException(Response.Status.INTERNAL_SERVER_ERROR,
Constants.ErrorMessage.ERROR_CODE_BUILDING_LINKS, e.getMessage());
}
}
- if (StringUtils.isNotBlank(excludedAttributes)) {
- urlStringBuilder.append("&").append(EXCLUDED_ATTRIBUTES_PARAM).append("=").append(excludedAttributes);
- }
- if (StringUtils.isNotBlank(attributes)) {
- urlStringBuilder.append("&").append(INCLUDED_ATTRIBUTES_PARAM).append("=").append(attributes);
- }
- return urlStringBuilder.toString();
+ if (StringUtils.isNotBlank(excludedAttributes)) {
+ params.add(EXCLUDED_ATTRIBUTES_PARAM + "=" + excludedAttributes);
+ }
+ if (StringUtils.isNotBlank(attributes)) {
+ params.add(INCLUDED_ATTRIBUTES_PARAM + "=" + attributes);
+ }
+ return urlStringBuilder.append(String.join("&", params)).toString();
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| private String buildPaginationQueryParams(String filter, int limit, Boolean recursive, String excludedAttributes, | |
| String attributes) { | |
| StringBuilder urlStringBuilder = new StringBuilder("?"); | |
| if (limit != 0) { | |
| urlStringBuilder.append(LIMIT_PARAM).append("=").append(limit); | |
| } | |
| if (recursive != null) { | |
| urlStringBuilder.append("&").append(RECURSIVE_PARAM).append("=").append(recursive); | |
| } | |
| if (StringUtils.isNotBlank(filter)) { | |
| try { | |
| urlStringBuilder.append("&").append(FILTER_PARAM).append("=") | |
| .append(URLEncoder.encode(filter, StandardCharsets.UTF_8.name())); | |
| } catch (UnsupportedEncodingException e) { | |
| throw handleException(Response.Status.INTERNAL_SERVER_ERROR, | |
| Constants.ErrorMessage.ERROR_CODE_BUILDING_LINKS, e.getMessage()); | |
| } | |
| } | |
| if (StringUtils.isNotBlank(excludedAttributes)) { | |
| urlStringBuilder.append("&").append(EXCLUDED_ATTRIBUTES_PARAM).append("=").append(excludedAttributes); | |
| } | |
| if (StringUtils.isNotBlank(attributes)) { | |
| urlStringBuilder.append("&").append(INCLUDED_ATTRIBUTES_PARAM).append("=").append(attributes); | |
| } | |
| return urlStringBuilder.toString(); | |
| } | |
| private String buildPaginationQueryParams(String filter, int limit, Boolean recursive, String excludedAttributes, | |
| String attributes) { | |
| StringBuilder urlStringBuilder = new StringBuilder("?"); | |
| List<String> params = new ArrayList<>(); | |
| if (limit != 0) { | |
| params.add(LIMIT_PARAM + "=" + limit); | |
| } | |
| if (recursive != null) { | |
| params.add(RECURSIVE_PARAM + "=" + recursive); | |
| } | |
| if (StringUtils.isNotBlank(filter)) { | |
| try { | |
| params.add(FILTER_PARAM + "=" + URLEncoder.encode(filter, StandardCharsets.UTF_8.name())); | |
| } catch (UnsupportedEncodingException e) { | |
| throw handleException(Response.Status.INTERNAL_SERVER_ERROR, | |
| Constants.ErrorMessage.ERROR_CODE_BUILDING_LINKS, e.getMessage()); | |
| } | |
| } | |
| if (StringUtils.isNotBlank(excludedAttributes)) { | |
| params.add(EXCLUDED_ATTRIBUTES_PARAM + "=" + excludedAttributes); | |
| } | |
| if (StringUtils.isNotBlank(attributes)) { | |
| params.add(INCLUDED_ATTRIBUTES_PARAM + "=" + attributes); | |
| } | |
| return urlStringBuilder.append(String.join("&", params)).toString(); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpSharingService.java`
around lines 353 - 379, Update buildPaginationQueryParams to track whether a
query parameter has already been appended, so the first present parameter
follows “?” and subsequent parameters use “&”. Ensure links with limit == 0 and
any other parameter no longer begin with “?&”, while preserving the existing
parameter values and encoding behavior.
| SharingMode: | ||
| type: object | ||
| properties: | ||
| policy: | ||
| type: string | ||
| description: |- | ||
| Sharing scope for this organization. | ||
|
|
||
| Possible values: | ||
| - `SELECTED_ORG_ONLY` | ||
| - `SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN` | ||
| - `ALL_EXISTING_AND_FUTURE_ORGS` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
SharingMode.policy description omits ALL_EXISTING_ORGS_ONLY, a value the response can legitimately report.
Since PolicyEnum includes ALL_EXISTING_ORGS_ONLY (used by the "share with all" flow), this response field's documented value list should include it as well for completeness.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yaml`
around lines 3846 - 3857, Update the SharingMode.policy description in the
idp.yaml schema to include ALL_EXISTING_ORGS_ONLY in the documented possible
values, while preserving the existing policy entries.
| IdentityProviderShareAllRequestBody: | ||
| type: object | ||
| required: [ identityProviderId, policy ] | ||
| properties: | ||
| identityProviderId: | ||
| type: string | ||
| example: 'c75e27f9-98c7-4518-a968-c6cd59f0ac6b' | ||
| policy: | ||
| type: string | ||
| description: |- | ||
| Sharing scope for this organization. | ||
|
|
||
| Possible values: | ||
| - `SELECTED_ORG_ONLY` | ||
| - `SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN` | ||
| - `ALL_EXISTING_AND_FUTURE_ORGS` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
IdentityProviderShareAllRequestBody.policy documents the wrong set of values for this endpoint.
The description lists SELECTED_ORG_ONLY, SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN, ALL_EXISTING_AND_FUTURE_ORGS, but ServerIdpSharingService#shareIdentityProviderWithAll only accepts ALL_EXISTING_ORGS_ONLY or ALL_EXISTING_AND_FUTURE_ORGS (any other value, including the two SELECTED_ORG_* values listed here, is rejected with ERROR_CODE_UNSUPPORTED_SHARE_POLICY). The documented list appears to be copy-pasted from OrgShareConfig.policy and is misleading for this "share with all" endpoint.
📝 Suggested fix
IdentityProviderShareAllRequestBody:
type: object
required: [ identityProviderId, policy ]
properties:
identityProviderId:
type: string
example: 'c75e27f9-98c7-4518-a968-c6cd59f0ac6b'
policy:
type: string
description: |-
Sharing scope for this organization.
Possible values:
- - `SELECTED_ORG_ONLY`
- - `SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN`
+ - `ALL_EXISTING_ORGS_ONLY`
- `ALL_EXISTING_AND_FUTURE_ORGS`📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| IdentityProviderShareAllRequestBody: | |
| type: object | |
| required: [ identityProviderId, policy ] | |
| properties: | |
| identityProviderId: | |
| type: string | |
| example: 'c75e27f9-98c7-4518-a968-c6cd59f0ac6b' | |
| policy: | |
| type: string | |
| description: |- | |
| Sharing scope for this organization. | |
| Possible values: | |
| - `SELECTED_ORG_ONLY` | |
| - `SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN` | |
| - `ALL_EXISTING_AND_FUTURE_ORGS` | |
| IdentityProviderShareAllRequestBody: | |
| type: object | |
| required: [ identityProviderId, policy ] | |
| properties: | |
| identityProviderId: | |
| type: string | |
| example: 'c75e27f9-98c7-4518-a968-c6cd59f0ac6b' | |
| policy: | |
| type: string | |
| description: |- | |
| Sharing scope for this organization. | |
| Possible values: | |
| - `ALL_EXISTING_ORGS_ONLY` | |
| - `ALL_EXISTING_AND_FUTURE_ORGS` |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yaml`
around lines 3926 - 3941, Update the policy description in
IdentityProviderShareAllRequestBody to document only ALL_EXISTING_ORGS_ONLY and
ALL_EXISTING_AND_FUTURE_ORGS, matching the values accepted by
ServerIdpSharingService#shareIdentityProviderWithAll; remove the SELECTED_ORG_*
entries.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pom.xml`:
- Around line 1160-1161: Update the
org.wso2.carbon.identity.organization.management.version property from the
unavailable 2.5.15-SNAPSHOT to the released 2.5.14 version, keeping the build
free of snapshot repository requirements.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 163c8cae-796d-4d8e-ad33-b9bfca2bc93f
⛔ Files ignored due to path filters (1)
components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/IdentityProviderListItem.javais excluded by!**/gen/**
📒 Files selected for processing (6)
components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/src/main/java/org/wso2/carbon/identity/api/server/idp/common/IdentityProviderServiceHolder.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpSharingService.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/factories/ServerIdpSharingServiceFactory.javacomponents/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yamlpom.xml
🚧 Files skipped from review as they are similar to previous changes (4)
- components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/factories/ServerIdpSharingServiceFactory.java
- components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/src/main/java/org/wso2/carbon/identity/api/server/idp/common/IdentityProviderServiceHolder.java
- components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yaml
- components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpSharingService.java
| <org.wso2.carbon.identity.organization.management.version>2.5.15-SNAPSHOT | ||
| </org.wso2.carbon.identity.organization.management.version> |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 4 \
'org.wso2.carbon.identity.organization.management.version|organization.connection.sharing|<snapshots>|<repository>' \
--glob 'pom.xml'Repository: wso2/identity-api-server
Length of output: 162
🏁 Script executed:
set -euo pipefail
echo '--- matching files ---'
git ls-files | rg '(^|/)pom\.xml$|(^|/)(settings|repository|maven).*\.(xml|ya?ml)$' || true
echo '--- dependency version and repository configuration ---'
rg -n -C 6 \
'org\.wso2\.carbon\.identity\.organization\.management\.version|organization\.connection\.sharing|<snapshots>|<repository>|distributionManagement|maven' \
--glob 'pom.xml' --glob 'settings*.xml' --glob '*.yaml' --glob '*.yml' . || true
echo '--- root pom context ---'
pom=$(git ls-files | awk '$0=="pom.xml"{print; exit}')
if [ -n "${pom:-}" ]; then
sed -n '1135,1180p' "$pom"
fiRepository: wso2/identity-api-server
Length of output: 50381
🏁 Script executed:
set -euo pipefail
root_pom=pom.xml
echo '--- version property occurrences ---'
rg -n -C 5 \
'org\.wso2\.carbon\.identity\.organization\.management\.version' \
--glob 'pom.xml' .
echo '--- root POM repository and profile sections ---'
rg -n -C 8 \
'<(repositories|repository|snapshots|releases|profiles|profile|distributionManagement|id|url)>' \
"$root_pom" | head -n 300
echo '--- CI and release references to Maven repositories or snapshots ---'
rg -n -C 4 \
'maven|repository|snapshot|SNAPSHOT|settings\.xml|server-id' \
.github .ci 2>/dev/null | head -n 300 || true
echo '--- relevant root POM lines ---'
sed -n '1145,1175p' "$root_pom"Repository: wso2/identity-api-server
Length of output: 15337
🌐 Web query:
"org.wso2.carbon.identity.organization.management" "2.5.15-SNAPSHOT"
💡 Result:
The identifier org.wso2.carbon.identity.organization.management 2.5.15-SNAPSHOT refers to a development-version snapshot of the Organization Management feature suite within the WSO2 Carbon ecosystem. This suite is a core component of the WSO2 Identity Server, providing capabilities for managing organizational hierarchies, resources, and access control [1][2][3]. Key technical context: - Versioning: While version 2.5.14 is the latest stable release of the organization management artifacts in Maven repositories [4][5], the 2.5.15-SNAPSHOT version exists as the current development iteration on the project's main branch [6]. - Source Repository: The source code for these modules is hosted in the official WSO2 GitHub repositories, specifically within the identity-organization-management extensions and core repositories [6][7][2]. - Usage: Artifacts under the org.wso2.carbon.identity.organization.management group ID are used to implement organization-based multitenancy and hierarchical resource management in WSO2 products [5][3]. Developers typically reference these artifacts when building extensions or customizing the identity server's organization management features [8][9]. Users looking for stable binaries should generally use the latest released version (e.g., 2.5.14) rather than the -SNAPSHOT version, as snapshot versions are subject to change and may contain unstable code [4][5].
Citations:
- 1: https://is.docs.wso2.com/en/latest/apis/organization-apis/org-organization-mgt/
- 2: https://github.com/wso2/identity-organization-management-core
- 3: https://is.docs.wso2.com/en/next/guides/organization-management/organizations-overview/
- 4: https://javadoc.io/doc/org.wso2.carbon.identity.organization.management
- 5: https://badges.mvnrepository.com/artifact/org.wso2.carbon.identity.organization.management/org.wso2.carbon.identity.organization.management.server.feature
- 6: https://github.com/wso2-extensions/identity-organization-management/blob/main/pom.xml
- 7: https://github.com/wso2-extensions/identity-organization-management/
- 8: https://central.sonatype.com/artifact/org.wso2.carbon.identity.organization.management/org.wso2.carbon.identity.organization.management.role.management.service/2.5.14
- 9: https://central.sonatype.com/artifact/org.wso2.carbon.identity.organization.management/org.wso2.carbon.identity.organization.discovery.service/2.5.14
🌐 Web query:
"org.wso2.carbon.identity.organization.management" Maven Central releases
💡 Result:
The artifacts under the Maven group ID org.wso2.carbon.identity.organization.management are actively published to Maven Central [1][2]. As of August 2026, the latest major version for most artifacts in this group is 2.5.14 [2]. These artifacts are part of the WSO2 Identity Server extension ecosystem, specifically related to organization management [3][2]. A summary of the group's presence in Maven Central includes: - Group ID: org.wso2.carbon.identity.organization.management [4][2] - Total Artifacts: Approximately 18 distinct modules, including core services, authorization services, role management, and configuration services [2]. - Latest Version: 2.5.14 is the most current release for the majority of these artifacts [2]. - Repository: Artifacts are hosted on the Maven Central Repository [1][2]. For project integration, you can include dependencies using the standard Maven format. For example, to include the role management service: org.wso2.carbon.identity.organization.management org.wso2.carbon.identity.organization.management.role.management.service 2.5.14 You can verify the full list of available artifacts and their specific version histories via standard repository search tools like MVNRepository or the Sonatype Central Repository [4][1][2].
Citations:
- 1: https://central.sonatype.com/artifact/org.wso2.carbon.identity.organization.management/org.wso2.carbon.identity.organization.management.role.management.service/2.5.14
- 2: https://javadoc.io/doc/org.wso2.carbon.identity.organization.management
- 3: https://github.com/wso2-extensions/identity-organization-management/blob/main/pom.xml
- 4: https://mvnrepository.com/artifact/org.wso2.carbon.identity.organization.management
🏁 Script executed:
set -euo pipefail
echo '--- change in the root POM ---'
git diff --unified=5 -- pom.xml | sed -n '1,120p'
echo '--- workflow files ---'
git ls-files '.github/workflows/*' | sort
echo '--- repository configuration in tracked build files ---'
rg -n \
'<(repositories|pluginRepositories|repository|snapshots|releases|distributionManagement)>|https?://[^<]+' \
pom.xml .github --glob '*.xml' --glob '*.yml' --glob '*.yaml' || true
echo '--- Maven Central metadata ---'
curl -fsSL -o /tmp/central-metadata.xml -w 'central status=%{http_code}\n' \
'https://repo1.maven.org/maven2/org/wso2/carbon/identity/organization/management/org.wso2.carbon.identity.organization.management.role.management.service/maven-metadata.xml' || true
if [ -s /tmp/central-metadata.xml ]; then
rg -n '2\.5\.14|2\.5\.15|snapshot|<latest>|<release>' /tmp/central-metadata.xml || true
fi
echo '--- WSO2 snapshot metadata ---'
for base in \
'https://maven.wso2.org/nexus/content/repositories/snapshots' \
'https://maven.wso2.org/nexus/content/repositories/releases'
do
url="$base/org/wso2/carbon/identity/organization/management/org.wso2.carbon.identity.organization.management.role.management.service/maven-metadata.xml"
status=$(curl -sS -o /tmp/wso2-metadata.xml -w '%{http_code}' "$url" || true)
echo "$base status=$status"
if [ "$status" = 200 ]; then
rg -n '2\.5\.14|2\.5\.15|snapshot|<latest>|<release>' /tmp/wso2-metadata.xml || true
fi
doneRepository: wso2/identity-api-server
Length of output: 1587
Use a released organization management version.
The CI build has no snapshot repository configuration, and Maven Central provides 2.5.14 but not 2.5.15-SNAPSHOT. Pin this property to 2.5.14, or configure an approved snapshot repository for every CI and release build.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pom.xml` around lines 1160 - 1161, Update the
org.wso2.carbon.identity.organization.management.version property from the
unavailable 2.5.15-SNAPSHOT to the released 2.5.14 version, keeping the build
free of snapshot repository requirements.
| urlStringBuilder.append(LIMIT_PARAM).append("=").append(limit); | ||
| } | ||
| if (recursive != null) { | ||
| urlStringBuilder.append("&").append(RECURSIVE_PARAM).append("=").append(recursive); |
There was a problem hiding this comment.
if a request comes without limit param, pagination url will have ?&
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Error' | ||
| '/identity-providers/{identity-provider-id}/share': |
There was a problem hiding this comment.
We are having a verb on a get endpoint here. Hope you discussed this approach.
Alternative name shared-organizations
| getConnectionSharedOrgsDTO.setFilter(filter); | ||
| getConnectionSharedOrgsDTO.setLimit(limitValue); | ||
| getConnectionSharedOrgsDTO.setRecursive(recursiveFlag); | ||
| getConnectionSharedOrgsDTO.setAttributes(resolveAttributeList(attributes)); |
There was a problem hiding this comment.
Seems excludedAttributes are not passed to the DTO
Purpose