-
Notifications
You must be signed in to change notification settings - Fork 353
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
filters/auth: add -oauth2-token-cookie-remove-subdomains flag #2203
filters/auth: add -oauth2-token-cookie-remove-subdomains flag #2203
Conversation
// TokenCookieRemoveSubdomains sets the number of subdomains to remove from | ||
// the callback request hostname to obtain token cookie domain. | ||
// Init converts default nil to 1. | ||
TokenCookieRemoveSubdomains *int |
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.
To stay backwards-compatible I had to use pointer here to tell zero and default value (one) apart.
The proper config initialization requires Init()
call.
If we can sacrifice a bit of compatibility for library users then we could use just int
and rely on the default skipper flag value of 1.
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.
There are not many options here https://stackoverflow.com/questions/68800319/how-to-differentiate-int-null-and-defaulted-to-zero-from-int-actually-equal-to-z
We could also create a wrapper type but that feels too much.
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.
If you need this 3 state: 0 value, 0, N, then ptr is the way to go
See related #1909 Signed-off-by: Alexander Yastrebov <[email protected]>
0b35759
to
c2d64ab
Compare
@@ -214,14 +217,22 @@ func checkStatus(t *testing.T, rsp *http.Response, expectedStatus int) { | |||
} | |||
} | |||
|
|||
func checkRedirect(t *testing.T, rsp *http.Response, expectedURL string) { | |||
func checkRedirect(t *testing.T, rsp *http.Response, expectedLocationWithoutQuery string) { |
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.
expectedURI maybe?
👍 |
1 similar comment
👍 |
Followup on #2203 Followup on #2244 Followup on #2457 Updates #2898 Signed-off-by: Alexander Yastrebov <[email protected]>
Followup on #2203 Followup on #2244 Followup on #2457 Updates #2898 Signed-off-by: Alexander Yastrebov <[email protected]>
See related #1909
Signed-off-by: Alexander Yastrebov [email protected]