Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL matching abstraction #19

Merged
merged 20 commits into from
Oct 3, 2024

Conversation

drathar
Copy link
Contributor

@drathar drathar commented Jul 12, 2024

This is my proposed alternative solution to #18.

I've created the UrlMatcher interface and various implementations for every possible value of the MatchVariant enumeration.
I've also created the DeniedUrlList and AllowedUrlList classes both implementing UrlMatcher to be used as compound matchers instead of using a List<DisallowedUrl> and List<String> respectively. This gives a nice API and more freedom over the allow-list as not only host matching can be checked using the UrlMatcher interface.

If you don't like this kind of abstraction feel free to close my PR and the corresponding issue, otherwise any observations, suggestions, ideas, etc. are more than welcome. 👍🏻

@balazsgerlei balazsgerlei self-requested a review July 14, 2024 12:24
@balazsgerlei balazsgerlei added the enhancement New feature or request label Jul 26, 2024
Copy link
Owner

@balazsgerlei balazsgerlei left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution, I really like the concept and the fact that it provides more flexibility for defining allowed and disallowed URIs. It's a huge bonus that you made it possible to unit test it, it's been on my TODO list since I started working on this library and this is a good basis to build on!

I added my remarks and suggestions, please check them and implement them if you agree, while I'm always open for discussion! Thanks for your patience while waiting on my review I was struggling to fit it in.

@drathar drathar force-pushed the 18-url-matching-abstraction branch from c5d2b09 to be129ff Compare October 2, 2024 15:10
@drathar drathar force-pushed the 18-url-matching-abstraction branch from ac85e3c to 13ef821 Compare October 2, 2024 19:37
@balazsgerlei balazsgerlei merged commit 617e301 into balazsgerlei:main Oct 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants