fix(cubejs): generate-models uses admin-secret Hasura calls, not the caller JWT#69
Merged
Merged
Conversation
…caller JWT
generateDataSchema forwarded the caller's original Authorization token to
Hasura for findDataSchemas/createDataSchema. Callers authenticated with an
externally-issued JWT (e.g. a WorkOS session forwarded by cxs2) then fail
with 'Could not verify JWT: JWSError JWSInvalidSignature' — Hasura only
verifies its own HS256 key. checkAuth + defineUserScope have already
authorized the request at that point; use the admin-secret path for the
internal calls, exactly like smartGenerate does ('the user's JWT may expire
during the long-running flow' precedent).
Surfaced by cxs2 spec 081 (Blue Car demo, US7b: connect Pagila → generate
models → dashboard).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
generateDataSchema forwarded the caller's original JWT to Hasura for its internal reads/writes. Externally-authenticated callers (WorkOS session tokens forwarded by cxs2) then fail with
Could not verify JWT: JWSError JWSInvalidSignature— Hasura only verifies its own HS256 key, and the request was already authorized by checkAuth + defineUserScope.Fix: use the admin-secret path for the internal
findDataSchemas/createDataSchemacalls, exactly likesmartGeneratealready does.Surfaced by cxs2 spec 081 (US7b: connect Pagila → generate models → Tychi refine → dashboard); verified against the local stack.
🤖 Generated with Claude Code