You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the bespoke oauth2-mock-server image with Keycloak. The mock was
built for this suite alone; Keycloak is a conformant OpenID Connect
server that flotilla and sara can also be run against for local
development, and that an operator deploying outside Azure could use in
earnest. custom_realms/robotics-realm.json is the single realm
definition, mounted both here and by those repositories' compose files,
so a local run and a CI run exercise the same clients, scopes and roles.
Keycloak does not derive a token's audience from the requested scope the
way Entra does, so each API gets a client scope carrying one audience
mapper: isar-api yields aud=isar-test. Exactly one such scope may be
requested per token -- two audience mappers make Keycloak emit aud as an
array, which fastapi-azure-auth rejects outright.
Three protocol mappers exist only to satisfy that library's Entra-shaped
token model: a hardcoded ver, a hardcoded nbf (Keycloak emits none and
the library requires it) and a flat roles claim, since the default
nested realm_access.roles maps to neither ISAR's User.roles nor .NET's
ClaimTypes.Role.
Keycloak has no equivalent of the mock's /issue-token, so a role set is
chosen by picking the service account that holds it. The negative
assertions gain a client holding Role.User.HUA alone, kept distinct from
the client with no roles because Flotilla answers 403 for an
insufficient role but 401 for a token carrying none.
Two things the spike caught. Waiting on the discovery document is not
enough: it answers while clients are still importing, and a token minted
in that window comes back 401, so readiness now mints a real token. And
the client credentials are constants rather than settings, because a
setting named INTEGRATION_TESTS_CLIENT_SECRET is silently overridden by
the stale Entra value of that name still sitting in developers' .env
files -- which presents only as an unexplained 401.
0 commit comments