fix: read the AuthKit issuer only from configuration - #22
Merged
Merged
Conversation
Remove WORKOS_AUTHORIZATION_SERVER = "https://accounts.mukoko.com" from worker/wrangler.toml [vars], the "https://accounts.mukoko.com" fallback in the agent card and the "https://api.workos.com" fallback in the resource metadata. Both documents now take the issuer only from the WORKOS_AUTHORIZATION_SERVER Worker secret (normalised: bare host or https origin, no trailing slash) and answer 503 "WORKOS_AUTHORIZATION_SERVER is not configured" when it is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq
Clears CodeQL js/polynomial-redos on the issuer normaliser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq
Parse the advertised AuthKit issuer with URL rather than prepending a scheme to a string. A bare host or an https origin (any case) is accepted; path, query and fragment are dropped; http, other schemes, credentials and unparseable values are rejected and treated as unset, so the resource metadata and agent card answer 503. The agent card's OpenID Connect URL is built with new URL. A correctly configured https value resolves to the same origin as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq
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.
The owner's rule: never hardcode the AuthKit domain.
shamwari-github-mcp(inworker/) had the AuthKit issuer in three places:wrangler.toml[vars]:WORKOS_AUTHORIZATION_SERVER = "https://accounts.mukoko.com"— removed; listed with the per-environment secrets.src/a2a.tsagent card:|| "https://accounts.mukoko.com"fallback — removed.src/auth.tsresource metadata:|| "https://api.workos.com"fallback — removed.New
authorizationServer()reads only the env (normalises a bare host or https origin, strips a trailing slash)./.well-known/oauth-protected-resourceand/.well-known/agent-card.jsonanswer 503WORKOS_AUTHORIZATION_SERVER is not configuredwhen it is unset. README /wrangler.tomlcomments no longer name the host in the secret examples. Tests set the value explicitly as a fixture; new fail-closed tests.Do not merge until the
shamwari-github-mcpWorker hasWORKOS_AUTHORIZATION_SERVERset as a secret. Today it is a plain-text var that comes from thiswrangler.toml, and merging runswrangler deploy(deploy-worker.yml), which would drop it. This Worker is not inowner-actions.shstepworkos_domainsyet; the value is the AuthKit domain withhttps://(1Passwordnyuchi/workos, fieldWORKOS_AUTHKIT_DOMAIN).🤖 Generated with Claude Code
https://claude.ai/code/session_01GHjaH1Vt2dVLWU68iz8tFq