Add REST API for connection sharing management#1112
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (15)
📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThis pull request adds a new organization connection sharing management API to the Identity Server. It introduces a parent aggregator module plus two submodules: Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant API as ConnectionsApiServiceImpl
participant Factory as ConnectionsApiServiceCoreFactory
participant Core as ConnectionsApiServiceCore
participant ServiceHolder as ConnectionSharingMgtServiceHolder
participant Handler as ConnectionSharingPolicyHandlerService
participant Response as Response Builder
Client->>API: shareConnectionsWithSelected(RequestBody)
API->>Factory: getConnectionsApiServiceCore()
Factory->>ServiceHolder: getConnectionSharingPolicyHandlerService()
ServiceHolder-->>Factory: Handler Instance
Factory-->>API: Core Instance
API->>Core: shareConnectionsWithSelected(RequestBody)
Core->>Core: Validate & build DTOs
Core->>Handler: Execute share operation
Handler-->>Core: Result
Core->>Response: Build 202 Accepted
Core-->>API: Response
API-->>Client: 202 Accepted
Note over Client,Core: Error path
Client->>API: shareConnectionsWithSelected(null)
API->>Core: shareConnectionsWithSelected(null)
Core->>Core: Validation fails
Core->>Response: Build 400 Bad Request
Core-->>API: 400 Response
API-->>Client: 400 Bad Request
sequenceDiagram
participant Client as Client
participant API as ConnectionsApiServiceImpl
participant Core as ConnectionsApiServiceCore
participant Handler as ConnectionSharingPolicyHandlerService
participant Response as Response Builder
Client->>API: getConnectionSharedOrganizations(connectionId, params)
API->>Core: getConnectionSharedOrganizations(...)
Core->>Core: Validate connectionId & params
Core->>Core: Decode cursors (Base64)
Core->>Handler: Retrieve shared organizations (with pagination)
Handler-->>Core: Shared org results
Core->>Core: Map results to API model
Core->>Response: Build pagination links
Core-->>API: 200 Response with list + links
API-->>Client: 200 OK
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Review rate limit: 0/1 reviews remaining, refill in 3 minutes and 46 seconds.Comment |
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.
There was a problem hiding this comment.
Actionable comments posted: 9
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/pom.xml`:
- Around line 21-25: Update the parent version declaration in the POM so it
matches the root parent used in this branch: change the <parent> block's
<version> value from 1.5.33-SNAPSHOT to 1.6.8-SNAPSHOT (the same version as the
root parent) so Maven can correctly resolve ../pom.xml for the artifact
identified by groupId org.wso2.carbon.identity.server.api and artifactId
org.wso2.carbon.identity.api.server.organization.connection.sharing.management.
In
`@components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/pom.xml`:
- Around line 21-25: Update the parent <parent> version in this module's POM so
it matches the new root parent version; specifically change the <version> value
under the <parent> element (currently "1.5.33-SNAPSHOT") to the root's
"1.6.8-SNAPSHOT" so Maven can resolve the local parent for artifactId
org.wso2.carbon.identity.api.server.organization.connection.sharing.management.
In
`@components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/core/ConnectionsApiServiceCore.java`:
- Around line 273-279: After decoding cursors in ConnectionsApiServiceCore
(afterCursor = decodeCursor(after); beforeCursor = decodeCursor(before);), add
an explicit non-negative bounds check: if either afterCursor or beforeCursor is
negative, return
Response.status(BAD_REQUEST).entity(buildErrorResponse(makeRequestError(ERROR_INVALID_CURSOR))).build();
this ensures negative decoded values are rejected the same way as decoding
errors and prevents forwarding invalid cursor values to the service.
In
`@components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/impl/ConnectionsApiServiceImpl.java`:
- Around line 48-50: The initialization catch block in ConnectionsApiServiceImpl
currently logs only e.getMessage(), losing stack trace; update the LOG.error
call in the constructor/initializer catch (IllegalStateException e) to log the
exception object (e.g., pass e as the throwable param) so the full stack trace
is preserved when throwing the RuntimeException with
ERROR_INITIATING_CONNECTIONS_API_SERVICE.
In
`@components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/resources/connection-sharing-v1.yaml`:
- Around line 798-809: The OpenAPI Error schema's example code uses the outdated
"CS-00000" format; update the Error object's code example (property 'code'
within the Error schema) to use the new "CSM-00000" prefix so it matches the
PR's API constants and real response codes (replace the example value "CS-00000"
with "CSM-00000").
- Around line 398-405: The description for the query parameter "limit" currently
implies an unbounded result set; update the OpenAPI parameter definition for
limit in connection-sharing-v1.yaml to enforce a safe default and cap by adding
schema properties "default": 50 and "maximum": 1000 (or other team-agreed
values) and revise the description text to state the default page size and the
maximum allowed (e.g., "Default 50; maximum 1000; omit to use default page
size") and mention that cursor-based pagination should be used to fetch
subsequent pages; ensure the parameter name "limit" and its schema are the only
changed symbols.
- Around line 547-590: Update the OpenAPI schemas so clients/validators cannot
send empty selections: for ConnectionCriteria add an anyOf (or oneOf) clause
that requires either connectionIds or connectionNames to be present and
non-empty by referencing connectionIds with properties.connectionIds.minItems: 1
(and similarly for connectionNames with minItems: 1); for
ConnectionShareSelectedRequestBody and any schema with organizations or orgIds
(e.g., ConnectionOrgShareConfig) add minItems: 1 on the organizations/orgIds
array properties (and/or mark them non-empty via required + minItems in the
enclosing schema) so generated validators will reject empty arrays. Ensure you
modify the ConnectionCriteria, ConnectionShareSelectedRequestBody, and
ConnectionOrgShareConfig schema entries to include these anyOf/required+minItems
changes.
- Around line 532-537: The OAuth2 flow in connection-sharing-v1.yaml currently
hardcodes localhost:9443 in the authorizationUrl and tokenUrl under OAuth2 ->
flows -> authorizationCode; change these to be deployment-aware by referencing
the OpenAPI servers URL (or a server variable) instead of a literal host so the
URLs resolve to the deployed host (e.g., build authorizationUrl and tokenUrl
from the servers.url/server variable or use relative paths based on the servers
entry). Update the authorizationUrl and tokenUrl entries to use that server
reference so Swagger consumers point to the correct deployed authorization/token
endpoints.
In
`@components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/pom.xml`:
- Around line 20-24: Update the Maven parent version in the module POM so it
matches the root reactor version: change the <version> value under the <parent>
element for groupId "org.wso2.carbon.identity.server.api" and artifactId
"identity-api-server" from 1.5.33-SNAPSHOT to 1.6.8-SNAPSHOT so Maven can
resolve the parent when this module is wired into the reactor.
🪄 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
Run ID: b38a6f49-c1bc-42a7-9e15-3358b30cdfdb
⛔ Files ignored due to path filters (15)
components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/ConnectionsApi.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/ConnectionsApiService.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/factories/ConnectionsApiServiceFactory.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionCriteria.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionOrgShareConfig.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionShareSelectedRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionShareWithAllRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionSharedOrganization.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionSharedOrganizationsResponse.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionSharingMode.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionUnshareSelectedRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionUnshareWithAllRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/Error.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/Link.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ProcessSuccessResponse.javais excluded by!**/gen/**
📒 Files selected for processing (10)
components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/pom.xmlcomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/common/ConnectionSharingMgtServiceHolder.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/common/constants/ConnectionSharingMgtConstants.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/pom.xmlcomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/core/ConnectionsApiServiceCore.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/factories/ConnectionsApiServiceCoreFactory.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/impl/ConnectionsApiServiceImpl.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/resources/connection-sharing-v1.yamlcomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/pom.xmlpom.xml
dacf576 to
c3be1a5
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/core/ConnectionsApiServiceCore.java`:
- Around line 420-430: The toApiConnectionSharedOrganization method currently
maps only a subset of fields; update it to map all fields defined in the API
model by copying missing properties from ResponseConnectionOrgDetailsDTO into
ConnectionSharedOrganization (e.g., map refs, hierarchy/parent/child metadata
and any other contract fields) rather than omitting them; locate
toApiConnectionSharedOrganization and the DTO class
ResponseConnectionOrgDetailsDTO and add calls to the corresponding setters on
ConnectionSharedOrganization (e.g., setRefs, setHierarchyMetadata,
setParentOrgId, setChildren or equivalent setters matching the API model) so the
response matches the API contract, or alternatively remove those fields from the
API schema if they are intentionally unsupported.
- Around line 301-303: getConnectionSharedOrganizations incorrectly maps all
ConnectionSharingMgtClientException to 400; implement a helper like
mapClientErrorToStatus(ConnectionSharingMgtClientException e) that inspects the
exception's error code/message and returns Response.Status.NOT_FOUND for
"connection not found" error codes and Response.Status.BAD_REQUEST for
validation/format errors, then replace the current catch that returns
Response.Status.BAD_REQUEST with logic that calls mapClientErrorToStatus(e) and
uses that status when building the Response (keep buildErrorResponse(e) as the
entity).
🪄 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
Run ID: cbfcc11c-0ea7-4ab4-a8dd-5faf1b7ba3f9
⛔ Files ignored due to path filters (15)
components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/ConnectionsApi.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/ConnectionsApiService.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/factories/ConnectionsApiServiceFactory.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionCriteria.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionOrgShareConfig.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionShareSelectedRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionShareWithAllRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionSharedOrganization.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionSharedOrganizationsResponse.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionSharingMode.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionUnshareSelectedRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ConnectionUnshareWithAllRequestBody.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/Error.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/Link.javais excluded by!**/gen/**components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/model/ProcessSuccessResponse.javais excluded by!**/gen/**
📒 Files selected for processing (10)
components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/pom.xmlcomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/common/ConnectionSharingMgtServiceHolder.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/common/constants/ConnectionSharingMgtConstants.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/pom.xmlcomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/core/ConnectionsApiServiceCore.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/factories/ConnectionsApiServiceCoreFactory.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/impl/ConnectionsApiServiceImpl.javacomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/resources/connection-sharing-v1.yamlcomponents/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/pom.xmlpom.xml
✅ Files skipped from review due to trivial changes (4)
- components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/pom.xml
- components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/pom.xml
- components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/common/constants/ConnectionSharingMgtConstants.java
- components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/pom.xml
🚧 Files skipped from review as they are similar to previous changes (3)
- components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.common/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/common/ConnectionSharingMgtServiceHolder.java
- components/org.wso2.carbon.identity.api.server.organization.connection.sharing.management/org.wso2.carbon.identity.api.server.organization.connection.sharing.management.v1/src/main/java/org/wso2/carbon/identity/api/server/organization/connection/sharing/management/v1/factories/ConnectionsApiServiceCoreFactory.java
- pom.xml
c3be1a5 to
d0b018e
Compare
d0b018e to
136018d
Compare
Purpose
Expose the connection sharing service layer as a REST API, enabling organization administrators to share, unshare, and query federated IDP connections across child organizations via HTTP.
Goals
Connection Sharing API v1following the existing user sharing API patternsConnectionSharingPolicyHandlerServiceinto the API layer using the standard WSO2 CXF factory patternApproach
common+v1) underorg.wso2.carbon.identity.api.server.organization.connection.sharing.managementconnection-sharing-v1.yamlwith five endpoints:POST /connections/share,POST /connections/share-with-all,POST /connections/unshare,POST /connections/unshare-with-all,GET /connections/{connectionId}/shareConnectionSharingMgtServiceHolderusing the OSGi static inner class lazy-lookup pattern (consistent withUserSharingMgtServiceHolder)ConnectionsApiServiceCoreFactoryto fail fast at startup if the OSGi service is unavailableConnectionsApiServiceCorewith full request mapping, cursor-based pagination, and structured error responsesorg.wso2.carbon.identity.organization.management.organization.connection.sharingto the root POM'sdependencyManagementwith version${org.wso2.carbon.identity.organization.management.version}Related Issue