Skip to content

Implementation of API Key Auth#106

Closed
aabchoo wants to merge 41 commits intomainfrom
aaron/apikey-auth
Closed

Implementation of API Key Auth#106
aabchoo wants to merge 41 commits intomainfrom
aaron/apikey-auth

Conversation

@aabchoo
Copy link
Copy Markdown
Contributor

@aabchoo aabchoo commented Jan 16, 2025

This PR implements APIKey Auth for backendSecurityPolicy. The api key stored in a secret will be mounted to the extproc's pod, and later extracted by the appropriate AuthHandler.

Moved extprocDeployment into the sink as we need to tinker with the deployment if backend/backendSecurityPolicy is updated.

Removed the envoy config yaml's field add_request_header and replaced it with new API Key Auth implementation. CI passes which means that API Key mounted to extproc + specified on backend auth works.

Will work on adding AWS Credential file after this.

@mathetake
Copy link
Copy Markdown
Member

could you merge the main branch?

Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
aabchoo and others added 5 commits January 17, 2025 16:07
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
Applies the same fix as in #120 to test_e2e

Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Aaron Choo <[email protected]>
}

// mountBackendSecurityPolicySecrets will mount secrets based on backendSecurityPolicies attached to AIServiceBackend.
func (c *ConfigSink) mountBackendSecurityPolicySecrets(spec *corev1.PodSpec, aiGatewayRoute *aigv1a1.AIGatewayRoute) (*corev1.PodSpec, error) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This part feels slightly messy. I am hoping to find a way to cleanly get all related backendSecurityPolicies without looping+our map, but this is what I've come up with for so far.

@aabchoo aabchoo marked this pull request as ready for review January 17, 2025 21:54
@aabchoo aabchoo requested a review from a team as a code owner January 17, 2025 21:54
@aabchoo
Copy link
Copy Markdown
Contributor Author

aabchoo commented Jan 17, 2025

cc @envoyproxy/assignable

@mathetake
Copy link
Copy Markdown
Member

aaron that is a different assignable team (for the entire envoyproxy/envoy repo)... @envoyproxy/ai-gateway-assignable is the correct one :)

client client.Client
kube kubernetes.Interface
logger logr.Logger
defaultExtProcImage string
Copy link
Copy Markdown
Contributor

@wengyao04 wengyao04 Jan 17, 2025

Choose a reason for hiding this comment

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

Could we also add defaultExtProcImagePullPolicy corev1.PullPolicy and value corev1.PullPolicy(IfNotPresent)

@mathetake mathetake closed this Jan 17, 2025
@mathetake mathetake deleted the aaron/apikey-auth branch January 17, 2025 22:06
mathetake added a commit that referenced this pull request Jan 29, 2025
**Commit Message**:

This adds a secret watcher controller that enables the 
hot reload of any secret referenced by backendTrafficPolicy.

**Related Issues/PRs (if applicable)**:

Follow up on #43  #106 #161 
Supersede #185

---------

Signed-off-by: Takeshi Yoneda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants