-
Notifications
You must be signed in to change notification settings - Fork 352
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 host opt-out to jwtMetrics and oauthTokeninfoValidate #3164
Conversation
c4ecdea
to
003f91c
Compare
{ | ||
name: "no metrics when host matches opted-out domain", | ||
filters: `jwtMetrics("{issuers: [foo, bar], optOutHosts: [ '^.+[.]domain[.]test$', '^exact[.]test$' ]}")`, | ||
request: &http.Request{Method: "GET", Host: "foo.domain.test"}, |
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 test the same filter, but with "domain.test" host?
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.
We can but the goal is not to test regexp itself or all edge cases but the logic when host matches any or none of the configured patterns.
Extend configuration of `jwtMetrics` and `oauthTokeninfoValidate` to support opt-out by request host pattern - disable metrics collection and validation when request host matches any of the configured opt-out regular expressions. This can be used to exclude internal cluster domain (*.ingress.cluster.local hosts). Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
003f91c
to
755df3d
Compare
👍 |
1 similar comment
👍 |
* zalando/skipper#3167 * zalando/skipper#3166 * zalando/skipper#3165 * zalando/skipper#3164 * zalando/skipper#3162 * zalando/skipper#3161 * zalando/skipper#3159 * zalando/skipper#3158 * zalando/skipper#3070 * zalando/skipper#3140 * zalando/skipper#3155 [Changes](zalando/skipper@v0.21.150...v0.21.161) Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
* zalando/skipper#3167 * zalando/skipper#3166 * zalando/skipper#3165 * zalando/skipper#3164 * zalando/skipper#3162 * zalando/skipper#3161 * zalando/skipper#3159 * zalando/skipper#3158 * zalando/skipper#3070 * zalando/skipper#3140 * zalando/skipper#3155 [Changes](zalando/skipper@v0.21.150...v0.21.161) Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
* zalando/skipper#3167 * zalando/skipper#3166 * zalando/skipper#3165 * zalando/skipper#3164 * zalando/skipper#3162 * zalando/skipper#3161 * zalando/skipper#3159 * zalando/skipper#3158 * zalando/skipper#3070 * zalando/skipper#3140 * zalando/skipper#3155 [Changes](zalando/skipper@v0.21.150...v0.21.161) Signed-off-by: Roman Zavodskikh <roman.zavodskikh@zalando.de>
require.Equal(t, spec.Name(), f.Name) | ||
|
||
_, err := spec.CreateFilter(f.Args) | ||
t.Logf("%v", err) |
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.
does not assert.Error show the same thing?
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 think assert.Error does not log the error, only checks that is not nil
Extend configuration of
jwtMetrics
andoauthTokeninfoValidate
to support opt-out by request host pattern - disable metrics collection and validation when request host matches any of the configured opt-out regular expressions.This can be used to exclude internal cluster domain (*.ingress.cluster.local hosts).