@zuplo/runtime 6.73.29 → 6.73.30

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.
@@ -1,5 +1,3 @@
1
- import { z } from "zod/v4";
2
-
3
1
  /**
4
2
  * Optional per-caller access control. Defaults to mode 'allPublic' (no access control). Set mode to 'rolesAndGroups' to match the caller's role/group claims against each capability's markup (a capability with no roles/groups/public markup is available to no one), or 'function' to delegate to a custom resolver.
5
3
  * @public
@@ -622,6 +620,27 @@ declare type IdJagClientAuth =
622
620
  expiresInSeconds?: number;
623
621
  };
624
622
 
623
+ /**
624
+ * Hand-written mirror of {@link idJagConfigSchema}'s parsed output. Keeping
625
+ * the type hand-written keeps zod out of the public policy class signatures
626
+ * (this type is part of {@link McpOAuthRuntimeConfig}); the assertion below
627
+ * fails to compile on drift.
628
+ */
629
+ declare type IdJagRuntimeConfig =
630
+ | {
631
+ enabled: false;
632
+ }
633
+ | {
634
+ enabled: true;
635
+ trustedIssuers: {
636
+ issuer: string;
637
+ jwksUrl: string;
638
+ expectedClientIds?: string[];
639
+ subjectMapping: "iss_prefix" | "iss_tenant_prefix" | "sub_id_only";
640
+ }[];
641
+ authorizationDetailsTypesAllowed?: string[];
642
+ };
643
+
625
644
  /**
626
645
  * A policy that can modify the incoming HTTP request before it is sent to
627
646
  * the handler. If a response is returned, the request is short-circuited and
@@ -1086,7 +1105,7 @@ declare interface Logger extends BaseLogger {
1086
1105
  * @title MCP Auth0 OAuth
1087
1106
  * @product mcp-gateway
1088
1107
  */
