Feat/GitHub oauth ownership - #5
Merged
Merged
Conversation
The forwarding form previously authenticated only the destination inbox (via Cloudflare's verification email), never the name itself. Since owner.github is public in domains/<name>.json, anyone could point someone else's name@devis.im at their own inbox and silently capture that person's mail. Add a GitHub OAuth gate: the form makes the user sign in via a popup (page state preserved, fresh single-use code per submit so the verify-then-resubmit step still works) and sends the code. The Worker exchanges it, reads the signed-in login, and requires it to equal the file's owner.github (403 otherwise). No scopes requested; the token only reads the public login and is discarded — nothing stored. - worker: githubLogin() exchange + lookup; ownership check before any Cloudflare provisioning; GH_CLIENT_ID var + GH_CLIENT_SECRET secret - form: popup OAuth (oauth-callback.html relays code via postMessage with origin + state CSRF guard) - tests: ownership match/mismatch, case-insensitive, oauth failures, secret-leak guard (19 passing) - docs: worker README OAuth App setup, CLAUDE.md phase 4, .dev.vars.example Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Logo for the 'devis.im email forwarding' GitHub OAuth App consent screen. SVG source + 512x512 PNG (GitHub accepts raster only). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying denizens with
|
| Latest commit: |
51ddd24
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6fd8b76e.denizens.pages.dev |
| Branch Preview URL: | https://feat-github-oauth-ownership.denizens.pages.dev |
✅ Claim validationNo domain claim changes detected — nothing to validate. |
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.
Claim
Name claimed:
____.devis.imChecklist
domains/.[a-z0-9-], no leading/trailing hyphen.owner.githubis my GitHub username (matches the author of this PR).schema.json(kept"$schema": "../schema.json"at the top).reserved.json.CNAMEorA/AAAA, not both.owner.email, if set, is a public contact only.)Notes (optional)