zuplo 7.15.9 → 7.15.12

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.
@@ -64,7 +64,7 @@ a path is skipped. Trailing commas are allowed.
64
64
  "excludePaths": ["/v1/internal/**"],
65
65
  },
66
66
 
67
- // A custom rule: require an API key policy on /v1 routes
67
+ // A custom rule: require the "api-key-auth" policy on /v1 routes
68
68
  "require-api-key-v1": {
69
69
  "message": "v1 routes need an API key",
70
70
  "severity": "error",
@@ -72,7 +72,10 @@ a path is skipped. Trailing commas are allowed.
72
72
  "given": "$",
73
73
  "then": {
74
74
  "function": "zuplo:requirePolicy",
75
- "functionOptions": { "policyTypes": ["api-key"] },
75
+ "functionOptions": {
76
+ "policyName": "api-key-auth",
77
+ "direction": "inbound",
78
+ },
76
79
  },
77
80
  },
78
81
  },
@@ -341,9 +344,10 @@ elsewhere.
341
344
 
342
345
  ### `requiredPolicies`
343
346
 
344
- Policies that every route must include. The `zuplo:strict` and `zuplo:security`
345
- presets each define a default set; `requiredPolicies` replaces those defaults
346
- with your own list.
347
+ Policies that every route must include, by the name they have in
348
+ `config/policies.json`. The `zuplo:strict` and `zuplo:security` presets each
349
+ define a default set; `requiredPolicies` replaces those defaults with your own
350
+ list.
347
351
 
348
352
  ```jsonc
349
353
  {
@@ -352,14 +356,14 @@ with your own list.
352
356
  "requiredPolicies": [
353
357
  {
354
358
  "id": "require-auth",
355
- "policyTypes": ["api-key", "open-id-jwt-auth"],
359
+ "policyName": "api-key-auth",
356
360
  "direction": "inbound",
357
361
  "severity": "error",
358
362
  "message": "Routes must have an authentication policy",
359
363
  },
360
364
  {
361
365
  "id": "require-rate-limit",
362
- "policyTypes": ["rate-limit"],
366
+ "policyName": "rate-limit",
363
367
  "severity": "warn",
364
368
  "message": "Routes should have a rate limiting policy",
365
369
  },
@@ -374,21 +378,18 @@ policy on only some routes, use [`overrides`](#overrides) or a
374
378
 
375
379
  Each entry has these fields:
376
380
 
377
- | Field | Description |
378
- | ------------- | --------------------------------------------------------------------------------------------------------- |
379
- | `id` | A name for the requirement. Use it to keep track of entries; results report under `zuplo/require-policy`. |
380
- | `policyTypes` | Policy types that satisfy the requirement. A route needs at least one policy whose type matches. |
381
- | `direction` | `"inbound"` or `"outbound"`. Defaults to `"inbound"`. |
382
- | `severity` | `"error"` or `"warn"`. Defaults to `"error"`. |
383
- | `message` | The message to report. The linter appends the method and path of the route, for example `: get /todos`. |
384
-
385
- The linter matches each policy name in the route's `x-zuplo-route.policies` list
386
- to its `policyType` in `config/policies.json`. An entry in `policyTypes` matches
387
- that exact type and any type that starts with it followed by a dash, so
388
- `"api-key"` matches `api-key-inbound`, and `"rate-limit"` matches
389
- `rate-limit-inbound`. Matching starts at the beginning of the type, so
390
- `"rate-limit"` doesn't match `complex-rate-limit-inbound`; list
391
- `"complex-rate-limit"` separately if you use it.
381
+ | Field | Description |
382
+ | ------------ | --------------------------------------------------------------------------------------------------------- |
383
+ | `policyName` | Required. The `name` of a policy in `config/policies.json`. |
384
+ | `direction` | `"inbound"` or `"outbound"`: the route policy list to check. Defaults to `"inbound"`. |
385
+ | `id` | A name for the requirement. Use it to keep track of entries; results report under `zuplo/require-policy`. |
386
+ | `severity` | `"error"` or `"warn"`. Defaults to `"error"`. |
387
+ | `message` | The message to report. The linter appends the method and path of the route, for example `: get /todos`. |
388
+
389
+ A route meets a requirement when its `x-zuplo-route.policies.inbound` (or
390
+ `outbound`) list contains `policyName` exactly. When different routes use
391
+ different policies, scope each requirement to its routes with a
392
+ [custom rule](./api-lint-custom-rules.mdx#require-a-policy-on-some-routes).
392
393
 
393
394
  Requirements with `"severity": "error"` report under the rule ID
394
395
  `zuplo/require-policy`. Requirements with `"severity": "warn"` report under
@@ -405,13 +406,16 @@ empty list:
405
406
  }
406
407
  ```
