Skip to content

worker: scaffold Cloudflare Worker with itty-router - #25

Closed
MekDrop wants to merge 2 commits into
mainfrom
claude/hopeful-borg-8a4f80
Closed

MekDrop wants to merge 2 commits into
mainfrom
claude/hopeful-borg-8a4f80

Conversation

@MekDrop

@MekDrop MekDrop commented Apr 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add worker/wrangler.toml with name, main, compatibility_date, and [vars] for SPA_URL, GH_RUNNER_OWNER, and GH_RUNNER_REPO
  • Add worker/.dev.vars.example documenting required secrets for local development
  • Add worker/src/index.js — minimal itty-router entry point with a GET / health route returning { status: 'ok' }
  • Add worker/.eslintrc.cjs with eslint:recommended and ES module source type
  • Wire itty-router and tweetnacl as runtime deps; wrangler and eslint as devDeps in worker/package.json
  • Add frontend/src/services/gitlab.js with GitLab PKCE OAuth flow helpers (startGitlabLogin, exchangeGitlabCode)

Closes #5
Closes #7

Test plan

  • npm install completes without errors
  • npm -w worker run build (wrangler deploy --dry-run) succeeds
  • npm -w worker run lint passes with no errors
  • Trigger startGitlabLogin('gitlab.com', clientId) and verify redirect URL contains correct code_challenge, code_challenge_method=S256, response_type=code, scope=read_api, and redirect_uri
  • Verify sessionStorage keys gitlab_verifier and gitlab_host are set before redirect
  • After redirect back with ?code=..., call exchangeGitlabCode(code) and confirm it POSTs to https://gitlab.com/oauth/token with the correct body fields
  • Confirm sessionStorage keys are removed after exchangeGitlabCode is called

MekDrop added 2 commits April 23, 2026 03:16
Add wrangler.toml, ESLint config, .dev.vars.example, and a minimal
itty-router entry point. Wire up itty-router and tweetnacl as runtime
deps; wrangler and eslint as devDeps. Closes #5
@MekDrop MekDrop changed the title frontend: implement GitLab PKCE OAuth flow worker: scaffold Cloudflare Worker with itty-router Apr 23, 2026
@MekDrop

MekDrop commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by separate PRs: #26 (worker scaffold, closes #5) and #27 (GitLab PKCE, closes #7).

@MekDrop MekDrop closed this Apr 23, 2026
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.

Frontend: GitLab PKCE OAuth flow (no Worker needed) Scaffold Cloudflare Worker with itty-router and tweetnacl

1 participant