You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: assets/agw-docs/pages/agentgateway/llm/virtual-keys.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,8 @@ Store your virtual keys in a Kubernetes ConfigMap, with one entry per user. Beca
58
58
59
59
> [!IMPORTANT]
60
60
> ConfigMaps with hashed keys (as opposed to Secrets) are the recommended way to store virtual keys. If you need to use Kubernetes Secrets, refer to the [API key authentication guide]({{< link-hextra path="/security/apikey/" >}}) for an example.
61
+
>
62
+
> Already storing virtual keys in a Secret? Instead of recreating them by hand, use the [`agctl migrate`]({{< link-hextra path="/reference/agctl/agctl-migrate/" >}}) command to convert your existing Secrets into the recommended ConfigMap format.
61
63
62
64
1. Generate a `sha256:<hex>` hash for each user's API key. The hash is computed over the exact key bytes, so do not include a trailing newline.
63
65
@@ -95,6 +97,9 @@ Store your virtual keys in a Kubernetes ConfigMap, with one entry per user. Beca
95
97
EOF
96
98
```
97
99
100
+
> [!TIP]
101
+
> If you already store virtual keys in a Kubernetes Secret, you do not have to build this ConfigMap by hand. Use the [`agctl migrate`]({{< link-hextra path="/reference/agctl/agctl-migrate/" >}}) command to generate an equivalent ConfigMap (with hashed keys) from your existing Secrets, for example `agctl migrate --apply virtualkeys-to-configmap -n {{< reuse "agw-docs/snippets/namespace.md" >}} | kubectl apply -f -`.
|`gcp`_[GcpAuth](#gcpauth)_| Google authentication method for the backend.<br />When omitted, default Google credential discovery is used. || Optional: \{\} <br /> |
|`location`_[AuthorizationLocation](#authorizationlocation)_| Where backend credentials are inserted. Defaults to the `Authorization`<br />header with the `Bearer ` prefix. Applies to `key`, `secretRef`, and<br />`passthrough`. || ExactlyOneOf: [header queryParameter cookie] <br />Optional: \{\} <br /> |
1017
+
|`location`_[AuthorizationLocation](#authorizationlocation)_| Where backend credentials are inserted.<br />If omitted, credentials are written to the `Authorization` header with the `Bearer ` prefix.<br />This applies to `key`, `secretRef`, and `passthrough`. Entries in `credentials` carry their own location. || ExactlyOneOf: [header queryParameter cookie] <br />Optional: \{\} <br /> |
1018
+
|`credentials`_[BackendAuthCredential](#backendauthcredential) array_| Credentials is a list of additional credentials to inject on the<br />backend request. Each entry resolves a Secret key and writes its value<br />to the entry's location. `credentials` is independent of the primary<br />`key`/`secretRef`/`passthrough` mechanism and may be set on its own or<br />alongside it. || MaxItems: 8 <br />MinItems: 1 <br />Optional: \{\} <br /> |
1019
+
1020
+
1021
+
#### BackendAuthCredential
1022
+
1023
+
1024
+
1025
+
BackendAuthCredential specifies one additional credential to inject on the
1026
+
backend request.
1027
+
1028
+
1029
+
1030
+
_Appears in:_
1031
+
-[BackendAuth](#backendauth)
1032
+
1033
+
| Field | Description | Default | Validation |
1034
+
| --- | --- | --- | --- |
1035
+
|`location`_[AuthorizationLocation](#authorizationlocation)_| Where the credential is inserted on the backend request. || ExactlyOneOf: [header queryParameter cookie] <br />Required: \{\} <br /> |
1036
+
|`secretRef`_[LocalSecretKeyRef](#localsecretkeyref)_| SecretRef references a Kubernetes Secret holding the credential value, and<br />optionally overrides the key read from it. Defaults to `Authorization`,<br />matching the key convention used by the top-level `secretRef`. || Required: \{\} <br /> |
1017
1037
1018
1038
1019
1039
#### BackendAuthPassthrough
@@ -1087,7 +1107,7 @@ _Appears in:_
1087
1107
|`tls`_[BackendTLS](#backendtls)_| Settings for managing TLS connections to the backend<br />When set, TLS is originated to the backend using the system trusted CA<br />certificates, and SNI is inferred from the destination. || AtMostOneOf: [verifySubjectAltNames insecureSkipVerify] <br />Optional: \{\} <br /> |
1088
1108
|`http`_[BackendHTTP](#backendhttp)_| Settings for managing HTTP requests to the backend || Optional: \{\} <br /> |
1089
1109
|`tunnel`_[BackendTunnel](#backendtunnel)_| Settings for managing tunnel connections to the backend, like `HTTPS_PROXY`|| Optional: \{\} <br /> |
1090
-
|`auth`_[BackendAuth](#backendauth)_| Settings for managing authentication to the backend ||ExactlyOneOf: [key secretRef passthrough aws azure gcp oauthTokenExchange crossAppAccess] <br />Optional: \{\} <br /> |
1110
+
|`auth`_[BackendAuth](#backendauth)_| Settings for managing authentication to the backend ||AtMostOneOf: [key secretRef passthrough aws azure gcp oauthTokenExchange crossAppAccess] <br />Optional: \{\} <br /> |
1091
1111
|`ai`_[BackendAI](#backendai)_| Settings for AI workloads. This is only applicable when<br />connecting to a `Backend` of type `ai`. || Optional: \{\} <br /> |
1092
1112
|`mcp`_[BackendMCP](#backendmcp)_| Settings for MCP workloads. This is only applicable when<br />connecting to a `Backend` of type `mcp`. || Optional: \{\} <br /> |
1093
1113
|`transformation`_[Transformation](#transformation)_| Mutates and transforms requests and responses sent to and from the backend. || Optional: \{\} <br /> |
@@ -1155,7 +1175,7 @@ _Appears in:_
1155
1175
|`tls`_[BackendTLS](#backendtls)_| Settings for managing TLS connections to the backend<br />When set, TLS is originated to the backend using the system trusted CA<br />certificates, and SNI is inferred from the destination. || AtMostOneOf: [verifySubjectAltNames insecureSkipVerify] <br />Optional: \{\} <br /> |
1156
1176
|`http`_[BackendHTTP](#backendhttp)_| Settings for managing HTTP requests to the backend || Optional: \{\} <br /> |
1157
1177
|`tunnel`_[BackendTunnel](#backendtunnel)_| Settings for managing tunnel connections to the backend, like `HTTPS_PROXY`|| Optional: \{\} <br /> |
1158
-
|`auth`_[BackendAuth](#backendauth)_| Settings for managing authentication to the backend ||ExactlyOneOf: [key secretRef passthrough aws azure gcp oauthTokenExchange crossAppAccess] <br />Optional: \{\} <br /> |
1178
+
|`auth`_[BackendAuth](#backendauth)_| Settings for managing authentication to the backend ||AtMostOneOf: [key secretRef passthrough aws azure gcp oauthTokenExchange crossAppAccess] <br />Optional: \{\} <br /> |
1159
1179
1160
1180
1161
1181
#### BackendTCP
@@ -1249,7 +1269,7 @@ _Appears in:_
1249
1269
|`tls`_[BackendTLS](#backendtls)_| Settings for managing TLS connections to the backend<br />When set, TLS is originated to the backend using the system trusted CA<br />certificates, and SNI is inferred from the destination. || AtMostOneOf: [verifySubjectAltNames insecureSkipVerify] <br />Optional: \{\} <br /> |
1250
1270
|`http`_[BackendHTTP](#backendhttp)_| Settings for managing HTTP requests to the backend || Optional: \{\} <br /> |
1251
1271
|`tunnel`_[BackendTunnel](#backendtunnel)_| Settings for managing tunnel connections to the backend, like `HTTPS_PROXY`|| Optional: \{\} <br /> |
1252
-
|`auth`_[BackendAuth](#backendauth)_| Settings for managing authentication to the backend ||ExactlyOneOf: [key secretRef passthrough aws azure gcp oauthTokenExchange crossAppAccess] <br />Optional: \{\} <br /> |
1272
+
|`auth`_[BackendAuth](#backendauth)_| Settings for managing authentication to the backend ||AtMostOneOf: [key secretRef passthrough aws azure gcp oauthTokenExchange crossAppAccess] <br />Optional: \{\} <br /> |
1253
1273
|`ai`_[BackendAI](#backendai)_| Settings for AI workloads. This is only applicable when<br />connecting to a `Backend` of type `ai`. || Optional: \{\} <br /> |
1254
1274
|`transformation`_[Transformation](#transformation)_| Mutates and transforms requests and responses sent to and from the backend. || Optional: \{\} <br /> |
1255
1275
|`health`_[Health](#health)_| Settings for passive and active health checking. || Optional: \{\} <br /> |
@@ -2891,6 +2911,7 @@ location-specific default key is used.
0 commit comments