1089
- export declare class McpAuth0OAuthInboundPolicy extends InboundPolicy<ValidatedAuth0OAuthOptions> {
1108
+ export declare class McpAuth0OAuthInboundPolicy extends InboundPolicy<McpAuth0OAuthInboundPolicyOptions> {
1090
1109
  #private;
1091
1110
  static readonly policyType = "mcp-auth0-oauth";
1092
1111
  constructor(rawOptions: unknown, policyName: string);
@@ -1215,44 +1234,6 @@ export declare interface McpAuth0OAuthInboundPolicyOptions {
1215
1234
  };
1216
1235
  }
1217
1236
 
1218
- declare const mcpAuth0OAuthOptionsSchema: z.ZodObject<
1219
- {
1220
- auth0Domain: z.ZodString;
1221
- audience: z.ZodOptional<z.ZodString>;
1222
- clientId: z.ZodString;
1223
- clientSecret: z.ZodString;
1224
- scope: z.ZodOptional<z.ZodString>;
1225
- gateway: z.ZodOptional<
1226
- z.ZodObject<
1227
- {
1228
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
1229
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
1230
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
1231
- },
1232
- z.core.$strict
1233
- >
1234
- >;
1235
- idJag: z.ZodOptional<z.ZodUnknown>;
1236
- browserLoginOverrides: z.ZodOptional<
1237
- z.ZodObject<
1238
- {
1239
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
1240
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
1241
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
1242
- pkce: z.ZodOptional<
1243
- z.ZodEnum<{
1244
- none: "none";
1245
- S256: "S256";
1246
- }>
1247
- >;
1248
- },
1249
- z.core.$strict
1250
- >
1251
- >;
1252
- },
1253
- z.core.$strict
1254
- >;
1255
-
1256
1237
  /**
1257
1238
  * Curate MCP capabilities advertised and reachable through `McpProxyHandler`.
1258
1239
  *
@@ -1269,7 +1250,7 @@ declare const mcpAuth0OAuthOptionsSchema: z.ZodObject<
1269
1250
  * @title MCP Capability Filter
1270
1251
  * @product mcp-gateway
1271
1252
  */
1272
- export declare class McpCapabilityFilterInboundPolicy extends InboundPolicy<ValidatedOptions> {
1253
+ export declare class McpCapabilityFilterInboundPolicy extends InboundPolicy<McpCapabilityFilterInboundPolicyOptions> {
1273
1254
  #private;
1274
1255
  static readonly policyType = "mcp-capability-filter";
1275
1256
  constructor(rawOptions: unknown, policyName: string);
@@ -1303,124 +1284,6 @@ export declare interface McpCapabilityFilterInboundPolicyOptions {
1303
1284
  accessControl?: AccessControl;
1304
1285
  }
1305
1286
 
1306
- declare const mcpCapabilityFilterOptionsSchema: z.ZodObject<
1307
- {
1308
- tools: z.ZodOptional<
1309
- z.ZodArray<
1310
- z.ZodUnion<
1311
- readonly [
1312
- z.ZodString,
1313
- z.ZodObject<
1314
- {
1315
- name: z.ZodString;
1316
- description: z.ZodOptional<z.ZodString>;
1317
- annotations: z.ZodOptional<
1318
- z.ZodRecord<z.ZodString, z.ZodUnknown>
1319
- >;
1320
- _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1321
- roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1322
- groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
1323
- public: z.ZodOptional<z.ZodBoolean>;
1324
- },
1325
- z.core.$strict
1326
- >,
1327
- ]
1328
- >
1329
- >
1330
- >;
1331
- prompts: z.ZodOptional<
1332
- z.ZodArray<
1333
- z.ZodUnion<
1334
- readonly [
1335
- z.ZodString,
1336
- z.ZodObject<
1337
- {
1338
- name: z.ZodString;
1339
- description: z.ZodOptional<z.ZodString>;
1340
- _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1341
- roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1342
- groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
1343
- public: z.ZodOptional<z.ZodBoolean>;
1344
- },
1345
- z.core.$strict
1346
- >,
1347
- ]
1348
- >
1349
- >
1350
- >;
1351
- resources: z.ZodOptional<
1352
- z.ZodArray<
1353
- z.ZodUnion<
1354
- readonly [
1355
- z.ZodString,
1356
- z.ZodObject<
1357
- {
1358
- uri: z.ZodString;
1359
- name: z.ZodOptional<z.ZodString>;
1360
- description: z.ZodOptional<z.ZodString>;
1361
- mimeType: z.ZodOptional<z.ZodString>;
1362
- _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1363
- roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1364
- groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
1365
- public: z.ZodOptional<z.ZodBoolean>;
1366
- },
1367
- z.core.$strict
1368
- >,
1369
- ]
1370
- >
1371
- >
1372
- >;
1373
- resourceTemplates: z.ZodOptional<
1374
- z.ZodArray<
1375
- z.ZodUnion<
1376
- readonly [
1377
- z.ZodString,
1378
- z.ZodObject<
1379
- {
1380
- uriTemplate: z.ZodString;
1381
- name: z.ZodOptional<z.ZodString>;
1382
- description: z.ZodOptional<z.ZodString>;
1383
- mimeType: z.ZodOptional<z.ZodString>;
1384
- _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1385
- roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1386
- groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
1387
- public: z.ZodOptional<z.ZodBoolean>;
1388
- },
1389
- z.core.$strict
1390
- >,
1391
- ]
1392
- >
1393
- >
1394
- >;
1395
- accessControl: z.ZodOptional<
1396
- z.ZodObject<
1397
- {
1398
- mode: z.ZodOptional<
1399
- z.ZodEnum<{
1400
- function: "function";
1401
- allPublic: "allPublic";
1402
- rolesAndGroups: "rolesAndGroups";
1403
- }>
1404
- >;
1405
- roleClaim: z.ZodOptional<z.ZodString>;
1406
- groupClaim: z.ZodOptional<z.ZodString>;
1407
- identifier: z.ZodOptional<
1408
- z.ZodObject<
1409
- {
1410
- module: z.ZodUnknown;
1411
- export: z.ZodString;
1412
- },
1413
- z.core.$strict
1414
- >
1415
- >;
1416
- },
1417
- z.core.$strict
1418
- >
1419
- >;
1420
- },
1421
- z.core.$strict
1422
- >;
1423
-
1424
1287
  /**
1425
1288
  * Resolves, per request, which MCP capabilities a caller may see and invoke.
1426
1289
  *
@@ -1431,6 +1294,13 @@ declare const mcpCapabilityFilterOptionsSchema: z.ZodObject<
1431
1294
  * `accessControl.identifier: { module, export }` to derive access any other way,
1432
1295
  * e.g. from an external entitlements API.
1433
1296
  *
1297
+ * The `options` argument is the policy's configuration as authored in
1298
+ * `policies.json`, with one caveat: `accessControl.identifier.module` is typed
1299
+ * as the `$import(...)` string that was written there, but the value at runtime
1300
+ * is the imported module itself — the build resolves `$import(...)` before the
1301
+ * policy runs. It only ever describes how this resolver was loaded, so a
1302
+ * resolver has no reason to read it.
1303
+ *
1434
1304
  * @public
1435
1305
  */
1436
1306
  export declare type McpCapabilityResolver = (
@@ -1451,7 +1321,7 @@ export declare type McpCapabilityResolver = (
1451
1321
  * @public
1452
1322
  * @product mcp-gateway
1453
1323
  */
1454
- export declare class McpClerkOAuthInboundPolicy extends InboundPolicy<ValidatedClerkOAuthOptions> {
1324
+ export declare class McpClerkOAuthInboundPolicy extends InboundPolicy<McpClerkOAuthInboundPolicyOptions> {
1455
1325
  #private;
1456
1326
  static readonly policyType = "mcp-clerk-oauth";
1457
1327
  constructor(rawOptions: unknown, policyName: string);
@@ -1572,37 +1442,6 @@ export declare interface McpClerkOAuthInboundPolicyOptions {
1572
1442
  };
1573
1443
  }
1574
1444
 
1575
- declare const mcpClerkOAuthOptionsSchema: z.ZodObject<
1576
- {
1577
- frontendApiUrl: z.ZodString;
1578
- clientId: z.ZodString;
1579
- clientSecret: z.ZodString;
1580
- scope: z.ZodOptional<z.ZodString>;
1581
- gateway: z.ZodOptional<
1582
- z.ZodObject<
1583
- {
1584
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
1585
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
1586
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
1587
- },
1588
- z.core.$strict
1589
- >
1590
- >;
1591
- idJag: z.ZodOptional<z.ZodUnknown>;
1592
- browserLoginOverrides: z.ZodOptional<
1593
- z.ZodObject<
1594
- {
1595
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
1596
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
1597
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
1598
- },
1599
- z.core.$strict
1600
- >
1601
- >;
1602
- },
1603
- z.core.$strict
1604
- >;
1605
-
1606
1445
  /**
1607
1446
  * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
1608
1447
  * with browser login delegated to Amazon Cognito.
@@ -1616,7 +1455,7 @@ declare const mcpClerkOAuthOptionsSchema: z.ZodObject<
1616
1455
  * @public
1617
1456
  * @product mcp-gateway
1618
1457
  */
1619
- export declare class McpCognitoOAuthInboundPolicy extends InboundPolicy<ValidatedCognitoOAuthOptions> {
1458
+ export declare class McpCognitoOAuthInboundPolicy extends InboundPolicy<McpCognitoOAuthInboundPolicyOptions> {
1620
1459
  #private;
1621
1460
  static readonly policyType = "mcp-cognito-oauth";
1622
1461
  constructor(rawOptions: unknown, policyName: string);
@@ -1749,45 +1588,6 @@ export declare interface McpCognitoOAuthInboundPolicyOptions {
1749
1588
  };
1750
1589
  }
1751
1590
 
1752
- declare const mcpCognitoOAuthOptionsSchema: z.ZodObject<
1753
- {
1754
- awsRegion: z.ZodString;
1755
- userPoolId: z.ZodString;
1756
- userPoolDomain: z.ZodString;
1757
- clientId: z.ZodString;
1758
- clientSecret: z.ZodString;
1759
- scope: z.ZodOptional<z.ZodString>;
1760
- gateway: z.ZodOptional<
1761
- z.ZodObject<
1762
- {
1763
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
1764
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
1765
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
1766
- },
1767
- z.core.$strict
1768
- >
1769
- >;
1770
- idJag: z.ZodOptional<z.ZodUnknown>;
1771
- browserLoginOverrides: z.ZodOptional<
1772
- z.ZodObject<
1773
- {
1774
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
1775
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
1776
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
1777
- pkce: z.ZodOptional<
1778
- z.ZodEnum<{
1779
- none: "none";
1780
- S256: "S256";
1781
- }>
1782
- >;
1783
- },
1784
- z.core.$strict
1785
- >
1786
- >;
1787
- },
1788
- z.core.$strict
1789
- >;
1790
-
1791
1591
  /**
1792
1592
  * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
1793
1593
  * with browser login delegated to Microsoft Entra ID.
@@ -1800,7 +1600,7 @@ declare const mcpCognitoOAuthOptionsSchema: z.ZodObject<
1800
1600
  * @public
1801
1601
  * @product mcp-gateway
1802
1602
  */
1803
- export declare class McpEntraOAuthInboundPolicy extends InboundPolicy<ValidatedEntraOAuthOptions> {
1603
+ export declare class McpEntraOAuthInboundPolicy extends InboundPolicy<McpEntraOAuthInboundPolicyOptions> {
1804
1604
  #private;
1805
1605
  static readonly policyType = "mcp-entra-oauth";
1806
1606
  constructor(rawOptions: unknown, policyName: string);
@@ -1925,43 +1725,6 @@ export declare interface McpEntraOAuthInboundPolicyOptions {
1925
1725
  };
1926
1726
  }
1927
1727
 
1928
- declare const mcpEntraOAuthOptionsSchema: z.ZodObject<
1929
- {
1930
- tenantId: z.ZodString;
1931
- clientId: z.ZodString;
1932
- clientSecret: z.ZodString;
1933
- scope: z.ZodOptional<z.ZodString>;
1934
- gateway: z.ZodOptional<
1935
- z.ZodObject<
1936
- {
1937
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
1938
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
1939
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
1940
- },
1941
- z.core.$strict
1942
- >
1943
- >;
1944
- idJag: z.ZodOptional<z.ZodUnknown>;
1945
- browserLoginOverrides: z.ZodOptional<
1946
- z.ZodObject<
1947
- {
1948
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
1949
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
1950
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
1951
- pkce: z.ZodOptional<
1952
- z.ZodEnum<{
1953
- none: "none";
1954
- S256: "S256";
1955
- }>
1956
- >;
1957
- },
1958
- z.core.$strict
1959
- >
1960
- >;
1961
- },
1962
- z.core.$strict
1963
- >;
1964
-
1965
1728
  /**
1966
1729
  * Activates the MCP Gateway internal routes (OAuth authorization server,
1967
1730
  * upstream connection management, well-known metadata) on the runtime router.
@@ -2032,7 +1795,7 @@ export declare interface McpGatewayPluginOptions {
2032
1795
  * @public
2033
1796
  * @product mcp-gateway
2034
1797
  */
2035
- export declare class McpGoogleOAuthInboundPolicy extends InboundPolicy<ValidatedGoogleOAuthOptions> {
1798
+ export declare class McpGoogleOAuthInboundPolicy extends InboundPolicy<McpGoogleOAuthInboundPolicyOptions> {
2036
1799
  #private;
2037
1800
  static readonly policyType = "mcp-google-oauth";
2038
1801
  constructor(rawOptions: unknown, policyName: string);
@@ -2153,42 +1916,6 @@ export declare interface McpGoogleOAuthInboundPolicyOptions {
2153
1916
  };
2154
1917
  }
2155
1918
 
2156
- declare const mcpGoogleOAuthOptionsSchema: z.ZodObject<
2157
- {
2158
- clientId: z.ZodString;
2159
- clientSecret: z.ZodString;
2160
- scope: z.ZodOptional<z.ZodString>;
2161
- gateway: z.ZodOptional<
2162
- z.ZodObject<
2163
- {
2164
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
2165
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
2166
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
2167
- },
2168
- z.core.$strict
2169
- >
2170
- >;
2171
- idJag: z.ZodOptional<z.ZodUnknown>;
2172
- browserLoginOverrides: z.ZodOptional<
2173
- z.ZodObject<
2174
- {
2175
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
2176
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
2177
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
2178
- pkce: z.ZodOptional<
2179
- z.ZodEnum<{
2180
- none: "none";
2181
- S256: "S256";
2182
- }>
2183
- >;
2184
- },
2185
- z.core.$strict
2186
- >
2187
- >;
2188
- },
2189
- z.core.$strict
2190
- >;
2191
-
2192
1919
  /**
2193
1920
  * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
2194
1921
  * with browser login delegated to Keycloak.
@@ -2202,7 +1929,7 @@ declare const mcpGoogleOAuthOptionsSchema: z.ZodObject<
2202
1929
  * @public
2203
1930
  * @product mcp-gateway
2204
1931
  */
2205
- export declare class McpKeycloakOAuthInboundPolicy extends InboundPolicy<ValidatedKeycloakOAuthOptions> {
1932
+ export declare class McpKeycloakOAuthInboundPolicy extends InboundPolicy<McpKeycloakOAuthInboundPolicyOptions> {
2206
1933
  #private;
2207
1934
  static readonly policyType = "mcp-keycloak-oauth";
2208
1935
  constructor(rawOptions: unknown, policyName: string);
@@ -2331,44 +2058,6 @@ export declare interface McpKeycloakOAuthInboundPolicyOptions {
2331
2058
  };
2332
2059
  }
2333
2060
 
2334
- declare const mcpKeycloakOAuthOptionsSchema: z.ZodObject<
2335
- {
2336
- keycloakBaseUrl: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
2337
- realm: z.ZodString;
2338
- clientId: z.ZodString;
2339
- clientSecret: z.ZodString;
2340
- scope: z.ZodOptional<z.ZodString>;
2341
- gateway: z.ZodOptional<
2342
- z.ZodObject<
2343
- {
2344
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
2345
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
2346
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
2347
- },
2348
- z.core.$strict
2349
- >
2350
- >;
2351
- idJag: z.ZodOptional<z.ZodUnknown>;
2352
- browserLoginOverrides: z.ZodOptional<
2353
- z.ZodObject<
2354
- {
2355
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
2356
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
2357
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
2358
- pkce: z.ZodOptional<
2359
- z.ZodEnum<{
2360
- none: "none";
2361
- S256: "S256";
2362
- }>
2363
- >;
2364
- },
2365
- z.core.$strict
2366
- >
2367
- >;
2368
- },
2369
- z.core.$strict
2370
- >;
2371
-
2372
2061
  /**
2373
2062
  * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
2374
2063
  * with browser login delegated to Logto.
@@ -2381,7 +2070,7 @@ declare const mcpKeycloakOAuthOptionsSchema: z.ZodObject<
2381
2070
  * @public
2382
2071
  * @product mcp-gateway
2383
2072
  */
2384
- export declare class McpLogtoOAuthInboundPolicy extends InboundPolicy<ValidatedLogtoOAuthOptions> {
2073
+ export declare class McpLogtoOAuthInboundPolicy extends InboundPolicy<McpLogtoOAuthInboundPolicyOptions> {
2385
2074
  #private;
2386
2075
  static readonly policyType = "mcp-logto-oauth";
2387
2076
  constructor(rawOptions: unknown, policyName: string);
@@ -2506,43 +2195,6 @@ export declare interface McpLogtoOAuthInboundPolicyOptions {
2506
2195
  };
2507
2196
  }
2508
2197
 
2509
- declare const mcpLogtoOAuthOptionsSchema: z.ZodObject<
2510
- {
2511
- logtoEndpoint: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
2512
- clientId: z.ZodString;
2513
- clientSecret: z.ZodString;
2514
- scope: z.ZodOptional<z.ZodString>;
2515
- gateway: z.ZodOptional<
2516
- z.ZodObject<
2517
- {
2518
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
2519
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
2520
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
2521
- },
2522
- z.core.$strict
2523
- >
2524
- >;
2525
- idJag: z.ZodOptional<z.ZodUnknown>;
2526
- browserLoginOverrides: z.ZodOptional<
2527
- z.ZodObject<
2528
- {
2529
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
2530
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
2531
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
2532
- pkce: z.ZodOptional<
2533
- z.ZodEnum<{
2534
- none: "none";
2535
- S256: "S256";
2536
- }>
2537
- >;
2538
- },
2539
- z.core.$strict
2540
- >
2541
- >;
2542
- },
2543
- z.core.$strict
2544
- >;
2545
-
2546
2198
  /**
2547
2199
  * Authenticate MCP gateway requests using a gateway-issued OAuth access token.
2548
2200
  *
@@ -2719,201 +2371,37 @@ export declare interface McpOAuthInboundPolicyOptions {
2719
2371
  };
2720
2372
  }
2721
2373
 
2722
- declare type McpOAuthRuntimeConfig = z.infer<
2723
- typeof mcpOAuthRuntimeConfigSchema
2724
- >;
2725
-
2726
- declare const mcpOAuthRuntimeConfigSchema: z.ZodPipe<
2727
- z.ZodObject<
2728
- {
2729
- oidc: z.ZodObject<
2730
- {
2731
- issuer: z.ZodURL;
2732
- jwksUrl: z.ZodURL;
2733
- audience: z.ZodOptional<z.ZodString>;
2734
- },
2735
- z.core.$strip
2736
- >;
2737
- browserLogin: z.ZodObject<
2738
- {
2739
- url: z.ZodURL;
2740
- tokenUrl: z.ZodOptional<z.ZodURL>;
2741
- clientId: z.ZodOptional<z.ZodString>;
2742
- clientSecret: z.ZodOptional<z.ZodString>;
2743
- scope: z.ZodDefault<z.ZodString>;
2744
- audience: z.ZodOptional<z.ZodString>;
2745
- pkce: z.ZodDefault<
2746
- z.ZodEnum<{
2747
- none: "none";
2748
- S256: "S256";
2749
- }>
2750
- >;
2751
- remoteTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
2752
- stateTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
2753
- sessionTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
2754
- },
2755
- z.core.$strict
2756
- >;
2757
- gateway: z.ZodPipe<
2758
- z.ZodDefault<
2759
- z.ZodObject<
2760
- {
2761
- accessTokenTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
2762
- refreshTokenTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
2763
- cimdEnabled: z.ZodDefault<z.ZodBoolean>;
2764
- },
2765
- z.core.$strict
2766
- >
2767
- >,
2768
- z.ZodTransform<
2769
- {
2770
- accessTokenTtlSeconds: number;
2771
- refreshTokenTtlSeconds: number;
2772
- downstreamCimdEnabled: boolean;
2773
- },
2774
- {
2775
- accessTokenTtlSeconds: number;
2776
- refreshTokenTtlSeconds: number;
2777
- cimdEnabled: boolean;
2778
- }
2779
- >
2780
- >;
2781
- idJag: z.ZodDefault<
2782
- z.ZodOptional<
2783
- z.ZodDefault<
2784
- z.ZodDiscriminatedUnion<
2785
- [
2786
- z.ZodObject<
2787
- {
2788
- enabled: z.ZodLiteral<false>;
2789
- },
2790
- z.core.$strict
2791
- >,
2792
- z.ZodObject<
2793
- {
2794
- enabled: z.ZodLiteral<true>;
2795
- trustedIssuers: z.ZodOptional<
2796
- z.ZodArray<
2797
- z.ZodObject<
2798
- {
2799
- issuer: z.ZodOptional<z.ZodURL>;
2800
- jwksUrl: z.ZodOptional<z.ZodURL>;
2801
- expectedClientIds: z.ZodOptional<
2802
- z.ZodArray<z.ZodString>
2803
- >;
2804
- subjectMapping: z.ZodDefault<
2805
- z.ZodEnum<{
2806
- iss_prefix: "iss_prefix";
2807
- iss_tenant_prefix: "iss_tenant_prefix";
2808
- sub_id_only: "sub_id_only";
2809
- }>
2810
- >;
2811
- },
2812
- z.core.$strict
2813
- >
2814
- >
2815
- >;
2816
- authorizationDetailsTypesAllowed: z.ZodOptional<
2817
- z.ZodArray<z.ZodString>
2818
- >;
2819
- },
2820
- z.core.$strict
2821
- >,
2822
- ]
2823
- >
2824
- >
2825
- >
2826
- >;
2827
- },
2828
- z.core.$strict
2829
- >,
2830
- z.ZodTransform<
2831
- {
2832
- idJag:
2833
- | {
2834
- enabled: false;
2835
- }
2836
- | {
2837
- enabled: true;
2838
- trustedIssuers: {
2839
- issuer: string;
2840
- jwksUrl: string;
2841
- subjectMapping:
2842
- | "iss_prefix"
2843
- | "iss_tenant_prefix"
2844
- | "sub_id_only";
2845
- expectedClientIds?: string[] | undefined;
2846
- }[];
2847
- authorizationDetailsTypesAllowed?: string[] | undefined;
2848
- };
2849
- oidc: {
2850
- issuer: string;
2851
- jwksUrl: string;
2852
- audience?: string | undefined;
2853
- };
2854
- browserLogin: {
2855
- url: string;
2856
- scope: string;
2857
- pkce: "none" | "S256";
2858
- remoteTimeoutMs: number;
2859
- stateTtlSeconds: number;
2860
- sessionTtlSeconds: number;
2861
- tokenUrl?: string | undefined;
2862
- clientId?: string | undefined;
2863
- clientSecret?: string | undefined;
2864
- audience?: string | undefined;
2865
- };
2866
- gateway: {
2867
- accessTokenTtlSeconds: number;
2868
- refreshTokenTtlSeconds: number;
2869
- downstreamCimdEnabled: boolean;
2870
- };
2871
- },
2872
- {
2873
- oidc: {
2874
- issuer: string;
2875
- jwksUrl: string;
2876
- audience?: string | undefined;
2877
- };
2878
- browserLogin: {
2879
- url: string;
2880
- scope: string;
2881
- pkce: "none" | "S256";
2882
- remoteTimeoutMs: number;
2883
- stateTtlSeconds: number;
2884
- sessionTtlSeconds: number;
2885
- tokenUrl?: string | undefined;
2886
- clientId?: string | undefined;
2887
- clientSecret?: string | undefined;
2888
- audience?: string | undefined;
2889
- };
2890
- gateway: {
2891
- accessTokenTtlSeconds: number;
2892
- refreshTokenTtlSeconds: number;
2893
- downstreamCimdEnabled: boolean;
2894
- };
2895
- idJag:
2896
- | {
2897
- enabled: false;
2898
- }
2899
- | {
2900
- enabled: true;
2901
- trustedIssuers?:
2902
- | {
2903
- subjectMapping:
2904
- | "iss_prefix"
2905
- | "iss_tenant_prefix"
2906
- | "sub_id_only";
2907
- issuer?: string | undefined;
2908
- jwksUrl?: string | undefined;
2909
- expectedClientIds?: string[] | undefined;
2910
- }[]
2911
- | undefined;
2912
- authorizationDetailsTypesAllowed?: string[] | undefined;
2913
- };
2914
- }
2915
- >
2916
- >;
2374
+ /**
2375
+ * The gateway's resolved OAuth runtime configuration — the parsed, defaulted
2376
+ * output of {@link mcpOAuthRuntimeConfigSchema}. Hand-written so the public
2377
+ * MCP OAuth policy class signatures contain no zod types; the assertion below
2378
+ * fails to compile if this interface drifts from the schema.
2379
+ */
2380
+ declare interface McpOAuthRuntimeConfig {
2381
+ oidc: {
2382
+ issuer: string;
2383
+ jwksUrl: string;
2384
+ audience?: string;
2385
+ };
2386
+ browserLogin: {
2387
+ url: string;
2388
+ tokenUrl?: string;
2389
+ clientId?: string;
2390
+ clientSecret?: string;
2391
+ scope: string;
2392
+ audience?: string;
2393
+ pkce: "S256" | "none";
2394
+ remoteTimeoutMs: number;
2395
+ stateTtlSeconds: number;
2396
+ sessionTtlSeconds: number;
2397
+ };
2398
+ gateway: {
2399
+ accessTokenTtlSeconds: number;
2400
+ refreshTokenTtlSeconds: number;
2401
+ downstreamCimdEnabled: boolean;
2402
+ };
2403
+ idJag: IdJagRuntimeConfig;
2404
+ }
2917
2405
 
2918
2406
  /**
2919
2407
  * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
@@ -2927,7 +2415,7 @@ declare const mcpOAuthRuntimeConfigSchema: z.ZodPipe<
2927
2415
  * @public
2928
2416
  * @product mcp-gateway
2929
2417
  */
2930
- export declare class McpOktaOAuthInboundPolicy extends InboundPolicy<ValidatedOktaOAuthOptions> {
2418
+ export declare class McpOktaOAuthInboundPolicy extends InboundPolicy<McpOktaOAuthInboundPolicyOptions> {
2931
2419
  #private;
2932
2420
  static readonly policyType = "mcp-okta-oauth";
2933
2421
  constructor(rawOptions: unknown, policyName: string);
@@ -3056,44 +2544,6 @@ export declare interface McpOktaOAuthInboundPolicyOptions {
3056
2544
  };
3057
2545
  }
3058
2546
 
3059
- declare const mcpOktaOAuthOptionsSchema: z.ZodObject<
3060
- {
3061
- oktaDomain: z.ZodString;
3062
- authorizationServerId: z.ZodOptional<z.ZodString>;
3063
- clientId: z.ZodString;
3064
- clientSecret: z.ZodString;
3065
- scope: z.ZodOptional<z.ZodString>;
3066
- gateway: z.ZodOptional<
3067
- z.ZodObject<
3068
- {
3069
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
3070
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
3071
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
3072
- },
3073
- z.core.$strict
3074
- >
3075
- >;
3076
- idJag: z.ZodOptional<z.ZodUnknown>;
3077
- browserLoginOverrides: z.ZodOptional<
3078
- z.ZodObject<
3079
- {
3080
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
3081
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
3082
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
3083
- pkce: z.ZodOptional<
3084
- z.ZodEnum<{
3085
- none: "none";
3086
- S256: "S256";
3087
- }>
3088
- >;
3089
- },
3090
- z.core.$strict
3091
- >
3092
- >;
3093
- },
3094
- z.core.$strict
3095
- >;
3096
-
3097
2547
  /**
3098
2548
  * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
3099
2549
  * with browser login delegated to OneLogin.
@@ -3106,7 +2556,7 @@ declare const mcpOktaOAuthOptionsSchema: z.ZodObject<
3106
2556
  * @public
3107
2557
  * @product mcp-gateway
3108
2558
  */
3109
- export declare class McpOneLoginOAuthInboundPolicy extends InboundPolicy<ValidatedOneLoginOAuthOptions> {
2559
+ export declare class McpOneLoginOAuthInboundPolicy extends InboundPolicy<McpOneLoginOAuthInboundPolicyOptions> {
3110
2560
  #private;
3111
2561
  static readonly policyType = "mcp-onelogin-oauth";
3112
2562
  constructor(rawOptions: unknown, policyName: string);
@@ -3227,37 +2677,6 @@ export declare interface McpOneLoginOAuthInboundPolicyOptions {
3227
2677
  };
3228
2678
  }
3229
2679
 
3230
- declare const mcpOneLoginOAuthOptionsSchema: z.ZodObject<
3231
- {
3232
- oneLoginSubdomain: z.ZodString;
3233
- clientId: z.ZodString;
3234
- clientSecret: z.ZodString;
3235
- scope: z.ZodOptional<z.ZodString>;
3236
- gateway: z.ZodOptional<
3237
- z.ZodObject<
3238
- {
3239
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
3240
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
3241
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
3242
- },
3243
- z.core.$strict
3244
- >
3245
- >;
3246
- idJag: z.ZodOptional<z.ZodUnknown>;
3247
- browserLoginOverrides: z.ZodOptional<
3248
- z.ZodObject<
3249
- {
3250
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
3251
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
3252
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
3253
- },
3254
- z.core.$strict
3255
- >
3256
- >;
3257
- },
3258
- z.core.$strict
3259
- >;
3260
-
3261
2680
  /**
3262
2681
  * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
3263
2682
  * with browser login delegated to PingOne.
@@ -3271,7 +2690,7 @@ declare const mcpOneLoginOAuthOptionsSchema: z.ZodObject<
3271
2690
  * @public
3272
2691
  * @product mcp-gateway
3273
2692
  */
3274
- export declare class McpPingOAuthInboundPolicy extends InboundPolicy<ValidatedPingOAuthOptions> {
2693
+ export declare class McpPingOAuthInboundPolicy extends InboundPolicy<McpPingOAuthInboundPolicyOptions> {
3275
2694
  #private;
3276
2695
  static readonly policyType = "mcp-ping-oauth";
3277
2696
  constructor(rawOptions: unknown, policyName: string);
@@ -3410,54 +2829,6 @@ export declare interface McpPingOAuthInboundPolicyOptions {
3410
2829
  };
3411
2830
  }
3412
2831
 
3413
- declare const mcpPingOAuthOptionsSchema: z.ZodObject<
3414
- {
3415
- environmentId: z.ZodOptional<z.ZodString>;
3416
- region: z.ZodOptional<
3417
- z.ZodEnum<{
3418
- "north-america": "north-america";
3419
- canada: "canada";
3420
- europe: "europe";
3421
- singapore: "singapore";
3422
- australia: "australia";
3423
- "asia-pacific": "asia-pacific";
3424
- }>
3425
- >;
3426
- customDomain: z.ZodOptional<z.ZodString>;
3427
- clientId: z.ZodString;
3428
- clientSecret: z.ZodString;
3429
- scope: z.ZodOptional<z.ZodString>;
3430
- gateway: z.ZodOptional<
3431
- z.ZodObject<
3432
- {
3433
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
3434
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
3435
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
3436
- },
3437
- z.core.$strict
3438
- >
3439
- >;
3440
- idJag: z.ZodOptional<z.ZodUnknown>;
3441
- browserLoginOverrides: z.ZodOptional<
3442
- z.ZodObject<
3443
- {
3444
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
3445
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
3446
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
3447
- pkce: z.ZodOptional<
3448
- z.ZodEnum<{
3449
- none: "none";
3450
- S256: "S256";
3451
- }>
3452
- >;
3453
- },
3454
- z.core.$strict
3455
- >
3456
- >;
3457
- },
3458
- z.core.$strict
3459
- >;
3460
-
3461
2832
  export declare function McpProxyHandler(
3462
2833
  request: ZuploRequest,
3463
2834
  context: ZuploContext
@@ -3477,6 +2848,7 @@ export declare function McpProxyHandler(
3477
2848
  * @product mcp-gateway
3478
2849
  */
3479
2850
  export declare class McpTokenExchangeInboundPolicy extends InboundPolicy<UpstreamTokenExchangePolicyOptions> {
2851
+ #private;
3480
2852
  static readonly policyType = "mcp-token-exchange";
3481
2853
  constructor(rawOptions: unknown, policyName: string);
3482
2854
  handler(
@@ -3597,7 +2969,7 @@ export declare interface McpTokenExchangeInboundPolicyOptions {
3597
2969
  * @public
3598
2970
  * @product mcp-gateway
3599
2971
  */
3600
- export declare class McpWorkosOAuthInboundPolicy extends InboundPolicy<ValidatedWorkosOAuthOptions> {
2972
+ export declare class McpWorkosOAuthInboundPolicy extends InboundPolicy<McpWorkosOAuthInboundPolicyOptions> {
3601
2973
  #private;
3602
2974
  static readonly policyType = "mcp-workos-oauth";
3603
2975
  constructor(rawOptions: unknown, policyName: string);
@@ -3718,42 +3090,6 @@ export declare interface McpWorkosOAuthInboundPolicyOptions {
3718
3090
  };
3719
3091
  }
3720
3092
 
3721
- declare const mcpWorkosOAuthOptionsSchema: z.ZodObject<
3722
- {
3723
- clientId: z.ZodString;
3724
- clientSecret: z.ZodString;
3725
- scope: z.ZodOptional<z.ZodString>;
3726
- gateway: z.ZodOptional<
3727
- z.ZodObject<
3728
- {
3729
- accessTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
3730
- refreshTokenTtlSeconds: z.ZodOptional<z.ZodNumber>;
3731
- cimdEnabled: z.ZodOptional<z.ZodBoolean>;
3732
- },
3733
- z.core.$strict
3734
- >
3735
- >;
3736
- idJag: z.ZodOptional<z.ZodUnknown>;
3737
- browserLoginOverrides: z.ZodOptional<
3738
- z.ZodObject<
3739
- {
3740
- remoteTimeoutMs: z.ZodOptional<z.ZodNumber>;
3741
- stateTtlSeconds: z.ZodOptional<z.ZodNumber>;
3742
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
3743
- pkce: z.ZodOptional<
3744
- z.ZodEnum<{
3745
- none: "none";
3746
- S256: "S256";
3747
- }>
3748
- >;
3749
- },
3750
- z.core.$strict
3751
- >
3752
- >;
3753
- },
3754
- z.core.$strict
3755
- >;
3756
-
3757
3093
  /**
3758
3094
  * Arbitrary MCP _meta fields to expose downstream.
3759
3095
  * @public
@@ -4597,6 +3933,23 @@ declare interface RequestUser<TUserData> {
4597
3933
  data: TUserData;
4598
3934
  }
4599
3935
 
3936
+ /**
3937
+ * Resolved upstream auth configuration, discriminated by auth mode.
3938
+ */
3939
+ declare type ResolvedUpstreamAuthConfig =
3940
+ | {
3941
+ mode: "shared-oauth";
3942
+ oauth: UpstreamOAuthConfig;
3943
+ }
3944
+ | {
3945
+ mode: "user-oauth";
3946
+ oauth: UpstreamOAuthConfig;
3947
+ }
3948
+ | {
3949
+ mode: "id-jag";
3950
+ idJag: UpstreamIdJagConfig;
3951
+ };
3952
+
4600
3953
  declare type ResolveRequestParams<
4601
3954
  TParams extends RequestParamsDefault | undefined,
4602
3955
  > = TParams extends RequestParamsDefault ? TParams : RequestParamsDefault;
@@ -4796,334 +4149,131 @@ declare interface ToolProjection {
4796
4149
  public?: Public;
4797
4150
  }
4798
4151
 
4799
- declare type UpstreamTokenExchangePolicyOptions = z.infer<
4800
- typeof upstreamTokenExchangePolicyOptionsSchema
4801
- >;
4802
-
4803
- declare const upstreamTokenExchangePolicyOptionsSchema: z.ZodObject<
4804
- {
4805
- id: z.core.$ZodBranded<z.ZodString, "UpstreamServerId">;
4806
- displayName: z.ZodString;
4807
- description: z.ZodOptional<z.ZodString>;
4808
- serverInfo: z.ZodOptional<
4809
- z.ZodObject<
4810
- {
4811
- version: z.ZodString;
4812
- websiteUrl: z.ZodOptional<z.ZodString>;
4813
- description: z.ZodOptional<z.ZodString>;
4814
- icons: z.ZodOptional<
4815
- z.ZodArray<
4816
- z.ZodObject<
4817
- {
4818
- src: z.ZodString;
4819
- mimeType: z.ZodOptional<z.ZodString>;
4820
- sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
4821
- theme: z.ZodOptional<
4822
- z.ZodEnum<{
4823
- light: "light";
4824
- dark: "dark";
4825
- }>
4826
- >;
4827
- },
4828
- z.core.$strip
4829
- >
4830
- >
4831
- >;
4832
- name: z.ZodString;
4833
- title: z.ZodOptional<z.ZodString>;
4834
- },
4835
- z.core.$strip
4836
- >
4837
- >;
4838
- protectedResourceMetadataUrl: z.ZodOptional<z.ZodURL>;
4839
- authMode: z.ZodEnum<{
4840
- "user-oauth": "user-oauth";
4841
- "shared-oauth": "shared-oauth";
4842
- "id-jag": "id-jag";
4843
- }>;
4844
- ownerMode: z.ZodEnum<{
4845
- user: "user";
4846
- shared: "shared";
4847
- }>;
4848
- authConfig: z.ZodDiscriminatedUnion<
4849
- [
4850
- z.ZodObject<
4851
- {
4852
- mode: z.ZodLiteral<"shared-oauth">;
4853
- oauth: z.ZodObject<
4854
- {
4855
- scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
4856
- scopeDelimiter: z.ZodDefault<z.ZodString>;
4857
- prompt: z.ZodOptional<
4858
- z.ZodUnion<
4859
- [
4860
- z.ZodEnum<{
4861
- none: "none";
4862
- login: "login";
4863
- consent: "consent";
4864
- select_account: "select_account";
4865
- }>,
4866
- z.ZodLiteral<false>,
4867
- ]
4868
- >
4869
- >;
4870
- clientRegistration: z.ZodDefault<
4871
- z.ZodDiscriminatedUnion<
4872
- [
4873
- z.ZodObject<
4874
- {
4875
- mode: z.ZodLiteral<"auto">;
4876
- },
4877
- z.core.$strict
4878
- >,
4879
- z.ZodObject<
4880
- {
4881
- mode: z.ZodLiteral<"manual">;
4882
- clientId: z.ZodString;
4883
- clientSecret: z.ZodOptional<z.ZodString>;
4884
- tokenEndpointAuthMethod: z.ZodDefault<
4885
- z.ZodEnum<{
4886
- none: "none";
4887
- client_secret_basic: "client_secret_basic";
4888
- client_secret_post: "client_secret_post";
4889
- }>
4890
- >;
4891
- },
4892
- z.core.$strict
4893
- >,
4894
- ]
4895
- >
4896
- >;
4897
- redirectPath: z.ZodString;
4898
- },
4899
- z.core.$strict
4900
- >;
4901
- },
4902
- z.core.$strict
4903
- >,
4904
- z.ZodObject<
4905
- {
4906
- mode: z.ZodLiteral<"user-oauth">;
4907
- oauth: z.ZodObject<
4908
- {
4909
- scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
4910
- scopeDelimiter: z.ZodDefault<z.ZodString>;
4911
- prompt: z.ZodOptional<
4912
- z.ZodUnion<
4913
- [
4914
- z.ZodEnum<{
4915
- none: "none";
4916
- login: "login";
4917
- consent: "consent";
4918
- select_account: "select_account";
4919
- }>,
4920
- z.ZodLiteral<false>,
4921
- ]
4922
- >
4923
- >;
4924
- clientRegistration: z.ZodDefault<
4925
- z.ZodDiscriminatedUnion<
4926
- [
4927
- z.ZodObject<
4928
- {
4929
- mode: z.ZodLiteral<"auto">;
4930
- },
4931
- z.core.$strict
4932
- >,
4933
- z.ZodObject<
4934
- {
4935
- mode: z.ZodLiteral<"manual">;
4936
- clientId: z.ZodString;
4937
- clientSecret: z.ZodOptional<z.ZodString>;
4938
- tokenEndpointAuthMethod: z.ZodDefault<
4939
- z.ZodEnum<{
4940
- none: "none";
4941
- client_secret_basic: "client_secret_basic";
4942
- client_secret_post: "client_secret_post";
4943
- }>
4944
- >;
4945
- },
4946
- z.core.$strict
4947
- >,
4948
- ]
4949
- >
4950
- >;
4951
- redirectPath: z.ZodString;
4952
- },
4953
- z.core.$strict
4954
- >;
4955
- },
4956
- z.core.$strict
4957
- >,
4958
- z.ZodObject<
4959
- {
4960
- mode: z.ZodLiteral<"id-jag">;
4961
- idJag: z.ZodObject<
4962
- {
4963
- scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
4964
- scopeDelimiter: z.ZodDefault<z.ZodString>;
4965
- idp: z.ZodObject<
4966
- {
4967
- tokenUrl: z.ZodURL;
4968
- clientAuth: z.ZodDiscriminatedUnion<
4969
- [
4970
- z.ZodObject<
4971
- {
4972
- method: z.ZodLiteral<"client_secret_post">;
4973
- clientId: z.ZodString;
4974
- clientSecret: z.ZodString;
4975
- },
4976
- z.core.$strict
4977
- >,
4978
- z.ZodObject<
4979
- {
4980
- method: z.ZodLiteral<"client_secret_basic">;
4981
- clientId: z.ZodString;
4982
- clientSecret: z.ZodString;
4983
- },
4984
- z.core.$strict
4985
- >,
4986
- z.ZodObject<
4987
- {
4988
- method: z.ZodLiteral<"private_key_jwt">;
4989
- clientId: z.ZodString;
4990
- privateKeyPem: z.ZodString;
4991
- algorithm: z.ZodDefault<
4992
- z.ZodEnum<{
4993
- RS256: "RS256";
4994
- RS384: "RS384";
4995
- RS512: "RS512";
4996
- ES256: "ES256";
4997
- ES384: "ES384";
4998
- ES512: "ES512";
4999
- }>
5000
- >;
5001
- keyId: z.ZodOptional<z.ZodString>;
5002
- audience: z.ZodOptional<z.ZodURL>;
5003
- expiresInSeconds: z.ZodDefault<z.ZodNumber>;
5004
- },
5005
- z.core.$strict
5006
- >,
5007
- ]
5008
- >;
5009
- },
5010
- z.core.$strict
5011
- >;
5012
- resourceAs: z.ZodObject<
5013
- {
5014
- tokenUrl: z.ZodURL;
5015
- audience: z.ZodString;
5016
- resource: z.ZodOptional<z.ZodString>;
5017
- clientAuth: z.ZodDiscriminatedUnion<
5018
- [
5019
- z.ZodObject<
5020
- {
5021
- method: z.ZodLiteral<"client_secret_post">;
5022
- clientId: z.ZodString;
5023
- clientSecret: z.ZodString;
5024
- },
5025
- z.core.$strict
5026
- >,
5027
- z.ZodObject<
5028
- {
5029
- method: z.ZodLiteral<"client_secret_basic">;
5030
- clientId: z.ZodString;
5031
- clientSecret: z.ZodString;
5032
- },
5033
- z.core.$strict
5034
- >,
5035
- z.ZodObject<
5036
- {
5037
- method: z.ZodLiteral<"private_key_jwt">;
5038
- clientId: z.ZodString;
5039
- privateKeyPem: z.ZodString;
5040
- algorithm: z.ZodDefault<
5041
- z.ZodEnum<{
5042
- RS256: "RS256";
5043
- RS384: "RS384";
5044
- RS512: "RS512";
5045
- ES256: "ES256";
5046
- ES384: "ES384";
5047
- ES512: "ES512";
5048
- }>
5049
- >;
5050
- keyId: z.ZodOptional<z.ZodString>;
5051
- audience: z.ZodOptional<z.ZodURL>;
5052
- expiresInSeconds: z.ZodDefault<z.ZodNumber>;
5053
- },
5054
- z.core.$strict
5055
- >,
5056
- ]
5057
- >;
5058
- },
5059
- z.core.$strict
5060
- >;
5061
- },
5062
- z.core.$strict
5063
- >;
5064
- },
5065
- z.core.$strict
5066
- >,
5067
- ]
5068
- >;
5069
- },
5070
- z.core.$strict
5071
- >;
4152
+ /**
4153
+ * Client authentication for the ID-JAG token exchange legs.
4154
+ */
4155
+ declare type UpstreamIdJagClientAuthConfig =
4156
+ | {
4157
+ method: "client_secret_post";
4158
+ clientId: string;
4159
+ clientSecret: string;
4160
+ }
4161
+ | {
4162
+ method: "client_secret_basic";
4163
+ clientId: string;
4164
+ clientSecret: string;
4165
+ }
4166
+ | {
4167
+ method: "private_key_jwt";
4168
+ clientId: string;
4169
+ privateKeyPem: string;
4170
+ algorithm: "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512";
4171
+ keyId?: string;
4172
+ audience?: string;
4173
+ expiresInSeconds: number;
4174
+ };
5072
4175
 
5073
- declare interface UrlConfig {
5074
- defaultUrl: string;
5075
- urls: string[];
4176
+ /**
4177
+ * Resolved ID-JAG (identity-chaining JWT authorization grant) configuration.
4178
+ */
4179
+ declare interface UpstreamIdJagConfig {
4180
+ scopes: string[];
4181
+ scopeDelimiter: string;
4182
+ idp: {
4183
+ tokenUrl: string;
4184
+ clientAuth: UpstreamIdJagClientAuthConfig;
4185
+ };
4186
+ resourceAs: {
4187
+ tokenUrl: string;
4188
+ audience: string;
4189
+ resource?: string;
4190
+ clientAuth: UpstreamIdJagClientAuthConfig;
4191
+ };
5076
4192
  }
5077
4193
 
5078
- declare type UserDataDefault = any;
5079
-
5080
- declare type ValidatedAuth0OAuthOptions = z.infer<
5081
- typeof mcpAuth0OAuthOptionsSchema
5082
- >;
5083
-
5084
- declare type ValidatedClerkOAuthOptions = z.infer<
5085
- typeof mcpClerkOAuthOptionsSchema
5086
- >;
5087
-
5088
- declare type ValidatedCognitoOAuthOptions = z.infer<
5089
- typeof mcpCognitoOAuthOptionsSchema
5090
- >;
5091
-
5092
- declare type ValidatedEntraOAuthOptions = z.infer<
5093
- typeof mcpEntraOAuthOptionsSchema
5094
- >;
5095
-
5096
- declare type ValidatedGoogleOAuthOptions = z.infer<
5097
- typeof mcpGoogleOAuthOptionsSchema
5098
- >;
5099
-
5100
- declare type ValidatedKeycloakOAuthOptions = z.infer<
5101
- typeof mcpKeycloakOAuthOptionsSchema
5102
- >;
4194
+ /**
4195
+ * Resolved upstream OAuth client registration: dynamic registration
4196
+ * (`auto`) or a pre-registered client (`manual`).
4197
+ */
4198
+ declare type UpstreamOAuthClientRegistrationConfig =
4199
+ | {
4200
+ mode: "auto";
4201
+ }
4202
+ | {
4203
+ mode: "manual";
4204
+ clientId: string;
4205
+ clientSecret?: string;
4206
+ tokenEndpointAuthMethod:
4207
+ | "none"
4208
+ | "client_secret_basic"
4209
+ | "client_secret_post";
4210
+ };
5103
4211
 
5104
- declare type ValidatedLogtoOAuthOptions = z.infer<
5105
- typeof mcpLogtoOAuthOptionsSchema
5106
- >;
4212
+ /**
4213
+ * Resolved upstream OAuth profile configuration (scopes, prompt override,
4214
+ * client registration, and the gateway-derived redirect path).
4215
+ */
4216
+ declare interface UpstreamOAuthConfig {
4217
+ scopes: string[];
4218
+ scopeDelimiter: string;
4219
+ prompt?: UpstreamOAuthPromptOverride;
4220
+ clientRegistration: UpstreamOAuthClientRegistrationConfig;
4221
+ redirectPath: string;
4222
+ }
5107
4223
 
5108
- declare type ValidatedOktaOAuthOptions = z.infer<
5109
- typeof mcpOktaOAuthOptionsSchema
5110
- >;
4224
+ /**
4225
+ * Overrides the OIDC `prompt` parameter on upstream authorization requests.
4226
+ * See {@link upstreamOAuthPromptOverrideSchema} for semantics.
4227
+ */
4228
+ declare type UpstreamOAuthPromptOverride =
4229
+ | "none"
4230
+ | "login"
4231
+ | "consent"
4232
+ | "select_account"
4233
+ | false
4234
+ | undefined;
5111
4235
 
5112
- declare type ValidatedOneLoginOAuthOptions = z.infer<
5113
- typeof mcpOneLoginOAuthOptionsSchema
5114
- >;
4236
+ /**
4237
+ * Upstream MCP server implementation metadata (MCP `Implementation` shape).
4238
+ */
4239
+ declare interface UpstreamServerInfo {
4240
+ name: string;
4241
+ title?: string;
4242
+ version: string;
4243
+ websiteUrl?: string;
4244
+ description?: string;
4245
+ icons?: {
4246
+ src: string;
4247
+ mimeType?: string;
4248
+ sizes?: string[];
4249
+ theme?: "light" | "dark";
4250
+ }[];
4251
+ }
5115
4252
 
5116
- declare type ValidatedOptions = z.infer<
5117
- typeof mcpCapabilityFilterOptionsSchema
5118
- >;
4253
+ /**
4254
+ * Validated options of the MCP token exchange policy — a fully-resolved
4255
+ * upstream MCP connection. This is the public shape exposed on the policy
4256
+ * class; it is identical to {@link ResolvedUpstreamTokenExchangePolicyOptions}
4257
+ * except that the internal `UpstreamServerId` brand on `id` is widened to a
4258
+ * plain `string`.
4259
+ */
4260
+ declare interface UpstreamTokenExchangePolicyOptions {
4261
+ id: string;
4262
+ displayName: string;
4263
+ description?: string;
4264
+ serverInfo?: UpstreamServerInfo;
4265
+ protectedResourceMetadataUrl?: string;
4266
+ authMode: "shared-oauth" | "user-oauth" | "id-jag";
4267
+ ownerMode: "user" | "shared";
4268
+ authConfig: ResolvedUpstreamAuthConfig;
4269
+ }
5119
4270
 
5120
- declare type ValidatedPingOAuthOptions = z.infer<
5121
- typeof mcpPingOAuthOptionsSchema
5122
- >;
4271
+ declare interface UrlConfig {
4272
+ defaultUrl: string;
4273
+ urls: string[];
4274
+ }
5123
4275
 
5124
- declare type ValidatedWorkosOAuthOptions = z.infer<
5125
- typeof mcpWorkosOAuthOptionsSchema
5126
- >;
4276
+ declare type UserDataDefault = any;
5127
4277
 
5128
4278
  /**
5129
4279
  * @public