feat: instance administrators from a group of the identity provider #21

Merged
crapougnax merged 2 commits from feat/20-provider-admin-groups into develop 2026-11-16 20:45:53 +00:00
Member

Closes #20

What

  • OIDC_ADMIN_GROUPS: comma-separated groups of the provider. A user whose ID token lists one of them holds the instance role admin.
  • OIDC_GROUPS_CLAIM: claim listing the groups (default groups).

Until now no right came from the provider. This is the one exception, off by default and chosen by the operator.

How it behaves

  • The groups are read from the verified ID token at each sign-in through the provider, and the result is stored on the account as providerRoles, apart from roles, which only the administration command writes. One never changes the other.
  • Leaving the group removes the role at the next sign-in. Open sessions keep it until then; disabling the account closes them.
  • providerRoles counts only while OIDC_ADMIN_GROUPS is set: removing the setting takes the role back at the next request, without waiting for a sign-in.
  • Group names are compared exactly. A claim that is not a list of strings gives nothing.
  • account:list shows the role as admin(provider).

Security

Whoever manages these groups at the provider manages the administrators of the instance. The documentation says so.

Verified

  • yarn test: 67 tests pass, 5 new.
  • End to end on the production build, with a stand-in provider and a throwaway PostgreSQL:
    • member of the group: signs in, the administration API answers 200, the account is listed admin(provider);
    • setting removed, same session reused: 403;
    • left the group, signs in again: refused, role gone;
    • token without groups claim: refused.

Not verified

  • Not tried against a real provider: the claim name and the form of the group names (plain name or full path) depend on its configuration.

🤖 Generated with Claude Code

Closes #20 ## What - `OIDC_ADMIN_GROUPS`: comma-separated groups of the provider. A user whose ID token lists one of them holds the instance role `admin`. - `OIDC_GROUPS_CLAIM`: claim listing the groups (default `groups`). Until now no right came from the provider. This is the one exception, off by default and chosen by the operator. ## How it behaves - The groups are read from the verified ID token at each sign-in through the provider, and the result is stored on the account as `providerRoles`, apart from `roles`, which only the administration command writes. One never changes the other. - Leaving the group removes the role at the next sign-in. Open sessions keep it until then; disabling the account closes them. - `providerRoles` counts only while `OIDC_ADMIN_GROUPS` is set: removing the setting takes the role back at the next request, without waiting for a sign-in. - Group names are compared exactly. A claim that is not a list of strings gives nothing. - `account:list` shows the role as `admin(provider)`. ## Security Whoever manages these groups at the provider manages the administrators of the instance. The documentation says so. ## Verified - `yarn test`: 67 tests pass, 5 new. - End to end on the production build, with a stand-in provider and a throwaway PostgreSQL: - member of the group: signs in, the administration API answers 200, the account is listed `admin(provider)`; - setting removed, same session reused: 403; - left the group, signs in again: refused, role gone; - token without groups claim: refused. ## Not verified - Not tried against a real provider: the claim name and the form of the group names (plain name or full path) depend on its configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat: instance administrators from a group of the identity provider (#20)
All checks were successful
Build and Publish OCI Image / Build & Push ARM64 OCI Image (pull_request) Successful in 3m28s
24b1bac3f8
OIDC_ADMIN_GROUPS names groups of the OpenID Connect provider whose members hold
the instance role admin; OIDC_GROUPS_CLAIM names the claim listing the groups.
The membership is read at each sign-in and kept apart from the roles given by the
administration command: leaving the group removes the role at the next sign-in,
and removing the setting removes it at once.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge branch 'develop' into feat/20-provider-admin-groups
All checks were successful
Build and Publish OCI Image / Build & Push ARM64 OCI Image (pull_request) Successful in 4m55s
5ca6efe532
crapougnax merged commit ae3e0edf9a into develop 2026-11-16 20:45:53 +00:00
crapougnax deleted branch feat/20-provider-admin-groups 2026-11-16 20:45:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
modaka/studio!21
No description provided.