Skip to content

feat: accept accessToken as alternative auth in createCheckoutSession - #1449

Open
mmelnyk-godaddy wants to merge 1 commit into
godaddy:mainfrom
mmelnyk-godaddy:feat/DEVX-1079-access-token-auth
Open

feat: accept accessToken as alternative auth in createCheckoutSession#1449
mmelnyk-godaddy wants to merge 1 commit into
godaddy:mainfrom
mmelnyk-godaddy:feat/DEVX-1079-access-token-auth

Conversation

@mmelnyk-godaddy

Copy link
Copy Markdown

Summary

  • Add accessToken as direct Bearer token option for createCheckoutSession
  • Mutually exclusive with existing clientId/clientSecret OAuth flow
  • TypeScript discriminated union (never fields) enforces at compile time, runtime check as safety net
  • 6 unit tests covering both auth paths, caching, and error cases

Changes

  • packages/react/src/types.tsCheckoutSessionAuth discriminated union type
  • packages/react/src/server.ts — accessToken direct path + runtime validation
  • packages/react/src/server.test.ts — 6 unit tests (new file)

Test plan

  • accessToken direct path bypasses OAuth flow
  • clientId/clientSecret OAuth path unchanged (backward compatible)
  • Mutual exclusivity throws clear error
  • No-auth failure handled gracefully
  • Token caching isolated to OAuth path only
  • All 6 tests pass

DEVX-1079

Add accessToken as a direct Bearer token option for createCheckoutSession,
mutually exclusive with the existing clientId/clientSecret OAuth flow.

- Add CheckoutSessionAuth discriminated union type (never-field pattern)
- Runtime validation throws when both auth methods provided
- OAuth token caching preserved for clientId/clientSecret path only
- 6 unit tests covering both paths, caching, and error cases

DEVX-1079
@mmelnyk-godaddy
mmelnyk-godaddy requested a review from a team as a code owner September 8, 2026 14:07
@mmelnyk-godaddy

Copy link
Copy Markdown
Author

Maestro Agent Metrics

Agent Duration Tokens In Cache Write Cache Read Tokens Out Status
maestro-orchestration:architecture-reviewer 0m 2s 0 0 0 0 Unknown
maestro-orchestration:coder 0m 0s 0 0 0 0 Unknown
maestro-orchestration:testing-reviewer 0m 2s 0 0 0 0 Unknown

Run ID: 20260908_120000

@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 64cab26

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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