Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/admin-groups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Admin can now be granted by directory group membership instead of editing the config secret.
Config:
auth.adminGroups: ["cairn-admins"]— any authenticated user carrying a listed group (OIDC groups claim or LDAPmemberOf; identical pipeline since v0.3.1) is an operator. Grant/revoke = add/remove from the group in the IdP, effective at next sign-in.auth.admins(usernames) stays as bootstrap + break-glass.Mechanism:
auth.WithAdminFlagprovider wrapper evaluates the flag once per authentication and setsUser.Admin; all admin checks now honor it —d.admins[u.Username] || u.Admin) → unscoped backend viewisAdmin→ raw/.trashaccess, real deletes inside itWrapProvider) → admins always pass/api/v1/admin/*and/api/v1/licensegatesadminsoradminGroupsis non-emptyGET /api/v1/menow reports"admin"(future UI use)No constructor signatures changed — existing components keep their username maps, so all existing tests pass untouched; new
adminflag_test.gocovers list/group/no-match/nil/error-passthrough. Design rationale in issues #51/#52: privileges live where people are managed; the trust decision (which group means admin) stays in Cairn's config.gofmt + vet + build + full test suite ran green on the runner before push.