-
Notifications
You must be signed in to change notification settings - Fork 680
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
apply ExtAuthz configuration to direct response routes #5962
apply ExtAuthz configuration to direct response routes #5962
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5962 +/- ##
=======================================
Coverage 78.56% 78.57%
=======================================
Files 139 139
Lines 19615 19623 +8
=======================================
+ Hits 15411 15419 +8
Misses 3901 3901
Partials 303 303
|
651b624
to
230fba2
Compare
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.
can we add release note as well? Or mark the pr as not need one
@davinci26 I don't have permissions to do that |
@shadialtarsha done |
Signed-off-by: shadi-altarsha <shadi.altarsha@reddit.com>
02f0045
to
27c73bc
Compare
Signed-off-by: shadi-altarsha <shadi.altarsha@reddit.com>
The Contour project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
Still fresh |
@@ -0,0 +1,2 @@ | |||
## Configure TypedPerFilterConfig with direct responses |
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.
nit: since this is a small change, can make this a single line with no title
something like Fixes bug where external authorization configuration was ignored on HTTPRoute rules configured with direct responses.
|
||
f.Certs.CreateSelfSignedCert(namespace, "testserver-cert", "testserver-cert", "testserver") | ||
|
||
// auth testserver |
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.
looks like we can pull all this setup logic into a BeforeEach in httpproxy_test.go and use it for existing tests as well?
@@ -283,4 +283,232 @@ func testExternalAuth(namespace string) { | |||
assert.Equal(t, "default", body.RequestHeaders.Get("Auth-Context-Target")) | |||
assert.Equal(t, "externalauth.projectcontour.io", body.RequestHeaders.Get("Auth-Context-Hostname")) | |||
}) | |||
|
|||
Specify("external auth can be configured on a direct response route", func() { |
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.
lets move this one into its own namespacedtest wrapper for debugability
Disabled: true, | ||
}, | ||
DirectResponsePolicy: &contourv1.HTTPDirectResponsePolicy{ | ||
StatusCode: 200, |
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.
nit: maybe use a different status code here to be precise
"target": "first", | ||
}, | ||
}, | ||
Services: []contourv1.Service{ |
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.
should we use a directresponsepolicy here instead?
The Contour project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
refresh |
@shadialtarsha if you can address @sunjayBhatia's comments we should be able to get this into the upcoming release. |
TypedPerFilterConfig
with direct responses
@skriss when is the next release? @shadialtarsha is on PTO till next week, so I wanted to see if I should push the changes myself or we can wait for it |
Release will be end of Jan (est. 1/31), with an RC a week or so beforehand. I'll leave it up to you but there should be time. |
We got time then I guess, will leave it to @shadialtarsha when he comes back |
@davinci26 @shadialtarsha just a reminder that the release date is approaching, it'd be great to get this PR updated so we can include it. |
Bumping to 1.29. |
Merged #6426, closing this one out. |
Currently, disabling external auth on direct responses doesn't work because we handle the case of direct responses in a different branch of the code while creating the Envoy route.
This PR fixes this bug.
P.S: For rate limiting it turns out it is an issue because direct responses don't care about the rate limit filter. I added tests to confirm that as well.