407
408
 
408
- The defaults in `zuplo:strict` and `zuplo:security` accept these policy types:
409
+ The defaults in `zuplo:strict` and `zuplo:security` don't depend on policy
410
+ names. A route meets them when one of its inbound policies has a `handler` with
411
+ `"module": "$import(@zuplo/runtime)"` and one of these `export` values:
409
412
 
410
- - **Authentication:** `api-key`, `auth0-jwt-auth`, `clerk-jwt-auth`,
411
- `cognito-jwt-auth`, `curity-phantom-token`, `firebase-jwt-auth`, `jwt-auth`,
412
- `oauth2-pkce-auth`, `okta-jwt-auth`, `open-id-jwt-auth`, `propel-auth`,
413
- `stytch-jwt-auth`, `supabase-jwt-auth`
414
- - **Rate limiting:** `rate-limit`, `complex-rate-limit`
413
+ - **Authentication:** `ApiKeyInboundPolicy`, `Auth0JwtInboundPolicy`,
414
+ `ClerkJwtInboundPolicy`, `CognitoJwtInboundPolicy`,
415
+ `CurityPhantomTokenInboundPolicy`, `FirebaseJwtInboundPolicy`,
416
+ `OktaJwtInboundPolicy`, `OpenIdJwtInboundPolicy`,
417
+ `PropelAuthJwtInboundPolicy`, `SupabaseJwtInboundPolicy`
418
+ - **Rate limiting:** `RateLimitInboundPolicy`, `ComplexRateLimitInboundPolicy`
415
419
 
416
420
  ### `breakingChanges`
417
421
 
@@ -95,13 +95,13 @@ A Zuplo route has settings, such as its policies, that the OpenAPI document
95
95
  alone can't explain, because policies are defined in `config/policies.json`.
96
96
  These Zuplo functions read both files:
97
97
 
98
- | Function | Reports a route that... | Options |
99
- | ------------------------------ | -------------------------------------------------------- | --------------------------------------------------------------- |
100
- | `zuplo:requirePolicy` | doesn't have a policy of one of the given types | `policyTypes` (required), `direction` (`inbound` or `outbound`) |
101
- | `zuplo:noUndefinedPolicies` | references a policy that isn't in `config/policies.json` | |
102
- | `zuplo:noEmptyInboundPolicies` | has an empty `policies.inbound` list | |
103
- | `zuplo:requireRouteLabel` | has no `label` in `x-zuplo-route` | |
104
- | `zuplo:requireCorsPolicy` | has no `corsPolicy` in `x-zuplo-route` | |
98
+ | Function | Reports a route that... | Options |
99
+ | ------------------------------ | -------------------------------------------------------- | ---------------------------------------------------------------------------- |
100
+ | `zuplo:requirePolicy` | doesn't list the named policy | `policyName` (required), `direction` (`inbound`, the default, or `outbound`) |
101
+ | `zuplo:noUndefinedPolicies` | references a policy that isn't in `config/policies.json` | |
102
+ | `zuplo:noEmptyInboundPolicies` | has an empty `policies.inbound` list | |
103
+ | `zuplo:requireRouteLabel` | has no `label` in `x-zuplo-route` | |
104
+ | `zuplo:requireCorsPolicy` | has no `corsPolicy` in `x-zuplo-route` | |
105
105
 
106
106
  A Zuplo function checks every route itself, so set `"given": "$"` and choose the
107
107
  routes with `paths` and `excludePaths`. Only `zuplo:requirePolicy` uses your
@@ -128,7 +128,10 @@ choose:
128
128
  "given": "$",
