zuplo 6.74.14 → 6.74.15
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.
- package/docs/articles/api-key-administration.mdx +2 -2
- package/docs/articles/api-key-authentication.mdx +6 -3
- package/docs/articles/api-key-buckets.mdx +19 -5
- package/docs/articles/api-key-consumer-bucket-portal-ui.mdx +20 -15
- package/docs/articles/api-key-self-serve-integration.mdx +2 -2
- package/docs/articles/monetization/api-access.mdx +1 -1
- package/docs/articles/monetization/going-to-production.mdx +1 -1
- package/docs/cli/test.mdx +20 -0
- package/docs/policies/_index.md +3 -1
- package/docs/policies/ai-gateway-metering-v2-inbound/doc.md +20 -0
- package/docs/policies/ai-gateway-metering-v2-inbound/schema.json +1 -1
- package/docs/policies/cdn-cache-control-outbound/doc.md +405 -0
- package/docs/policies/cdn-cache-control-outbound/intro.md +26 -0
- package/docs/policies/cdn-cache-control-outbound/schema.json +275 -0
- package/docs/policies/ip-address-restriction-inbound/doc.md +234 -0
- package/docs/policies/ip-address-restriction-inbound/intro.md +17 -0
- package/docs/policies/ip-address-restriction-inbound/schema.json +97 -0
- package/package.json +5 -5
|
@@ -13,8 +13,8 @@ environments.
|
|
|
13
13
|

