Skip to content

Conversation

matthewdean-semgrep
Copy link
Contributor

@matthewdean-semgrep matthewdean-semgrep commented Aug 19, 2025

The library we use for URL pattern matching, urlpath, matches wildcards only if they are the last path segment in a URL. This has prevented us from allowing code access to GitLab repos which belong to subgroups and also confused customers who expected a path like "/foo*" to match a URL with that suffix

Resolve this by uprading from urlpath to go-urlpattern, an implementation of the URL Pattern standard. We also add tests to verify the wildcard matching behavior and a benchmark test to ensure an individual match attempt does not exceed a specified runtime budget and thus degrade Broker's performance.

As implemented the URL Pattern objects are being constructed at match time. We can likely improve speed and memory efficiency by moving this to Broker startup at some complexity cost.

@matthewdean-semgrep matthewdean-semgrep marked this pull request as ready for review August 19, 2025 22:01
Copy link
Member

@vivekkhimani vivekkhimani left a comment

Choose a reason for hiding this comment

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

Looks good to me! Matthew mentioned that he built and tested this locally to confirm that basic requests are making it past the allowlist.

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.

2 participants