2.7 KiB
Integrated server OIDC test (explicit local development fixture)
Prerequisites: native cargo build -p rmm-server --locked, normal migrations through
0011 applied to the existing development database, existing protected development
configuration/CA/job key, Python cryptography, existing web Playwright/Chromium and
the isolated certutil tool used by the browser harness. No external IdP is required.
Run python3 tests/oidc/server_integration.py. It starts its own ephemeral loopback
TLS provider and native API on an unused loopback port, and reaches the existing
development PostgreSQL container through its bridge address. It does not publish
PostgreSQL or restart the existing server/database. Private configuration is parsed
internally as data; no shell sourcing, credential stdout/argv or browser artifacts.
The only administrative fixtures are its own random restricted auth-state login
role, synthetic external identity routing row and explicit human membership row
in development tenant A. It grants no membership from OIDC groups/email. Those
fixtures and its own encrypted state rows are removed afterwards. It does not
write authorization/job/permit rows or positively invoke a plan approval endpoint.
The only approval-endpoint test uses a bearer and must be denied before plan lookup.
Actual latest standalone run: 35 assertions passed, including a real Chromium provider button/cross-site callback with normal CA validation and a temporary NSS store. Browser interaction is visibly synthetic and uses explicit dev simulation. The configured production-profile start/login check uses simulation false solely to test configuration behavior against the mock; this is not external-provider, human production-approval or Linux-VM acceptance.
Covered: code/PKCE/nonce/state, binding non-burning and callback replay, stable mapping, final session/CSRF/logout, JWT resource audience/ID-token separation, issuer/expiry/kid/rotation/scopes, actual MCP lifecycle/inventory call and insufficient scope denial, persistent membership revocation, disabled external identity, foreign tenant not-found, bearer+cookie approval denial, production dev-route disabling.
Harness corrections during implementation: avoid duplicate Python environment keywords; do not route the dev-login JSON extractor in production; read MCP SSE to its concrete JSON-RPC response instead of waiting for a long-lived stream to close. No auth/approval check was disabled to make the harness pass.
Current backend configuration/routes/migration/provisioning contract is
crates/server/OIDC.md. Earlier proto/BACKEND_CONTRACT.md statements about absent
production auth describe the pre-OIDC backend increment, not this additive adapter.
The other Sync/root/APT contracts and native-execution gates are unchanged.