|
|
14
14
|
|
|
15
15
|
To view the bucket for a different environment, use the **Dev / Preview / Prod**
|
|
16
|
-
switcher at the top of the sidebar.
|
|
17
|
-
|
|
16
|
+
switcher at the top of the sidebar. Click **Bucket Details** under the **API Key
|
|
17
|
+
Service** heading to copy the active bucket's name or ID.
|
|
18
18
|
|
|
19
19
|
To add a new API Key Consumer, click **Create Consumer** and complete the form.
|
|
20
20
|
|
|
@@ -139,12 +139,15 @@ When running API Key Authentication locally, if you
|
|
|
139
139
|
shared by both your development (working copy) environment and local
|
|
140
140
|
development.
|
|
141
141
|
|
|
142
|
-
### Setting the API Key bucket
|
|
142
|
+
### Setting the API Key bucket
|
|
143
143
|
|
|
144
144
|
Either locally or in CI/CD you can specify any API Key bucket on the
|
|
145
145
|
[API Key Authentication](../policies/api-key-inbound.mdx) policy by setting the
|
|
146
|
-
`
|
|
147
|
-
|
|
146
|
+
`bucketId` property. Every environment can then share a single bucket that holds
|
|
147
|
+
the consumers your tests need. Find a bucket's ID under **Bucket Details** on
|
|
148
|
+
the
|
|
149
|
+
[**Services → API Keys → Consumers**](https://portal.zuplo.com/+/account/project/services)
|
|
150
|
+
page in the Zuplo Portal. You can use the
|
|
148
151
|
[Zuplo Developer API](https://dev.zuplo.com) to
|
|
149
152
|
[create and manage buckets](./api-key-management.mdx), consumers, keys, and
|
|
150
153
|
more.
|
|
@@ -23,21 +23,33 @@ For more information on how environments relate to Git branches, see
|
|
|
23
23
|
|
|
24
24
|
## Custom bucket configuration
|
|
25
25
|
|
|
26
|
-
To use a custom bucket, specify
|
|
26
|
+
To use a custom bucket, specify its `bucketId` in your API Key policy options:
|
|
27
27
|
|
|
28
28
|
```json
|
|
29
29
|
{
|
|
30
30
|
"export": "ApiKeyInboundPolicy",
|
|
31
31
|
"module": "$import(@zuplo/runtime)",
|
|
32
32
|
"options": {
|
|
33
|
-
"
|
|
33
|
+
"bucketId": "bckt_2HaK3odRyJle6NJSu8mzNKBC30BYxllxL",
|
|
34
34
|
"allowUnauthenticatedRequests": false
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
Bucket IDs start with `bckt_`. To find one, open
|
|
40
|
+
[**Services → API Keys → Consumers**](https://portal.zuplo.com/+/account/project/services)
|
|
41
|
+
in the Zuplo Portal, select the environment with the **Dev / Preview / Prod**
|
|
42
|
+
switcher, then click **Bucket Details**.
|
|
43
|
+
|
|
44
|
+
When the configuration sets no bucket, the policy uses the default bucket for
|
|
45
|
+
the current environment.
|
|
46
|
+
|
|
47
|
+
:::note
|
|
48
|
+
|
|
49
|
+
The policy's `bucketName` option is deprecated. Policies that set it keep
|
|
50
|
+
working, but the runtime logs a warning — use `bucketId` instead.
|
|
51
|
+
|
|
52
|
+
:::
|
|
41
53
|
|
|
42
54
|
## Creating custom buckets
|
|
43
55
|
|
|
@@ -46,7 +58,9 @@ Create custom buckets using the
|
|
|
46
58
|
[create buckets endpoint](https://dev.zuplo.com/docs/routes#apikeybucketsservice_create)
|
|
47
59
|
for details.
|
|
48
60
|
|
|
49
|
-
The following example creates a bucket for a QA environment
|
|
61
|
+
The following example creates a bucket for a QA environment. The response
|
|
62
|
+
includes the new bucket's `id`, which is the value to set as `bucketId` on the
|
|
63
|
+
policy:
|
|
50
64
|
|
|
51
65
|
```bash
|
|
52
66
|
curl --request POST \
|
|
@@ -63,19 +63,22 @@ For deeper detail, see [Buckets and Environments](./api-key-buckets.mdx).
|
|
|
63
63
|
opens on **API Keys → Consumers** in the section sidebar.
|
|
64
64
|
|
|
65
65
|
1. Use the **Dev / Preview / Prod** switcher at the top of the sidebar to select
|
|
66
|
-
the environment whose bucket you want.
|
|
67
|
-
|
|
66
|
+
the environment whose bucket you want.
|
|
67
|
+
|
|
68
|
+
1. Click **Bucket Details** under the **API Key Service** heading to see the
|
|
69
|
+
active bucket's name and ID, each with a copy button.
|
|
68
70
|
|
|
69
71
|
</Stepper>
|
|
70
72
|
|
|
71
73
|
<ModalScreenshot size="md">
|
|
72
74
|
|
|
73
|
-

|
|
74
76
|
|
|
75
77
|
</ModalScreenshot>
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
**Bucket Details** shows the name and ID of the bucket that's currently active
|
|
80
|
+
for the selected environment. Bucket IDs start with `bckt_` — this is the value
|
|
81
|
+
the API Key Authentication policy's `bucketId` option takes.
|
|
79
82
|
|
|
80
83
|
## Create a consumer in a specific bucket
|
|
81
84
|
|
|
@@ -114,8 +117,8 @@ an environment whose API Key Authentication policy resolves to that same bucket.
|
|
|
114
117
|
## How bucket selection affects key validation
|
|
115
118
|
|
|
116
119
|
The [API Key Authentication policy](../policies/api-key-inbound.mdx) decides
|
|
117
|
-
which bucket to validate keys against. With no
|
|
118
|
-
|
|
120
|
+
which bucket to validate keys against. With no bucket set, the policy defaults
|
|
121
|
+
to the bucket that matches the current environment:
|
|
119
122
|
|
|
120
123
|
| Environment | Default bucket |
|
|
121
124
|
| ----------- | -------------- |
|
|
@@ -123,20 +126,22 @@ defaults to the bucket that matches the current environment:
|
|
|
123
126
|
| Preview | Preview |
|
|
124
127
|
| Development | Development |
|
|
125
128
|
|
|
126
|
-
For a custom bucket, set `
|
|
127
|
-
the right one:
|
|
129
|
+
For a custom bucket, set `bucketId` on the policy so it checks the right one:
|
|
128
130
|
|
|
129
131
|
```json
|
|
130
132
|
{
|
|
131
133
|
"export": "ApiKeyInboundPolicy",
|
|
132
134
|
"module": "$import(@zuplo/runtime)",
|
|
133
135
|
"options": {
|
|
134
|
-
"
|
|
136
|
+
"bucketId": "bckt_2HaK3odRyJle6NJSu8mzNKBC30BYxllxL",
|
|
135
137
|
"allowUnauthenticatedRequests": false
|
|
136
138
|
}
|
|
137
139
|
}
|
|
138
140
|
```
|
|
139
141
|
|
|
142
|
+
The policy's `bucketName` option is deprecated. Policies that set it keep
|
|
143
|
+
working, but the runtime logs a warning — use `bucketId` instead.
|
|
144
|
+
|
|
140
145
|
:::caution
|
|
141
146
|
|
|
142
147
|
If the consumer lives in one bucket but the policy checks a different bucket,
|
|
@@ -178,11 +183,11 @@ a different one.
|
|
|
178
183
|
|
|
179
184
|
1. In the portal, open **Services → API Keys → Consumers** and confirm which
|
|
180
185
|
bucket holds the consumer.
|
|
181
|
-
2. Open the route's API Key Authentication policy. If `
|
|
182
|
-
is set, verify it matches the consumer's bucket. If
|
|
183
|
-
policy uses the current environment's default bucket.
|
|
186
|
+
2. Open the route's API Key Authentication policy. If `bucketId` (or the
|
|
187
|
+
deprecated `bucketName`) is set, verify it matches the consumer's bucket. If
|
|
188
|
+
neither is set, the policy uses the current environment's default bucket.
|
|
184
189
|
3. Either recreate the consumer in the correct bucket, or update the policy's
|
|
185
|
-
`
|
|
190
|
+
`bucketId` to match.
|
|
186
191
|
|
|
187
192
|
</details>
|
|
188
193
|
|
|
@@ -218,7 +223,7 @@ to the matching environment to locate it.
|
|
|
218
223
|
- [Manage Keys in the Portal](./api-key-administration.mdx): General portal
|
|
219
224
|
management walkthrough
|
|
220
225
|
- [API Key Authentication policy](../policies/api-key-inbound.mdx): Policy
|
|
221
|
-
configuration reference including `
|
|
226
|
+
configuration reference including `bucketId`
|
|
222
227
|
- [Use the Developer API](./api-key-api.mdx): Programmatic consumer management
|
|
223
228
|
- [Create an API Key Consumer on Login](../dev-portal/dev-portal-create-consumer-on-auth.mdx):
|
|
224
229
|
Automatically create consumers when users sign in
|
|
@@ -55,8 +55,8 @@ Before you start, you need:
|
|
|
55
55
|
environment - each project has buckets for production, preview, and
|
|
56
56
|
development. Find the bucket name on your project's
|
|
57
57
|
[**Services → API Keys → Consumers**](https://portal.zuplo.com/+/account/project/services)
|
|
58
|
-
page (
|
|
59
|
-
account name in
|
|
58
|
+
page (under **Bucket Details**, next to the **API Key Service** heading), and
|
|
59
|
+
the account name in
|
|
60
60
|
[**Project Settings → General**](https://portal.zuplo.com/+/account/project/settings/general).
|
|
61
61
|
- An application with server-side code and existing user authentication.
|
|
62
62
|
|
|
@@ -37,7 +37,7 @@ are set in your terminal:
|
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
# Your Bucket ID (could be working-copy, preview, or production)
|
|
40
|
-
# (Copy
|
|
40
|
+
# (Copy it from Bucket Details on Services > API Keys > Consumers — https://portal.zuplo.com/+/account/project/services)
|
|
41
41
|
export BUCKET_ID=your-bucket-id
|
|
42
42
|
# Your Zuplo API Key (Found in Account Settings > Zuplo API Keys —
|
|
43
43
|
# https://portal.zuplo.com/+/account/settings/api-keys)
|
|
@@ -459,7 +459,7 @@ To help the team resolve your issue quickly, include:
|
|
|
459
459
|
| ------------------ | ------------------------------------------------------ |
|
|
460
460
|
| Account slug | Your Zuplo account identifier |
|
|
461
461
|
| Project slug | The project with monetization enabled |
|
|
462
|
-
| Bucket ID |
|
|
462
|
+
| Bucket ID | Bucket Details on Services → API Keys → Consumers |
|
|
463
463
|
| Stripe account ID | Stripe Dashboard → Settings, starts with `acct_` |
|
|
464
464
|
| Plan keys | The plan keys involved in the issue |
|
|
465
465
|
| Subscription ID | If the issue is subscription-specific |
|
package/docs/cli/test.mdx
CHANGED
|
@@ -23,6 +23,14 @@ sidebar_label: test
|
|
|
23
23
|
"deprecated": false,
|
|
24
24
|
"hidden": false
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
"name": "skip-filter",
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Skip tests whose name matches this pattern (e.g., --skip-filter '\\[deep\\]'). Applied after --filter.",
|
|
30
|
+
"required": false,
|
|
31
|
+
"deprecated": false,
|
|
32
|
+
"hidden": false
|
|
33
|
+
},
|
|
26
34
|
{
|
|
27
35
|
"name": "dir",
|
|
28
36
|
"type": "string",
|
|
@@ -33,6 +41,14 @@ sidebar_label: test
|
|
|
33
41
|
"hidden": true,
|
|
34
42
|
"normalize": true
|
|
35
43
|
},
|
|
44
|
+
{
|
|
45
|
+
"name": "only",
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "Run only the tests and suites marked with .only. Without this flag Node ignores .only and runs everything.",
|
|
48
|
+
"required": false,
|
|
49
|
+
"deprecated": false,
|
|
50
|
+
"hidden": false
|
|
51
|
+
},
|
|
36
52
|
{
|
|
37
53
|
"name": "test-concurrency",
|
|
38
54
|
"type": "number",
|
|
@@ -54,6 +70,10 @@ sidebar_label: test
|
|
|
54
70
|
"$0 test --endpoint https://your-api-123abc.zuplo.app --filter '/api\\/v1/'",
|
|
55
71
|
"Run tests matching a regex pattern"
|
|
56
72
|
],
|
|
73
|
+
[
|
|
74
|
+
"$0 test --endpoint https://your-api-123abc.zuplo.app --skip-filter '\\[slow\\]'",
|
|
75
|
+
"Run everything except tests tagged [slow] in their name"
|
|
76
|
+
],
|
|
57
77
|
[
|
|
58
78
|
"MY_VAR=example $0 test --endpoint https://your-api-123abc.zuplo.app",
|
|
59
79
|
"Run tests with environment variables"
|
package/docs/policies/_index.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| set-query-params-inbound | Add or Set Query Parameters | Adds or sets query parameters on the incoming request. | api-gateway |
|
|
6
6
|
| set-headers-inbound | Add or Set Request Headers | Adds or sets headers on the incoming request. | api-gateway |
|
|
7
7
|
| ai-gateway-fallback-model-v2-inbound | AI Gateway Fallback Model (v2) | Adds failure and quota fallbacks to an existing AI Gateway model selection. Place this policy after AI Gateway Model Filtering (v2). It never creates a model selection, so a misplaced policy cannot bypass filtering. | ai-gateway |
|
|
8
|
-
| ai-gateway-metering-v2-inbound | AI Gateway Metering (v2) | Meters AI Gateway v2 usage and enforces
|
|
8
|
+
| ai-gateway-metering-v2-inbound | AI Gateway Metering (v2) | Meters AI Gateway v2 usage and enforces app and ancestor usage limits. Limits configured on parent teams or the bucket root are enforced through a server-side hierarchical check. The authentication policy must run before this policy so the app configuration id is available for meter storage and analytics. | ai-gateway |
|
|
9
9
|
| ai-gateway-model-filtering-v2-inbound | AI Gateway Model Filtering (v2) | Matches AI Gateway requests against curated allow lists or open block lists, then stores the winning model reference for the route handler. | ai-gateway |
|
|
10
10
|
| akamai-ai-firewall | Akamai AI Firewall | Akamai AI Firewall Inbound Policy | ai-gateway |
|
|
11
11
|
| akamai-firewall-for-ai-outbound | Akamai Firewall for AI | Inspects each upstream response with Akamai's Firewall for AI detect API and replaces the response with a `403 Forbidden` if Akamai returns a `deny` rule. Useful behind AI-powered APIs to filter unsafe completions, sensitive data exposure, and toxic content before they reach the client. The body, headers, URL, and query string sent to Akamai are configurable; by default only the response body is captured. Bodies are read from a clone so the client still receives the original. | api-gateway |
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
| bot-detection-inbound | Bot Detection | Detect known and suspected bots based on sophisticated traffic analysis. | api-gateway |
|
|
22
22
|
| brownout-inbound | Brown Out | The brownout policy allows performing scheduled downtime on your API | api-gateway |
|
|
23
23
|
| caching-inbound | Caching | Respond to matched incoming requests with cached content | api-gateway |
|
|
24
|
+
| cdn-cache-control-outbound | CDN Cache Control | Sets the response headers that tell a CDN how long it may cache a response and which purge tags it belongs to, separately from what the browser is told. | api-gateway |
|
|
24
25
|
| change-method-inbound | Change Method | Changes the HTTP method of the incoming request. | api-gateway |
|
|
25
26
|
| clear-headers-inbound | Clear Request Headers | Removes all headers from the incoming request except for those in the exclude list. | api-gateway |
|
|
26
27
|
| clear-headers-outbound | Clear Response Headers | Removes all headers from the response except for those in the exclude list. | api-gateway |
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
| graphql-disable-introspection-inbound | GraphQL Disable Introspection | Policy that disables GraphQL introspection queries in production. Introspection allows clients to discover the schema, which can be a security risk as it exposes your entire API structure. | api-gateway |
|
|
45
46
|
| graphql-introspection-filter-outbound | GraphQL Introspection Filter | Filters GraphQL introspection responses to exclude specific types and fields. This policy intercepts GraphQL introspection query responses and removes configured types and fields from the schema. Useful for hiding internal types or sensitive fields from the public schema. | api-gateway |
|
|
46
47
|
| http-deprecation-outbound | HTTP Deprecation | Sets HTTP deprecation headers on the outgoing response following the IETF HTTP Deprecation Header standard. Supports the Deprecation, Sunset, and Link headers. | api-gateway |
|
|
48
|
+
| ip-address-restriction-inbound | IP Address Restriction | Restricts which client IP addresses can call a route using an allow list, a deny list, or both. Entries are individual IP addresses or CIDR ranges, in IPv4 or IPv6. | api-gateway |
|
|
47
49
|
| validate-json-schema-inbound | JSON Body Validation (deprecated) | Validates the body of an incoming request based on a JSON schema. | api-gateway |
|
|
48
50
|
| open-id-jwt-auth-inbound | JWT Auth | The Open ID JWT Authentication policy allows you to authenticate incoming requests using an Open ID compliant bearer token. | api-gateway |
|
|
49
51
|
| jwt-scopes-inbound | JWT Scope Validation | Validates that the JWT token includes specific scopes | api-gateway |
|
|
@@ -40,6 +40,26 @@ The supported meters are `costs`, `tokens`, and `requests`. Each meter can have
|
|
|
40
40
|
When `throwOnFailure` is `false`, metering failures pass the request through.
|
|
41
41
|
Set it to `true` to fail the request instead.
|
|
42
42
|
|
|
43
|
+
## Team limits
|
|
44
|
+
|
|
45
|
+
Limits configured on a parent team or the bucket root are enforced automatically
|
|
46
|
+
through a server-side hierarchical check against aggregated usage. The
|
|
47
|
+
`options.limits` settings govern only the app running this policy; the server
|
|
48
|
+
walks the ancestor chain and reports the first exceeded limit.
|
|
49
|
+
|
|
50
|
+
An exceeded team or root limit follows the same configured model-fallback or 429
|
|
51
|
+
response path as an app limit. Ancestor enforcement cannot be disabled from the
|
|
52
|
+
app's policy-chain entry. When the hierarchical check is unavailable,
|
|
53
|
+
`throwOnFailure` controls the behavior: the default skips enforcement for that
|
|
54
|
+
request while continuing to meter it, and `true` fails the request.
|
|
55
|
+
|
|
56
|
+
### Known residual
|
|
57
|
+
|
|
58
|
+
Grandfathered v2 apps that already store `metadata.limits` are still evaluated
|
|
59
|
+
at the leaf by the server's hierarchy walk. The companion Gateway Service change
|
|
60
|
+
rejects introducing or modifying app metadata limits; cleaning up stale rows is
|
|
61
|
+
tracked separately.
|
|
62
|
+
|
|
43
63
|
## Set limits from custom code
|
|
44
64
|
|
|
45
65
|
Use a custom inbound policy to vary limits for individual requests. For example,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"isHidden": false,
|
|
12
12
|
"requiresAI": true,
|
|
13
13
|
"products": ["ai-gateway"],
|
|
14
|
-
"description": "Meters AI Gateway v2 usage and enforces
|
|
14
|
+
"description": "Meters AI Gateway v2 usage and enforces app and ancestor usage limits.\n\nLimits configured on parent teams or the bucket root are enforced through a server-side hierarchical check.\n\nThe authentication policy must run before this policy so the app configuration id is available for meter storage and analytics.",
|
|
15
15
|
"deprecatedMessage": "",
|
|
16
16
|
"required": ["handler"],
|
|
17
17
|
"properties": {
|