[Prototype] Add characterization tests for auth session modules - #8271
Draft
dmerand wants to merge 1 commit into
Draft
[Prototype] Add characterization tests for auth session modules#8271dmerand wants to merge 1 commit into
dmerand wants to merge 1 commit into
Conversation
Assisted-By: devx/929eb347-2efd-4cd2-8ad1-417fba996246
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Prototype. This PR is part of an exploratory auth-extraction effort (portable
@shopify/dev-platform-authpackage). 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 (admindestination/store,${store}-${appId}result keying), all-or-nothing fan-out, device-code error mappings, token construction (expiry, scopes, JWTsub, missing-user error)scopes.test.ts— per-API scope mappings and deduplicationvalidate.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 validationNo production changes. No existing assertions modified.
device-authorization.tsis 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