zuplo 7.1.6 → 7.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -159,10 +159,10 @@ connecting a Git repository to making your first LLM request through Zuplo.
|
|
|
159
159
|
:::note
|
|
160
160
|
|
|
161
161
|
The gateway checks the key only after you add the
|
|
162
|
-
[authentication policy](./policy-chains.mdx#authentication) to the
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
[authentication policy](./policy-chains.mdx#authentication) to the app's
|
|
163
|
+
chain. Until then the gateway identifies the app from the `{app_id}` segment
|
|
164
|
+
of the URL and accepts the request without a key. The examples below send the
|
|
165
|
+
key so they keep working once you add the policy.
|
|
166
166
|
|
|
167
167
|
:::
|
|
168
168
|
|
|
@@ -12,10 +12,9 @@ calling app from the key. A missing or invalid key returns `401`. A valid key
|
|
|
12
12
|
whose app doesn't match the `{app_id}` in the URL returns `403`.
|
|
13
13
|
|
|
14
14
|
The policy applies per app: in an app's chain, it requires a key for that app
|
|
15
|
-
alone. A new team's [policy template](../policy-templates.mdx)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
repository—one entry requires a key for every app on that route.
|
|
15
|
+
alone. A new top-level team's [policy template](../policy-templates.mdx)
|
|
16
|
+
includes it as a locked entry—and sub-teams inherit that template by default—so
|
|
17
|
+
apps created in the team require keys from the start.
|
|
19
18
|
|
|
20
19
|
## Options
|
|
21
20
|
|
|
@@ -33,11 +32,11 @@ expires.
|
|
|
33
32
|
|
|
34
33
|
:::caution{title="A gateway without this policy is open"}
|
|
35
34
|
|
|
36
|
-
When
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
When an app's chain doesn't include the policy, the gateway resolves the app
|
|
36
|
+
from the `{app_id}` segment of the URL and serves the request with no key at
|
|
37
|
+
all. Anyone who knows the URL can spend against the app's providers and budget.
|
|
38
|
+
Only run an open gateway when something else, such as network isolation,
|
|
39
|
+
controls who can reach it.
|
|
41
40
|
|
|
42
41
|
:::
|
|
43
42
|
|
|
@@ -21,8 +21,8 @@ and secrets are inherited.
|
|
|
21
21
|
| [Galileo tracing](./galileo-tracing.mdx) | Sends a trace of each request and response to Galileo |
|
|
22
22
|
| [Configuration Executor](../policy-chains.mdx#configuration-executor) | Loads the app's configuration and runs its chain—this is what makes app chains work |
|
|
23
23
|
|
|
24
|
-
The Configuration Executor
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
The Configuration Executor and its companion Configuration Loader sit on the
|
|
25
|
+
gateway's route rather than in an app's chain. API key authentication runs in an
|
|
26
|
+
app's chain and protects that app alone. Any
|
|
27
27
|
[custom policy](../custom-policies.mdx) you declare joins the menu alongside
|
|
28
28
|
these.
|
|
@@ -67,16 +67,14 @@ remove that entry.
|
|
|
67
67
|
policy that's no longer declared.
|
|
68
68
|
- An app with an empty chain runs no app-selected policies; requests go straight
|
|
69
69
|
to the AI Gateway handler.
|
|
70
|
-
- The chain
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
response hook from their inbound position, so one entry covers both
|
|
74
|
-
directions.
|
|
70
|
+
- The chain runs on the request path. Policies that need the response—Semantic
|
|
71
|
+
Cache and the Akamai AI Firewall—register a response hook from their position
|
|
72
|
+
in the chain, so one entry covers both directions.
|
|
75
73
|
- There's no allow-list of policy types. Any policy declared in `policies.json`
|
|
76
|
-
|
|
74
|
+
is a valid chain entry, including a
|
|
77
75
|
[custom code policy](./custom-policies.mdx). The only exclusions are the
|
|
78
|
-
[Configuration Executor](#configuration-executor)
|
|
79
|
-
|
|
76
|
+
[Configuration Executor](#configuration-executor) and its companion
|
|
77
|
+
Configuration Loader.
|
|
80
78
|
- Chain validation is all-or-nothing: if any entry is invalid—for example, it
|
|
81
79
|
references a policy that isn't declared in the gateway's `policies.json`—the
|
|
82
80
|
request fails with an error identifying the entry to fix, and no entries run.
|
|
@@ -130,24 +128,26 @@ stored inbound chain, instantiating only policies already declared in
|
|
|
130
128
|
`config/policies.json`. Every scaffolded gateway declares it and puts it on the
|
|
131
129
|
AI Gateway route—that route entry is what gives an app's chain somewhere to run.
|
|
132
130
|
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
The scaffolded route also carries a **Configuration Loader**
|
|
132
|
+
(`ai-gateway-configuration-loader-v2-inbound`) ahead of the executor. The
|
|
133
|
+
executor loads the app's configuration by default, so the loader changes nothing
|
|
134
|
+
on its own—it's there for when you want to manipulate the loaded configuration
|
|
135
|
+
programmatically before the chain runs: place your own route policy between the
|
|
136
|
+
loader and the executor.
|
|
135
137
|
|
|
136
|
-
|
|
137
|
-
loaded app configuration. The default is `10` seconds, `10` is also the
|
|
138
|
-
and a lower value throws a configuration error—as does any other option
|
|
139
|
-
|
|
140
|
-
loaded the configuration for the request.
|
|
138
|
+
Both take a single option, `cacheTtlSeconds`, which sets how long the gateway
|
|
139
|
+
caches a loaded app configuration. The default is `10` seconds, `10` is also the
|
|
140
|
+
minimum, and a lower value throws a configuration error—as does any other option
|
|
141
|
+
key.
|
|
141
142
|
|
|
142
143
|
## Authentication
|
|
143
144
|
|
|
144
145
|
The `ai-gateway-auth-v2-inbound` policy—**API Key Authentication** in the
|
|
145
146
|
portal—requires callers to present the app's API key, and it applies per app:
|
|
146
|
-
add it to an app's chain to require a key for that app alone. A new
|
|
147
|
-
[policy template](./policy-templates.mdx) includes it as a locked
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
route in the gateway's repository, before the Configuration Executor.
|
|
147
|
+
add it to an app's chain to require a key for that app alone. A new top-level
|
|
148
|
+
team's [policy template](./policy-templates.mdx) includes it as a locked
|
|
149
|
+
entry—and sub-teams inherit that template by default—so apps created in the team
|
|
150
|
+
require keys from the start.
|
|
151
151
|
|
|
152
152
|
Where the policy applies, clients send the app's API key as a bearer token and
|
|
153
153
|
the gateway resolves the calling app from the key; for a missing or invalid key
|
|
@@ -160,11 +160,11 @@ working until the cache expires. Each app's key appears on its app page—see
|
|
|
160
160
|
|
|
161
161
|
:::caution{title="A gateway without the authentication policy is open"}
|
|
162
162
|
|
|
163
|
-
When
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
When an app's chain doesn't include the policy, the gateway resolves the app
|
|
164
|
+
from the `{app_id}` segment of the request URL and serves the request with no
|
|
165
|
+
key of any kind. Anyone who knows the URL can spend against the app's providers
|
|
166
|
+
and budget. Only run an open gateway when something else, such as network
|
|
167
|
+
isolation, controls who can reach it.
|
|
168
168
|
|
|
169
169
|
:::
|
|
170
170
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zuplo",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The programmable API Gateway",
|
|
6
6
|
"author": "Zuplo, Inc.",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"zuplo": "zuplo.js"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@zuplo/cli": "7.1.
|
|
23
|
-
"@zuplo/core": "7.1.
|
|
24
|
-
"@zuplo/runtime": "7.1.
|
|
25
|
-
"@zuplo/test": "7.1.
|
|
22
|
+
"@zuplo/cli": "7.1.8",
|
|
23
|
+
"@zuplo/core": "7.1.8",
|
|
24
|
+
"@zuplo/runtime": "7.1.8",
|
|
25
|
+
"@zuplo/test": "7.1.8"
|
|
26
26
|
}
|
|
27
27
|
}
|