Skip to content

feat(connections): revoke grant + public_repo + audit log + docs/privacy (PR-E) - #22

Merged
implemented.stream (thanabartbb) merged 2 commits into
mainfrom
feat/connections-e
Oct 15, 2026
Merged

implemented.stream (thanabartbb) merged 2 commits into
mainfrom
feat/connections-e

Conversation

@thanabartbb

Copy link
Copy Markdown
Member

PR-E, the last one in the stack. Stacked on #21 (PR-D).

What

  • Revoke: DELETE /api/connections/github calls DELETE /applications/{client_id}/grant (Basic auth with the OAuth app id/secret, token in body), then deletes the stored token. Deleting the account cascades to every 0010 table.
  • Least privilege: /api/auth/github?scope=public requests read:user user:email public_repo. The callback now stores the scope GitHub actually granted (exchangeCodeWithScope).
  • Audit log: GET /api/connections/audit (event types only) + list on /settings/connections.
  • Docs:
    • docs/user-guide/customer-deploy.md (TH + EN): Cloudflare token template (Workers Scripts: Edit + Account Settings: Read), limits, deploy paths, self-heal, privacy note.
    • Design refs in docs/design/ui-ux-revamp-plan.md §16 (reference only, no copied code).
    • CHANGELOG Unreleased.
  • Tests: tests/connections-revoke.test.ts.

Owner must do (whole stack A to E)

  1. openssl rand -base64 32 → npx wrangler secret put CREDENTIALS_KEY, and keep an offline backup.
  2. Review, then apply migration 0010_customer_connections.sql with npm run db:migrate:remote.
  3. OAuth scope decision: keep repo as the default (private repos) or make public_repo the default. Both buttons exist; the default is repo. A GitHub App with per-repo installs is the long-term option.
  4. Recommended: regenerate the OAuth client secret (it was seen once by tooling) and update GITHUB_CLIENT_SECRET.
  5. Merge A → E in order, then approve a production deploy. Smoke-test direct deploy with a throwaway Cloudflare account first.
  6. Decide pricing/limits (now 5 repos / 30 PRs / 20 deploys per user per day, 3 fix attempts).

Not merged, not deployed, no remote migration, no secrets set.

@codesandbox-ci

codesandbox-ci Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4ed13c7:

Sandbox Source
devstack-my-button Configuration

@thanabartbb
implemented.stream (thanabartbb) merged commit f86d50b into main Oct 15, 2026
5 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