@zuplo/runtime 6.70.48 → 6.70.50

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.
@@ -4,6 +4,7 @@ import { CallToolResult } from "@zuplo/mcp/types";
4
4
  import { KeyLike } from "jose";
5
5
  import { RequestGeneric as RequestGeneric_2 } from "../../request.js";
6
6
  import type { ValidateFunction } from "ajv";
7
+ import { z } from "zod/v4";
7
8
 
8
9
  /**
9
10
  * Converts Anthropic Messages API format requests to OpenAI Chat Completions format.
@@ -5641,8 +5642,890 @@ declare type LokiTransportVersion = 1 | 2;
5641
5642
 
5642
5643
  /* Excluded from this release type: LookupResult */
5643
5644
 
5645
+ /**
5646
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5647
+ * with browser login delegated to Auth0.
5648
+ *
5649
+ * Auth0-friendly wrapper around `McpOAuthInboundPolicy`. Provide `auth0Domain`
5650
+ * and `clientId`; the constructor derives the OIDC issuer, JWKS URL, and Auth0
5651
+ * authorize/token endpoints automatically and runs the resulting shape through
5652
+ * the same Zod schema as the generic policy.
5653
+ *
5654
+ * Validation runs lazily inside the policy constructor, which the runtime
5655
+ * caches per policy name — so a misconfigured policy fails the first request
5656
+ * with a `ConfigurationError` (surfaced in the 500 problem body) rather than
5657
+ * crashing boot.
5658
+ *
5659
+ * @hidden
5660
+ * @title MCP Auth0 OAuth
5661
+ */
5662
+ export declare class McpAuth0OAuthInboundPolicy extends InboundPolicy<McpAuth0OAuthInboundPolicyOptions> {
5663
+ #private;
5664
+ constructor(rawOptions: unknown, policyName: string);
5665
+ handler(
5666
+ request: ZuploRequest,
5667
+ context: ZuploContext
5668
+ ): Promise<ZuploRequest | Response>;
5669
+ }
5670
+
5671
+ /**
5672
+ * The options for this policy.
5673
+ * @public
5674
+ */
5675
+ export declare interface McpAuth0OAuthInboundPolicyOptions {
5676
+ /**
5677
+ * Your Auth0 tenant domain. The OIDC issuer, JWKS URL, /authorize URL, and /oauth/token URL are derived from this.
5678
+ */
5679
+ auth0Domain: string;
5680
+ /**
5681
+ * Optional Auth0 API audience. When set, the gateway sends it as the Auth0 authorize?audience= parameter and validates returned provider access tokens against it. Leave unset when Auth0 is only used for browser identity.
5682
+ */
5683
+ audience?: string;
5684
+ /**
5685
+ * The Auth0 client_id registered for the gateway's browser login flow.
5686
+ */
5687
+ clientId: string;
5688
+ /**
5689
+ * The Auth0 client_secret. Use $env(...) to source from a secret environment variable.
5690
+ */
5691
+ clientSecret: string;
5692
+ /**
5693
+ * OIDC scopes requested during browser login.
5694
+ */
5695
+ scope?: string;
5696
+ /**
5697
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5698
+ */
5699
+ gateway?: {
5700
+ /**
5701
+ * Lifetime of access tokens issued by /oauth/token.
5702
+ */
5703
+ accessTokenTtlSeconds?: number;
5704
+ /**
5705
+ * Lifetime of refresh tokens issued by /oauth/token.
5706
+ */
5707
+ refreshTokenTtlSeconds?: number;
5708
+ /**
5709
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5710
+ */
5711
+ cimdEnabled?: boolean;
5712
+ };
5713
+ /**
5714
+ * Optional overrides for the derived browser-login settings.
5715
+ */
5716
+ browserLoginOverrides?: {
5717
+ remoteTimeoutMs?: number;
5718
+ stateTtlSeconds?: number;
5719
+ sessionTtlSeconds?: number;
5720
+ };
5721
+ }
5722
+
5723
+ /**
5724
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5725
+ * with browser login delegated to Clerk.
5726
+ *
5727
+ * Clerk-friendly wrapper around `McpOAuthInboundPolicy`. Provide Clerk's
5728
+ * Frontend API URL plus the OAuth application client id and secret; the
5729
+ * constructor derives the Clerk issuer, JWKS URL, authorize URL, and token URL.
5730
+ *
5731
+ * @title MCP Clerk OAuth
5732
+ * @public
5733
+ * @product mcp-gateway
5734
+ */
5735
+ export declare class McpClerkOAuthInboundPolicy extends InboundPolicy<McpClerkOAuthInboundPolicyOptions> {
5736
+ #private;
5737
+ constructor(rawOptions: unknown, policyName: string);
5738
+ handler(
5739
+ request: ZuploRequest,
5740
+ context: ZuploContext
5741
+ ): Promise<ZuploRequest | Response>;
5742
+ }
5743
+
5744
+ /**
5745
+ * The options for this policy.
5746
+ * @public
5747
+ */
5748
+ export declare interface McpClerkOAuthInboundPolicyOptions {
5749
+ /**
5750
+ * The Clerk Frontend API URL origin, without a trailing path, query string, or fragment.
5751
+ */
5752
+ frontendApiUrl: string;
5753
+ /**
5754
+ * The Clerk OAuth application client_id registered for the gateway's browser login flow.
5755
+ */
5756
+ clientId: string;
5757
+ /**
5758
+ * The Clerk OAuth application client_secret. Use $env(...) to source from a secret environment variable.
5759
+ */
5760
+ clientSecret: string;
5761
+ /**
5762
+ * OIDC scopes requested during browser login.
5763
+ */
5764
+ scope?: string;
5765
+ /**
5766
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5767
+ */
5768
+ gateway?: {
5769
+ /**
5770
+ * Lifetime of access tokens issued by /oauth/token.
5771
+ */
5772
+ accessTokenTtlSeconds?: number;
5773
+ /**
5774
+ * Lifetime of refresh tokens issued by /oauth/token.
5775
+ */
5776
+ refreshTokenTtlSeconds?: number;
5777
+ /**
5778
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5779
+ */
5780
+ cimdEnabled?: boolean;
5781
+ };
5782
+ /**
5783
+ * Optional overrides for the derived browser-login settings.
5784
+ */
5785
+ browserLoginOverrides?: {
5786
+ remoteTimeoutMs?: number;
5787
+ stateTtlSeconds?: number;
5788
+ sessionTtlSeconds?: number;
5789
+ };
5790
+ }
5791
+
5792
+ /**
5793
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5794
+ * with browser login delegated to Amazon Cognito.
5795
+ *
5796
+ * Cognito-friendly wrapper around `McpOAuthInboundPolicy`. Provide an AWS
5797
+ * region, user pool id, user pool domain, client id, and client secret; the
5798
+ * constructor derives the Cognito issuer, JWKS URL, authorize URL, and token
5799
+ * URL.
5800
+ *
5801
+ * @title MCP Amazon Cognito OAuth
5802
+ * @public
5803
+ * @product mcp-gateway
5804
+ */
5805
+ export declare class McpCognitoOAuthInboundPolicy extends InboundPolicy<McpCognitoOAuthInboundPolicyOptions> {
5806
+ #private;
5807
+ constructor(rawOptions: unknown, policyName: string);
5808
+ handler(
5809
+ request: ZuploRequest,
5810
+ context: ZuploContext
5811
+ ): Promise<ZuploRequest | Response>;
5812
+ }
5813
+
5814
+ /**
5815
+ * The options for this policy.
5816
+ * @public
5817
+ */
5818
+ export declare interface McpCognitoOAuthInboundPolicyOptions {
5819
+ /**
5820
+ * The AWS region that contains the Amazon Cognito user pool.
5821
+ */
5822
+ awsRegion: string;
5823
+ /**
5824
+ * The Amazon Cognito user pool ID.
5825
+ */
5826
+ userPoolId: string;
5827
+ /**
5828
+ * The hosted UI domain for the user pool, without https://, a trailing slash, or a path.
5829
+ */
5830
+ userPoolDomain: string;
5831
+ /**
5832
+ * The Cognito app client_id registered for the gateway's browser login flow.
5833
+ */
5834
+ clientId: string;
5835
+ /**
5836
+ * The Cognito app client_secret. Use $env(...) to source from a secret environment variable.
5837
+ */
5838
+ clientSecret: string;
5839
+ /**
5840
+ * OIDC scopes requested during browser login.
5841
+ */
5842
+ scope?: string;
5843
+ /**
5844
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5845
+ */
5846
+ gateway?: {
5847
+ /**
5848
+ * Lifetime of access tokens issued by /oauth/token.
5849
+ */
5850
+ accessTokenTtlSeconds?: number;
5851
+ /**
5852
+ * Lifetime of refresh tokens issued by /oauth/token.
5853
+ */
5854
+ refreshTokenTtlSeconds?: number;
5855
+ /**
5856
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5857
+ */
5858
+ cimdEnabled?: boolean;
5859
+ };
5860
+ /**
5861
+ * Optional overrides for the derived browser-login settings.
5862
+ */
5863
+ browserLoginOverrides?: {
5864
+ remoteTimeoutMs?: number;
5865
+ stateTtlSeconds?: number;
5866
+ sessionTtlSeconds?: number;
5867
+ };
5868
+ }
5869
+
5870
+ /**
5871
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5872
+ * with browser login delegated to Microsoft Entra ID.
5873
+ *
5874
+ * Entra-friendly wrapper around `McpOAuthInboundPolicy`. Provide a tenant UUID,
5875
+ * application client id, and client secret; the constructor derives the Entra
5876
+ * v2 issuer, JWKS URL, authorize URL, and token URL.
5877
+ *
5878
+ * @title MCP Microsoft Entra OAuth
5879
+ * @public
5880
+ * @product mcp-gateway
5881
+ */
5882
+ export declare class McpEntraOAuthInboundPolicy extends InboundPolicy<McpEntraOAuthInboundPolicyOptions> {
5883
+ #private;
5884
+ constructor(rawOptions: unknown, policyName: string);
5885
+ handler(
5886
+ request: ZuploRequest,
5887
+ context: ZuploContext
5888
+ ): Promise<ZuploRequest | Response>;
5889
+ }
5890
+
5891
+ /**
5892
+ * The options for this policy.
5893
+ * @public
5894
+ */
5895
+ export declare interface McpEntraOAuthInboundPolicyOptions {
5896
+ /**
5897
+ * The Microsoft Entra tenant UUID. Multi-tenant aliases like common and organizations are not supported by this policy yet.
5898
+ */
5899
+ tenantId: string;
5900
+ /**
5901
+ * The Microsoft Entra application (client) ID UUID registered for the gateway's browser login flow.
5902
+ */
5903
+ clientId: string;
5904
+ /**
5905
+ * The Microsoft Entra client secret. Use $env(...) to source from a secret environment variable.
5906
+ */
5907
+ clientSecret: string;
5908
+ /**
5909
+ * OIDC scopes requested during browser login.
5910
+ */
5911
+ scope?: string;
5912
+ /**
5913
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5914
+ */
5915
+ gateway?: {
5916
+ /**
5917
+ * Lifetime of access tokens issued by /oauth/token.
5918
+ */
5919
+ accessTokenTtlSeconds?: number;
5920
+ /**
5921
+ * Lifetime of refresh tokens issued by /oauth/token.
5922
+ */
5923
+ refreshTokenTtlSeconds?: number;
5924
+ /**
5925
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5926
+ */
5927
+ cimdEnabled?: boolean;
5928
+ };
5929
+ /**
5930
+ * Optional overrides for the derived browser-login settings.
5931
+ */
5932
+ browserLoginOverrides?: {
5933
+ remoteTimeoutMs?: number;
5934
+ stateTtlSeconds?: number;
5935
+ sessionTtlSeconds?: number;
5936
+ };
5937
+ }
5938
+
5644
5939
  /* Excluded from this release type: McpGatewayOAuthProtectedResourcePlugin */
