-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
support routing based on jwt claims #34974
Conversation
Skipping CI for Draft Pull Request. |
66ed50e
to
4f4018c
Compare
1c3044e
to
b9d3a4e
Compare
b9d3a4e
to
94caf26
Compare
/test all |
1 similar comment
/test all |
94caf26
to
77490d8
Compare
@howardjohn @costinm @mandarjog PTAL, this is ready for review. Note I will have some follow-up PRs for things like code refactor of the authn filter go code generation, the release notes and probably more tests, thanks. There also seems quite some tests fail due to the Envoy update (see #34188 for the failed envoy update) but the newly added tests for jwt route matching should pass. |
77490d8
to
6140e59
Compare
@howardjohn @costinm could you review the PR? 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, one small comment
@@ -459,3 +461,63 @@ func TestSourceMatchHTTP(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestTranslateMetadataMatch(t *testing.T) { |
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.
Nice tests
@@ -67,6 +67,7 @@ func buildFilter(in *plugin.InputParams, mutable *networking.MutableObjects) err | |||
if filter := applier.JwtFilter(); filter != nil { | |||
mutable.FilterChains[i].HTTP = append(mutable.FilterChains[i].HTTP, filter) | |||
} | |||
// TODO(yangminzhu): Set DisableClearRouteCache to true on sidecars. |
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.
what is the impact until then? just performance?
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.
yeah, and the performance impact should be really small. I will fix this right after this PR, just want to get this in first as it has been out for really long and avoid making the existing PR too large.
/test integ-telemetry-istiodremote-tests_istio |
/test integ-pilot-multicluster-tests_istio |
Please provide a description of this PR:
Adds support of the special header
x-jwt-claims
in virtual service for routing based on JWT claims.This must be used with RequestAuthentication otherwise the routing will never match (covered in e2e tests), see more details in design doc: https://docs.google.com/document/d/1s8Lykf8-KUZTLiG4YMSCHvxBDwZzHlrrHyZ7cJymc_8/edit#heading=h.6p29w9kcduab
Note: will add release notes to make this feature in a follow PR