RS256 / JWKS SSO for the cloud control plane (closes #2)#6
Merged
Conversation
Adds asymmetric RS256 JWT verification alongside the existing HS256 path, so the cloud plane integrates with real identity providers (Auth0, Okta, Cognito, Clerk in RS mode) that sign with a private key and publish their public keys as a JWKS. verify_rs256_jwt builds an RSA public key from an RFC 7517 JWK (n, e), selects the key by the token's kid, verifies the PKCS1v15/SHA256 signature, and checks exp/iss/aud. jwt_principal now dispatches on the token's own alg header: HS256 uses VOLO_JWT_SECRET, RS256 uses VOLO_JWT_JWKS; both can be configured at once and coexist. With neither set the anonymous local-dev path is unchanged. Shared claim validation is factored into _validate_claims (used by both algs). generate_rsa_jwks / mint_rs256_jwt support local issuance and tests. Adds cryptography as a cloud dependency. 7 tests. Closes #2.
🛫 Volo reliability — ❌ NO-SHIPReplayed 7 adversarial scenarios against the agent (threshold ≥ 0.90).
Cost — replayed deterministically at $0 (no live API calls). baseline |
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.
Closes #2.
Adds asymmetric RS256 JWT verification to the cloud plane's SSO (M30), alongside the existing HS256 path.
Why
M30's SSO verifies HS256 (symmetric shared secret). Most identity providers — Auth0, Okta, Cognito, Clerk in RS mode — issue RS256 tokens and publish their public keys as a JWKS. To integrate with a real IdP we need asymmetric verification.
What
verify_rs256_jwtbuilds an RSA public key from an RFC 7517 JWK (n,e), selects the key by the token'skid, verifies the PKCS1v15 / SHA-256 signature, and checksexp/iss/aud.jwt_principalnow dispatches on the token's ownalgheader:HS256→VOLO_JWT_SECRET;RS256→VOLO_JWT_JWKS(a JSON JWKS document). Both can be configured at once and coexist. Neither set → the anonymous local-dev path, unchanged.exp/iss/audchecks factored into_validate_claims(used by both algorithms).generate_rsa_jwks/mint_rs256_jwtfor local issuance + tests.cryptographyadded as a cloud dependency.Tests
7 new: RS256 roundtrip against a JWKS, wrong-key / tamper / wrong-issuer / expired rejection,
jwt_principalRS256 dispatch, HS256+RS256 coexistence, no-config anonymous, and RS256 enforced end-to-end over the API (401 without a token, team created with one). Cloud suite 29 passed; full suite 535 passed, mypy clean, ruff clean.Refs ADR-0035.