Skip to content

GEN-2923 Add X OAuth foundation - #408

Merged
asselstine merged 9 commits into
mainfrom
GEN-2923-dev-agent
Nov 19, 2026
Merged

asselstine merged 9 commits into
mainfrom
GEN-2923-dev-agent

Conversation

@asselstine

@asselstine asselstine commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

X OAuth connection lifecycle

This PR delivers user-owned X OAuth setup, tenant-owned job selection, run-scoped X API v2 access, refresh/disconnect race safety, owner connection testing, and explicit app credential replacement with reauthorization for GEN-2923.

  • Owner test connection performs only a read-only GET /2/users/me using the saved access token. It returns a safe status/message and stored handle only; upstream error bodies and credentials are never returned.
  • Credential replacement encrypts the new client secret, clears old access/refresh tokens and granted-scope metadata, invalidates pending OAuth attempts, and pauses the connection until reauthorization.
  • Reauthorization stays bound to the existing account ID. OAuth attempts are credential-version-bound, so a stale callback cannot install tokens after replacement. A different account is rejected; create a new connection to change account identity.
  • Disconnect retains its revoked tombstone, so reconnect/replacement cannot restore access to revoked run grants.

Acceptance ledger

  • User-owned setup, PKCE callback, granted-scope validation and verified account identity: verified complete.
  • Tenant-owned job selection, immutable run snapshots, safe runtime discovery and fixed-origin X API v2 proxy: verified complete.
  • Serialized refresh rotation, atomic encrypted persistence, disconnect/reconnect race safety and terminal versus transient failures: verified complete.
  • Owner-only non-mutating test connection, safe failures, credential replacement, account-preserving reauthorization and revoked grant safety: verified complete.

Validation

npm run test:local passed on 97bf3e56bae1c5329df36531a11717498e7ca2fc: backend 710 passed / 5 skipped across 109 files; generated contract drift check, app build, backend checks, compiled app/API/PostgreSQL integration, 6 functional browser checks, app tests 98 passed / 1 skipped, proxy checks and Docker E2E passed. New PostgreSQL/API cases used mocked X responses; browser coverage exercised test failure and replacement/re-authorization. No live paid X calls were made.

GitHub Build Manager owns asynchronous PR check monitoring; this run did not wait for remote checks.

@linear

linear Bot commented Nov 17, 2026

Copy link
Copy Markdown

GEN-2923

@asselstine
asselstine marked this pull request as ready for review November 17, 2026 22:10
@asselstine
asselstine merged commit 426cd76 into main Nov 19, 2026
3 checks passed
@asselstine
asselstine deleted the GEN-2923-dev-agent branch November 19, 2026 17:33
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