@zuplo/runtime 5.1577.0 → 5.1579.0
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/index.d.ts +33 -117
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ValidateFunction as ValidateFunction_2 } from 'ajv';
|
|
|
6
6
|
* Amberflo is a usage metering and billing service. This policy allows you to send metering calls for each API to their meter ingest endpoint.
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* Amberflo
|
|
9
|
+
* Amberflo {@link https://www.amberflo.io|amberflo.com} is a usage metering and
|
|
10
10
|
* billing service. This policy allows you to meter API calls going through Zuplo
|
|
11
11
|
* and send them to your Amberflo account using your Amberflo API key.
|
|
12
12
|
*
|
|
@@ -87,16 +87,13 @@ declare interface AmberfloMeteringProperties extends Omit<AmberfloMeteringIngest
|
|
|
87
87
|
* [here](https://zuplo.com/docs/articles/api-key-api#buckets)
|
|
88
88
|
*
|
|
89
89
|
* @remarks
|
|
90
|
-
* **This policy is deprecated. Use the new
|
|
91
|
-
* [API Key Authentication policy instead](https://zuplo.com/docs/policies/api-key-inbound)**
|
|
92
|
-
*
|
|
93
90
|
* This policy uses the managed API key storage provided by Zuplo.
|
|
94
91
|
* `allowUnauthenticatedRequests` defaults to false and rejects any request without
|
|
95
92
|
* a valid API key (returning a `401 - Unauthorized` response). You can override
|
|
96
93
|
* (set `"allowUnauthenticatedRequests" : true`) this to support multiple
|
|
97
94
|
* authentication methods or support both authenticated and anonymous requests.
|
|
98
95
|
*
|
|
99
|
-
* @deprecated
|
|
96
|
+
* @deprecated Please use the new {@link https://zuplo.com/docs/policies/api-key-inbound|API Key Authentication} policy
|
|
100
97
|
* instead. This policy will continue to work but will be removed in a future
|
|
101
98
|
* version of Zuplo.
|
|
102
99
|
*
|
|
@@ -132,8 +129,8 @@ export declare interface ApiAuthKeyInboundPolicyOptions {
|
|
|
132
129
|
* For more information on Zuplo's API Key Management service and options enabling
|
|
133
130
|
* self-serve API Key management see the following resources:
|
|
134
131
|
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
132
|
+
* @see {@link https://zuplo.com/docs/articles/api-key-management|API Key Authentication Overview}
|
|
133
|
+
* @see {@link https://zuplo.com/docs/articles/api-key-api|API Key Management API}
|
|
137
134
|
*
|
|
138
135
|
* @title API Key Authentication
|
|
139
136
|
* @public
|
|
@@ -247,7 +244,7 @@ declare interface AuditLogRequestFilter {
|
|
|
247
244
|
*
|
|
248
245
|
* @remarks
|
|
249
246
|
* Authenticate requests with JWT tokens issued by Auth0. This is a customized
|
|
250
|
-
* version of the
|
|
247
|
+
* version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy} specifically
|
|
251
248
|
* for Auth0.
|
|
252
249
|
*
|
|
253
250
|
* @title Auth0 JWT Auth
|
|
@@ -459,7 +456,7 @@ declare interface BasicAuthAccount {
|
|
|
459
456
|
* with different passwords and a different bucket of user 'data'.
|
|
460
457
|
*
|
|
461
458
|
* The API will expect a Basic Auth header (you can generate samples
|
|
462
|
-
*
|
|
459
|
+
* {@link https://www.debugbear.com/basic-auth-header-generator|here}). Requests with
|
|
463
460
|
* invalid credentials (or no header) will not be authenticated. Authenticated
|
|
464
461
|
* requests will populate the `user` property of the `ZuploRequest` parameter on
|
|
465
462
|
* your RequestHandler.
|
|
@@ -647,7 +644,7 @@ export declare interface ClearHeadersOutboundPolicyOptions {
|
|
|
647
644
|
*
|
|
648
645
|
* @remarks
|
|
649
646
|
* Authenticate requests with JWT tokens issued by Clerk. This is a customized
|
|
650
|
-
* version of the
|
|
647
|
+
* version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy} specifically
|
|
651
648
|
* for Clerk.
|
|
652
649
|
*
|
|
653
650
|
* @title Clerk JWT Auth
|
|
@@ -679,10 +676,10 @@ export declare interface ClerkJwtInboundPolicyOptions {
|
|
|
679
676
|
*
|
|
680
677
|
* @remarks
|
|
681
678
|
* Authenticate requests with JWT tokens issued by AWS Cognito. This is a
|
|
682
|
-
* customized version of the
|
|
679
|
+
* customized version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy}
|
|
683
680
|
* specifically for AWS Cognito.
|
|
684
681
|
*
|
|
685
|
-
* See
|
|
682
|
+
* See {@link https://zuplo.com/docs/articles/oauth-authentication|this document} for more information
|
|
686
683
|
* about OAuth authorization in Zuplo.
|
|
687
684
|
*
|
|
688
685
|
* @title AWS Cognito JWT Auth
|
|
@@ -725,13 +722,9 @@ export declare type CompatibilityDate = "2023-03-14";
|
|
|
725
722
|
* The Composite policy allows you to create groups of other policies, for easy
|
|
726
723
|
* reuse across multiple routes. Other policies are referenced by their `name`.
|
|
727
724
|
*
|
|
728
|
-
* :::warning
|
|
729
|
-
*
|
|
730
725
|
* Be careful not to create circular references which can cause your gateway to
|
|
731
726
|
* fail.
|
|
732
727
|
*
|
|
733
|
-
* :::
|
|
734
|
-
*
|
|
735
728
|
* @title Composite Inbound (Group Policies)
|
|
736
729
|
* @public
|
|
737
730
|
* @param request - The ZuploRequest
|
|
@@ -921,7 +914,7 @@ export declare interface ErrorHandler {
|
|
|
921
914
|
* token, if successfully authenticated, with be on the `request.user.data` object
|
|
922
915
|
* accessible to the runtime.
|
|
923
916
|
*
|
|
924
|
-
* See
|
|
917
|
+
* See {@link https://zuplo.com/docs/articles/oauth-authentication|this document} for more information
|
|
925
918
|
* about OAuth authorization in Zuplo.
|
|
926
919
|
*
|
|
927
920
|
* @title Firebase JWT Auth
|
|
@@ -2400,7 +2393,7 @@ declare interface MoesifContext {
|
|
|
2400
2393
|
* Moesif is an API analytics and billing service. This policy allows you to send metering calls for each API to their events batch endpoint.
|
|
2401
2394
|
*
|
|
2402
2395
|
* @remarks
|
|
2403
|
-
* Moesif
|
|
2396
|
+
* Moesif {@link https://moesif.com|moesif.com} is an API analytics and monetization
|
|
2404
2397
|
* platform. This policy allows you to measure (and meter) API calls flowing
|
|
2405
2398
|
* through your Zuplo gateway.
|
|
2406
2399
|
*
|
|
@@ -2444,10 +2437,10 @@ declare interface NotFoundOptions {
|
|
|
2444
2437
|
*
|
|
2445
2438
|
* @remarks
|
|
2446
2439
|
* Authenticate requests with JWT tokens issued by Okta. This is a customized
|
|
2447
|
-
* version of the
|
|
2440
|
+
* version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy} specifically
|
|
2448
2441
|
* for Okta.
|
|
2449
2442
|
*
|
|
2450
|
-
* See
|
|
2443
|
+
* See {@link https://zuplo.com/docs/articles/oauth-authentication|this document} for more information
|
|
2451
2444
|
* about OAuth authorization in Zuplo.
|
|
2452
2445
|
*
|
|
2453
2446
|
* @title Okta JWT Auth
|
|
@@ -2526,7 +2519,7 @@ export declare function openApiSpecHandler(request: ZuploRequest, context: Zuplo
|
|
|
2526
2519
|
* token. It will also have a `data` property populated by other data returned in
|
|
2527
2520
|
* the JWT token (including any claims).
|
|
2528
2521
|
*
|
|
2529
|
-
* See
|
|
2522
|
+
* See {@link https://zuplo.com/docs/articles/oauth-authentication|this document} for more information
|
|
2530
2523
|
* about OAuth authorization in Zuplo.
|
|
2531
2524
|
*
|
|
2532
2525
|
* @title JWT Auth
|
|
@@ -2738,9 +2731,9 @@ export declare class ProblemResponseFormatter {
|
|
|
2738
2731
|
* Authenticate users using PropelAuth issued JWT tokens.
|
|
2739
2732
|
*
|
|
2740
2733
|
* @remarks
|
|
2741
|
-
* Authenticate requests with JWT tokens issued by
|
|
2742
|
-
*
|
|
2743
|
-
*
|
|
2734
|
+
* Authenticate requests with JWT tokens issued by {@link https://propelauth.com|PropelAuth}.
|
|
2735
|
+
* This is a customized version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy}
|
|
2736
|
+
* specifically for PropelAuth.
|
|
2744
2737
|
*
|
|
2745
2738
|
* @title PropelAuth JWT Auth
|
|
2746
2739
|
* @public
|
|
@@ -2886,12 +2879,10 @@ declare interface ReadmeMeteringInboundPolicyOptions {
|
|
|
2886
2879
|
* Readme is a developer documentation and API metrics company. This policy pushes logs to their API calls dashboard.
|
|
2887
2880
|
*
|
|
2888
2881
|
* @remarks
|
|
2889
|
-
*
|
|
2882
|
+
* {@link https://readme.com|Readme} is a developer Documentation and
|
|
2890
2883
|
* metrics service. This policy pushes the request/response data to their ingestion
|
|
2891
2884
|
* endpoint so you can see your Zuplo API traffic in their API calls dashboard.
|
|
2892
2885
|
*
|
|
2893
|
-
* 
|
|
2894
|
-
*
|
|
2895
2886
|
* @title Readme Metrics
|
|
2896
2887
|
* @public
|
|
2897
2888
|
* @param request - The ZuploRequest
|
|
@@ -3056,34 +3047,6 @@ export declare interface RequestUser<TUserData = any> {
|
|
|
3056
3047
|
* rejected with a `400: Bad Request` response containing a detailed error message
|
|
3057
3048
|
* (in JSON) explaining why the request was not accepted.
|
|
3058
3049
|
*
|
|
3059
|
-
* Here's an example of how to specify a schema for validation in a request body in
|
|
3060
|
-
* OpenAPI.
|
|
3061
|
-
*
|
|
3062
|
-
* ```json
|
|
3063
|
-
* "requestBody": {
|
|
3064
|
-
* "description": "user to add to the system",
|
|
3065
|
-
* "content": {
|
|
3066
|
-
* "application/json": {
|
|
3067
|
-
* "schema": {
|
|
3068
|
-
* "type": "object",
|
|
3069
|
-
* "properties": {
|
|
3070
|
-
* "name": {
|
|
3071
|
-
* "type": "string"
|
|
3072
|
-
* },
|
|
3073
|
-
* "age": {
|
|
3074
|
-
* "type": "integer"
|
|
3075
|
-
* }
|
|
3076
|
-
* },
|
|
3077
|
-
* "required": [
|
|
3078
|
-
* "name",
|
|
3079
|
-
* "age"
|
|
3080
|
-
* ]
|
|
3081
|
-
* }
|
|
3082
|
-
* }
|
|
3083
|
-
* }
|
|
3084
|
-
* }
|
|
3085
|
-
* ```
|
|
3086
|
-
*
|
|
3087
3050
|
* @title Request Validation
|
|
3088
3051
|
* @public
|
|
3089
3052
|
* @param request - The ZuploRequest
|
|
@@ -3306,10 +3269,10 @@ export declare interface ServiceProvider {
|
|
|
3306
3269
|
*
|
|
3307
3270
|
* @remarks
|
|
3308
3271
|
* The Set Body policy allows you to set or override the incoming request body.
|
|
3309
|
-
*
|
|
3310
|
-
* so be sure to use the
|
|
3272
|
+
* {@link https://zuplo.com/docs/articles/zp-body-removed|GET or HEAD requests do not support bodies on Zuplo},
|
|
3273
|
+
* so be sure to use the {@link https://zuplo.com/docs/policies/change-method-inbound|Change Method}
|
|
3311
3274
|
* policy to update the method to a `POST` or whatever is appropriate. You might
|
|
3312
|
-
* also need to use the
|
|
3275
|
+
* also need to use the {@link https://zuplo.com/docs/policies/set-headers-inbound|Set Header} policy to
|
|
3313
3276
|
* set a `content-type`.
|
|
3314
3277
|
*
|
|
3315
3278
|
* @title Set Body
|
|
@@ -3337,47 +3300,7 @@ export declare interface SetBodyInboundPolicyOptions {
|
|
|
3337
3300
|
*
|
|
3338
3301
|
* @remarks
|
|
3339
3302
|
* The set header policy adds a header to the request in the inbound pipeline. This
|
|
3340
|
-
* can be used to set a security header required by the downstream service.
|
|
3341
|
-
* example, if your backend service uses basic authentication you might use this
|
|
3342
|
-
* policy to attach the Basic auth header to the request:
|
|
3343
|
-
*
|
|
3344
|
-
* ```json
|
|
3345
|
-
* {
|
|
3346
|
-
* "export": "SetHeadersInboundPolicy",
|
|
3347
|
-
* "module": "$import(@zuplo/runtime)",
|
|
3348
|
-
* "options": {
|
|
3349
|
-
* "headers": [
|
|
3350
|
-
* {
|
|
3351
|
-
* "name": "Authorization",
|
|
3352
|
-
* "value": "Basic DIGEST_HERE",
|
|
3353
|
-
* "overwrite": true
|
|
3354
|
-
* }
|
|
3355
|
-
* ]
|
|
3356
|
-
* }
|
|
3357
|
-
* }
|
|
3358
|
-
* ```
|
|
3359
|
-
*
|
|
3360
|
-
* When doing this, you most likely want to set the secret as an environment
|
|
3361
|
-
* variable, which can be accessed in the policy as follows
|
|
3362
|
-
*
|
|
3363
|
-
* ```json
|
|
3364
|
-
* {
|
|
3365
|
-
* "export": "SetHeadersInboundPolicy",
|
|
3366
|
-
* "module": "$import(@zuplo/runtime)",
|
|
3367
|
-
* "options": {
|
|
3368
|
-
* "headers": [
|
|
3369
|
-
* {
|
|
3370
|
-
* "name": "Authorization",
|
|
3371
|
-
* "value": "$env(BASIC_AUTHORIZATION_HEADER_VALUE)",
|
|
3372
|
-
* "overwrite": true
|
|
3373
|
-
* }
|
|
3374
|
-
* ]
|
|
3375
|
-
* }
|
|
3376
|
-
* }
|
|
3377
|
-
* ```
|
|
3378
|
-
*
|
|
3379
|
-
* And you would set the environment variable `BASIC_AUTHORIZATION_HEADER_VALUE` to
|
|
3380
|
-
* `Basic DIGEST_HERE`.
|
|
3303
|
+
* can be used to set a security header required by the downstream service.
|
|
3381
3304
|
*
|
|
3382
3305
|
* @title Add or Set Request Headers
|
|
3383
3306
|
* @public
|
|
@@ -3555,7 +3478,7 @@ export declare class SumoLogicLoggingPlugin extends LogPlugin {
|
|
|
3555
3478
|
*
|
|
3556
3479
|
* @remarks
|
|
3557
3480
|
* The Supabase JWT Authentication policy allows you to authenticate incoming
|
|
3558
|
-
* requests using a token created by
|
|
3481
|
+
* requests using a token created by {@link https://supabase.com|supabase.com}.
|
|
3559
3482
|
*
|
|
3560
3483
|
* When configured, you can have Zuplo check incoming requests for a JWT token and
|
|
3561
3484
|
* automatically populate the `ZuploRequest`'s `user` property with a user object.
|
|
@@ -3605,7 +3528,6 @@ export declare interface SupabaseJwtInboundPolicyOptions {
|
|
|
3605
3528
|
|
|
3606
3529
|
/**
|
|
3607
3530
|
* Uses Azure Active Directory to add an Authorization header to the request in order to authenticate requests using Azure identity.
|
|
3608
|
-
* @see {@link https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad|Configure your App Service or Azure Functions app to use Azure AD login}
|
|
3609
3531
|
*
|
|
3610
3532
|
* @remarks
|
|
3611
3533
|
* This policy adds a `Authorization` header to the upstream request that allows
|
|
@@ -3616,7 +3538,7 @@ export declare interface SupabaseJwtInboundPolicyOptions {
|
|
|
3616
3538
|
* Using this policy allows you to delegate authentication and authorization to
|
|
3617
3539
|
* your gateway without writing any code on your origin service. For instructions
|
|
3618
3540
|
* on how to configure Azure AD authentication see
|
|
3619
|
-
*
|
|
3541
|
+
* {@link https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad | Configure your App Service or Azure Functions app to use Azure AD login}.
|
|
3620
3542
|
*
|
|
3621
3543
|
* @title Upstream Azure AD Service Auth
|
|
3622
3544
|
* @public
|
|
@@ -3761,17 +3683,15 @@ export declare interface UpstreamFirebaseUserAuthInboundPolicyOptions {
|
|
|
3761
3683
|
* Creates a self-signed JWT token (generated using a Google Service Account JSON) and attaches it to the outgoing request. Useful when calling GCP services like Cloud Endpoints / ESPv2
|
|
3762
3684
|
*
|
|
3763
3685
|
* @remarks
|
|
3764
|
-
* **CAUTION: This policy only works with
|
|
3765
|
-
* [certain Google APIs](https://developers.google.com/identity/protocols/oauth2/service-account#jwt-auth).
|
|
3766
|
-
* In most cases, the
|
|
3767
|
-
* [Upstream GCP Service Auth](/docs/policies/upstream-gcp-service-auth-inbound)
|
|
3768
|
-
* should be used.**
|
|
3769
|
-
*
|
|
3770
3686
|
* This policy adds a JWT token to the headers, ready for us in an outgoing request
|
|
3771
3687
|
* when calling a GCP service (e.g. Cloud Endpoints / ESPv2). We recommend reading
|
|
3772
3688
|
* the `serviceAccountJson` from environment variables (so it is not checked in to
|
|
3773
3689
|
* source control) using the `$env(ENV_VAR)` syntax.
|
|
3774
3690
|
*
|
|
3691
|
+
* CAUTION: This policy only works with {@link https://developers.google.com/identity/protocols/oauth2/service-account#jwt-auth | certain Google APIs}.
|
|
3692
|
+
* In most cases, the {@link https://zuplo.com/docs/policies/upstream-gcp-service-auth-inbound | Upstream GCP Service Auth}
|
|
3693
|
+
* should be used.
|
|
3694
|
+
*
|
|
3775
3695
|
* @title Upstream GCP Self-Signed JWT
|
|
3776
3696
|
* @public
|
|
3777
3697
|
* @param request - The ZuploRequest
|
|
@@ -3808,8 +3728,8 @@ export declare interface UpstreamGcpJwtInboundPolicyOptions {
|
|
|
3808
3728
|
* gateway can make requests against it.
|
|
3809
3729
|
*
|
|
3810
3730
|
* This policy works with
|
|
3811
|
-
*
|
|
3812
|
-
* or services like
|
|
3731
|
+
* {@link https://zuplo.com/docs/articles/gke-with-upstream-auth-policy|GCP Identity Aware Proxy}
|
|
3732
|
+
* or services like {@link https://cloud.google.com/iap/docs/managing-access|Cloud Run}
|
|
3813
3733
|
* that natively support IAM authorization.
|
|
3814
3734
|
*
|
|
3815
3735
|
* We recommend reading the `serviceAccountJson` from environment variables (so it
|
|
@@ -3834,7 +3754,7 @@ export declare interface UpstreamGcpServiceAuthInboundPolicyOptions {
|
|
|
3834
3754
|
*/
|
|
3835
3755
|
audience: string;
|
|
3836
3756
|
/**
|
|
3837
|
-
* The Google Service Account key in JSON format. Note you can load this from environment variables using the
|
|
3757
|
+
* The Google Service Account key in JSON format. Note you can load this from environment variables using the `$env(ENV_VAR)` syntax.
|
|
3838
3758
|
* @see {@link https://developers.google.com/workspace/guides/create-credentials|Create access credentials}
|
|
3839
3759
|
*/
|
|
3840
3760
|
serviceAccountJson: string;
|
|
@@ -3877,11 +3797,6 @@ export declare const VALID_COMPATIBILITY_DATES: readonly CompatibilityDate[];
|
|
|
3877
3797
|
* Validates the body of an incoming request based on a JSON schema.
|
|
3878
3798
|
*
|
|
3879
3799
|
* @remarks
|
|
3880
|
-
* **This policy is deprecated. Use the new
|
|
3881
|
-
* [Request Validation Policy](https://zuplo.com/docs/policies/request-validation-inbound).
|
|
3882
|
-
* The new policy validates JSON bodies like this policy, but also supports
|
|
3883
|
-
* validation of parameters, query strings, etc.**
|
|
3884
|
-
*
|
|
3885
3800
|
* The Validate JSON Schema policy is used to validate the body of incoming
|
|
3886
3801
|
* requests. It works using JSON Schemas defined in the `Schemas` folder of your
|
|
3887
3802
|
* project.
|
|
@@ -3892,7 +3807,8 @@ export declare const VALID_COMPATIBILITY_DATES: readonly CompatibilityDate[];
|
|
|
3892
3807
|
*
|
|
3893
3808
|
* @title JSON Body Validation
|
|
3894
3809
|
* @public
|
|
3895
|
-
* @deprecated Use the Request Validation
|
|
3810
|
+
* @deprecated Use the new {@link https://zuplo.com/docs/policies/request-validation-inbound|Request Validation Policy}.
|
|
3811
|
+
* The new policy validates JSON bodies like this policy, but also supports validation of parameters, query strings, etc.
|
|
3896
3812
|
* @param request - The ZuploRequest
|
|
3897
3813
|
* @param context - The ZuploContext
|
|
3898
3814
|
* @param options - The policy options set in policies.json
|