You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2026/05/11 07:53:16 UTC
[PR] CAMEL-23452: camel-keycloak - Add Organizations API operations (Keycloak 26+) [camel]
oscerd opened a new pull request, #23113:
URL: https://github.com/apache/camel/pull/23113
## Motivation
Keycloak 26 introduced an [Organizations](https://www.keycloak.org/docs/latest/server_admin/index.html#_managing-organizations) primitive that allows realms to model multi-tenant scenarios — companies, customer accounts, etc. — with members and identity-provider links.
The Keycloak admin client `26.0.8` already on `camel-keycloak`'s classpath exposes the Organizations API via `OrganizationsResource` / `OrganizationResource` / `OrganizationMembersResource` / `OrganizationIdentityProvidersResource`, but none of it was surfaced as Camel operations. This change wires the full Organizations CRUD plus member and identity-provider management into the existing `camel-keycloak` producer.
JIRA: https://issues.apache.org/jira/browse/CAMEL-23452
## Changes
### New operations on ``KeycloakOperations``
| Operation | Description |
| --- | --- |
| `createOrganization` | Create a new organization (header-based or `pojoRequest=true` with `OrganizationRepresentation`). |
| `updateOrganization` | Update an existing organization (POJO request). |
| `deleteOrganization` | Delete an organization by ID. |
| `getOrganization` | Retrieve an organization by ID. |
| `listOrganizations` | List all organizations in a realm (optional `FIRST_RESULT` / `MAX_RESULTS` paging). |
| `searchOrganizations` | Search organizations by free-text (name / alias / domain), with optional paging. |
| `addOrganizationMember` | Add an existing realm user as a member of an organization. |
| `removeOrganizationMember` | Remove a user from an organization. |
| `listOrganizationMembers` | List members of an organization (optional paging). |
| `linkOrganizationIdentityProvider` | Link an existing realm IdP to an organization. |
| `unlinkOrganizationIdentityProvider` | Unlink an IdP from an organization. |
| `listOrganizationIdentityProviders` | List IdPs linked to an organization. |
### New headers on ``KeycloakConstants``
`ORGANIZATION_ID`, `ORGANIZATION_NAME`, `ORGANIZATION_ALIAS`, `ORGANIZATION_DESCRIPTION`, `ORGANIZATION_REDIRECT_URL`, `ORGANIZATION_DOMAIN`, `ORGANIZATION_SEARCH`. Member operations re-use the existing `USER_ID`, IdP-link operations re-use `IDP_ALIAS`, and paging operations re-use `FIRST_RESULT` / `MAX_RESULTS`.
### Implementation
`KeycloakProducer` follows the existing switch-on-operation pattern. Every new method validates required headers (`MISSING_REALM_NAME`, `MISSING_ORGANIZATION_ID`, `MISSING_ORGANIZATION_NAME`, `MISSING_ORGANIZATION_MEMBER_ID`, `MISSING_ORGANIZATION_IDP_ALIAS`) and returns either the JAX-RS `Response`, a representation POJO, a `List<...>`, or a fixed success string — matching the conventions used by existing operations.
### Tests
* `KeycloakProducerTest` adds Mockito-based unit tests for all 12 operations plus missing-name / missing-id validation.
* `KeycloakTestInfraIT` exercises the full lifecycle (create → list → get → search → add-member → list-members → remove-member → link-IdP → list-IdPs → unlink-IdP → cleanup) against the testcontainers-based Keycloak from `camel-test-infra-keycloak`, with a dedicated cleanup step ordered before the existing IdP/realm teardown.
### Documentation
`keycloak-component.adoc` is updated:
* New `Organization Management` entry in the **Supported Operations** summary.
* New `=== Organization Operations` section with end-to-end Java examples covering all 12 operations.
## How to test
```bash
cd components/camel-keycloak
mvn clean install # unit tests
mvn verify -Pit # integration tests (testcontainers)
```
All 91 unit tests pass locally (28 of them in `KeycloakProducerTest`, including the 11 new organization tests).
## Notes
* No new dependencies. The Organizations API is already provided by `keycloak-admin-client` 26.0.8 currently on the classpath.
* No public API signatures are changed; only additions to the operations enum and constants.
---
_Claude Code on behalf of Andrea Cosentino_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23452: camel-keycloak - Add Organizations API operations (Keycloak 26+) [camel]
Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd merged PR #23113:
URL: https://github.com/apache/camel/pull/23113
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23452: camel-keycloak - Add Organizations API operations (Keycloak 26+) [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23113:
URL: https://github.com/apache/camel/pull/23113#issuecomment-4420018533
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `catalog/camel-catalog`
- `components/camel-keycloak`
- `dsl/camel-endpointdsl`
<details><summary>All tested modules (10 modules)</summary>
- Camel :: Catalog :: Camel Catalog
- Camel :: Endpoint DSL
- Camel :: JBang :: MCP
- Camel :: JBang :: Plugin :: Route Parser
- Camel :: JBang :: Plugin :: TUI
- Camel :: JBang :: Plugin :: Validate
- Camel :: Keycloak
- Camel :: Launcher :: Container
- Camel :: YAML DSL :: Validator
- Camel :: YAML DSL :: Validator Maven Plugin
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/25662475436)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-23452: camel-keycloak - Add Organizations API operations (Keycloak 26+) [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23113:
URL: https://github.com/apache/camel/pull/23113#issuecomment-4418591256
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org