Skip to content

fix(publish): redact inline registry credentials - #1009

Merged
jdx merged 2 commits into
mainfrom
codex/publish-redact-registry-urls
Jul 13, 2026
Merged

jdx merged 2 commits into
mainfrom
codex/publish-redact-registry-urls

Conversation

@jdx

@jdx jdx commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • redact registry URLs in publish diagnostics and dry-run output
  • redact the OIDC token-exchange endpoint
  • cover scoped package target rendering with inline credentials

Tests

  • cargo fmt --check
  • cargo test -p aube publish

This pull request was generated by Codex.


Note

Low Risk
Display-only change; publish and auth behavior are unchanged.

Overview
Publish user-facing output and errors no longer echo raw registry URLs when those URLs embed credentials (e.g. user:secret@host).

The already published error, OIDC token exchange failure wrapper, and --dry-run “would PUT to …” line now pass URLs through aube_util::url::redact_url. Dry-run text is centralized in dry_run_outcome_line, with a unit test asserting scoped package targets redact inline auth while keeping the encoded path.

Reviewed by Cursor Bugbot for commit d5accc1. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Sensitive registry credentials are now redacted from publish command messages, including dry-run output and authentication error details.
    • Improved protection for URLs shown when packages are already present in a registry.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The publish command now redacts inline registry credentials in already-published errors, npm OIDC exchange errors, and dry-run PUT output. A unit test verifies redaction of credentials in the displayed publish target.

Changes

Publish URL redaction

Layer / File(s) Summary
Redact user-visible publish URLs
crates/aube/src/commands/publish.rs
Already-published errors, OIDC exchange failures, and dry-run PUT targets now use redact_url; a unit test verifies inline credential redaction.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a rabbit with a secretive nose,
Hiding credentials wherever text flows.
PUT targets gleam, errors stay neat,
OIDC paths keep secrets discreet.
Hop, hop—safe output is sweet!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: redacting inline registry credentials in publish-related output.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
crates/aube/src/commands/publish.rs (1)

1620-1628: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Test the actual dry-run output path.

This test duplicates the helper expression, so it still passes if Line 941 stops redacting. Exercise the CLI/output formatter directly, or extract a formatter used by both production and the assertion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/aube/src/commands/publish.rs` around lines 1620 - 1628, Update
publish_target_display_redacts_inline_registry_credentials to exercise the
actual dry-run output formatting path rather than calling
aube_util::url::redact_url directly. Invoke the CLI/output formatter used at the
production call site around the publish target display, or extract that shared
formatter and use it both in production and the test, then assert the rendered
output redacts the credentials.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/aube/src/commands/publish.rs`:
- Around line 1620-1628: Update
publish_target_display_redacts_inline_registry_credentials to exercise the
actual dry-run output formatting path rather than calling
aube_util::url::redact_url directly. Invoke the CLI/output formatter used at the
production call site around the publish target display, or extract that shared
formatter and use it both in production and the test, then assert the rendered
output redacts the credentials.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 9083aebb-0cc8-40a3-ba90-ced1f7e718e2

📥 Commits

Reviewing files that changed from the base of the PR and between 10c4081 and ee75126.

📒 Files selected for processing (1)
  • crates/aube/src/commands/publish.rs

@greptile-apps

greptile-apps Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR hardens publish diagnostic output by routing all three user-visible registry URLs through aube_util::url::redact_url, preventing inline user:password@ credentials from appearing in error messages, dry-run output, and OIDC failure text.

  • Already-published error and OIDC token-exchange failure now pass &registry_url / &endpoint through redact_url before interpolation.
  • Dry-run output is extracted into a testable dry_run_outcome_line helper, and the URL it formats goes through redact_url; a new unit test verifies the full redacted string for a scoped package with embedded credentials — the expected value (@scope%2Fpkg, uppercase %2F, unencoded @) is consistent with what encode_package_name actually produces.

Confidence Score: 5/5

Display-only change; no HTTP requests, auth tokens, or publish logic are touched. Safe to merge.

All three changed call sites correctly wrap the URL string in redact_url before it reaches user output, without altering the actual network request or credential handling. The redact_userinfo logic handles scoped-package paths correctly (the at >= slash guard prevents the @ in @scope from being mistaken for userinfo). The new test's expected string matches the actual output of encode_package_name followed by redact_url.

No files require special attention.

Important Files Changed

Filename Overview
crates/aube/src/commands/publish.rs Adds redact_url to three user-facing strings (already-published error, OIDC failure, dry-run output) and extracts dry_run_outcome_line to enable the new unit test; logic and assertion are correct.

Reviews (2): Last reviewed commit: "test(publish): cover redacted dry-run ou..." | Re-trigger Greptile

Comment thread crates/aube/src/commands/publish.rs Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ee75126. Configure here.

Comment thread crates/aube/src/commands/publish.rs Resolved
@jdx
jdx merged commit 5072806 into main Jul 13, 2026
18 checks passed
@jdx
jdx deleted the codex/publish-redact-registry-urls branch July 13, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant