-
Notifications
You must be signed in to change notification settings - Fork 314
api: add GCP OIDC auth support in BackendSecurityPolicies #635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
bd5edf3
90121fb
6c7df97
355ad5a
ebc5147
f541e98
40b1477
f7e2634
2414542
f7d5192
c538a45
e101a82
e851bcc
7263be3
622f5f5
3001321
c4208b4
831b6d2
04b7c08
2ae31ec
fa5d02d
2756c32
a4e725c
700dc73
687d29c
a48254b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -404,7 +404,7 @@ type AIServiceBackendSpec struct { | |
| type VersionedAPISchema struct { | ||
| // Name is the name of the API schema of the AIGatewayRoute or AIServiceBackend. | ||
| // | ||
| // +kubebuilder:validation:Enum=OpenAI;AWSBedrock;AzureOpenAI | ||
| // +kubebuilder:validation:Enum=OpenAI;AWSBedrock;AzureOpenAI;GCPGemini;GCPAnthropic | ||
| Name APISchema `json:"name"` | ||
|
|
||
| // Version is the version of the API schema. | ||
|
|
@@ -427,6 +427,15 @@ const ( | |
| // | ||
| // https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs | ||
| APISchemaAzureOpenAI APISchema = "AzureOpenAI" | ||
| // APISchemaGCPGemini is the schema followed by Gemini models hosted on GCP. | ||
|
yuzisun marked this conversation as resolved.
Outdated
|
||
| // | ||
| // https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/generateContent?hl=en | ||
|
yuzisun marked this conversation as resolved.
|
||
| APISchemaGCPGemini APISchema = "GCPGemini" | ||
| // APISchemaGCPAnthropic is the schema followed by Anthropic models hosted on GCP. | ||
| // This is majorly the Anthropic API with some GCP specific parameters as described in below URL. | ||
| // | ||
| // https://docs.anthropic.com/en/api/claude-on-vertex-ai | ||
| APISchemaGCPAnthropic APISchema = "GCPAnthropic" | ||
| ) | ||
|
|
||
| const ( | ||
|
|
@@ -442,6 +451,7 @@ const ( | |
| BackendSecurityPolicyTypeAPIKey BackendSecurityPolicyType = "APIKey" | ||
| BackendSecurityPolicyTypeAWSCredentials BackendSecurityPolicyType = "AWSCredentials" | ||
| BackendSecurityPolicyTypeAzureCredentials BackendSecurityPolicyType = "AzureCredentials" | ||
| BackendSecurityPolicyTypeGCPCredentials BackendSecurityPolicyType = "GCPCredentials" | ||
| ) | ||
|
|
||
| // BackendSecurityPolicy specifies configuration for authentication and authorization rules on the traffic | ||
|
|
@@ -466,7 +476,7 @@ type BackendSecurityPolicy struct { | |
| type BackendSecurityPolicySpec struct { | ||
| // Type specifies the auth mechanism used to access the provider. Currently, only "APIKey", "AWSCredentials", and "AzureCredentials" are supported. | ||
|
yuzisun marked this conversation as resolved.
Outdated
|
||
| // | ||
| // +kubebuilder:validation:Enum=APIKey;AWSCredentials;AzureCredentials | ||
| // +kubebuilder:validation:Enum=APIKey;AWSCredentials;AzureCredentials;GCPCredentials | ||
| Type BackendSecurityPolicyType `json:"type"` | ||
|
|
||
| // APIKey is a mechanism to access a backend(s). The API key will be injected into the Authorization header. | ||
|
|
@@ -483,6 +493,10 @@ type BackendSecurityPolicySpec struct { | |
| // | ||
| // +optional | ||
| AzureCredentials *BackendSecurityPolicyAzureCredentials `json:"azureCredentials,omitempty"` | ||
| // GCPCredentials is a mechanism to access a backend(s). GCP specific logic will be applied. | ||
| // | ||
| // +optional | ||
| GCPCredentials *BackendSecurityPolicyGCPCredentials `json:"gcpCredentials,omitempty"` | ||
| } | ||
|
|
||
| // BackendSecurityPolicyList contains a list of BackendSecurityPolicy | ||
|
|
@@ -520,6 +534,32 @@ type BackendSecurityPolicyOIDC struct { | |
| Aud string `json:"aud,omitempty"` | ||
| } | ||
|
|
||
| // BackendSecurityPolicyGCPCredentials contains the supported authentication mechanisms to access GCP. | ||
| type BackendSecurityPolicyGCPCredentials struct { | ||
| // ProjectID is the GCP project ID that the backend is hosted in. | ||
| // | ||
| // +kubebuilder:validation:Required | ||
| // +kubebuilder:validation:MinLength=1 | ||
| ProjectID string `json:"projectID"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is ProjectID specific to Federation Config? Would it make sense to bubble this field up if it's needed for all GCP auth
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure if other authentication methods would need project-id, so keeping it within federation config for now |
||
| // ServiceAccountEmail is the email address of the service account to be used to access GCP. | ||
| // | ||
| // +kubebuilder:validation:Required | ||
| // +kubebuilder:validation:MinLength=1 | ||
| ServiceAccountEmail string `json:"serviceAccountEmail"` | ||
|
yuzisun marked this conversation as resolved.
Outdated
|
||
| // WorkloadIdentityPoolName is the name of the workload identity pool defined in GCP. | ||
| // | ||
| // +kubebuilder:validation:Required | ||
| // +kubebuilder:validation:MinLength=1 | ||
| WorkloadIdentityPoolName string `json:"workloadIdentityPoolName"` | ||
|
yuzisun marked this conversation as resolved.
Outdated
|
||
| // GCPIdentityProviderName refers to the external identity provider whose credentials your workload is using to authenticate to Google Cloud. | ||
| // | ||
| // +kubebuilder:validation:Required | ||
| // +kubebuilder:validation:MinLength=1 | ||
| GCPIdentityProviderName string `json:"GCPIdentityProviderName"` | ||
|
yuzisun marked this conversation as resolved.
Outdated
|
||
| // BackendSecurityPolicyOIDC is the generic OIDC fields. | ||
|
yuzisun marked this conversation as resolved.
Outdated
|
||
| BackendSecurityPolicyOIDC `json:",inline"` | ||
| } | ||
|
|
||
| // BackendSecurityPolicyAzureCredentials contains the supported authentication mechanisms to access Azure. | ||
| type BackendSecurityPolicyAzureCredentials struct { | ||
| // ClientID is a unique identifier for an application in Azure. | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.