refactor(data-inspector): use devframe_auth_token for the SPA handshake param - #151
Merged
Conversation
…ke param
Align the standalone attach URL's token param with devframe core's canonical
DEVFRAME_AUTH_TOKEN_QUERY_PARAM ('devframe_auth_token'), which the WS transport
already uses, so the CLI producer, the SPA consumer, and the socket handshake
share one name and one source of truth instead of the bespoke di_token.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
What
Rename the Data Inspector standalone attach URL's auth-token query param from the bespoke
di_tokento devframe core's canonicaldevframe_auth_token.Why
devframe core already defines
DEVFRAME_AUTH_TOKEN_QUERY_PARAM = 'devframe_auth_token'(packages/devframe/src/constants.ts), and the WebSocket transport already appends?devframe_auth_token=to the socket URL. Data Inspector was minting and consuming its owndi_tokenname, so the CLI producer, the SPA consumer, and the underlying socket handshake used two different names for the same secret. This aligns them on one name and one source of truth by importing the shared constant instead of hardcoding a string.Changes
cli.ts— the printed attach URL now emits?devframe_auth_token=<token>via the shared constant.spa/composables/rpc.ts—consumeAuthToken()reads and scrubsdevframe_auth_tokenusing the same constant.Note
This changes the standalone handshake contract: a stale/bookmarked URL carrying
?di_token=will no longer authenticate. Since the CLI mints the URL fresh on eachattach, this only affects old copied links.This PR was created with the help of an agent.