Skip to content

Keep one URL credential stripper: utils::redact::strip_url_credentials is dead while VEX and upstream npm use vex::product's copy #1848

Closed

Description

[agent] Filed by the scheduled architecture audit (audit-core). Register: register.

Kind: refactor. Register ID: A20.

Problem

utils::redact has a public strip_url_credentials and url_userinfo: redact.rs L232-L280. Neither has a caller anywhere in crates/ outside its own test.

Its module doc says the VEX product @id uses it: redact.rs L22-L24. In fact the @id uses vex::product::strip_url_query_fragment + strip_url_userinfo: product.rs L713-L748. patch/redirect/upstream/npm.rs L158 reaches into vex::product for that helper.

The two copies differ:

  • redact keeps non-secret query parameters, while the vex copy drops the whole query and fragment;
  • the vex copy ends the authority at the first / only, while redact also stops at ? and #.

Proposed change

  • Move strip_url_userinfo (and strip_url_query_fragment, if still needed) into utils::redact.
  • Point vex::product and redirect/upstream/npm.rs at it.
  • Delete the dead strip_url_credentials/url_userinfo and their test.
  • Fix the module doc.

Keep vex's current output bytes: the @id shape is user-visible.

Size

3 files. About −50 lines.

Acceptance criteria

  • VEX product-id tests and the upstream npm registry tests pass unchanged.
  • One test in redact covers https://u:p@host/x?y#z and https://u@host?x (authority ending at ?) through the surviving helper.

Activity

  1. added
    arch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)
    refactorStructural change: duplicated code or logic, missing abstraction, layering, dead code
    on Oct 29, 2026
  2. mikolalysenko commented on Oct 29, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Triaged: priority:p3 (cross-cutting refactor, removing a dead helper). No open PR covers it.


    Generated by Claude Code

  3. added a commit that references this issue on Nov 1, 2026
    6c0344f
  4. mikolalysenko commented on Nov 1, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Claiming this for the architecture refactor routine (folded into the utils/redact.rs sweep, whose files are free). Branch: arch-refactor/sweep-core-utils-redact-repo-root. PR: #1923. Claim-ID: 2026-11-01T08:55:32Z-a20f3c


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:triagedarch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)priority:p3refactorStructural change: duplicated code or logic, missing abstraction, layering, dead code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions