Skip to content

Implement support for URI constraint matching - #515

Open
djc wants to merge 2 commits into
mainfrom
uri-constraints
Open

Implement support for URI constraint matching#515
djc wants to merge 2 commits into
mainfrom
uri-constraints

Conversation

@djc

@djc djc commented Jul 2, 2026

Copy link
Copy Markdown
Member

Based on the RFC and the Go implementation.

(With help from Claude.)

Fixes #514.

@djc
djc requested review from cpu and ctz July 2, 2026 20:34
@djc
djc force-pushed the uri-constraints branch from 6bbe97b to 6dea61e Compare July 2, 2026 20:36
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.69%. Comparing base (f221207) to head (a3b8449).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #515      +/-   ##
==========================================
+ Coverage   97.61%   97.69%   +0.07%     
==========================================
  Files          20       21       +1     
  Lines        4070     4201     +131     
==========================================
+ Hits         3973     4104     +131     
  Misses         97       97              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@djc
djc force-pushed the uri-constraints branch 2 times, most recently from d644508 to 7d07058 Compare July 2, 2026 21:03
Comment thread src/subject_name/uri.rs
///
/// Parsing follows the generic RFC 3986 authority syntax and is intentionally minimal: anything
/// ambiguous fails closed (returns `None`).
pub(super) fn host_of(uri: untrusted::Input<'_>) -> Option<untrusted::Input<'_>> {

@ctz ctz Jul 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's also:

  • fuzz this? (or, better)
  • have a property test that this produces the same result as a more fully-featured URL parsing crate?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I haven't really done property testing before, but Claude used the propertytest crate to whip something up which looks credible at least. Do you have experience with property testing frameworks for Rust?

Comment thread tests/tls_server_certs.rs
@djc
djc force-pushed the uri-constraints branch from 7d07058 to 030e4b8 Compare July 31, 2026 15:35
@djc
djc force-pushed the uri-constraints branch from 030e4b8 to 1f3d8bb Compare July 31, 2026 15:39
@djc
djc force-pushed the uri-constraints branch from 1f3d8bb to a3b8449 Compare July 31, 2026 15:41
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.

Add opt-in support for ignoring URI name constraints

2 participants