Repository navigation
Conversation
Pulumi PreviewNo preview ran for this commit: the preview environment has no deploy secrets. |
|
@dsp-ant this is ready for review. Three things need you, all in the Setup → @dsp-ant section of the description:
Sign-in starts as a pilot for me only ( The PR can merge before any of this; the deploy job skips until the secrets exist. Generated by Claude Code |
Automated review (Claude-generated)
Severity key: 🔴 High · 🟠 Medium · 🟡 Low · ⚪ Nit 🔴 High1. 2. Identity is trust-on-first-use of a mutable GitHub login — 🟠 Medium3. GitHub error callback causes a redirect loop — 4. OAuth 5. Key-rotation procedure can break verification for up to the JWKS cache TTL — 6. Deploy gate doesn't require the GitHub client secret — 7. Test fixtures are derived from live 🟡 Low8. 9. Eligibility predicate is re-implemented instead of shared — 10. 11. 12. ⚪ Nit13. Hand-rolled base64url — 14. Generated by Claude Code |
|
@dsp-ant thanks for the review. All 14 items are addressed in bf5bde6, and 72b7dcf simplifies the result:
Worker: 23 tests and typecheck pass. Repo: format, config validation and 79 tests pass. Generated by Claude Code |
|
Ready for review. The review fixes are in, and the access-site, repository CI, and Pulumi preview checks all passed. I also backfilled the numeric GitHub IDs for all 139 configured usernames in The Workspace SSO pilot is still limited to |
|
Thanks for working through the review. The overall design looks good to me. Three things we should fix before merging: 1. Sign-in fails in the Workers runtime (
2. The pilot allowlist fails open ( 3. Merge conflict in Two notes on CI. The The rest can be follow-ups, but verifying the backfilled GitHub IDs has to happen before we widen the pilot beyond you. Generated by Claude Code |
dce9ae3 to
aa706d7
Compare
0a9a350 to
9ba46ca
Compare
45305c3 to
f10a86b
Compare
|
Thanks for the review, @localden. I’ve addressed the profile defaults, GitHub ID and role checks, session duration, offboarding docs, and JSONata tests in I’ve left the NameID thread open. After merge, I’ll use a throwaway Cloudflare app to confirm an unlisted org member gets |
f10a86b to
3cd8c42
Compare
3cd8c42 to
9629912
Compare
9629912 to
ad842e3
Compare
ad842e3 to
c8fa190
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c8fa190 to
1c778fe
Compare
…access-site # Conflicts: # README.md Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Summary
Allow a single maintainer,
sambhav, to sign in to MCP Google Workspace with GitHub through Cloudflare Access for SaaS. Cloudflare signs the SAML assertion. The earlier custom OIDC Worker, GitHub App and D1 database are no longer part of this change.The direct members of the
workspace-ssoGitHub team are the pilot roster. The same entries inusers.tssupply the numeric GitHub ID → Workspace email mapping. An enabled member needs a GitHub login and a current Google provisioning role, including inherited roles. CI resolves each enabled ID with GitHub and checks the login. The policy uses the slug from the Pulumi-managed team and requires a GitHub login method. The app allows only the GitHub identity provider, disables Cloudflare One Client authentication, and sends one constant SAML attribute (source: cloudflare-access) in place of Access's default group attributes. The app and policy each use a one-hour session duration.The NameID transform checks GitHub org membership and looks up the numeric GitHub ID. It does not check the identity provider, because Cloudflare's transform input has no
idpfield (verified live, see below). The policy's login-method rule enforces GitHub instead.allowedIdpsonly limits which providers the login page offers.Verification
npm run validate,npm test,npm run check-github-ids(live GitHub ID → login check, its own CI step) andnpm run format:check.Live results
The test used the app settings from
src/cloudflare.tsand Google's SP values were never set. Its policy admitted the whole GitHub org rather than theworkspace-ssoteam, so an unmapped member could reach the transform.nameIdFormatreturned byte-for-byte, with no custom attributesunmapped@access.invalid. The transform input is{id, name, email, groups[{id, name, teams[{name}]}]}, with noidpfield, so theidp.idclause was always false. Fixed in this PR, and the tests now use the captured shape.<pilot>@modelcontextprotocol.io, formatemailAddress, emptyAttributeStatementunmapped@access.invalid"")<NameID/>and the format switched topersistent. No fallback to email.buildNameIdTransformalways ends in a non-empty string literal, so it can't produce this.Second round, on Den's follow-ups. The app allowed GitHub and one-time PIN, so the PIN case could be exercised, and the policy included the login-method rule:
unmapped@access.invalidrequires.loginMethodchanged. Requiring PIN: a GitHub sign-in was refused ("That account does not have access", no assertion). Requiring GitHub: the same sign-in was admitted. The rule enforces the login method by itself.updated_atchanged. A mapped sign-in after the save still worked.source=cloudflare-access(xs:string). The NameID is unaffected, both mapped and unmapped.PIN codes were delivered to an address the policy admitted. In our tests no code arrived for addresses the policy did not admit, including every address under an org-only policy. Delivery was intermittent during testing, so that negative case is observed rather than proven.
Neither negative case fell back to email, so
nameIdFormat: 'id'is not needed.Pilot rollout
Before merge
Not covered, and not blocking: checking the signature against the app certificate.
After merge — connect Google and activate the pilot
cf zero-trust access applications get) and confirms:buildNameIdTransformand has noidpclause{"source": "cloudflare-access"}allowed_idpsis GitHub only and the Cloudflare One Client option is offworkspace-ssoteam is denied.access.invalidfails, but the signed response is visible before it's sent.sambhav@is enrolled and has no Workspace admin roleThe README covers enabling more members and revoking Google and Cloudflare sessions during offboarding. A mapping change takes effect on the next assertion, about a minute after deploy. Existing Google sessions and Access sessions still have to be revoked.