Repository navigation
Send the API key hash to v2 when forwarding - #2556
Closed
RhysSullivan wants to merge 1 commit into
Closed
RhysSullivan wants to merge 1 commit into
RhysSullivan wants to merge 1 commit into
Conversation
Cloudflare previewTorn down — the PR is closed. |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
Collaborator
Author
|
Closing: v1 is frozen, and the API key capture moves into Executor v2 instead. Sent from my Claude |
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.
When v1 forwards an MCP request of a moved organization to v2, the signed
v1fwdtoken now carries an optionalapiKeyclaim for callers that authenticated with a WorkOS API key:v2 stores every forwarded WorkOS API key as a native key, so those keys keep working after v1 shuts down. The hash is computed in
verifyApiKeyfrom the exact bearer v1 validated (same value as Better Auth'sdefaultKeyHasher), carried on the verified token and principal, and passed tomintForwardToken. AuthKit JWT callers get noapiKey. Everything else in the token, headers and responses is unchanged.The hash only travels inside the HMAC-signed bearer over the
V2_MCPservice binding. It is never logged and never put on a span.Tests:
v2-forward.test.ts: payload key order withapiKeylast, an API-key caller's forwarded token carries the key id, the key's organization and the hash (computed independently withnode:crypto), a caller without a key gets noapiKey, and the HMAC signature verifies.auth-provider.test.ts: the realMcpAuthLiveover a stubbed key lookup puts the hash on the principal while the URL still selects the organization; a JWT caller's principal has noapiKey.agent-handler.test.ts: the principal's key reachesforwardToV2.