5645
5940
 
5941
+ /**
5942
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5943
+ * with browser login delegated to Google.
5944
+ *
5945
+ * Google-friendly wrapper around `McpOAuthInboundPolicy`. Provide `clientId`
5946
+ * and `clientSecret`; the constructor uses Google's fixed OIDC issuer, JWKS
5947
+ * URL, authorize URL, and token URL, then runs the resulting shape through the
5948
+ * same Zod schema as the generic policy.
5949
+ *
5950
+ * @title MCP Google OAuth
5951
+ * @public
5952
+ * @product mcp-gateway
5953
+ */
5954
+ export declare class McpGoogleOAuthInboundPolicy extends InboundPolicy<McpGoogleOAuthInboundPolicyOptions> {
5955
+ #private;
5956
+ constructor(rawOptions: unknown, policyName: string);
5957
+ handler(
5958
+ request: ZuploRequest,
5959
+ context: ZuploContext
5960
+ ): Promise<ZuploRequest | Response>;
5961
+ }
5962
+
5963
+ /**
5964
+ * The options for this policy.
5965
+ * @public
5966
+ */
5967
+ export declare interface McpGoogleOAuthInboundPolicyOptions {
5968
+ /**
5969
+ * The Google OAuth client_id registered for the gateway's browser login flow. Google uses a fixed OIDC issuer and discovery endpoint.
5970
+ */
5971
+ clientId: string;
5972
+ /**
5973
+ * The Google OAuth client_secret. Use $env(...) to source from a secret environment variable.
5974
+ */
5975
+ clientSecret: string;
5976
+ /**
5977
+ * OIDC scopes requested during browser login.
5978
+ */
5979
+ scope?: string;
5980
+ /**
5981
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5982
+ */
5983
+ gateway?: {
5984
+ /**
5985
+ * Lifetime of access tokens issued by /oauth/token.
5986
+ */
5987
+ accessTokenTtlSeconds?: number;
5988
+ /**
5989
+ * Lifetime of refresh tokens issued by /oauth/token.
5990
+ */
5991
+ refreshTokenTtlSeconds?: number;
5992
+ /**
5993
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5994
+ */
5995
+ cimdEnabled?: boolean;
5996
+ };
5997
+ /**
5998
+ * Optional overrides for the derived browser-login settings.
5999
+ */
6000
+ browserLoginOverrides?: {
6001
+ remoteTimeoutMs?: number;
6002
+ stateTtlSeconds?: number;
6003
+ sessionTtlSeconds?: number;
6004
+ };
6005
+ }
6006
+
6007
+ /**
6008
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6009
+ * with browser login delegated to Keycloak.
6010
+ *
6011
+ * Keycloak-friendly wrapper around `McpOAuthInboundPolicy`. Provide the
6012
+ * Keycloak server root, realm, client id, and client secret; the constructor
6013
+ * derives the realm issuer, JWKS URL, authorize URL, and token URL from
6014
+ * Keycloak's documented OIDC endpoint layout.
6015
+ *
6016
+ * @title MCP Keycloak OAuth
6017
+ * @public
6018
+ * @product mcp-gateway
6019
+ */
6020
+ export declare class McpKeycloakOAuthInboundPolicy extends InboundPolicy<McpKeycloakOAuthInboundPolicyOptions> {
6021
+ #private;
6022
+ constructor(rawOptions: unknown, policyName: string);
6023
+ handler(
6024
+ request: ZuploRequest,
6025
+ context: ZuploContext
6026
+ ): Promise<ZuploRequest | Response>;
6027
+ }
6028
+
6029
+ /**
6030
+ * The options for this policy.
6031
+ * @public
6032
+ */
6033
+ export declare interface McpKeycloakOAuthInboundPolicyOptions {
6034
+ /**
6035
+ * The absolute URL for the Keycloak server root. Do not include /realms/{realm}; set the realm option separately.
6036
+ */
6037
+ keycloakBaseUrl: string;
6038
+ /**
6039
+ * The Keycloak realm name.
6040
+ */
6041
+ realm: string;
6042
+ /**
6043
+ * The Keycloak OIDC client_id registered for the gateway's browser login flow.
6044
+ */
6045
+ clientId: string;
6046
+ /**
6047
+ * The Keycloak OIDC client_secret. Use $env(...) to source from a secret environment variable.
6048
+ */
6049
+ clientSecret: string;
6050
+ /**
6051
+ * OIDC scopes requested during browser login.
6052
+ */
6053
+ scope?: string;
6054
+ /**
6055
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6056
+ */
6057
+ gateway?: {
6058
+ /**
6059
+ * Lifetime of access tokens issued by /oauth/token.
6060
+ */
6061
+ accessTokenTtlSeconds?: number;
6062
+ /**
6063
+ * Lifetime of refresh tokens issued by /oauth/token.
6064
+ */
6065
+ refreshTokenTtlSeconds?: number;
6066
+ /**
6067
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6068
+ */
6069
+ cimdEnabled?: boolean;
6070
+ };
6071
+ /**
6072
+ * Optional overrides for the derived browser-login settings.
6073
+ */
6074
+ browserLoginOverrides?: {
6075
+ remoteTimeoutMs?: number;
6076
+ stateTtlSeconds?: number;
6077
+ sessionTtlSeconds?: number;
6078
+ };
6079
+ }
6080
+
6081
+ /**
6082
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6083
+ * with browser login delegated to Logto.
6084
+ *
6085
+ * Logto-friendly wrapper around `McpOAuthInboundPolicy`. Provide the Logto
6086
+ * tenant endpoint, client id, and client secret; the constructor derives the
6087
+ * Logto `/oidc` issuer, JWKS URL, authorize URL, and token URL.
6088
+ *
6089
+ * @title MCP Logto OAuth
6090
+ * @public
6091
+ * @product mcp-gateway
6092
+ */
6093
+ export declare class McpLogtoOAuthInboundPolicy extends InboundPolicy<McpLogtoOAuthInboundPolicyOptions> {
6094
+ #private;
6095
+ constructor(rawOptions: unknown, policyName: string);
6096
+ handler(
6097
+ request: ZuploRequest,
6098
+ context: ZuploContext
6099
+ ): Promise<ZuploRequest | Response>;
6100
+ }
6101
+
6102
+ /**
6103
+ * The options for this policy.
6104
+ * @public
6105
+ */
6106
+ export declare interface McpLogtoOAuthInboundPolicyOptions {
6107
+ /**
6108
+ * Your Logto tenant endpoint or custom domain, without the /oidc path. The OIDC issuer, JWKS URL, authorization URL, and token URL are derived from this.
6109
+ */
6110
+ logtoEndpoint: string;
6111
+ /**
6112
+ * The Logto application client_id registered for the gateway's browser login flow.
6113
+ */
6114
+ clientId: string;
6115
+ /**
6116
+ * The Logto application client_secret. Use $env(...) to source from a secret environment variable.
6117
+ */
6118
+ clientSecret: string;
6119
+ /**
6120
+ * OIDC scopes requested during browser login.
6121
+ */
6122
+ scope?: string;
6123
+ /**
6124
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6125
+ */
6126
+ gateway?: {
6127
+ /**
6128
+ * Lifetime of access tokens issued by /oauth/token.
6129
+ */
6130
+ accessTokenTtlSeconds?: number;
6131
+ /**
6132
+ * Lifetime of refresh tokens issued by /oauth/token.
6133
+ */
6134
+ refreshTokenTtlSeconds?: number;
6135
+ /**
6136
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6137
+ */
6138
+ cimdEnabled?: boolean;
6139
+ };
6140
+ /**
6141
+ * Optional overrides for the derived browser-login settings.
6142
+ */
6143
+ browserLoginOverrides?: {
6144
+ remoteTimeoutMs?: number;
6145
+ stateTtlSeconds?: number;
6146
+ sessionTtlSeconds?: number;
6147
+ };
6148
+ }
6149
+
6150
+ /**
6151
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token.
6152
+ *
6153
+ * The gateway hosts its own OAuth authorization server endpoints (DCR,
6154
+ * `/authorize`, `/token`, `/callback`) — registered automatically when this
6155
+ * policy is present in `policies.json`. End-user browser login is delegated
6156
+ * to the OpenID Connect identity provider configured via the `oidc` and
6157
+ * `browserLogin` policy options.
6158
+ *
6159
+ * Validation runs lazily inside the policy constructor, which the runtime
6160
+ * caches per policy name — so a misconfigured policy fails the first request
6161
+ * with a `ConfigurationError` (surfaced in the 500 problem body) rather than
6162
+ * crashing boot.
6163
+ *
6164
+ * @hidden
6165
+ * @title MCP OAuth
6166
+ */
6167
+ export declare class McpOAuthInboundPolicy extends InboundPolicy<McpOAuthRuntimeConfig> {
6168
+ constructor(rawOptions: unknown, policyName: string);
6169
+ handler(
6170
+ request: ZuploRequest,
6171
+ context: ZuploContext
6172
+ ): Promise<ZuploRequest | Response>;
6173
+ }
6174
+
6175
+ /**
6176
+ * The options for this policy.
6177
+ * @public
6178
+ */
6179
+ export declare interface McpOAuthInboundPolicyOptions {
6180
+ /**
6181
+ * OpenID Connect identity provider that authenticates end-users before the gateway issues its own OAuth access token.
6182
+ */
6183
+ oidc: {
6184
+ /**
6185
+ * The OIDC issuer URL of the identity provider.
6186
+ */
6187
+ issuer: string;
6188
+ /**
6189
+ * The JWKS endpoint used to verify ID tokens issued by the identity provider.
6190
+ */
6191
+ jwksUrl: string;
6192
+ /**
6193
+ * Optional IdP audience value. Leave unset when browser login ID tokens use the OIDC client_id as their audience.
6194
+ */
6195
+ audience?: string;
6196
+ };
6197
+ /**
6198
+ * Browser-side OAuth/OIDC settings used when the gateway redirects the user to the identity provider for login.
6199
+ */
6200
+ browserLogin: {
6201
+ /**
6202
+ * The IdP /authorize endpoint to redirect the user to. For local development on loopback, use http://127.0.0.1:9000/oauth/dev-login.
6203
+ */
6204
+ url: string;
6205
+ /**
6206
+ * The IdP token endpoint used for the federated authorization code exchange. Required for federated_oidc browser login.
6207
+ */
6208
+ tokenUrl?: string;
6209
+ /**
6210
+ * The OIDC client_id registered with the identity provider for the gateway's browser login flow.
6211
+ */
6212
+ clientId?: string;
6213
+ /**
6214
+ * The OIDC client_secret. Required for federated browser login. Use $env(...) to source from a secret environment variable.
6215
+ */
6216
+ clientSecret?: string;
6217
+ /**
6218
+ * The OIDC scopes requested during browser login.
6219
+ */
6220
+ scope?: string;
6221
+ /**
6222
+ * Optional audience parameter for the IdP authorization request (Auth0-style API audiences).
6223
+ */
6224
+ audience?: string;
6225
+ /**
6226
+ * Timeout for outbound calls to the IdP (token exchange, JWKS fetch).
6227
+ */
6228
+ remoteTimeoutMs?: number;
6229
+ /**
6230
+ * Lifetime of an in-flight browser-login state record.
6231
+ */
6232
+ stateTtlSeconds?: number;
6233
+ /**
6234
+ * Lifetime of the gateway browser-login session cookie issued after a successful login.
6235
+ */
6236
+ sessionTtlSeconds?: number;
6237
+ };
6238
+ /**
6239
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6240
+ */
6241
+ gateway?: {
6242
+ /**
6243
+ * Lifetime of access tokens issued by /oauth/token.
6244
+ */
6245
+ accessTokenTtlSeconds?: number;
6246
+ /**
6247
+ * Lifetime of refresh tokens issued by /oauth/token.
6248
+ */
6249
+ refreshTokenTtlSeconds?: number;
6250
+ /**
6251
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6252
+ */
6253
+ cimdEnabled?: boolean;
6254
+ };
6255
+ }
6256
+
6257
+ declare type McpOAuthRuntimeConfig = z.infer<
6258
+ typeof mcpOAuthRuntimeConfigSchema
6259
+ >;
6260
+
6261
+ declare const mcpOAuthRuntimeConfigSchema: z.ZodObject<
6262
+ {
6263
+ oidc: z.ZodObject<
6264
+ {
6265
+ issuer: z.ZodURL;
6266
+ jwksUrl: z.ZodURL;
6267
+ audience: z.ZodOptional<z.ZodString>;
6268
+ },
6269
+ z.core.$strip
6270
+ >;
6271
+ browserLogin: z.ZodObject<
6272
+ {
6273
+ url: z.ZodURL;
6274
+ tokenUrl: z.ZodOptional<z.ZodURL>;
6275
+ clientId: z.ZodOptional<z.ZodString>;
6276
+ clientSecret: z.ZodOptional<z.ZodString>;
6277
+ scope: z.ZodDefault<z.ZodString>;
6278
+ audience: z.ZodOptional<z.ZodString>;
6279
+ remoteTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6280
+ stateTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6281
+ sessionTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6282
+ },
6283
+ z.core.$strict
6284
+ >;
6285
+ gateway: z.ZodDefault<
6286
+ z.ZodOptional<
6287
+ z.ZodDefault<
6288
+ z.ZodObject<
6289
+ {
6290
+ accessTokenTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6291
+ refreshTokenTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6292
+ cimdEnabled: z.ZodDefault<z.ZodBoolean>;
6293
+ },
6294
+ z.core.$strict
6295
+ >
6296
+ >
6297
+ >
6298
+ >;
6299
+ },
6300
+ z.core.$strict
6301
+ >;
6302
+
6303
+ /**
6304
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6305
+ * with browser login delegated to Okta.
6306
+ *
6307
+ * Okta-friendly wrapper around `McpOAuthInboundPolicy`. Provide an Okta org
6308
+ * domain, optional authorization server id, client id, and client secret; the
6309
+ * constructor derives the Okta issuer, JWKS URL, authorize URL, and token URL.
6310
+ *
6311
+ * @title MCP Okta OAuth
6312
+ * @public
6313
+ * @product mcp-gateway
6314
+ */
6315
+ export declare class McpOktaOAuthInboundPolicy extends InboundPolicy<McpOktaOAuthInboundPolicyOptions> {
6316
+ #private;
6317
+ constructor(rawOptions: unknown, policyName: string);
6318
+ handler(
6319
+ request: ZuploRequest,
6320
+ context: ZuploContext
6321
+ ): Promise<ZuploRequest | Response>;
6322
+ }
6323
+
6324
+ /**
6325
+ * The options for this policy.
6326
+ * @public
6327
+ */
6328
+ export declare interface McpOktaOAuthInboundPolicyOptions {
6329
+ /**
6330
+ * The Okta org domain, without https://, a trailing slash, or a path.
6331
+ */
6332
+ oktaDomain: string;
6333
+ /**
6334
+ * Optional Okta custom authorization server id. Omit this to use the org authorization server.
6335
+ */
6336
+ authorizationServerId?: string;
6337
+ /**
6338
+ * The Okta OIDC application client_id registered for the gateway's browser login flow.
6339
+ */
6340
+ clientId: string;
6341
+ /**
6342
+ * The Okta OIDC application client_secret. Use $env(...) to source from a secret environment variable.
6343
+ */
6344
+ clientSecret: string;
6345
+ /**
6346
+ * OIDC scopes requested during browser login.
6347
+ */
6348
+ scope?: string;
6349
+ /**
6350
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6351
+ */
6352
+ gateway?: {
6353
+ /**
6354
+ * Lifetime of access tokens issued by /oauth/token.
6355
+ */
6356
+ accessTokenTtlSeconds?: number;
6357
+ /**
6358
+ * Lifetime of refresh tokens issued by /oauth/token.
6359
+ */
6360
+ refreshTokenTtlSeconds?: number;
6361
+ /**
6362
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6363
+ */
6364
+ cimdEnabled?: boolean;
6365
+ };
6366
+ /**
6367
+ * Optional overrides for the derived browser-login settings.
6368
+ */
6369
+ browserLoginOverrides?: {
6370
+ remoteTimeoutMs?: number;
6371
+ stateTtlSeconds?: number;
6372
+ sessionTtlSeconds?: number;
6373
+ };
6374
+ }
6375
+
6376
+ /**
6377
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6378
+ * with browser login delegated to OneLogin.
6379
+ *
6380
+ * OneLogin-friendly wrapper around `McpOAuthInboundPolicy`. Provide the
6381
+ * OneLogin account subdomain, client id, and client secret; the constructor
6382
+ * derives OneLogin's OIDC issuer, JWKS URL, authorize URL, and token URL.
6383
+ *
6384
+ * @title MCP OneLogin OAuth
6385
+ * @public
6386
+ * @product mcp-gateway
6387
+ */
6388
+ export declare class McpOneLoginOAuthInboundPolicy extends InboundPolicy<McpOneLoginOAuthInboundPolicyOptions> {
6389
+ #private;
6390
+ constructor(rawOptions: unknown, policyName: string);
6391
+ handler(
6392
+ request: ZuploRequest,
6393
+ context: ZuploContext
6394
+ ): Promise<ZuploRequest | Response>;
6395
+ }
6396
+
6397
+ /**
6398
+ * The options for this policy.
6399
+ * @public
6400
+ */
6401
+ export declare interface McpOneLoginOAuthInboundPolicyOptions {
6402
+ /**
6403
+ * The OneLogin account subdomain, without https://, .onelogin.com, a trailing slash, or a path.
6404
+ */
6405
+ oneLoginSubdomain: string;
6406
+ /**
6407
+ * The OneLogin OIDC application client_id registered for the gateway's browser login flow.
6408
+ */
6409
+ clientId: string;
6410
+ /**
6411
+ * The OneLogin OIDC application client_secret. Use $env(...) to source from a secret environment variable.
6412
+ */
6413
+ clientSecret: string;
6414
+ /**
6415
+ * OIDC scopes requested during browser login.
6416
+ */
6417
+ scope?: string;
6418
+ /**
6419
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6420
+ */
6421
+ gateway?: {
6422
+ /**
6423
+ * Lifetime of access tokens issued by /oauth/token.
6424
+ */
6425
+ accessTokenTtlSeconds?: number;
6426
+ /**
6427
+ * Lifetime of refresh tokens issued by /oauth/token.
6428
+ */
6429
+ refreshTokenTtlSeconds?: number;
6430
+ /**
6431
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6432
+ */
6433
+ cimdEnabled?: boolean;
6434
+ };
6435
+ /**
6436
+ * Optional overrides for the derived browser-login settings.
6437
+ */
6438
+ browserLoginOverrides?: {
6439
+ remoteTimeoutMs?: number;
6440
+ stateTtlSeconds?: number;
6441
+ sessionTtlSeconds?: number;
6442
+ };
6443
+ }
6444
+
6445
+ /**
6446
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6447
+ * with browser login delegated to PingOne.
6448
+ *
6449
+ * PingOne-friendly wrapper around `McpOAuthInboundPolicy`. Provide a PingOne
6450
+ * environment ID plus optional region, or a PingOne custom domain, with client
6451
+ * ID and client secret; the constructor derives the PingOne issuer, JWKS URL,
6452
+ * authorize URL, and token URL.
6453
+ *
6454
+ * @title MCP Ping OAuth
6455
+ * @public
6456
+ * @product mcp-gateway
6457
+ */
6458
+ export declare class McpPingOAuthInboundPolicy extends InboundPolicy<McpPingOAuthInboundPolicyOptions> {
6459
+ #private;
6460
+ constructor(rawOptions: unknown, policyName: string);
6461
+ handler(
6462
+ request: ZuploRequest,
6463
+ context: ZuploContext
6464
+ ): Promise<ZuploRequest | Response>;
6465
+ }
6466
+
6467
+ /**
6468
+ * The options for this policy.
6469
+ * @public
6470
+ */
6471
+ export declare interface McpPingOAuthInboundPolicyOptions {
6472
+ /**
6473
+ * The PingOne environment ID. Required unless customDomain is set.
6474
+ */
6475
+ environmentId?: string;
6476
+ /**
6477
+ * The PingOne geography for the environment. Ignored when customDomain is set.
6478
+ */
6479
+ region?:
6480
+ | "north-america"
6481
+ | "canada"
6482
+ | "europe"
6483
+ | "singapore"
6484
+ | "australia"
6485
+ | "asia-pacific";
6486
+ /**
6487
+ * Optional PingOne custom domain, without https://, a trailing slash, or a path. When set, environmentId and region are not used.
6488
+ */
6489
+ customDomain?: string;
6490
+ /**
6491
+ * The PingOne OIDC application client_id registered for the gateway's browser login flow.
6492
+ */
6493
+ clientId: string;
6494
+ /**
6495
+ * The PingOne OIDC application client_secret. Use $env(...) to source from a secret environment variable.
6496
+ */
6497
+ clientSecret: string;
6498
+ /**
6499
+ * OIDC scopes requested during browser login.
6500
+ */
6501
+ scope?: string;
6502
+ /**
6503
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6504
+ */
6505
+ gateway?: {
6506
+ /**
6507
+ * Lifetime of access tokens issued by /oauth/token.
6508
+ */
6509
+ accessTokenTtlSeconds?: number;
6510
+ /**
6511
+ * Lifetime of refresh tokens issued by /oauth/token.
6512
+ */
6513
+ refreshTokenTtlSeconds?: number;
6514
+ /**
6515
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6516
+ */
6517
+ cimdEnabled?: boolean;
6518
+ };
6519
+ /**
6520
+ * Optional overrides for the derived browser-login settings.
6521
+ */
6522
+ browserLoginOverrides?: {
6523
+ remoteTimeoutMs?: number;
6524
+ stateTtlSeconds?: number;
6525
+ sessionTtlSeconds?: number;
6526
+ };
6527
+ }
6528
+
5646
6529
  /**
5647
6530
  * An MCP Server handler for Zuplo
5648
6531
  * Only POST requests are supported for the HTTP streamable MCP transport.
@@ -5657,6 +6540,72 @@ export declare function mcpServerHandler(
5657
6540
  context: ZuploContext
5658
6541
  ): Promise<Response>;
5659
6542
 
6543
+ /**
6544
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6545
+ * with browser login delegated to WorkOS.
6546
+ *
6547
+ * WorkOS-friendly wrapper around `McpOAuthInboundPolicy`. Provide `clientId`
6548
+ * and `clientSecret`; the constructor derives the WorkOS OIDC issuer, JWKS URL,
6549
+ * authorize URL, and token URL automatically and runs the resulting shape
6550
+ * through the same Zod schema as the generic policy.
6551
+ *
6552
+ * @title MCP WorkOS OAuth
6553
+ * @public
6554
+ * @product mcp-gateway
6555
+ */
6556
+ export declare class McpWorkosOAuthInboundPolicy extends InboundPolicy<McpWorkosOAuthInboundPolicyOptions> {
6557
+ #private;
6558
+ constructor(rawOptions: unknown, policyName: string);
6559
+ handler(
6560
+ request: ZuploRequest,
6561
+ context: ZuploContext
6562
+ ): Promise<ZuploRequest | Response>;
6563
+ }
6564
+
6565
+ /**
6566
+ * The options for this policy.
6567
+ * @public
6568
+ */
6569
+ export declare interface McpWorkosOAuthInboundPolicyOptions {
6570
+ /**
6571
+ * The WorkOS client_id registered for the gateway's browser login flow. The OIDC issuer and JWKS URL are derived from this client ID.
6572
+ */
6573
+ clientId: string;
6574
+ /**
6575
+ * The WorkOS client_secret. Use $env(...) to source from a secret environment variable.
6576
+ */
6577
+ clientSecret: string;
6578
+ /**
6579
+ * OIDC scopes requested during browser login.
6580
+ */
6581
+ scope?: string;
6582
+ /**
6583
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6584
+ */
6585
+ gateway?: {
6586
+ /**
6587
+ * Lifetime of access tokens issued by /oauth/token.
6588
+ */
6589
+ accessTokenTtlSeconds?: number;
6590
+ /**
6591
+ * Lifetime of refresh tokens issued by /oauth/token.
6592
+ */
6593
+ refreshTokenTtlSeconds?: number;
6594
+ /**
6595
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6596
+ */
6597
+ cimdEnabled?: boolean;
6598
+ };
6599
+ /**
6600
+ * Optional overrides for the derived browser-login settings.
6601
+ */
6602
+ browserLoginOverrides?: {
6603
+ remoteTimeoutMs?: number;
6604
+ stateTtlSeconds?: number;
6605
+ sessionTtlSeconds?: number;
6606
+ };
6607
+ }
6608
+
5660
6609
  declare interface MemoryCacheOptions {
5661
6610
  maxSize: number;
5662
6611
  }