Repository navigation
fix(cli): archive diagnostics redact the store URL - #9119
Conversation
Quest-Claim: 490637380a8fa551
Recording and replay logged the raw store URL at INFO, and opening a store quoted it in errors, along with object_store's own messages, which echo the URL they were given. Log every store URL through moq_tokio::RedactedUrl, scrub the raw URL out of object_store's error chain, and refuse a password, query, or fragment in the URL, which no store reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. Refusing the password, query, and fragment up front is the right place for the policy, since no object_store builder reads them. The string scrub of object_store's error chain covers the one remaining leak, a bare username that the parser or builder echoes back.
Reviewed changes
This review covers the full PR: archive store URL redaction in rs/moq-cli/src/archive.rs and its documentation.
- Redacted logs and contexts: the
recordingandreplayingINFO lines and theno readable recording at/replaying ... failedcontexts now format throughRedactedUrl. - Up-front refusal in
open_store: a store URL with a password, query, or fragment fails before object_store sees it. A bare username is still allowed, so Azure'sabfs://container@accountform keeps working. - Scrubbed object_store errors: errors from
ObjectStoreScheme::parseand from the S3, GCS, and Azurebuild()calls are flattened and have the raw URL replaced with its redacted form. They are then wrapped asunsupported archive store {redacted}. - Test:
a_refused_store_hides_its_credentialschecks both{:#}and{:?}for every refusal path, including object_store's ownUnable to recognise URLmessage. - Docs:
doc/bin/cli.mddocuments the refusal and the redaction.
claude-opus-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughArchive store opening now rejects URLs that contain a password, query, or fragment. Export and import logs and errors use redacted URLs. Error handling sanitizes URLs in object-store parsing and cloud builder failures. Tests check that selected failure messages do not expose credentials. The CLI documentation describes these URL rules. Merge Risk:
|

Finishes quest/m1/precut-fixes/archive-url-logs.md and deletes it.
Summary
export archiveandimport archiveprinted the raw store URL, userinfo and query included, in their INFO lines (recording,replaying) and in their error contexts (no readable recording at,replaying ... failed,unsupported archive store). object_store's own errors (Unable to recognise URL "...",URL did not match any known pattern,Unable parse source url) also quote the exact URL string they were handed, so a redacted context alone still leaked through the chain.moq_tokio::RedactedUrl.open_storereplaces the raw URL with its redacted form throughout object_store's error chain.open_storerefuses a store URL with a password, query, or fragment before anything else sees it. No object_store builder reads them, so they were silently ignored before; now the error says to pass credentials through the environment. A bare username stays allowed, since Azure reads it as the container (abfs://container@account.dfs.core.windows.net).doc/bin/cli.mdsays so.Decisions
Public API
None. CLI behavior change:
export archive/import archivereject a store URL carrying a password, query, or fragment.Validation
a_refused_store_hides_its_credentials: each ofs3://user:SECRET@bucket/prefix,file:///rec?token=SECRET,file:///rec#SECRET,ftp://SECRET@example.com/rec,https://SECRET@example.com/rec, and (withazure)az://SECRET@account.example.com/recfails to open with neither{:#}nor{:?}containingSECRET, and naming the redacted URL. Mutation check: dropping the scrub fails it withUnable to recognise URL "ftp://SECRET@example.com/rec".moq-relay, with dummyAWS_*credentials:export archive s3://SECRET@bucket/prefixlogsrecording prefix=ev store=s3://bucket/prefix.import archive s3://SECRET@bucket/prefix/ev/@xfails withno readable recording at s3://bucket/prefix/ev/@x(403 from S3).export/importwith?token=SECREToruser:SECRET@exit with the refusal, which names only the redacted URL. Withftp://SECRET@example.com/rec, the cause readsUnable to recognise URL "ftp://example.com/rec".grep SECRETover every captured log: no matches.cargo test -p moq-cli --bin moq archive::(11 pass),just checkpasses.Caused by
git log -Sshowsunsupported archive store {url}came in with quest(archive): Timeline-indexed MoQ archives #4034; feat(cli,hls)!: take moq-cli's and moq-hls's crypto from rind #7571 only moved the builders to rind.Follow-ups
None.
Models
Size: S
Implementer: Claude Code, claude-opus-5-5, medium effort
(Written by Claude Opus 5.5 with medium)
Review
Rewritten by
quest reviewafter each round.Head: 8ca1a08
Base: origin/main at a7e327b
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1f0b7-bcd6-7862-96cf-c60ad29dfa53, round 1Score: 9/10,
Source review found no blocking issues or behavioral regressions, but builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none