Repository navigation
fix(oplog): keep source credentials out of the operation log - #881
Merged
Merged
Conversation
An install source typed as a URL can carry a token in its userinfo or query, and operations.log stored it as typed, so anyone reading the log or the dashboard's log view could see the credential (#878). Redact in oplog.Write, which every CLI and dashboard writer goes through: the source, oldSource and newSource args lose their userinfo, query and fragment, and the message loses the same parts where an error echoes them. The redaction reuses update's redactRepoURL, moved to install.RedactRepoURL. It now also covers git+https:// and ssh:// passwords, and a source typed without a scheme such as user:token@host/owner/repo, which install clones over HTTPS. logInstallOp logged args[0] as the source, which is a flag when one comes first (install --into team <url> logged "--into"), so the message was never redacted. It now logs the parsed source. Fixes #878
Codex Review Summary: ✅ CompletedThis 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. |
This was referenced Nov 13, 2026
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.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)What changed
operations.logstored an install source as typed, so a URL with a token in its userinfo or query put that token in the log and the dashboard's log view.oplog.Writenow redacts thesource,oldSourceandnewSourceargs. It drops their userinfo, query and fragment, and drops the same parts from the message where an error echoes them. Every CLI and dashboard writer goes through it:install,searchinstalls (single and batch), dashboard installs, and the dashboard's source edit (skill.source, which loggedoldSource/newSource).redactRepoURL, moved toinstall.RedactRepoURL. It now also coversgit+https://andssh://passwords, and a source typed without a scheme such asuser:token@host/owner/repo, which install clones over HTTPS. scp-style URLs, GitHub shorthands and local paths are unchanged.logInstallOploggedargs[0]as the source. When a flag came first (install --into team <url>), it logged"--into", and the message was never redacted. It now logs the parsed source.Before, for
skillshare install --into team "https://someone:s3cret@host/team/skills.git?token=q-s3cret":After:
Not covered:
skillshare log --clearremoves them..gitafter the query (...skills.git?token=x.git/). That is how the clone URL is built, not the log, so it is left for a follow-up.Linked Issue
Fixes #878
Checklist
make check) — for code changesTests:
TestRedactRepoURL(internal/install; the table moved fromcmd/skillshare/update_batch_redact_test.go, plusgit+https,ssh, scheme-less, shorthand and local-path cases),TestWrite_RedactsSourceCredentials(internal/oplog) andTestLog_InstallRedactsSourceCredentials(integration, real CLI with a flag before the source and a scheme-less source). All three failed before the fix.make checkpasses in the devcontainer. I also ran the built binary against an unreachable credentialed URL in global and project mode and found no credential in either log. Not run: website build (no docs changed) and the E2E runbooks.