Redact sensitive device authorization debug output - #8269
Open
dmerand wants to merge 2 commits into
Open
Conversation
Assisted-By: devx/bb1c6644-dd32-425e-b0c8-33f7efa1bb93
Assisted-By: devx/51bab362-9374-42a8-86d0-152326d57949
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents sensitive OAuth device authorization values (notably device_code and verification_uri_complete) from being emitted in verbose/debug logs, reducing the risk of credential leakage in captured CLI output while keeping the interactive login experience unchanged.
Changes:
- Replaced debug logging of the full device authorization response with a redacted, metadata-only message (HTTP status,
interval,expires_inwith anot providedfallback). - Added regression tests to ensure debug output excludes sensitive fields while preserving expected user-facing info output.
- Added a patch changeset for
@shopify/cli-kitdocumenting the user-visible fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/cli-kit/src/private/node/session/device-authorization.ts | Redacts debug output to avoid logging live device authorization credentials. |
| packages/cli-kit/src/private/node/session/device-authorization.test.ts | Adds tests asserting secrets are absent from debug logs and fallback markers render correctly. |
| .changeset/redact-device-authorization-log.md | Patch changeset describing the redaction fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
4 tasks
byrichardpowell
approved these changes
Aug 8, 2026
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.
WHY are these changes introduced?
The device authorization debug log serialized the full server response. In verbose mode this wrote
device_code— a live credential while the flow is pending — andverification_uri_completeto the terminal and to anything that captures CLI output.WHAT is this pull request doing?
interval,expires_in. Omitted optional fields render asnot provided.How to test your changes?
Run
shopify auth logout, then any authenticated command with--verbose(for exampleshopify theme list --verbose). Confirm the "Received device authorization response" debug line shows only status/interval/expiry, while the login prompt still shows the user code and link.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add