Skip to content

Feat/GitHub oauth ownership - #5

Merged
cdrrazan merged 3 commits into
mainfrom
feat/github-oauth-ownership
Jun 14, 2026
Merged

Feat/GitHub oauth ownership#5
cdrrazan merged 3 commits into
mainfrom
feat/github-oauth-ownership

Conversation

@cdrrazan

@cdrrazan cdrrazan commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Claim

Name claimed: ____.devis.im

Checklist

  • This PR adds (or edits/deletes) exactly one file under domains/.
  • The filename is lowercase [a-z0-9-], no leading/trailing hyphen.
  • owner.github is my GitHub username (matches the author of this PR).
  • The file validates against schema.json (kept "$schema": "../schema.json" at the top).
  • The name is not already taken and is not in reserved.json.
  • I used CNAME or A/AAAA, not both.
  • I did not put my private forwarding email anywhere in the file. (owner.email, if set, is a public contact only.)

Notes (optional)

cdrrazan and others added 3 commits June 14, 2026 08:08
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>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying denizens with  Cloudflare Pages  Cloudflare Pages

Latest commit: 51ddd24
Status: ✅  Deploy successful!
Preview URL: https://6fd8b76e.denizens.pages.dev
Branch Preview URL: https://feat-github-oauth-ownership.denizens.pages.dev

View logs

@github-actions

Copy link
Copy Markdown

✅ Claim validation

No domain claim changes detected — nothing to validate.

@cdrrazan
cdrrazan merged commit 4fdad06 into main Jun 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant