fix: derive OSC_ENV from OSC_MCP_URL for config-to-env and token refresh#8
Merged
fix: derive OSC_ENV from OSC_MCP_URL for config-to-env and token refresh#8
Conversation
Without --env, the CLI defaulted to prod, causing the prod token service
to reject dev/stage JWTs with "token signature is invalid". Extract the
environment from OSC_MCP_URL (always injected by the runner job) and pass
it via --env to the config-to-env call. The token refresh URL already uses
${OSC_ENV:-prod} so it picks up the derivation automatically.
Part of Eyevinn/osaas-app#3762
Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced May 9, 2026
Open
Open
Open
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.
Problem
scripts/entrypoint.shcalled the OSC CLIconfig-to-envcommand without an--envflag, so it always targeted the prod environment. On dev/stage,getServiceAccessTokenthen called the prod token service with a dev/stage JWT (signed with a dev/stage key). The prod token service correctly rejected it: "Authorization token is invalid: The token signature is invalid."The token refresh curl call already used
${OSC_ENV:-prod}, butOSC_ENVwas never set, so it also silently hit prod.Fix
OSC_MCP_URLis always injected into the runner job and its hostname encodes the environment:https://ai.svc.dev.osaas.io/mcp→devhttps://ai.svc.stage.osaas.io/mcp→stagehttps://mcp.osaas.io/mcp→prodAn env-detection block extracts the environment from
OSC_MCP_URLusingsedand setsOSC_ENVbefore the token refresh and config-to-env calls. Theconfig-to-envinvocation now passes--env "${OSC_ENV:-prod}".This is the same fix applied to
birme/claude-runnervia PR #14.Changes
scripts/entrypoint.sh: add env-detection block; add--envflag toconfig-to-envcallPart of Eyevinn/osaas-app#3762
🤖 Generated with Claude Code