129
129
  "then": {
130
130
  "function": "zuplo:requirePolicy",
131
- "functionOptions": { "policyTypes": ["api-key"] },
131
+ "functionOptions": {
132
+ "policyName": "api-key-auth",
133
+ "direction": "inbound",
134
+ },
132
135
  },
133
136
  },
134
137
  },
@@ -139,9 +142,10 @@ choose:
139
142
  16:14 error v1 routes need an API key: get /v1/admin require-api-key-v1 paths./v1/admin.get.x-zuplo-route.policies.inbound
140
143
  ```
141
144
 
142
- `policyTypes` matches the same way as in `requiredPolicies`: `"api-key"` matches
143
- the `api-key-inbound` policy type. Add one rule per requirement, each with its
144
- own ID and `paths`.
145
+ `policyName` matches the same way as in `requiredPolicies`: the route's
146
+ `policies.inbound` list (or `outbound`, with `"direction": "outbound"`) must
147
+ contain that exact policy name from `config/policies.json`. Add one rule per
148
+ requirement, each with its own ID and `paths`.
145
149
 
146
150
  ### Enforce a naming convention
147
151
 
@@ -245,7 +245,9 @@ the Zuplo Portal's route designer, logs, and analytics.
245
245
 
246
246
  _`zuplo:strict` and `zuplo:security`, or any preset with
247
247
  [`requiredPolicies`](./api-lint-configuration.mdx#requiredpolicies)._ Every
248
- route must include a policy of each required type.
248
+ route must include each required policy. The presets require a built-in
249
+ authentication policy and a built-in rate limiting policy; `requiredPolicies`
250
+ requires policies by name.
249
251
 
250
252
  | Preset | Authentication | Rate limiting |
251
253
  | ---------------- | -------------- | ------------- |
@@ -278,7 +280,7 @@ health check, turn the rule off for them with an
278
280
  }
279
281
  ```
280
282
 
281
- To change which policy types count, set your own
283
+ To require specific policies instead, set your own
282
284
  [`requiredPolicies`](./api-lint-configuration.mdx#requiredpolicies). To require
283
285
  a policy on only some routes, use a
284
286
  [custom rule](./api-lint-custom-rules.mdx#require-a-policy-on-some-routes).
@@ -17,11 +17,11 @@ support window applies.
17
17
 
18
18
  ## At a glance
19
19
 
20
- | Surface | What controls compatibility | Support window |
21
- | -------------------------------------------------- | --------------------------------------------- | --------------------------------------------------------- |
22
- | Gateway runtime | The `compatibilityDate` in your `zuplo.jsonc` | At least 12 months per compatibility date, likely longer. |
23
- | Specification-based features (MCP, OAuth, OpenAPI) | The upstream specification's own lifecycle | Tracks the specification. Old revisions eventually drop. |
24
- | Developer Portal | The `zudoku` package version in your project | Current version only. Fixes aren't backported. |
20
+ | Surface | What controls compatibility | Support window |
21
+ | -------------------------------------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
22
+ | Gateway runtime | The `compatibilityDate` in your `zuplo.jsonc` | At least 12 months per compatibility date, likely longer. At least six months' notice before deprecation. |
23
+ | Specification-based features (MCP, OAuth, OpenAPI) | The upstream specification's own lifecycle | Tracks the specification. Old revisions eventually drop. |
24
+ | Developer Portal | The `zudoku` package version in your project | Current version only. Fixes aren't backported. |
25
25
 
26
26
  ## What counts as a breaking change
27
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zuplo",
3
- "version": "7.15.9",
3
+ "version": "7.15.12",
4
4
  "type": "module",
5
5
  "description": "The official Zuplo CLI for local development and platform management",
6
6
  "homepage": "https://zuplo.com/docs/cli/overview",
@@ -32,9 +32,9 @@
32
32
  "zuplo": "zuplo.js"
33
33
  },
34
34
  "dependencies": {
35
- "@zuplo/cli": "7.15.9",
36
- "@zuplo/core": "7.15.9",
37
- "@zuplo/runtime": "7.15.9",
38
- "@zuplo/test": "7.15.9"
35
+ "@zuplo/cli": "7.15.12",
36
+ "@zuplo/core": "7.15.12",
37
+ "@zuplo/runtime": "7.15.12",
38
+ "@zuplo/test": "7.15.12"
39
39
  }
40
40
  }