-
Notifications
You must be signed in to change notification settings - Fork 4
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
URL matching abstraction #19
Conversation
There was a problem hiding this 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.
library/src/test/java/dev/gerlot/securewebview/url/AnyUriMatcherTest.java
Outdated
Show resolved
Hide resolved
library/src/test/java/dev/gerlot/securewebview/url/AuthorityAndPathMatcherTest.java
Outdated
Show resolved
Hide resolved
library/src/test/java/dev/gerlot/securewebview/url/AuthorityContainmentMatcherTest.java
Outdated
Show resolved
Hide resolved
library/src/main/java/dev/gerlot/securewebview/url/AllowedUrlList.java
Outdated
Show resolved
Hide resolved
library/src/test/java/dev/gerlot/securewebview/url/AuthorityContainmentMatcherTest.java
Outdated
Show resolved
Hide resolved
library/src/test/java/dev/gerlot/securewebview/url/BeginningMatcherTest.java
Outdated
Show resolved
Hide resolved
library/src/test/java/dev/gerlot/securewebview/url/DeniedUrlListTest.java
Outdated
Show resolved
Hide resolved
c5d2b09
to
be129ff
Compare
… iterate through the whole list
…ays iterate through the whole list
…t for both allowing and disallowing URIs
ac85e3c
to
13ef821
Compare
This is my proposed alternative solution to #18.
I've created the
UrlMatcher
interface and various implementations for every possible value of theMatchVariant
enumeration.I've also created the
DeniedUrlList
andAllowedUrlList
classes both implementingUrlMatcher
to be used as compound matchers instead of using aList<DisallowedUrl>
andList<String>
respectively. This gives a nice API and more freedom over the allow-list as not only host matching can be checked using theUrlMatcher
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. 👍🏻