Skip to content

Require an explicit URL persistence policy - #22358

Closed
zsol wants to merge 1 commit into
zsol/url-persistence-02-credentialsfrom
zsol/url-persistence-03-explicit
Closed

zsol wants to merge 1 commit into
zsol/url-persistence-02-credentialsfrom
zsol/url-persistence-03-explicit

Conversation

@zsol

@zsol zsol commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

DisplaySafeUrl and VerbatimUrl currently implement Serialize, so callers can persist a URL without choosing how to handle credentials.

Remove those implementations and require callers to choose PersistSafeUrl or CredentialPersistingUrl. Use PersistSafeUrl for publish URLs and registry index fields.

This changes serialized output in two places:

  • Publish URLs in tool receipts now omit sensitive userinfo while retaining the complete query. The full URL remains available in memory for authentication.
  • Package indexes in pylock.toml now preserve complete query strings, including signed parameters, while omitting sensitive userinfo. They previously passed through display formatting, which redacted credential-like query parameters.

The generated schema reflects the updated publish URL type and documentation.

Stacked on #22357.

@zsol
zsol force-pushed the zsol/url-persistence-02-credentials branch from 210cf5c to 787a7d8 Compare October 9, 2026 15:46
@zsol
zsol force-pushed the zsol/url-persistence-03-explicit branch from 92b6201 to fb81882 Compare October 9, 2026 15:46
@zsol
zsol added this pull request to stack #22393 October 9, 2026 15:50
@zsol
zsol force-pushed the zsol/url-persistence-02-credentials branch from 787a7d8 to 8fb2e72 Compare October 12, 2026 11:50
@zsol
zsol force-pushed the zsol/url-persistence-03-explicit branch from fb81882 to e3f3db9 Compare October 12, 2026 11:50
@zsol
zsol force-pushed the zsol/url-persistence-02-credentials branch from 8fb2e72 to 43c35c6 Compare October 12, 2026 12:02
@zsol
zsol force-pushed the zsol/url-persistence-03-explicit branch from e3f3db9 to abf3403 Compare October 12, 2026 12:02
@codspeed

codspeed Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 0.38%

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 67 untouched benchmarks
⏩ 54 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ WallTime git_fetch_cold_precise[sampleproject] 36.3 ms 38.5 ms -5.78%
⚡ ⚠️ Simulation discover_workspace_from_all_members 156 ms 148.1 ms +5.32%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing zsol/url-persistence-03-explicit (5804a91) with zsol/url-persistence-02-credentials (a6dd1b4)

Open in CodSpeed

Footnotes

  1. 54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@zsol
zsol force-pushed the zsol/url-persistence-02-credentials branch from 43c35c6 to 5c6644b Compare October 13, 2026 09:23
@zsol
zsol force-pushed the zsol/url-persistence-03-explicit branch from abf3403 to 5be0993 Compare October 13, 2026 09:23
@zsol
zsol force-pushed the zsol/url-persistence-02-credentials branch from 5c6644b to 0cdd712 Compare October 13, 2026 10:35
@zsol
zsol force-pushed the zsol/url-persistence-03-explicit branch from 5be0993 to 604a907 Compare October 13, 2026 10:35
@zsol
zsol force-pushed the zsol/url-persistence-02-credentials branch from 0cdd712 to da4ecd7 Compare October 13, 2026 11:03
@zsol
zsol force-pushed the zsol/url-persistence-03-explicit branch from 604a907 to cdadff3 Compare October 13, 2026 11:03
@zsol zsol added the bug Something isn't working label Oct 13, 2026
@zsol
zsol marked this pull request as ready for review October 13, 2026 11:15
@zsol
zsol requested a review from zanieb October 13, 2026 11:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T10:31:51.918642Z 5804a91 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@zsol
zsol force-pushed the zsol/url-persistence-02-credentials branch from da4ecd7 to a6dd1b4 Compare October 15, 2026 10:28
@zsol
zsol force-pushed the zsol/url-persistence-03-explicit branch from cdadff3 to 5804a91 Compare October 15, 2026 10:28
zanieb pushed a commit that referenced this pull request Oct 16, 2026
`SafeUrl` currently serializes the full URL, so fields can persist
credentials without an explicit choice. Add a type-level policy that
defaults to `Unserializable`; `Stripped` removes sensitive userinfo
while retaining the complete query, and `Raw` serializes the full parsed
URL. `Display` and `Debug` continue to redact passwords and recognized
sensitive query parameters. Index URLs in `pylock.toml` and publish URLs
in tool receipts use `Stripped`.

The inherent `serialize` and `serialize_internal` methods prevent those
method calls from falling through `Deref` to `Url`. Ordinary Serde
serialization of `SafeUrl` requires `Stripped` or `Raw`; the internal
serialization method requires `Raw`.

The serialization policies are an alternative to the wrapper types in
#22356, #22357, and #22358, combined in astral-sh#2712 for
comparison. `Stripped` and `Raw` follow the same serialization rules as
`PersistSafeUrl` and `CredentialPersistingUrl`. Using `SafeUrl<P>`
carries the policy through `VerbatimUrl`, stored fields, and
transformations such as `join`; shared implementations are generic over
the policy. The aforementioned stack also changes how `DirectUrl`
metadata is parsed and written; those changes are outside this PR's
scope. See also
#22600 (comment)

Stacked on #22599.

Co-authored-by: zaniebot <[email protected]>
@zsol
zsol removed this pull request from stack #22393 October 16, 2026 15:25
@zsol zsol closed this Oct 16, 2026

This branch was previously deployed

1 inactive deployment
automations — 5804a919 Deployed Oct 15, 2026 by zsol via review / security review #51077
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant