Skip to content

[Prototype] Add characterization tests for auth session modules - #8271

Draft
dmerand wants to merge 1 commit into
mainfrom
donald/auth-characterization-tests
Draft

[Prototype] Add characterization tests for auth session modules#8271
dmerand wants to merge 1 commit into
mainfrom
donald/auth-characterization-tests

Conversation

@dmerand

@dmerand dmerand commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Note

Prototype. This PR is part of an exploratory auth-extraction effort (portable @shopify/dev-platform-auth package). It exists as design evidence and groundwork; do not treat it as a merge candidate until the extraction project is approved.

WHY are these changes introduced?

We plan to move the auth/session protocol code into a reusable package. Before any code moves, its current behavior must be pinned by tests that exist independently of the move. Then the extraction can prove it changed nothing: same tests, same results, different location.

WHAT is this pull request doing?

Test-only. Pins the contracts the extraction relies on, in packages/cli-kit/src/private/node/session/:

  • exchange.test.ts — exact token-request parameters for refresh and application-token exchange (admin destination/store, ${store}-${appId} result keying), all-or-nothing fan-out, device-code error mappings, token construction (expiry, scopes, JWT sub, missing-user error)
  • scopes.test.ts — per-API scope mappings and deduplication
  • validate.test.ts — missing application token handling; expiration-margin boundary (just inside vs just outside)
  • schema.test.ts (new) — session schema shape, Date serialization round-trip, cached identity structure validation

No production changes. No existing assertions modified. device-authorization.ts is excluded while #8269 and #8270 are in flight; its coverage completes this PR after they merge.

How to test your changes?

pnpm --filter @shopify/cli-kit vitest run src/private/node/session/

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — not user-facing: test-only, no changeset needed

Assisted-By: devx/929eb347-2efd-4cd2-8ad1-417fba996246
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Aug 8, 2026
@dmerand dmerand changed the title Add characterization tests for auth session modules [Prototype] Add characterization tests for auth session modules Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant