Skip to content
18 changes: 16 additions & 2 deletions api/v1alpha1/agentgateway/agentgateway_policy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ const (
HostnameRewriteModeNone HostnameRewriteMode = "None"
)

// +kubebuilder:validation:ExactlyOneOf=key;secretRef;passthrough
// +kubebuilder:validation:ExactlyOneOf=key;secretRef;passthrough;aws
type BackendAuth struct {
// key provides an inline key to use as the value of the Authorization header.
// This option is the least secure; usage of a Secret is preferred.
Expand All @@ -726,7 +726,21 @@ type BackendAuth struct {
// request, the original token would be unchanged, so this would have no effect.
// +optional
Passthrough *BackendAuthPassthrough `json:"passthrough,omitempty"`
// TODO: aws, azure, gcp
// TODO: azure, gcp

// Auth specifies an explicit AWS authentication method for the backend.
// When omitted, we will try to use the default AWS SDK authentication methods.
//
// +optional
AWS *AwsAuth `json:"aws,omitempty"`
}

// AwsAuth specifies the authentication method to use for the backend.
type AwsAuth struct {
// SecretRef references a Kubernetes Secret containing the AWS credentials.
// The Secret must have keys "accessKey", "secretKey", and optionally "sessionToken".
// +required
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to add workload credentials in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean from the env of the pod? i think that is already supported - it's the default if you don't specify auth. cc @howardjohn

SecretRef corev1.LocalObjectReference `json:"secretRef"`
}

type BackendAuthPassthrough struct {
Expand Down
21 changes: 21 additions & 0 deletions api/v1alpha1/agentgateway/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 @@ -477,6 +477,30 @@ spec:
authentication to the
backend
properties:
aws:
description: |-
Auth specifies an explicit AWS authentication method for the backend.
When omitted, we will try to use the default AWS SDK authentication methods.
properties:
secretRef:
description: |-
SecretRef references a Kubernetes Secret containing the AWS credentials.
The Secret must have keys "accessKey", "secretKey", and optionally "sessionToken".
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
required:
- secretRef
type: object
key:
description: |-
key provides an inline key to use as the value of the Authorization header.
Expand Down Expand Up @@ -510,9 +534,9 @@ spec:
x-kubernetes-validations:
- message: exactly one of
the fields in [key secretRef
passthrough] must be
set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough)].filter(x,x==true).size()
passthrough aws] must
be set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough),has(self.aws)].filter(x,x==true).size()
== 1'
http:
description: http defines
Expand Down Expand Up @@ -1213,6 +1237,30 @@ spec:
description: auth defines settings for managing
authentication to the backend
properties:
aws:
description: |-
Auth specifies an explicit AWS authentication method for the backend.
When omitted, we will try to use the default AWS SDK authentication methods.
properties:
secretRef:
description: |-
SecretRef references a Kubernetes Secret containing the AWS credentials.
The Secret must have keys "accessKey", "secretKey", and optionally "sessionToken".
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
required:
- secretRef
type: object
key:
description: |-
key provides an inline key to use as the value of the Authorization header.
Expand Down Expand Up @@ -1245,8 +1293,8 @@ spec:
type: object
x-kubernetes-validations:
- message: exactly one of the fields in [key secretRef
passthrough] must be set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough)].filter(x,x==true).size()
passthrough aws] must be set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough),has(self.aws)].filter(x,x==true).size()
== 1'
http:
description: http defines settings for managing
Expand Down Expand Up @@ -1829,6 +1877,30 @@ spec:
description: auth defines settings for managing
authentication to the backend
properties:
aws:
description: |-
Auth specifies an explicit AWS authentication method for the backend.
When omitted, we will try to use the default AWS SDK authentication methods.
properties:
secretRef:
description: |-
SecretRef references a Kubernetes Secret containing the AWS credentials.
The Secret must have keys "accessKey", "secretKey", and optionally "sessionToken".
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
required:
- secretRef
type: object
key:
description: |-
key provides an inline key to use as the value of the Authorization header.
Expand Down Expand Up @@ -1861,8 +1933,8 @@ spec:
type: object
x-kubernetes-validations:
- message: exactly one of the fields in [key secretRef
passthrough] must be set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough)].filter(x,x==true).size()
passthrough aws] must be set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough),has(self.aws)].filter(x,x==true).size()
== 1'
http:
description: http defines settings for managing
Expand Down Expand Up @@ -2528,6 +2600,30 @@ spec:
description: auth defines settings for managing
authentication to the backend
properties:
aws:
description: |-
Auth specifies an explicit AWS authentication method for the backend.
When omitted, we will try to use the default AWS SDK authentication methods.
properties:
secretRef:
description: |-
SecretRef references a Kubernetes Secret containing the AWS credentials.
The Secret must have keys "accessKey", "secretKey", and optionally "sessionToken".
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
required:
- secretRef
type: object
key:
description: |-
key provides an inline key to use as the value of the Authorization header.
Expand Down Expand Up @@ -2560,9 +2656,9 @@ spec:
type: object
x-kubernetes-validations:
- message: exactly one of the fields in
[key secretRef passthrough] must be
set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough)].filter(x,x==true).size()
[key secretRef passthrough aws] must
be set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough),has(self.aws)].filter(x,x==true).size()
== 1'
http:
description: http defines settings for managing
Expand Down Expand Up @@ -3221,6 +3317,30 @@ spec:
description: auth defines settings for managing authentication
to the backend
properties:
aws:
description: |-
Auth specifies an explicit AWS authentication method for the backend.
When omitted, we will try to use the default AWS SDK authentication methods.
properties:
secretRef:
description: |-
SecretRef references a Kubernetes Secret containing the AWS credentials.
The Secret must have keys "accessKey", "secretKey", and optionally "sessionToken".
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
required:
- secretRef
type: object
key:
description: |-
key provides an inline key to use as the value of the Authorization header.
Expand Down Expand Up @@ -3252,9 +3372,9 @@ spec:
x-kubernetes-map-type: atomic
type: object
x-kubernetes-validations:
- message: exactly one of the fields in [key secretRef passthrough]
must be set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough)].filter(x,x==true).size()
- message: exactly one of the fields in [key secretRef passthrough
aws] must be set
rule: '[has(self.key),has(self.secretRef),has(self.passthrough),has(self.aws)].filter(x,x==true).size()
== 1'
http:
description: http defines settings for managing HTTP requests
Expand Down
Loading