Pin and document the Keycloak permission surface #82

Stängd
öppnade 2026-10-08 21:12:31 +00:00 av supernaut · 0 kommentarer
Ägare

What

The client works only because it never calls per-user endpoints. The realm client has no view-users, so those return 403. Nothing pins this, and the README does not list the permissions it needs.

Why

A later change could add /users/{id}/groups. The fake client accepts any path, so tests pass and production fails. Under query-users alone Keycloak may also strip user attributes from the user list. Identity projection would then see no values, propose no changes, and stay green.

Failing case

Someone fetches a user's groups to speed up a lookup. All tests pass. The first live run returns 403 and aborts.

Fix

Add one test that records every request path from every HttpKeycloakClient method and checks it against an allowlist. Add a README section with the required roles and the forbidden endpoints. Warn when listUsers returns users and none has an email. Confirm in a staging dry-run that a known drift is proposed.

Done when

  • The allowlist test fails when a new path is requested
  • README lists the required roles and the endpoints that return 403
  • The empty-email warning exists and is tested
## What The client works only because it never calls per-user endpoints. The realm client has no `view-users`, so those return 403. Nothing pins this, and the README does not list the permissions it needs. ## Why A later change could add `/users/{id}/groups`. The fake client accepts any path, so tests pass and production fails. Under `query-users` alone Keycloak may also strip user attributes from the user list. Identity projection would then see no values, propose no changes, and stay green. ## Failing case Someone fetches a user's groups to speed up a lookup. All tests pass. The first live run returns 403 and aborts. ## Fix Add one test that records every request path from every `HttpKeycloakClient` method and checks it against an allowlist. Add a README section with the required roles and the forbidden endpoints. Warn when `listUsers` returns users and none has an email. Confirm in a staging dry-run that a known drift is proposed. ## Done when - [ ] The allowlist test fails when a new path is requested - [ ] README lists the required roles and the endpoints that return 403 - [ ] The empty-email warning exists and is tested
Logga in för att delta i denna konversation.
Ingen milstolpe
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-auth-reconciler#82
Ingen beskrivning angiven.