Skip to content

Commit

Permalink
rename to recomputeRoute
Browse files Browse the repository at this point in the history
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
arkodg committed Feb 23, 2024
1 parent 9241363 commit 0276f45
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
13 changes: 8 additions & 5 deletions api/v1alpha1/jwt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,16 @@ type JWTProvider struct {
// For examples, following config:
// The claim must be of type; string, int, double, bool. Array type claims are not supported
//
// +optional
ClaimToHeaders []ClaimToHeader `json:"claimToHeaders,omitempty"`

// RecomputeRoute clears the route cache and recalculates the routing decision.
// This field must be enabled if the headers generated from the claim are used for
// route matching decisions.
//
// +optional
RecomputeRoute *bool `json:"recomputeRoute,omitempty"`

// ExtractFrom defines different ways to extract the JWT token from HTTP request.
// If empty, it defaults to extract JWT token from the Authorization HTTP request header using Bearer schema
// or access_token from query parameters.
Expand Down Expand Up @@ -85,11 +93,6 @@ type ClaimToHeader struct {
// (eg. "claim.nested.key", "sub"). The nested claim name must use dot "."
// to separate the JSON name path.
Claim string `json:"claim"`

// UseForRouting must be enabled if this header generated from the claim should be used for
// route matching decisions
// +optional
UseForRouting *bool `json:"useForRouting,omitempty"`
}

// JWTExtractor defines a custom JWT token extraction from HTTP request.
Expand Down
14 changes: 6 additions & 8 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,6 @@ spec:
description: Header defines the name of the HTTP request
header that the JWT Claim will be saved into.
type: string
useForRouting:
description: UseForRouting must be enabled if this
header generated from the claim should be used for
route matching decisions
type: boolean
required:
- claim
- header
Expand Down Expand Up @@ -466,6 +461,12 @@ spec:
maxLength: 253
minLength: 1
type: string
recomputeRoute:
description: RecomputeRoute clears the route cache and recalculates
the routing decision. This field must be enabled if the
headers generated from the claim are used for route matching
decisions.
type: boolean
remoteJWKS:
description: RemoteJWKS defines how to fetch and cache JSON
Web Key Sets (JWKS) from a remote HTTP/HTTPS endpoint.
Expand Down
4 changes: 2 additions & 2 deletions site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ _Appears in:_
| --- | --- | --- | --- |
| `header` | _string_ | true | Header defines the name of the HTTP request header that the JWT Claim will be saved into. |
| `claim` | _string_ | true | Claim is the JWT Claim that should be saved into the header : it can be a nested claim of type (eg. "claim.nested.key", "sub"). The nested claim name must use dot "." to separate the JSON name path. |
| `useForRouting` | _boolean_ | false | UseForRouting must be enabled if this header generated from the claim should be used for route matching decisions |


#### ClientIPDetectionSettings
Expand Down Expand Up @@ -1375,7 +1374,8 @@ _Appears in:_
| `issuer` | _string_ | false | Issuer is the principal that issued the JWT and takes the form of a URL or email address. For additional details, see https://tools.ietf.org/html/rfc7519#section-4.1.1 for URL format and https://rfc-editor.org/rfc/rfc5322.html for email format. If not provided, the JWT issuer is not checked. |
| `audiences` | _string array_ | false | Audiences is a list of JWT audiences allowed access. For additional details, see https://tools.ietf.org/html/rfc7519#section-4.1.3. If not provided, JWT audiences are not checked. |
| `remoteJWKS` | _[RemoteJWKS](#remotejwks)_ | true | RemoteJWKS defines how to fetch and cache JSON Web Key Sets (JWKS) from a remote HTTP/HTTPS endpoint. |
| `claimToHeaders` | _[ClaimToHeader](#claimtoheader) array_ | true | ClaimToHeaders is a list of JWT claims that must be extracted into HTTP request headers For examples, following config: The claim must be of type; string, int, double, bool. Array type claims are not supported |
| `claimToHeaders` | _[ClaimToHeader](#claimtoheader) array_ | false | ClaimToHeaders is a list of JWT claims that must be extracted into HTTP request headers For examples, following config: The claim must be of type; string, int, double, bool. Array type claims are not supported |
| `recomputeRoute` | _boolean_ | false | RecomputeRoute clears the route cache and recalculates the routing decision. This field must be enabled if the headers generated from the claim are used for route matching decisions. |
| `extractFrom` | _[JWTExtractor](#jwtextractor)_ | false | ExtractFrom defines different ways to extract the JWT token from HTTP request. If empty, it defaults to extract JWT token from the Authorization HTTP request header using Bearer schema or access_token from query parameters. |


Expand Down

0 comments on commit 0276f45

Please sign in to comment.