Merge pull request #1353 from briankane/feature/provider-headers

Feat: Update External Providers documentation to include custom headers
This commit is contained in:
Anoop Gopalakrishnan 2025-04-03 08:54:45 -07:00 committed by GitHub
commit 5ec62ecdd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -40,6 +40,7 @@ Specifies where CueX should send function calls.
- `spec.provider.protocol`: Defines the communication method (currently only `"http"`).
- `spec.provider.endpoint`: The root endpoint of the function provider (e.g. http://my-cuex-server:8443/api/v1)
> e.g. If `#do: "api/example-fn-name"` is defined in a function, CueX will send `POST {provider_endpoint}/api/example-fn-name`.
- `spec.provider.header`: Optional headers to send with the request in string map format.
#### spec.templates
- Defines CUE function templates that describe available functions.
@ -60,6 +61,8 @@ spec:
provider:
protocol: http # Currently, only `http` is supported
endpoint: http://my-cuex-server:8443 # Root endpoint of the provider service
header:
User-Agent: CueX # Custom headers to send to the Provider service
templates:
utils.cue: | # The filename inside the package
package example // Recommended to match the final segment of the {spec.path} value
@ -231,7 +234,7 @@ spec:
With the Package registered, the `utils.#Sum` function is now available for use with WorkflowStepDefinition templates by importing the `ext/utils` provider.
```cue
ˇimport (
import (
"ext/utils" // The external provider
"vela/op"
)