-
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
fix #6617 and #6659 #6661
base: main
Are you sure you want to change the base?
fix #6617 and #6659 #6661
Conversation
Changes: - use dagRoute's AuthContext and AuthDisabled in HTTPS-Upgrade to fix 6659 - Use globalExtAuth.AuthPolicy.Disabled to calculate dagRoute.AuthDisabled - Fix Tests Signed-off-by: Saman Mahdanian <[email protected]>
Signed-off-by: Saman Mahdanian <[email protected]>
Signed-off-by: Saman Mahdanian <[email protected]>
Signed-off-by: Saman Mahdanian <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6661 +/- ##
==========================================
- Coverage 81.76% 81.03% -0.74%
==========================================
Files 133 133
Lines 15944 20016 +4072
==========================================
+ Hits 13037 16220 +3183
- Misses 2614 3503 +889
Partials 293 293
|
@sunjayBhatia can you please add required labels to this one? |
Thank you @tsaarni for the label. |
@SamMHD I will try to arrange time for myself to review ASAP today or tomorrow! |
Thank you so much @tsaarni |
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 good!
Regarding testing the fix: Would it be possible to add a new test case in the e2e test suite that would have caught this bug. There are global ext auth tests here but they currently only cover disabled: false
.
Also tagging @clayton-gonsalves for your input, as your review would be valuable since you originally implemented this functionality.
Thank you for your feedback; I'll add the tests as suggested. I previously attempted to write tests for this scenario but found the existing test functions a bit incompatible to implement |
Exactly, the existing test functions make no sense for |
Signed-off-by: Saman Mahdanian <[email protected]>
Signed-off-by: Saman Mahdanian <[email protected]>
Signed-off-by: Saman Mahdanian <[email protected]>
I think I have implemented a workaround to this by making the test function more flexible. Btw, Do you think we still need to add this to e2e tests? |
Signed-off-by: Saman Mahdanian <[email protected]>
Signed-off-by: Saman Mahdanian <[email protected]>
@tsaarni Do have time to review the changes again? |
@tsaarni @sunjayBhatia @skriss is there any update on this? |
Why nobody answer us? :((( |
Sorry @SamMHD I haven’t had a chance to review yet, I've been swamped 😅 |
thank you @tsaarni , when do you think you can give it a look? |
Hello again, Is there any update on this PR? @tsaarni |
Hi @SamMHD and apologies once more for the delays! I've now created an environment to test this PR. It works well, however it seems override can only be done at the route level and not at the virtual host level. This example does not work: apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
name: echoserver
spec:
virtualhost:
fqdn: protected.127-0-0-101.nip.io
tls:
secretName: ingress
authorization:
authPolicy:
disabled: false
routes:
- services:
- name: echoserver
port: 80 It seems that with this scenario we end up in this code branch where it will try use the uninitialized extension name from |
Signed-off-by: Saman Mahdanian <[email protected]>
Signed-off-by: Saman Mahdanian <[email protected]>
Very good point dear @tsaarni , I have visited that code branch and fixed it, other than this one more thing came to my attention, and it was that "If we disable global auth in vhost configuration then we can not enable it back again in a route" so I have fixed it in "else clause" of same code branch. Can you give it a try or help me setup your test environment for myself? I think it should be fixed now. |
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 |
dear @tsaarni , do you have any update on this PR? |
closes #6617 and #6659
In order to fix #6617 I have changed how
dagRoute.DisableAuth
is caclulated.Also, to fix #6659 I thought it is needed to change behavior when we are upgrading a request to HTTPS (when
permitInsecure
is not set and we are redirecting HTTP to HTTPS). Thereby, whendagRoute.AuthContext
/dagRoute.AuthDisabled
is configured it will affect redirection as well -- before these changes, redirection won't care about them.Changes: