From 19c13375c68f90fec8edc1d5f6a73eadc62fc8a8 Mon Sep 17 00:00:00 2001 From: Aaron Choo Date: Mon, 16 Dec 2024 10:54:05 -0500 Subject: [PATCH] update documentation and tests --- api/v1alpha1/api.go | 8 +++++--- api/v1alpha1/zz_generated.deepcopy.go | 4 ++-- .../crds/aigateway.envoyproxy.io_llmbackends.yaml | 10 ++++++---- .../aigateway.envoyproxy.io_llmsecuritypolicies.yaml | 3 ++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/api/v1alpha1/api.go b/api/v1alpha1/api.go index d5f7b7c78..62d1c0b30 100644 --- a/api/v1alpha1/api.go +++ b/api/v1alpha1/api.go @@ -107,9 +107,11 @@ type LLMBackendSpec struct { // +kubebuilder:validation:Required BackendRef egv1a1.BackendRef `json:"backendRef"` - // LLMSecurityPolicyName list the LLMSecurityPolicy that this backend will depend on + // SecurityPolicyName list the LLMSecurityPolicy that this backend will depend on. // - LLMSecurityPolicyName *string `json:"llmSecurityPolicyName,omitempty"` + // A SecurityPolicy specifies authentication, JWT, and API Key. + // + SecurityPolicyName *string `json:"securityPolicyName,omitempty"` } // LLMAPISchema defines the API schema of either LLMRoute (the input) or LLMBackend (the output). @@ -158,7 +160,7 @@ const ( // +kubebuilder:object:root=true -// LLMSecurityPolicy specifies the provider specific configuration. +// LLMSecurityPolicy specifies the provider specific configuration like authorization, JWT, and API Key. type LLMSecurityPolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 581ca2d13..ff05f0cfa 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -87,8 +87,8 @@ func (in *LLMBackendSpec) DeepCopyInto(out *LLMBackendSpec) { *out = *in out.APISchema = in.APISchema in.BackendRef.DeepCopyInto(&out.BackendRef) - if in.LLMSecurityPolicyName != nil { - in, out := &in.LLMSecurityPolicyName, &out.LLMSecurityPolicyName + if in.SecurityPolicyName != nil { + in, out := &in.SecurityPolicyName, &out.SecurityPolicyName *out = new(string) **out = **in } diff --git a/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_llmbackends.yaml b/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_llmbackends.yaml index 5b92fd669..5a6f3d83e 100644 --- a/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_llmbackends.yaml +++ b/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_llmbackends.yaml @@ -131,10 +131,6 @@ spec: - message: Must have port for Service reference rule: '(size(self.group) == 0 && self.kind == ''Service'') ? has(self.port) : true' - llmSecurityPolicyName: - description: LLMSecurityPolicyName list the LLMSecurityPolicy that - this backend will depend on - type: string outputSchema: description: |- APISchema specifies the API schema of the output format of requests from @@ -156,6 +152,12 @@ spec: required: - schema type: object + securityPolicyName: + description: |- + SecurityPolicyName list the LLMSecurityPolicy that this backend will depend on. + + A SecurityPolicy specifies authentication, JWT, and API Key. + type: string required: - backendRef - outputSchema diff --git a/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_llmsecuritypolicies.yaml b/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_llmsecuritypolicies.yaml index fbdd7629a..ccba1dccb 100644 --- a/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_llmsecuritypolicies.yaml +++ b/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_llmsecuritypolicies.yaml @@ -17,7 +17,8 @@ spec: - name: v1alpha1 schema: openAPIV3Schema: - description: LLMSecurityPolicy specifies the provider specific configuration. + description: LLMSecurityPolicy specifies the provider specific configuration + like authorization, JWT, and API Key. properties: apiVersion: description: |-