feat: provision CLI data-plane service key#23
Closed
tkkhq wants to merge 1 commit into
Closed
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a data-plane service-key provisioning path and integrates it into cloud commands so function invoke and storage object routes can authenticate with a reserved per-project key (volcano-cli-data-plane) when the platform token cannot access runtime/data-plane routes directly.
Changes:
- Introduces a new
internal/dataplaneservice that finds/creates the reserved project service key and returns its plaintext token. - Adds a configurable token-provider hook for function invoke workflows and wires cloud
functions invoketo use the data-plane service key. - Adds API helpers and tests covering service-key reuse/create/conflict-reload and verifying cloud command auth headers.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/function/function.go | Adds invoke token provider plumbing and routes invoke auth through a configurable token source. |
| internal/dataplane/service_key.go | Implements service-key lookup/create logic for the reserved data-plane key. |
| internal/dataplane/service_key_test.go | Tests service-key reuse, create-on-missing, and conflict reload behavior. |
| internal/cmd/functions/invoke.go | Allows passing function service options into functions invoke. |
| internal/cmd/functions/functions.go | Adds command-level options to wire invoke token providers down to the function service. |
| internal/cmd/cloud/cloud.go | Wires cloud storage object commands and cloud function invoke to use the data-plane service key. |
| internal/cmd/cloud/cloud_test.go | Verifies cloud storage object and function invoke commands send Authorization headers with the CLI service key. |
| internal/api/service_keys.go | Adds service-key API client helpers (list/create/get). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+283
to
+286
| if s.invokeTokenProvider != nil { | ||
| return s.invokeTokenProvider(ctx, project) | ||
| } | ||
| return project.Config.FunctionInvokeToken(), nil |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
volcano-cli-data-planekeyTests
go test ./...Note