Fix warden access proxy for catalog fetch commands with shell pipes.
resolve_fetch_command used shlex.split, which treated `|` as a literal argument — breaking reuse-surface-hub-write-token (kubectl | base64 -d). Piped commands now run via shell=True with inherited stdio for --fetch.
This commit is contained in:
parent
7d915a2eb5
commit
be3b4a2a86
4 changed files with 137 additions and 27 deletions
|
|
@ -964,7 +964,7 @@ def _access_proxy(
|
|||
err.print("[yellow]Proxying ungated[/yellow] (--no-policy; gate not enforced).")
|
||||
|
||||
try:
|
||||
argv = resolve_fetch_command(entry, domain=domain, field=field, path=path)
|
||||
resolved = resolve_fetch_command(entry, domain=domain, field=field, path=path)
|
||||
except ProxyError as e:
|
||||
err.print(f"[red]{e}[/red]")
|
||||
raise typer.Exit(2)
|
||||
|
|
@ -979,9 +979,9 @@ def _access_proxy(
|
|||
if not child_argv:
|
||||
err.print("[red]--exec needs a command after `--`[/red], e.g. `-- npm publish`.")
|
||||
raise typer.Exit(2)
|
||||
rc = proxy_exec(argv, env_var=field or "", child_argv=child_argv)
|
||||
rc = proxy_exec(resolved, env_var=field or "", child_argv=child_argv)
|
||||
else:
|
||||
rc = proxy_fetch(argv)
|
||||
rc = proxy_fetch(resolved)
|
||||
except ProxyError as e:
|
||||
err.print(f"[red]{e}[/red]")
|
||||
raise typer.Exit(5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue