Skip to content

Allow using validate_allocations to validate Keycloak group memberships#307

Open
QuanMPhm wants to merge 2 commits intonerc-project:mainfrom
QuanMPhm:ops_948/kc_validate
Open

Allow using validate_allocations to validate Keycloak group memberships#307
QuanMPhm wants to merge 2 commits intonerc-project:mainfrom
QuanMPhm:ops_948/kc_validate

Conversation

@QuanMPhm
Copy link
Copy Markdown
Contributor

@QuanMPhm QuanMPhm commented May 4, 2026

Part of nerc-project/operations#948. Dependant on #249. This PR consists of the last commit

A Keycloak admin client has been added
When `activate_allocation` is called, the user is added
to a Keycloak group named using a format string defined in the
allocation's resource attribute "Format String for Keystone Group Names"
If the user does not already exist in Keycloak, the case is ignored for now

Keycloak integration is optional, toggled by setting the env var "KEYCLOAK_BASE_URL"
Authentication to Keycloak is done via client credentials grant

When `deactivate_allocation` is called, the user is removed from the Keycloak group

New functional test added for Keycloak integration

A comment in `validate_allocations` has been updated to
reflect the more restrictive validation behavior, where users on cluster projects
will be removed if they are not part of the Coldfront allocation (rather
than if they are not registered on Coldfront at all).
`validate_allocations` command will now add users to Keycloak groups
if they are part of an allocation, and remove them if they are not.

Updated keyclaok functional tests
@QuanMPhm QuanMPhm requested review from knikolla and naved001 May 4, 2026 19:49
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.

1 participant