Repository navigation
fix(cold-store-reaper): keep Turso credentials out of curl argv in export-turso.sh (#1027) - #1034
Conversation
…port-turso.sh (#1027) All three curl calls (database discovery, per-DB token mint, /dump download) passed the Authorization header via -H argv, world-readable in the process list for up to 300s per database. Route them through a curl_auth helper that feeds the header in a curl config on stdin (--config -), mirroring cold_store.py _curl_fetch (#983). Add tests/test_export_turso.py: a stub-curl argv-capture harness that asserts no credential or Authorization text appears in any argv, the header reaches curl via the stdin config (platform token x2, per-DB JWT x1), the export is still filed, and the skip-when-unset path is unchanged.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Closes #1027.
Problem
export-turso.sh(PR #993) passed the Turso platform token (discovery + token-mint calls) and each minted per-database JWT (dump download) to curl as-Hargv elements — world-readable in the process list for up to 300 s per database, nightly. This is the exposure removed twice before (#948 push-fleet-feed.sh, #983 cold_store.py).Fix
curl_authhelper inexport-turso.sh: the Authorization header travels in a curl config fed on stdin (--config -), mirroringcold_store.py's_curl_fetch. The config is never written to a file and the token is never printed./dump) route through it. Behaviour otherwise unchanged: discovery, mint, download, integrity check, gzip,put-backup, and skip-when-unset all work as before.Tests
tests/test_export_turso.py(stub curl on PATH): captures argv + stdin for all three invocations; asserts no credential and noAuthorizationtext in any argv,--config -is used, the header reaches curl via the stdin config (platform token ×2, per-DB JWT ×1), the export is filed with cold-store, and skip-when-unset still exits 0 without calling curl. 2/2 pass.python3 -m unittest discover -s pkgs/cold-store-reaper/tests— 61 tests OK (1 skipped).Note (per the issue packet, not performed): rotating the Turso platform token is an operator action if wanted; the exposure was local process-list only.
🤖 Queue worker task 1199 (repo-health-code-pilot).
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit