fix(cli): add auth header and shell-safe quoting to config-to-env#96
Merged
fix(cli): add auth header and shell-safe quoting to config-to-env#96
Conversation
The config-to-env command had two bugs: 1. The fetch call to app-config-svc was missing the Authorization header, causing unauthenticated requests. When auth failed, the error output was eval'd by the web-runner entrypoint, producing "Authorization: command not found" errors and loading 0 env vars. 2. Config values were output without shell quoting (export KEY=value), so values containing shell metacharacters (!, $, backticks) were corrupted by bash eval in the entrypoint. Now values are single- quoted with proper escaping (export KEY='value'). Also: exit with non-zero code on errors so the entrypoint can detect failures, and throw when the config instance is not found. Fixes Eyevinn/osaas-ai#192 (Issues 1 and 6) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 tasks
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.
Summary
Fixes two critical bugs in the
osc web config-to-envCLI command that caused:!in passwords) — values were output without shell quoting, soevalin the web-runner entrypoint interpreted metacharactersAuthorization: command not found— the fetch call to app-config-svc was missing the Authorization headerChanges
Authorization: Bearer ${token}header to the config fetch callexport KEY='value') with proper escaping of embedded single quotesRoot cause
Line 210 (old):
await fetch(url)— token obtained on line 201 but never passedLine 214 (old):
`export ${key}=${value}`— no quoting around valueFixes Eyevinn/osaas-ai#192 (Issues 1 and 6)
Test plan
npx lerna run build --scope @osaas/cli!,$, single quotesosc web config-to-env <store-name>and verify output is properly single-quoted🤖 Generated with Claude Code