-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
http: remove getAll() header map API and switch all usages to get() #13363
Conversation
This forces all callers to think about multiple header values. Signed-off-by: Matt Klein <[email protected]>
@alyssawilk lmk if you want a comment for every converted prod code site. I think I had that in setec at some point and can bring it back. |
yeah, I think any point we're automatically pulling [0] we should comment why that's OK. |
OK I will update. |
Signed-off-by: Matt Klein <[email protected]>
Signed-off-by: Matt Klein <[email protected]>
@alyssawilk updated |
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.
Awesome, thanks for the comments.
Sending some comments back your way, mostly optional but a few I think worth cleaning up for clarity
source/extensions/filters/http/cache/simple_http_cache/simple_http_cache.cc
Show resolved
Hide resolved
@@ -200,7 +200,7 @@ void Filter::onComplete(Filters::Common::ExtAuthz::ResponsePtr&& response) { | |||
// Currently it is not possible to add {{"append": "1"}, {"append": "2"}} (the intended | |||
// combined headers: {{"original": "true"}, {"append": "1"}, {"append": "2"}}) to the request | |||
// to upstream server by only sets `headers_to_append`. | |||
if (header_to_modify != nullptr) { | |||
if (!header_to_modify.empty()) { |
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.
In general I wonder if it's worth a docs comment somewhere that header to append appends to first value.
If had a tracing header in a non-envoy server which did multi-value,
Trace: ServerA
Trace: ServerB
I think Envoy as server C would generally end up
Trace: ServerA, ServerC
Trace: ServerB.
We offer no header order guarantees so really anyone who cares about order is ideally doing inline appends anyway, so optional.
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.
Honestly I find this code mind boggingly confusing every time I look at this, between gRPC/HTTP/etc. @dio do you mind taking a look and seeing if we can improve the docs here for extauth about this behavior?
Signed-off-by: Matt Klein <[email protected]>
Once we agree on this PR I'm going to need to update envoy-filter-example to get this to pass FYI. |
Signed-off-by: Matt Klein <[email protected]>
Signed-off-by: Matt Klein <[email protected]>
Signed-off-by: Matt Klein <[email protected]>
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
@alyssawilk I think I covered most of the comments. PTAL. When you are satisfied I will fix envoy-filter-example and we can merge in lockstep. |
Signed-off-by: Matt Klein <[email protected]>
Signed-off-by: Matt Klein <[email protected]>
To go with envoyproxy/envoy#13363 Signed-off-by: Matt Klein <[email protected]>
See envoyproxy/envoy-filter-example#135 for required filter example fix. |
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.
Awesome! I'm going to let you merge this and the filter example at your convenience :-)
Hm, looks like CI needs a pass and it needs a merge though. I'll do another pass once you have that sorted. |
To go with envoyproxy/envoy#13363 Signed-off-by: Matt Klein <[email protected]>
Signed-off-by: Matt Klein <[email protected]>
Signed-off-by: Matt Klein <[email protected]>
Signed-off-by: Matt Klein <[email protected]>
// TODO(kyessenov, PiotrSikora): This needs to either return a concatenated list of values, or | ||
// the ABI needs to be changed to return multiple values. This is a potential security issue. |
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.
@kyessenov @PiotrSikora this needs to be fixed ASAP
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.
(Talked to @kyessenov offline about this and it will be fixed soon)
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.
FWIW, the ABI in proxy-wasm/spec#1 already returns multiple values.
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.
Perfect. Let's do that then.
@alyssawilk I need another approve if you have a sec. |
This is a follow up to 2c60632.
This forces all callers to think about multiple header values. There may be places that we want
to support multiple values, but none of them are security critical and this change should be
functionally equivalent to what exists today.
Risk Level: Low
Testing: Existing tests
Docs Changes: N/A
Release Notes: N/A