Skip to content

[ENG-2451] build(oauth): use projectIdOrName on /oauth-connect#1603

Merged
dionlow merged 1 commit intomainfrom
eng/oauth-connect-project-id-or-name
Apr 30, 2026
Merged

[ENG-2451] build(oauth): use projectIdOrName on /oauth-connect#1603
dionlow merged 1 commit intomainfrom
eng/oauth-connect-project-id-or-name

Conversation

@dionlow
Copy link
Copy Markdown
Contributor

@dionlow dionlow commented Apr 30, 2026

Summary

OAuth connect previously only supported projectId, we update to use projectIdorName.

  • Regenerate the API SDK after amp-labs/openapi#354 — the /oauth-connect request body now uses projectIdOrName instead of projectId.
  • Update useOauthConnectQuery and OauthFlow2 to the new field name.
  • Pull projectIdOrName directly from useAmpersandProviderProps() instead of resolving the UUID via useProjectQuery() first — removes an unnecessary fetch dependency from the OAuth flow.
  • Pairs with backend amp-labs/server#3839.

The regenerated SDK also picks up unrelated providerInfo subscribe-support changes that already merged in amp-labs/openapi#352.

Test plan

  • tsc --noEmit clean
  • yarn lint clean (0 errors)
  • Manual end-to-end: configure AmpersandProvider with a project name (not UUID), trigger an OAuth flow via OauthFlow2, verify the POST /oauth-connect body contains projectIdOrName and the connection is created
  • Repeat with a project UUID to confirm both forms still work

Backend (amp-labs/server#3839) and OpenAPI spec
(amp-labs/openapi#354) now accept project name in addition to UUID
on /oauth-connect. Regenerate the SDK and pass projectIdOrName
straight from AmpersandProvider context, removing the unnecessary
useProjectQuery() round-trip in the OAuth flow.

The regenerated SDK also picks up unrelated providerInfo subscribe
changes from amp-labs/openapi#352.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dionlow dionlow force-pushed the eng/oauth-connect-project-id-or-name branch from f159dd5 to bd3ba43 Compare April 30, 2026 23:01
@dionlow dionlow requested review from a team and RajatPawar and removed request for a team April 30, 2026 23:02
@dionlow dionlow changed the title feat(oauth): use projectIdOrName on /oauth-connect build(oauth): use projectIdOrName on /oauth-connect Apr 30, 2026
@dionlow dionlow changed the title build(oauth): use projectIdOrName on /oauth-connect [ENG-2451] build(oauth): use projectIdOrName on /oauth-connect Apr 30, 2026
@linear
Copy link
Copy Markdown

linear Bot commented Apr 30, 2026

@dionlow dionlow merged commit 249f1d9 into main Apr 30, 2026
4 checks passed
@dionlow dionlow deleted the eng/oauth-connect-project-id-or-name branch April 30, 2026 23:11
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.

2 participants