Skip to content

Commit

Permalink
chore: rename allowMissing to optional
Browse files Browse the repository at this point in the history
Signed-off-by: Ardika Bagus <me@ardikabs.com>
  • Loading branch information
ardikabs committed Apr 17, 2024
1 parent 33b3bc0 commit b90ad69
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 125 deletions.
6 changes: 3 additions & 3 deletions api/v1alpha1/jwt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ package v1alpha1
// JWT defines the configuration for JSON Web Token (JWT) authentication.
type JWT struct {

// AllowMissing determines whether a missing JWT is acceptable, defaulting to false if not specified.
// Note: Even if allowMissing is set to true, JWT authentication will still fail if an invalid JWT is presented.
AllowMissing *bool `json:"allowMissing,omitempty"`
// Optional determines whether a missing JWT is acceptable, defaulting to false if not specified.
// Note: Even if optional is set to true, JWT authentication will still fail if an invalid JWT is presented.
Optional *bool `json:"optional,omitempty"`

// Providers defines the JSON Web Token (JWT) authentication provider type.
// When multiple JWT providers are specified, the JWT is considered valid if
Expand Down
4 changes: 2 additions & 2 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 @@ -422,10 +422,10 @@ spec:
description: JWT defines the configuration for JSON Web Token (JWT)
authentication.
properties:
allowMissing:
optional:
description: |-
AllowMissing determines whether a missing JWT is acceptable, defaulting to false if not specified.
Note: Even if allowMissing is set to true, JWT authentication will still fail if an invalid JWT is presented.
Optional determines whether a missing JWT is acceptable, defaulting to false if not specified.
Note: Even if optional is set to true, JWT authentication will still fail if an invalid JWT is presented.
type: boolean
providers:
description: |-
Expand Down
2 changes: 1 addition & 1 deletion internal/gatewayapi/securitypolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ func wildcard2regex(wildcard string) string {

func (t *Translator) buildJWT(jwt *egv1a1.JWT) *ir.JWT {
return &ir.JWT{
AllowMissing: ptr.Deref(jwt.AllowMissing, false),
AllowMissing: ptr.Deref(jwt.Optional, false),
Providers: jwt.Providers,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ securityPolicies:
- session_access_token
params:
- token
allowMissing: true
optional: true
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ infraIR:
name: envoy-gateway/gateway-1/http
ports:
- containerPort: 10080
name: http
name: http-80
protocol: HTTP
servicePort: 80
metadata:
Expand All @@ -175,7 +175,7 @@ infraIR:
name: envoy-gateway/gateway-2/http
ports:
- containerPort: 10080
name: http
name: http-80
protocol: HTTP
servicePort: 80
metadata:
Expand All @@ -192,7 +192,7 @@ securityPolicies:
namespace: default
spec:
jwt:
allowMissing: true
optional: true
providers:
- audiences:
- three.foo.com
Expand Down
223 changes: 111 additions & 112 deletions site/content/en/latest/api/extension_types.md

Large diffs are not rendered by default.

0 comments on commit b90ad69

Please sign in to comment.