Skip to content

Commit

Permalink
change string to bool pointer variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienPillevesse committed Nov 8, 2024
1 parent 574815d commit 528f373
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/ext_auth_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type ExtAuth struct {
// +optional
HeadersToExtAuth []string `json:"headersToExtAuth,omitempty"`

BodyToExtAuth *string `json:"bodyToExtAuth,omitempty"`
BodyToExtAuth *bool `json:"bodyToExtAuth,omitempty"`

// FailOpen is a switch used to control the behavior when a response from the External Authorization service cannot be obtained.
// If FailOpen is set to true, the system allows the traffic to pass through.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ securityPolicies:
headersToExtAuth:
- header1
- header2
bodyToExtAuth: '{"name": "John Doe"}'
bodyToExtAuth: true
grpc:
backendRefs:
- name: service-2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ securityPolicies:
headersToExtAuth:
- header1
- header2
bodyToExtAuth: '{"name": "John Doe"}'
bodyToExtAuth: true
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
Expand Down Expand Up @@ -263,7 +263,7 @@ xdsIR:
headersToExtAuth:
- header1
- header2
bodyToExtAuth: '{"name": "John Doe"}'
bodyToExtAuth: true
name: securitypolicy/default/policy-for-http-route-1
- destination:
name: httproute/default/httproute-1/rule/1
Expand Down Expand Up @@ -308,7 +308,7 @@ xdsIR:
headersToExtAuth:
- header1
- header2
bodyToExtAuth: '{"name": "John Doe"}'
bodyToExtAuth: true
name: securitypolicy/default/policy-for-http-route-1
- destination:
name: httproute/default/httproute-2/rule/0
Expand Down
2 changes: 1 addition & 1 deletion internal/ir/xds.go
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ type ExtAuth struct {
// +optional
HeadersToExtAuth []string `json:"headersToExtAuth,omitempty"`

BodyToExtAuth *string `json:"bodyToExtAuth,omitempty"`
BodyToExtAuth *bool `json:"bodyToExtAuth,omitempty"`

// FailOpen is a switch used to control the behavior when a response from the External Authorization service cannot be obtained.
// If FailOpen is set to true, the system allows the traffic to pass through.
Expand Down
2 changes: 1 addition & 1 deletion internal/xds/translator/extauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func extAuthConfig(extAuth *ir.ExtAuth) *extauthv3.ExtAuthz {
})
}

if extAuth.BodyToExtAuth != nil {
if extAuth.BodyToExtAuth != nil && *extAuth.BodyToExtAuth {
config.WithRequestBody = &extauthv3.BufferSettings{
AllowPartialMessage: false,
PackAsBytes: false,
Expand Down

0 comments on commit 528f373

Please sign in to comment.