-
Notifications
You must be signed in to change notification settings - Fork 139
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
Bug 2026573: use rd for redirect #234
Conversation
/retest |
@clyang82: This pull request references Bugzilla bug 2026573, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/bugzilla refresh |
@s-urbaniak: This pull request references Bugzilla bug 2026573, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
/test e2e-component |
Thanks @s-urbaniak for sharing the history for
For my case, I do not set |
@@ -504,7 +504,7 @@ func (p *OAuthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (st | |||
} | |||
|
|||
func (p *OAuthProxy) GetRedirect(req *http.Request) (redirect string, err error) { | |||
if p.SkipProviderButton { | |||
if p.SkipProviderButton && p.ProxyPrefix != "/oauth" { |
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.
do you mind to add some tests here as well?
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.
Done. Thanks.
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.
LGTM, but let's give @stlaz a chance to look into this.
/lgtm
/hold
/lgtm cancel |
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.
Could you please provide an example of a request that would loop?
Also, the explanation of this change should be included in a commit message.
Needs unit tests.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: clyang82, slaskawi The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…and skip provider button
Signed-off-by: clyang82 <chuyang@redhat.com>
Does the example here help? Let me know if it is unclear. Thanks. |
/test e2e-component |
1 similar comment
/test e2e-component |
/retest |
1 similar comment
/retest |
The tests are failing with the proxy returning 500s, please check what's the issue and address it. |
/retest |
/test e2e-component |
/retest |
run |
/retest-required |
/bugzilla refresh |
@clyang82: This pull request references Bugzilla bug 2026573, which is valid. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Bugzilla (ytripath@redhat.com), skipping review request. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
{ | ||
name: "Redirect to root", | ||
options: func() *Options { | ||
opts := testOptions() | ||
opts.SkipProviderButton = true | ||
opts.ProxyPrefix = "/oauth" | ||
return opts | ||
}, | ||
requestURI: "/oauth/start", | ||
expected: "/", | ||
}, | ||
{ | ||
name: "Redirect to custom uri", | ||
options: func() *Options { | ||
opts := testOptions() | ||
opts.SkipProviderButton = true | ||
opts.ProxyPrefix = "/oauth2" | ||
return opts | ||
}, | ||
requestURI: "/oauth2/start", | ||
expected: "/oauth2/start", | ||
}, |
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.
Why do these scenarios behave differently? Why is the /oauth
-prefixed path special-cased in the code above?
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.
/oauth
is default value for ProxyPrefix
. the expected redirect is /
. that is our case. I have described it in the description.
/oauth2
is custom value for ProxyPrefix
. Keep the behaviour as it is.
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.
I still don't see the reason why we should treat /oauth
differently than any other prefix
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.
I do not know if my case is used by other customers. my case is using default setting with skip-provider-button=true
. so it always redirects to oauth/start
. it should be redirected to /
. You can see there is not such fix introduced in #18 in upstream - https://github.com/bitly/oauth2_proxy/blob/fa2771998a98a5bfdfa3c3503757668ac4f1c8ec/oauthproxy.go#L422
/bugzilla refresh The requirements for Bugzilla bugs have changed (BZs linked to PRs on master branch need to target OCP 4.11), recalculating validity. |
@openshift-bot: This pull request references Bugzilla bug 2026573, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/bugzilla refresh |
@clyang82: This pull request references Bugzilla bug 2026573, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
@clyang82: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
@clyang82, as mentioned in the issue, it is a misconfiguration, please check my response on your issue: #232. We can't just add a custom path to make your solution work in particular. We would need to add a feature flag (which defaults to turned off) and it would allow relative paths (set by |
@clyang82: This pull request references Bugzilla bug 2026573. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
fixes: #232
req.RequestURI
isoauth/start
so there is a dead loop, because the request is fromxxx/oauth/start
.It can be reproduced by entering the url
xxx/oauth/sign_in
orxxx/oauth/start
into the browsers.Signed-off-by: clyang82 chuyang@redhat.com