Adds JWT Authn Support to XDS Translator#934
Conversation
|
Marked PR as a draft until:
|
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #934 +/- ##
==========================================
- Coverage 63.84% 63.83% -0.02%
==========================================
Files 54 55 +1
Lines 7834 8221 +387
==========================================
+ Hits 5002 5248 +246
- Misses 2519 2629 +110
- Partials 313 344 +31
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Per #813 (comment), this PR uses per filter config to configure the JWT provider for matched traffic. @lizan @arkodg PTAL when you have a moment, PTAL and let me know if this looks correct to you. I did not include any match in requirements since the route provides the match.
There was a problem hiding this comment.
yeah look good from a config perspective
4d676dd to
a933248
Compare
|
Removing "draft" since commit a933248 expands xds translator integration tests and the jwt |
a933248 to
9a36fbe
Compare
|
Converted back to draft since Envoy is not accepting the jwt config: Let me know if see something I’m missing. |
15399b5 to
45c0cb8
Compare
5c8705b to
b445e48
Compare
a2f28c9 to
3830676
Compare
There was a problem hiding this comment.
you for the case when two listeners have the same port, addFilterChain is false for the second listener, which means mgr is nil, which is being passed to this function.
rather than do this I suggest calling GetHTTPConnectionManagerFromListener here
func GetHTTPConnectionManagerFromListener(l *listener.Listener) (*hcm.HttpConnectionManager, error) {
for _, filterChain := range l.FilterChains {
for _, filter := range filterChain.Filters {
if filter.Name == wellknown.HTTPConnectionManager {
m := new(hcm.HttpConnectionManager)
if err := filter.GetTypedConfig().UnmarshalTo(m); err != nil {
return nil, err
}
return m, nil
}
}
}
return nil, ErrHcmNotFound
}
There was a problem hiding this comment.
I've updated buildXdsRoute() to take the xds listener as a param. The authn code gets the hcm HTTP filters from the listener and creates the PerRouteConfig requirement for jwt.
There was a problem hiding this comment.
instead of using rIdx and fIdx in Gateway API, you could just use routeIdx and providerIdx here to build a unique providerKey
There was a problem hiding this comment.
Thanks for catching this. Now that the IR no longer uses a keyed list of jwt providers, I removed the gatewayapi translator changes.
Signed-off-by: danehans <daneyonhansen@gmail.com>
3830676 to
36515e1
Compare
Adds initial JWT authentication support to xDS translator.
Signed-off-by: danehans daneyonhansen@gmail.com