Skip to content

Commit

Permalink
feat: recomputeRoute for claim based routing (#2688)
Browse files Browse the repository at this point in the history
Relates to #2452

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
arkodg authored Feb 24, 2024
1 parent c5cd964 commit f4277b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/xds/translator/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func buildJWTAuthn(irListener *ir.HTTPListener) (*jwtauthnv3.JwtAuthentication,
Forward: true,
}

if irProvider.RecomputeRoute != nil {
jwtProvider.ClearRouteCache = *irProvider.RecomputeRoute
}

if irProvider.ExtractFrom != nil {
jwtProvider.FromHeaders = buildJwtFromHeaders(irProvider.ExtractFrom.Headers)
jwtProvider.FromCookies = irProvider.ExtractFrom.Cookies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ http:
- two.foo.com
remoteJWKS:
uri: https://192.168.1.250:8080/jwt/public-key/jwks.json
recomputeRoute: true
claimToHeaders:
- header: one-route-example2-key1
claim: claim.neteased.key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
headerName: one-route-example2-key1
- claimName: name
headerName: one-route-example2-key2
clearRouteCache: true
forward: true
issuer: https://www.two.example.com
payloadInMetadata: https://www.two.example.com
Expand Down

0 comments on commit f4277b1

Please sign in to comment.