feat(auth): register hermes as an OIDC client - #49
Merged
Merged
Conversation
Puts the Hermes dashboard behind estate single sign-on instead of its own password: the session that opens Grafana, Outline and Headlamp now opens Hermes too. Public client with PKCE, the same shape as headlamp and rabbitmq. That is forced rather than chosen -- Hermes' dashboard takes only HERMES_DASHBOARD_OIDC_ISSUER, _CLIENT_ID and _SCOPES, with no field for a client secret, so a confidential client could not authenticate at all. The upside is there is no secret in Vault and none to rotate. The HERMES grant moves rather than disappears. Hermes' route carries no forward-auth -- a middleware there would intercept the OIDC callback and break the login before the dashboard sees the authorization code, which is why outline is `direct` too -- so DOWNSTREAM_CLIENT_PERMISSIONS enforces the grant at the authorize endpoint instead. The redirect URIs are the one coupling worth watching: Hermes builds its callback as <public_url>/auth/callback verbatim from HERMES_DASHBOARD_PUBLIC_URL in fleet-infra. If the two drift the flow fails at the redirect and the dashboard reports only a generic error, so the test pins both spellings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Puts the Hermes dashboard behind estate single sign-on rather than its own password — the session that opens Grafana, Outline and Headlamp now opens Hermes.
buildHermesClient()— public client with PKCE, same shape asheadlampandrabbitmq.AuthorizationServerConfig."hermes" to ServicePermission.HERMESinDOWNSTREAM_CLIENT_PERMISSIONS.Public client is forced, not preferred. Hermes' dashboard exposes only
HERMES_DASHBOARD_OIDC_ISSUER,_CLIENT_IDand_SCOPES— there is no client-secret field, so a confidential client could not authenticate. The upside is no Vault key and nothing to rotate.The grant moves, it does not disappear. Hermes' route carries no forward-auth: a middleware there would intercept the OIDC callback and break the login before the dashboard sees the authorization code — the same reason
outlineisdirect. So theHERMESgrant is enforced at the authorize endpoint instead.Validation
./gradlew :api:test --tests '*RegisteredClientsTest*' --tests '*ServicePermissionTest*'— 36 tests, 36 passed.HERMES_DASHBOARD_PUBLIC_URLin fleet-infra: Hermes builds the callback as<public_url>/auth/callbackverbatim, and a drift fails at the redirect with only a generic error surfaced.Risk
hermescollides with no existing client id.DASHBOARDthan to a media app. ADMIN bypasses as usual.Links
JorisJonkers-dev/fleet-infra— OIDC env, forward-auth removal, and the Vault secrets script.