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
custom DoH request validation #4329
Conversation
1b63e97
to
09b5443
Compare
So the idea then would be some sort of plugin that installs a new validation function? Like:
Or something like that? The (completely made up) If so, it seems reasonable to me. The John |
My idea is more like http middleware, but only for reading the requests and only one global middleware :) Then my plugin (which doesn't have to be included in this repo) would extract this ID and possibly pass it along using the metadata plugin. Others could potentially use this in their plugin for collecting HTTP specific stats such as which user agent is used. |
Why do they use UUID in the path? Wouldn't it make more sense to use the standard path and put the UUID in a header? In the latter case, this change would no longer be the same; instead of a validator, it would just be some sort of getter for the original HTTP request or some sort of inline parser function. |
The reason why it can’t be a header is that the clients aren’t modified or under my control. They can be any client, as long as they can specify a custom path. Which most can |
Ah, those pesky clients. Ok. So in your case you will install a custom validator function that just checks a regex or something. So that's why my description above is not accurate for you, and we don't need the This approach is fine with me. |
Yes. This sounds spot on 🙂 |
Unless @miekg has some strong objections, I would merge this but it needs the following:
|
Signed-off-by: Johnny Bergström <johnny@klaudify.se>
Signed-off-by: Johnny Bergström <johnny@klaudify.se>
Signed-off-by: Johnny Bergström <johnny@klaudify.se>
09b5443
to
5a60e52
Compare
@johnbelamaric up for grabs! |
Codecov Report
@@ Coverage Diff @@
## master #4329 +/- ##
==========================================
+ Coverage 54.96% 55.46% +0.50%
==========================================
Files 223 223
Lines 9918 9923 +5
==========================================
+ Hits 5451 5504 +53
+ Misses 4022 3963 -59
- Partials 445 456 +11
Continue to review full report at Codecov.
|
/lgtm |
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.
Approved by johnbelamaric
This is a POC for #4323