@frontmcp/auth 1.0.4 → 1.1.0-beta.1
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/authorities/authorities.context.d.ts +63 -0
- package/authorities/authorities.context.d.ts.map +1 -0
- package/authorities/authorities.engine.d.ts +65 -0
- package/authorities/authorities.engine.d.ts.map +1 -0
- package/authorities/authorities.errors.d.ts +59 -0
- package/authorities/authorities.errors.d.ts.map +1 -0
- package/authorities/authorities.evaluator.d.ts +28 -0
- package/authorities/authorities.evaluator.d.ts.map +1 -0
- package/authorities/authorities.metadata-augment.d.ts +31 -0
- package/authorities/authorities.metadata-augment.d.ts.map +1 -0
- package/authorities/authorities.profiles.d.ts +75 -0
- package/authorities/authorities.profiles.d.ts.map +1 -0
- package/authorities/authorities.registry.d.ts +86 -0
- package/authorities/authorities.registry.d.ts.map +1 -0
- package/authorities/authorities.schema.d.ts +24 -0
- package/authorities/authorities.schema.d.ts.map +1 -0
- package/authorities/authorities.scope-mapping.d.ts +16 -0
- package/authorities/authorities.scope-mapping.d.ts.map +1 -0
- package/authorities/authorities.types.d.ts +290 -0
- package/authorities/authorities.types.d.ts.map +1 -0
- package/authorities/index.d.ts +17 -0
- package/authorities/index.d.ts.map +1 -0
- package/authorization/authorization.class.d.ts +2 -3
- package/authorization/authorization.class.d.ts.map +1 -1
- package/authorization/authorization.types.d.ts +53 -54
- package/authorization/authorization.types.d.ts.map +1 -1
- package/authorization/index.d.ts +1 -1
- package/authorization/index.d.ts.map +1 -1
- package/cimd/cimd.types.d.ts +90 -90
- package/cimd/cimd.types.d.ts.map +1 -1
- package/common/jwt.types.d.ts +16 -16
- package/common/jwt.types.d.ts.map +1 -1
- package/common/session.types.d.ts +75 -76
- package/common/session.types.d.ts.map +1 -1
- package/common/zod-utils.d.ts +1 -1
- package/common/zod-utils.d.ts.map +1 -1
- package/consent/consent.types.d.ts +69 -69
- package/consent/consent.types.d.ts.map +1 -1
- package/context/frontmcp-auth-context.d.ts +113 -0
- package/context/frontmcp-auth-context.d.ts.map +1 -0
- package/context/frontmcp-auth-context.factory.d.ts +39 -0
- package/context/frontmcp-auth-context.factory.d.ts.map +1 -0
- package/context/frontmcp-auth-context.impl.d.ts +72 -0
- package/context/frontmcp-auth-context.impl.d.ts.map +1 -0
- package/context/index.d.ts +16 -0
- package/context/index.d.ts.map +1 -0
- package/detection/auth-provider-detection.d.ts +25 -25
- package/detection/auth-provider-detection.d.ts.map +1 -1
- package/esm/index.mjs +1036 -120
- package/esm/package.json +5 -5
- package/fetch/fetch-credential-middleware.d.ts +99 -0
- package/fetch/fetch-credential-middleware.d.ts.map +1 -0
- package/fetch/index.d.ts +10 -0
- package/fetch/index.d.ts.map +1 -0
- package/index.d.ts +6 -2
- package/index.d.ts.map +1 -1
- package/index.js +1619 -680
- package/machine-id/index.d.ts +1 -1
- package/machine-id/index.d.ts.map +1 -1
- package/options/app-auth.schema.d.ts +235 -235
- package/options/app-auth.schema.d.ts.map +1 -1
- package/options/orchestrated.schema.d.ts +371 -371
- package/options/orchestrated.schema.d.ts.map +1 -1
- package/options/public.schema.d.ts +16 -16
- package/options/public.schema.d.ts.map +1 -1
- package/options/schema.d.ts +227 -227
- package/options/schema.d.ts.map +1 -1
- package/options/shared.schemas.d.ts +97 -97
- package/options/shared.schemas.d.ts.map +1 -1
- package/options/transparent.schema.d.ts +30 -30
- package/options/transparent.schema.d.ts.map +1 -1
- package/options/typecheck.d.ts.map +1 -1
- package/package.json +5 -5
- package/session/authorization-vault.d.ts +380 -380
- package/session/authorization-vault.d.ts.map +1 -1
- package/session/authorization.store.d.ts +28 -29
- package/session/authorization.store.d.ts.map +1 -1
- package/session/encrypted-authorization-vault.d.ts +21 -21
- package/session/encrypted-authorization-vault.d.ts.map +1 -1
- package/session/transport-session.types.d.ts +166 -167
- package/session/transport-session.types.d.ts.map +1 -1
- package/session/vault-encryption.d.ts +27 -27
- package/session/vault-encryption.d.ts.map +1 -1
- package/vault/auth-providers.types.d.ts +45 -46
- package/vault/auth-providers.types.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -237,6 +237,11 @@ __export(index_exports, {
|
|
|
237
237
|
AuthProvidersNotConfiguredError: () => AuthProvidersNotConfiguredError,
|
|
238
238
|
AuthProvidersRegistry: () => AuthProvidersRegistry,
|
|
239
239
|
AuthProvidersVault: () => AuthProvidersVault,
|
|
240
|
+
AuthoritiesContextBuilder: () => AuthoritiesContextBuilder,
|
|
241
|
+
AuthoritiesEngine: () => AuthoritiesEngine,
|
|
242
|
+
AuthoritiesEvaluatorRegistry: () => AuthoritiesEvaluatorRegistry,
|
|
243
|
+
AuthoritiesProfileRegistry: () => AuthoritiesProfileRegistry,
|
|
244
|
+
AuthorityDeniedError: () => AuthorityDeniedError,
|
|
240
245
|
AuthorizationBase: () => AuthorizationBase,
|
|
241
246
|
CDN: () => CDN,
|
|
242
247
|
CimdClientIdMismatchError: () => CimdClientIdMismatchError,
|
|
@@ -254,10 +259,12 @@ __export(index_exports, {
|
|
|
254
259
|
EagerCredentialLoader: () => EagerCredentialLoader,
|
|
255
260
|
ElicitationSecretRequiredError: () => ElicitationSecretRequiredError,
|
|
256
261
|
EncryptedRedisVault: () => EncryptedRedisVault,
|
|
257
|
-
EncryptedStorageError: () =>
|
|
258
|
-
EncryptedTypedStorage: () =>
|
|
262
|
+
EncryptedStorageError: () => import_utils16.EncryptedStorageError,
|
|
263
|
+
EncryptedTypedStorage: () => import_utils16.EncryptedTypedStorage,
|
|
259
264
|
EncryptionContextNotSetError: () => EncryptionContextNotSetError,
|
|
260
265
|
EncryptionKeyNotConfiguredError: () => EncryptionKeyNotConfiguredError,
|
|
266
|
+
FetchCredentialMiddleware: () => FetchCredentialMiddleware,
|
|
267
|
+
FrontMcpAuthContextImpl: () => FrontMcpAuthContextImpl,
|
|
261
268
|
InMemoryAuthorizationStore: () => InMemoryAuthorizationStore,
|
|
262
269
|
InMemoryAuthorizationVault: () => InMemoryAuthorizationVault,
|
|
263
270
|
InMemoryCimdCache: () => InMemoryCimdCache,
|
|
@@ -291,11 +298,14 @@ __export(index_exports, {
|
|
|
291
298
|
TokenVault: () => TokenVault,
|
|
292
299
|
TransparentAuthorization: () => TransparentAuthorization,
|
|
293
300
|
TransportIdGenerator: () => TransportIdGenerator,
|
|
294
|
-
TypedStorage: () =>
|
|
301
|
+
TypedStorage: () => import_utils15.TypedStorage,
|
|
295
302
|
VaultEncryption: () => VaultEncryption,
|
|
296
303
|
VaultLoadError: () => VaultLoadError,
|
|
297
304
|
VaultNotFoundError: () => VaultNotFoundError,
|
|
298
305
|
VercelKvSessionStore: () => VercelKvSessionStore,
|
|
306
|
+
abacConditionSchema: () => abacConditionSchema,
|
|
307
|
+
abacOperatorSchema: () => abacOperatorSchema,
|
|
308
|
+
abacPolicySchema: () => abacPolicySchema,
|
|
299
309
|
aiPlatformTypeSchema: () => aiPlatformTypeSchema,
|
|
300
310
|
allowsPublicAccess: () => allowsPublicAccess,
|
|
301
311
|
apiKeyCredentialSchema: () => apiKeyCredentialSchema,
|
|
@@ -311,13 +321,20 @@ __export(index_exports, {
|
|
|
311
321
|
authProviderMappingSchema: () => authProviderMappingSchema,
|
|
312
322
|
authProvidersVaultOptionsSchema: () => authProvidersVaultOptionsSchema,
|
|
313
323
|
authUserSchema: () => authUserSchema,
|
|
324
|
+
authoritiesClaimsMappingSchema: () => authoritiesClaimsMappingSchema,
|
|
325
|
+
authoritiesConfigSchema: () => authoritiesConfigSchema,
|
|
326
|
+
authoritiesMetadataSchema: () => authoritiesMetadataSchema,
|
|
327
|
+
authoritiesPolicySchema: () => authoritiesPolicySchema,
|
|
314
328
|
authorizationCodeRecordSchema: () => authorizationCodeRecordSchema,
|
|
315
329
|
authorizationVaultEntrySchema: () => authorizationVaultEntrySchema,
|
|
316
330
|
authorizedPromptSchema: () => authorizedPromptSchema,
|
|
317
331
|
authorizedToolSchema: () => authorizedToolSchema,
|
|
318
332
|
baseLayout: () => baseLayout,
|
|
333
|
+
basicApplier: () => basicApplier,
|
|
319
334
|
basicAuthCredentialSchema: () => basicAuthCredentialSchema,
|
|
335
|
+
bearerApplier: () => bearerApplier,
|
|
320
336
|
bearerCredentialSchema: () => bearerCredentialSchema,
|
|
337
|
+
buildAuthContext: () => buildAuthContext,
|
|
321
338
|
buildConsentPage: () => buildConsentPage,
|
|
322
339
|
buildErrorPage: () => buildErrorPage,
|
|
323
340
|
buildFederatedLoginPage: () => buildFederatedLoginPage,
|
|
@@ -352,9 +369,9 @@ __export(index_exports, {
|
|
|
352
369
|
credentialTypeSchema: () => credentialTypeSchema,
|
|
353
370
|
customCredentialSchema: () => customCredentialSchema,
|
|
354
371
|
decodeJwtPayloadSafe: () => decodeJwtPayloadSafe,
|
|
355
|
-
decryptAesGcm: () =>
|
|
372
|
+
decryptAesGcm: () => import_utils23.decryptAesGcm,
|
|
356
373
|
decryptSessionJson: () => decryptSessionJson,
|
|
357
|
-
decryptValue: () =>
|
|
374
|
+
decryptValue: () => import_utils23.decryptValue,
|
|
358
375
|
defaultSessionRateLimiter: () => defaultSessionRateLimiter,
|
|
359
376
|
deriveAuthorizationId: () => deriveAuthorizationId,
|
|
360
377
|
deriveExpectedAudience: () => deriveExpectedAudience,
|
|
@@ -362,9 +379,9 @@ __export(index_exports, {
|
|
|
362
379
|
deriveTypedUser: () => deriveTypedUser,
|
|
363
380
|
detectAuthProviders: () => detectAuthProviders,
|
|
364
381
|
detectedAuthProviderSchema: () => detectedAuthProviderSchema,
|
|
365
|
-
encryptAesGcm: () =>
|
|
382
|
+
encryptAesGcm: () => import_utils23.encryptAesGcm,
|
|
366
383
|
encryptJson: () => encryptJson,
|
|
367
|
-
encryptValue: () =>
|
|
384
|
+
encryptValue: () => import_utils23.encryptValue,
|
|
368
385
|
encryptedBlobSchema: () => encryptedBlobSchema,
|
|
369
386
|
encryptedDataSchema: () => encryptedDataSchema,
|
|
370
387
|
encryptedVaultEntrySchema: () => encryptedVaultEntrySchema,
|
|
@@ -382,15 +399,16 @@ __export(index_exports, {
|
|
|
382
399
|
generatePkceChallenge: () => generatePkceChallenge,
|
|
383
400
|
getCredentialOptionsSchema: () => getCredentialOptionsSchema,
|
|
384
401
|
getKey: () => getKey,
|
|
385
|
-
getMachineId: () => getMachineId,
|
|
386
402
|
getNextProvider: () => getNextProvider,
|
|
387
403
|
getProviderApps: () => getProviderApps,
|
|
388
404
|
getProviderScopes: () => getProviderScopes,
|
|
389
405
|
getTokenSignatureFingerprint: () => getTokenSignatureFingerprint,
|
|
390
406
|
hasOnlyLocalhostRedirectUris: () => hasOnlyLocalhostRedirectUris,
|
|
391
|
-
|
|
407
|
+
headerApplier: () => headerApplier,
|
|
408
|
+
hkdfSha256: () => import_utils23.hkdfSha256,
|
|
392
409
|
incrementalAuthConfigSchema: () => incrementalAuthConfigSchema,
|
|
393
410
|
isCimdClientId: () => isCimdClientId,
|
|
411
|
+
isFrontMcpCredentials: () => isFrontMcpCredentials,
|
|
394
412
|
isJwt: () => isJwt,
|
|
395
413
|
isLocalMode: () => isLocalMode,
|
|
396
414
|
isOrchestratedLocal: () => isOrchestratedLocal,
|
|
@@ -428,17 +446,22 @@ __export(index_exports, {
|
|
|
428
446
|
providerConfigSchema: () => providerConfigSchema,
|
|
429
447
|
publicAccessConfigSchema: () => publicAccessConfigSchema,
|
|
430
448
|
publicAuthOptionsSchema: () => publicAuthOptionsSchema,
|
|
449
|
+
queryApplier: () => queryApplier,
|
|
450
|
+
rbacPermissionsPolicySchema: () => rbacPermissionsPolicySchema,
|
|
451
|
+
rbacRolesPolicySchema: () => rbacRolesPolicySchema,
|
|
452
|
+
rebacPolicySchema: () => rebacPolicySchema,
|
|
431
453
|
redisConfigSchema: () => redisConfigSchema,
|
|
432
454
|
redisVaultEntrySchema: () => redisVaultEntrySchema,
|
|
433
455
|
remoteAuthSchema: () => remoteAuthSchema,
|
|
434
456
|
remoteProviderConfigSchema: () => remoteProviderConfigSchema,
|
|
435
457
|
renderToHtml: () => renderToHtml,
|
|
436
458
|
resetCachedKey: () => resetCachedKey,
|
|
459
|
+
resolveRequiredScopes: () => resolveRequiredScopes,
|
|
460
|
+
resourceIdRefSchema: () => resourceIdRefSchema,
|
|
437
461
|
safeDecrypt: () => safeDecrypt,
|
|
438
462
|
serviceAccountCredentialSchema: () => serviceAccountCredentialSchema,
|
|
439
463
|
sessionIdPayloadSchema: () => sessionIdPayloadSchema,
|
|
440
464
|
sessionJwtPayloadSchema: () => sessionJwtPayloadSchema,
|
|
441
|
-
setMachineIdOverride: () => setMachineIdOverride,
|
|
442
465
|
signSession: () => signSession,
|
|
443
466
|
skippedAppBehaviorSchema: () => skippedAppBehaviorSchema,
|
|
444
467
|
sseTransportStateSchema: () => sseTransportStateSchema,
|
|
@@ -1401,33 +1424,33 @@ function renderToHtml(html, _options) {
|
|
|
1401
1424
|
}
|
|
1402
1425
|
|
|
1403
1426
|
// libs/auth/src/session/authorization.store.ts
|
|
1427
|
+
var import_lazy_zod = require("@frontmcp/lazy-zod");
|
|
1404
1428
|
var import_utils4 = require("@frontmcp/utils");
|
|
1405
|
-
var
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
method: import_zod.z.literal("S256")
|
|
1429
|
+
var pkceChallengeSchema = import_lazy_zod.z.object({
|
|
1430
|
+
challenge: import_lazy_zod.z.string().min(43).max(128),
|
|
1431
|
+
method: import_lazy_zod.z.literal("S256")
|
|
1409
1432
|
});
|
|
1410
|
-
var authorizationCodeRecordSchema =
|
|
1411
|
-
code:
|
|
1412
|
-
clientId:
|
|
1413
|
-
redirectUri:
|
|
1414
|
-
scopes:
|
|
1433
|
+
var authorizationCodeRecordSchema = import_lazy_zod.z.object({
|
|
1434
|
+
code: import_lazy_zod.z.string().min(1),
|
|
1435
|
+
clientId: import_lazy_zod.z.string().min(1),
|
|
1436
|
+
redirectUri: import_lazy_zod.z.string().url(),
|
|
1437
|
+
scopes: import_lazy_zod.z.array(import_lazy_zod.z.string()),
|
|
1415
1438
|
pkce: pkceChallengeSchema,
|
|
1416
|
-
userSub:
|
|
1417
|
-
userEmail:
|
|
1418
|
-
userName:
|
|
1419
|
-
state:
|
|
1420
|
-
createdAt:
|
|
1421
|
-
expiresAt:
|
|
1422
|
-
used:
|
|
1423
|
-
resource:
|
|
1439
|
+
userSub: import_lazy_zod.z.string().min(1),
|
|
1440
|
+
userEmail: import_lazy_zod.z.string().email().optional(),
|
|
1441
|
+
userName: import_lazy_zod.z.string().optional(),
|
|
1442
|
+
state: import_lazy_zod.z.string().optional(),
|
|
1443
|
+
createdAt: import_lazy_zod.z.number(),
|
|
1444
|
+
expiresAt: import_lazy_zod.z.number(),
|
|
1445
|
+
used: import_lazy_zod.z.boolean(),
|
|
1446
|
+
resource: import_lazy_zod.z.string().url().optional(),
|
|
1424
1447
|
// Consent and federated login fields
|
|
1425
|
-
selectedToolIds:
|
|
1426
|
-
selectedProviderIds:
|
|
1427
|
-
skippedProviderIds:
|
|
1428
|
-
consentEnabled:
|
|
1429
|
-
federatedLoginUsed:
|
|
1430
|
-
pendingAuthId:
|
|
1448
|
+
selectedToolIds: import_lazy_zod.z.array(import_lazy_zod.z.string()).optional(),
|
|
1449
|
+
selectedProviderIds: import_lazy_zod.z.array(import_lazy_zod.z.string()).optional(),
|
|
1450
|
+
skippedProviderIds: import_lazy_zod.z.array(import_lazy_zod.z.string()).optional(),
|
|
1451
|
+
consentEnabled: import_lazy_zod.z.boolean().optional(),
|
|
1452
|
+
federatedLoginUsed: import_lazy_zod.z.boolean().optional(),
|
|
1453
|
+
pendingAuthId: import_lazy_zod.z.string().optional()
|
|
1431
1454
|
});
|
|
1432
1455
|
function verifyPkce(codeVerifier, challenge) {
|
|
1433
1456
|
if (challenge.method !== "S256") {
|
|
@@ -1680,8 +1703,8 @@ var RedisAuthorizationStore = class {
|
|
|
1680
1703
|
};
|
|
1681
1704
|
|
|
1682
1705
|
// libs/auth/src/session/authorization-vault.ts
|
|
1683
|
-
var
|
|
1684
|
-
var credentialTypeSchema =
|
|
1706
|
+
var import_lazy_zod2 = require("@frontmcp/lazy-zod");
|
|
1707
|
+
var credentialTypeSchema = import_lazy_zod2.z.enum([
|
|
1685
1708
|
"oauth",
|
|
1686
1709
|
// OAuth 2.0 tokens
|
|
1687
1710
|
"api_key",
|
|
@@ -1703,135 +1726,135 @@ var credentialTypeSchema = import_zod2.z.enum([
|
|
|
1703
1726
|
"oauth_pkce"
|
|
1704
1727
|
// OAuth 2.0 with PKCE for public clients
|
|
1705
1728
|
]);
|
|
1706
|
-
var oauthCredentialSchema =
|
|
1707
|
-
type:
|
|
1729
|
+
var oauthCredentialSchema = import_lazy_zod2.z.object({
|
|
1730
|
+
type: import_lazy_zod2.z.literal("oauth"),
|
|
1708
1731
|
/** Access token */
|
|
1709
|
-
accessToken:
|
|
1732
|
+
accessToken: import_lazy_zod2.z.string(),
|
|
1710
1733
|
/** Refresh token (optional) */
|
|
1711
|
-
refreshToken:
|
|
1734
|
+
refreshToken: import_lazy_zod2.z.string().optional(),
|
|
1712
1735
|
/** Token type (usually 'Bearer') */
|
|
1713
|
-
tokenType:
|
|
1736
|
+
tokenType: import_lazy_zod2.z.string().default("Bearer"),
|
|
1714
1737
|
/** Token expiration timestamp (epoch ms) */
|
|
1715
|
-
expiresAt:
|
|
1738
|
+
expiresAt: import_lazy_zod2.z.number().optional(),
|
|
1716
1739
|
/** Granted scopes */
|
|
1717
|
-
scopes:
|
|
1740
|
+
scopes: import_lazy_zod2.z.array(import_lazy_zod2.z.string()).default([]),
|
|
1718
1741
|
/** ID token for OIDC (optional) */
|
|
1719
|
-
idToken:
|
|
1742
|
+
idToken: import_lazy_zod2.z.string().optional()
|
|
1720
1743
|
});
|
|
1721
|
-
var apiKeyCredentialSchema =
|
|
1722
|
-
type:
|
|
1744
|
+
var apiKeyCredentialSchema = import_lazy_zod2.z.object({
|
|
1745
|
+
type: import_lazy_zod2.z.literal("api_key"),
|
|
1723
1746
|
/** The API key value */
|
|
1724
|
-
key:
|
|
1747
|
+
key: import_lazy_zod2.z.string().min(1),
|
|
1725
1748
|
/** Header name to use (e.g., 'X-API-Key', 'Authorization') */
|
|
1726
|
-
headerName:
|
|
1749
|
+
headerName: import_lazy_zod2.z.string().default("X-API-Key"),
|
|
1727
1750
|
/** Prefix for the header value (e.g., 'Bearer ', 'Api-Key ') */
|
|
1728
|
-
headerPrefix:
|
|
1751
|
+
headerPrefix: import_lazy_zod2.z.string().optional(),
|
|
1729
1752
|
/** Alternative: send as query parameter */
|
|
1730
|
-
queryParam:
|
|
1753
|
+
queryParam: import_lazy_zod2.z.string().optional()
|
|
1731
1754
|
});
|
|
1732
|
-
var basicAuthCredentialSchema =
|
|
1733
|
-
type:
|
|
1755
|
+
var basicAuthCredentialSchema = import_lazy_zod2.z.object({
|
|
1756
|
+
type: import_lazy_zod2.z.literal("basic"),
|
|
1734
1757
|
/** Username */
|
|
1735
|
-
username:
|
|
1758
|
+
username: import_lazy_zod2.z.string().min(1),
|
|
1736
1759
|
/** Password */
|
|
1737
|
-
password:
|
|
1760
|
+
password: import_lazy_zod2.z.string(),
|
|
1738
1761
|
/** Pre-computed base64 encoded value (optional, for caching) */
|
|
1739
|
-
encodedValue:
|
|
1762
|
+
encodedValue: import_lazy_zod2.z.string().optional()
|
|
1740
1763
|
});
|
|
1741
|
-
var bearerCredentialSchema =
|
|
1742
|
-
type:
|
|
1764
|
+
var bearerCredentialSchema = import_lazy_zod2.z.object({
|
|
1765
|
+
type: import_lazy_zod2.z.literal("bearer"),
|
|
1743
1766
|
/** The bearer token value */
|
|
1744
|
-
token:
|
|
1767
|
+
token: import_lazy_zod2.z.string().min(1),
|
|
1745
1768
|
/** Token expiration (optional, for static tokens that expire) */
|
|
1746
|
-
expiresAt:
|
|
1769
|
+
expiresAt: import_lazy_zod2.z.number().optional()
|
|
1747
1770
|
});
|
|
1748
|
-
var privateKeyCredentialSchema =
|
|
1749
|
-
type:
|
|
1771
|
+
var privateKeyCredentialSchema = import_lazy_zod2.z.object({
|
|
1772
|
+
type: import_lazy_zod2.z.literal("private_key"),
|
|
1750
1773
|
/** Key format */
|
|
1751
|
-
format:
|
|
1774
|
+
format: import_lazy_zod2.z.enum(["pem", "jwk", "pkcs8", "pkcs12"]),
|
|
1752
1775
|
/** The key data (PEM string or JWK JSON) */
|
|
1753
|
-
keyData:
|
|
1776
|
+
keyData: import_lazy_zod2.z.string(),
|
|
1754
1777
|
/** Key ID (for JWK) */
|
|
1755
|
-
keyId:
|
|
1778
|
+
keyId: import_lazy_zod2.z.string().optional(),
|
|
1756
1779
|
/** Algorithm to use for signing */
|
|
1757
|
-
algorithm:
|
|
1780
|
+
algorithm: import_lazy_zod2.z.string().optional(),
|
|
1758
1781
|
/** Passphrase if key is encrypted */
|
|
1759
|
-
passphrase:
|
|
1782
|
+
passphrase: import_lazy_zod2.z.string().optional(),
|
|
1760
1783
|
/** Associated certificate (for mTLS) */
|
|
1761
|
-
certificate:
|
|
1784
|
+
certificate: import_lazy_zod2.z.string().optional()
|
|
1762
1785
|
});
|
|
1763
|
-
var mtlsCredentialSchema =
|
|
1764
|
-
type:
|
|
1786
|
+
var mtlsCredentialSchema = import_lazy_zod2.z.object({
|
|
1787
|
+
type: import_lazy_zod2.z.literal("mtls"),
|
|
1765
1788
|
/** Client certificate (PEM format) */
|
|
1766
|
-
certificate:
|
|
1789
|
+
certificate: import_lazy_zod2.z.string(),
|
|
1767
1790
|
/** Private key (PEM format) */
|
|
1768
|
-
privateKey:
|
|
1791
|
+
privateKey: import_lazy_zod2.z.string(),
|
|
1769
1792
|
/** Passphrase if private key is encrypted */
|
|
1770
|
-
passphrase:
|
|
1793
|
+
passphrase: import_lazy_zod2.z.string().optional(),
|
|
1771
1794
|
/** CA certificate chain (optional) */
|
|
1772
|
-
caCertificate:
|
|
1795
|
+
caCertificate: import_lazy_zod2.z.string().optional()
|
|
1773
1796
|
});
|
|
1774
|
-
var customCredentialSchema =
|
|
1775
|
-
type:
|
|
1797
|
+
var customCredentialSchema = import_lazy_zod2.z.object({
|
|
1798
|
+
type: import_lazy_zod2.z.literal("custom"),
|
|
1776
1799
|
/** Custom type identifier */
|
|
1777
|
-
customType:
|
|
1800
|
+
customType: import_lazy_zod2.z.string().min(1),
|
|
1778
1801
|
/** Arbitrary credential data */
|
|
1779
|
-
data:
|
|
1802
|
+
data: import_lazy_zod2.z.record(import_lazy_zod2.z.string(), import_lazy_zod2.z.unknown()),
|
|
1780
1803
|
/** Headers to include in requests */
|
|
1781
|
-
headers:
|
|
1804
|
+
headers: import_lazy_zod2.z.record(import_lazy_zod2.z.string(), import_lazy_zod2.z.string()).optional()
|
|
1782
1805
|
});
|
|
1783
|
-
var sshKeyCredentialSchema =
|
|
1784
|
-
type:
|
|
1806
|
+
var sshKeyCredentialSchema = import_lazy_zod2.z.object({
|
|
1807
|
+
type: import_lazy_zod2.z.literal("ssh_key"),
|
|
1785
1808
|
/** Private key (PEM format) */
|
|
1786
|
-
privateKey:
|
|
1809
|
+
privateKey: import_lazy_zod2.z.string().min(1),
|
|
1787
1810
|
/** Public key (optional, can be derived from private key) */
|
|
1788
|
-
publicKey:
|
|
1811
|
+
publicKey: import_lazy_zod2.z.string().optional(),
|
|
1789
1812
|
/** Passphrase if private key is encrypted */
|
|
1790
|
-
passphrase:
|
|
1813
|
+
passphrase: import_lazy_zod2.z.string().optional(),
|
|
1791
1814
|
/** Key type */
|
|
1792
|
-
keyType:
|
|
1815
|
+
keyType: import_lazy_zod2.z.enum(["rsa", "ed25519", "ecdsa", "dsa"]).default("ed25519"),
|
|
1793
1816
|
/** Key fingerprint (SHA256 hash) */
|
|
1794
|
-
fingerprint:
|
|
1817
|
+
fingerprint: import_lazy_zod2.z.string().optional(),
|
|
1795
1818
|
/** Username for SSH connections */
|
|
1796
|
-
username:
|
|
1819
|
+
username: import_lazy_zod2.z.string().optional()
|
|
1797
1820
|
});
|
|
1798
|
-
var serviceAccountCredentialSchema =
|
|
1799
|
-
type:
|
|
1821
|
+
var serviceAccountCredentialSchema = import_lazy_zod2.z.object({
|
|
1822
|
+
type: import_lazy_zod2.z.literal("service_account"),
|
|
1800
1823
|
/** Cloud provider */
|
|
1801
|
-
provider:
|
|
1824
|
+
provider: import_lazy_zod2.z.enum(["gcp", "aws", "azure", "custom"]),
|
|
1802
1825
|
/** Raw credentials (JSON key file content, access keys, etc.) */
|
|
1803
|
-
credentials:
|
|
1826
|
+
credentials: import_lazy_zod2.z.record(import_lazy_zod2.z.string(), import_lazy_zod2.z.unknown()),
|
|
1804
1827
|
/** Project/Account ID */
|
|
1805
|
-
projectId:
|
|
1828
|
+
projectId: import_lazy_zod2.z.string().optional(),
|
|
1806
1829
|
/** Region for regional services */
|
|
1807
|
-
region:
|
|
1830
|
+
region: import_lazy_zod2.z.string().optional(),
|
|
1808
1831
|
/** AWS: Role ARN to assume */
|
|
1809
|
-
assumeRoleArn:
|
|
1832
|
+
assumeRoleArn: import_lazy_zod2.z.string().optional(),
|
|
1810
1833
|
/** AWS: External ID for cross-account access */
|
|
1811
|
-
externalId:
|
|
1834
|
+
externalId: import_lazy_zod2.z.string().optional(),
|
|
1812
1835
|
/** Service account email (GCP) or ARN (AWS) */
|
|
1813
|
-
serviceAccountId:
|
|
1836
|
+
serviceAccountId: import_lazy_zod2.z.string().optional(),
|
|
1814
1837
|
/** Expiration timestamp for temporary credentials */
|
|
1815
|
-
expiresAt:
|
|
1838
|
+
expiresAt: import_lazy_zod2.z.number().optional()
|
|
1816
1839
|
});
|
|
1817
|
-
var pkceOAuthCredentialSchema =
|
|
1818
|
-
type:
|
|
1840
|
+
var pkceOAuthCredentialSchema = import_lazy_zod2.z.object({
|
|
1841
|
+
type: import_lazy_zod2.z.literal("oauth_pkce"),
|
|
1819
1842
|
/** Access token */
|
|
1820
|
-
accessToken:
|
|
1843
|
+
accessToken: import_lazy_zod2.z.string(),
|
|
1821
1844
|
/** Refresh token (optional) */
|
|
1822
|
-
refreshToken:
|
|
1845
|
+
refreshToken: import_lazy_zod2.z.string().optional(),
|
|
1823
1846
|
/** Token type (usually 'Bearer') */
|
|
1824
|
-
tokenType:
|
|
1847
|
+
tokenType: import_lazy_zod2.z.string().default("Bearer"),
|
|
1825
1848
|
/** Token expiration timestamp (epoch ms) */
|
|
1826
|
-
expiresAt:
|
|
1849
|
+
expiresAt: import_lazy_zod2.z.number().optional(),
|
|
1827
1850
|
/** Granted scopes */
|
|
1828
|
-
scopes:
|
|
1851
|
+
scopes: import_lazy_zod2.z.array(import_lazy_zod2.z.string()).default([]),
|
|
1829
1852
|
/** ID token for OIDC (optional) */
|
|
1830
|
-
idToken:
|
|
1853
|
+
idToken: import_lazy_zod2.z.string().optional(),
|
|
1831
1854
|
/** Authorization server issuer */
|
|
1832
|
-
issuer:
|
|
1855
|
+
issuer: import_lazy_zod2.z.string().optional()
|
|
1833
1856
|
});
|
|
1834
|
-
var credentialSchema =
|
|
1857
|
+
var credentialSchema = import_lazy_zod2.z.discriminatedUnion("type", [
|
|
1835
1858
|
oauthCredentialSchema,
|
|
1836
1859
|
apiKeyCredentialSchema,
|
|
1837
1860
|
basicAuthCredentialSchema,
|
|
@@ -1843,117 +1866,117 @@ var credentialSchema = import_zod2.z.discriminatedUnion("type", [
|
|
|
1843
1866
|
serviceAccountCredentialSchema,
|
|
1844
1867
|
pkceOAuthCredentialSchema
|
|
1845
1868
|
]);
|
|
1846
|
-
var appCredentialSchema =
|
|
1869
|
+
var appCredentialSchema = import_lazy_zod2.z.object({
|
|
1847
1870
|
/** App ID this credential belongs to */
|
|
1848
|
-
appId:
|
|
1871
|
+
appId: import_lazy_zod2.z.string().min(1),
|
|
1849
1872
|
/** Provider ID within the app (for apps with multiple auth providers) */
|
|
1850
|
-
providerId:
|
|
1873
|
+
providerId: import_lazy_zod2.z.string().min(1),
|
|
1851
1874
|
/** The credential data */
|
|
1852
1875
|
credential: credentialSchema,
|
|
1853
1876
|
/** Timestamp when credential was acquired */
|
|
1854
|
-
acquiredAt:
|
|
1877
|
+
acquiredAt: import_lazy_zod2.z.number(),
|
|
1855
1878
|
/** Timestamp when credential was last used */
|
|
1856
|
-
lastUsedAt:
|
|
1879
|
+
lastUsedAt: import_lazy_zod2.z.number().optional(),
|
|
1857
1880
|
/** Credential expiration (if applicable) */
|
|
1858
|
-
expiresAt:
|
|
1881
|
+
expiresAt: import_lazy_zod2.z.number().optional(),
|
|
1859
1882
|
/** Whether this credential is currently valid */
|
|
1860
|
-
isValid:
|
|
1883
|
+
isValid: import_lazy_zod2.z.boolean().default(true),
|
|
1861
1884
|
/** Error message if credential is invalid */
|
|
1862
|
-
invalidReason:
|
|
1885
|
+
invalidReason: import_lazy_zod2.z.string().optional(),
|
|
1863
1886
|
/** User info associated with this credential */
|
|
1864
|
-
userInfo:
|
|
1865
|
-
sub:
|
|
1866
|
-
email:
|
|
1867
|
-
name:
|
|
1887
|
+
userInfo: import_lazy_zod2.z.object({
|
|
1888
|
+
sub: import_lazy_zod2.z.string().optional(),
|
|
1889
|
+
email: import_lazy_zod2.z.string().optional(),
|
|
1890
|
+
name: import_lazy_zod2.z.string().optional()
|
|
1868
1891
|
}).optional(),
|
|
1869
1892
|
/** Metadata for tracking/debugging */
|
|
1870
|
-
metadata:
|
|
1893
|
+
metadata: import_lazy_zod2.z.record(import_lazy_zod2.z.string(), import_lazy_zod2.z.unknown()).optional()
|
|
1871
1894
|
});
|
|
1872
|
-
var vaultConsentRecordSchema =
|
|
1895
|
+
var vaultConsentRecordSchema = import_lazy_zod2.z.object({
|
|
1873
1896
|
/** Whether consent was enabled */
|
|
1874
|
-
enabled:
|
|
1897
|
+
enabled: import_lazy_zod2.z.boolean(),
|
|
1875
1898
|
/** Selected tool IDs (user approved these) */
|
|
1876
|
-
selectedToolIds:
|
|
1899
|
+
selectedToolIds: import_lazy_zod2.z.array(import_lazy_zod2.z.string()),
|
|
1877
1900
|
/** Available tool IDs at time of consent */
|
|
1878
|
-
availableToolIds:
|
|
1901
|
+
availableToolIds: import_lazy_zod2.z.array(import_lazy_zod2.z.string()),
|
|
1879
1902
|
/** Timestamp when consent was given */
|
|
1880
|
-
consentedAt:
|
|
1903
|
+
consentedAt: import_lazy_zod2.z.number(),
|
|
1881
1904
|
/** Consent version for tracking changes */
|
|
1882
|
-
version:
|
|
1905
|
+
version: import_lazy_zod2.z.string().default("1.0")
|
|
1883
1906
|
});
|
|
1884
|
-
var vaultFederatedRecordSchema =
|
|
1907
|
+
var vaultFederatedRecordSchema = import_lazy_zod2.z.object({
|
|
1885
1908
|
/** Provider IDs that were selected */
|
|
1886
|
-
selectedProviderIds:
|
|
1909
|
+
selectedProviderIds: import_lazy_zod2.z.array(import_lazy_zod2.z.string()),
|
|
1887
1910
|
/** Provider IDs that were skipped (can be authorized later) */
|
|
1888
|
-
skippedProviderIds:
|
|
1911
|
+
skippedProviderIds: import_lazy_zod2.z.array(import_lazy_zod2.z.string()),
|
|
1889
1912
|
/** Primary provider ID */
|
|
1890
|
-
primaryProviderId:
|
|
1913
|
+
primaryProviderId: import_lazy_zod2.z.string().optional(),
|
|
1891
1914
|
/** Timestamp when federated login was completed */
|
|
1892
|
-
completedAt:
|
|
1915
|
+
completedAt: import_lazy_zod2.z.number()
|
|
1893
1916
|
});
|
|
1894
|
-
var pendingIncrementalAuthSchema =
|
|
1917
|
+
var pendingIncrementalAuthSchema = import_lazy_zod2.z.object({
|
|
1895
1918
|
/** Unique ID for this request */
|
|
1896
|
-
id:
|
|
1919
|
+
id: import_lazy_zod2.z.string(),
|
|
1897
1920
|
/** App ID being authorized */
|
|
1898
|
-
appId:
|
|
1921
|
+
appId: import_lazy_zod2.z.string(),
|
|
1899
1922
|
/** Tool ID that triggered the auth request */
|
|
1900
|
-
toolId:
|
|
1923
|
+
toolId: import_lazy_zod2.z.string().optional(),
|
|
1901
1924
|
/** Authorization URL */
|
|
1902
|
-
authUrl:
|
|
1925
|
+
authUrl: import_lazy_zod2.z.string(),
|
|
1903
1926
|
/** Required scopes */
|
|
1904
|
-
requiredScopes:
|
|
1927
|
+
requiredScopes: import_lazy_zod2.z.array(import_lazy_zod2.z.string()).optional(),
|
|
1905
1928
|
/** Whether elicit is being used */
|
|
1906
|
-
elicitId:
|
|
1929
|
+
elicitId: import_lazy_zod2.z.string().optional(),
|
|
1907
1930
|
/** Timestamp when request was created */
|
|
1908
|
-
createdAt:
|
|
1931
|
+
createdAt: import_lazy_zod2.z.number(),
|
|
1909
1932
|
/** Expiration timestamp */
|
|
1910
|
-
expiresAt:
|
|
1933
|
+
expiresAt: import_lazy_zod2.z.number(),
|
|
1911
1934
|
/** Status of the request */
|
|
1912
|
-
status:
|
|
1935
|
+
status: import_lazy_zod2.z.enum(["pending", "completed", "cancelled", "expired"])
|
|
1913
1936
|
});
|
|
1914
|
-
var authorizationVaultEntrySchema =
|
|
1937
|
+
var authorizationVaultEntrySchema = import_lazy_zod2.z.object({
|
|
1915
1938
|
/** Vault ID (maps to access token jti claim) */
|
|
1916
|
-
id:
|
|
1939
|
+
id: import_lazy_zod2.z.string(),
|
|
1917
1940
|
/** User subject identifier */
|
|
1918
|
-
userSub:
|
|
1941
|
+
userSub: import_lazy_zod2.z.string(),
|
|
1919
1942
|
/** User email */
|
|
1920
|
-
userEmail:
|
|
1943
|
+
userEmail: import_lazy_zod2.z.string().optional(),
|
|
1921
1944
|
/** User name */
|
|
1922
|
-
userName:
|
|
1945
|
+
userName: import_lazy_zod2.z.string().optional(),
|
|
1923
1946
|
/** Client ID that created this session */
|
|
1924
|
-
clientId:
|
|
1947
|
+
clientId: import_lazy_zod2.z.string(),
|
|
1925
1948
|
/** Creation timestamp */
|
|
1926
|
-
createdAt:
|
|
1949
|
+
createdAt: import_lazy_zod2.z.number(),
|
|
1927
1950
|
/** Last access timestamp */
|
|
1928
|
-
lastAccessAt:
|
|
1951
|
+
lastAccessAt: import_lazy_zod2.z.number(),
|
|
1929
1952
|
/** App credentials (keyed by `${appId}:${providerId}`) */
|
|
1930
|
-
appCredentials:
|
|
1953
|
+
appCredentials: import_lazy_zod2.z.record(import_lazy_zod2.z.string(), appCredentialSchema).default({}),
|
|
1931
1954
|
/** Consent record */
|
|
1932
1955
|
consent: vaultConsentRecordSchema.optional(),
|
|
1933
1956
|
/** Federated login record */
|
|
1934
1957
|
federated: vaultFederatedRecordSchema.optional(),
|
|
1935
1958
|
/** Pending incremental authorization requests */
|
|
1936
|
-
pendingAuths:
|
|
1959
|
+
pendingAuths: import_lazy_zod2.z.array(pendingIncrementalAuthSchema),
|
|
1937
1960
|
/** Apps that are fully authorized */
|
|
1938
|
-
authorizedAppIds:
|
|
1961
|
+
authorizedAppIds: import_lazy_zod2.z.array(import_lazy_zod2.z.string()),
|
|
1939
1962
|
/** Apps that were skipped (not yet authorized) */
|
|
1940
|
-
skippedAppIds:
|
|
1963
|
+
skippedAppIds: import_lazy_zod2.z.array(import_lazy_zod2.z.string())
|
|
1941
1964
|
});
|
|
1942
1965
|
|
|
1943
1966
|
// libs/auth/src/session/vault-encryption.ts
|
|
1944
|
-
var
|
|
1967
|
+
var import_lazy_zod3 = require("@frontmcp/lazy-zod");
|
|
1945
1968
|
var import_utils5 = require("@frontmcp/utils");
|
|
1946
|
-
var encryptedDataSchema =
|
|
1969
|
+
var encryptedDataSchema = import_lazy_zod3.z.object({
|
|
1947
1970
|
/** Version for future algorithm changes */
|
|
1948
|
-
v:
|
|
1971
|
+
v: import_lazy_zod3.z.literal(1),
|
|
1949
1972
|
/** Algorithm identifier */
|
|
1950
|
-
alg:
|
|
1973
|
+
alg: import_lazy_zod3.z.literal("aes-256-gcm"),
|
|
1951
1974
|
/** Initialization vector (base64) */
|
|
1952
|
-
iv:
|
|
1975
|
+
iv: import_lazy_zod3.z.string(),
|
|
1953
1976
|
/** Ciphertext (base64) */
|
|
1954
|
-
ct:
|
|
1977
|
+
ct: import_lazy_zod3.z.string(),
|
|
1955
1978
|
/** Authentication tag (base64) */
|
|
1956
|
-
tag:
|
|
1979
|
+
tag: import_lazy_zod3.z.string()
|
|
1957
1980
|
});
|
|
1958
1981
|
var VaultEncryption = class {
|
|
1959
1982
|
pepper;
|
|
@@ -2091,29 +2114,29 @@ var VaultEncryption = class {
|
|
|
2091
2114
|
return encryptedDataSchema.safeParse(data).success;
|
|
2092
2115
|
}
|
|
2093
2116
|
};
|
|
2094
|
-
var encryptedVaultEntrySchema =
|
|
2117
|
+
var encryptedVaultEntrySchema = import_lazy_zod3.z.object({
|
|
2095
2118
|
/** Vault ID (maps to JWT jti claim) */
|
|
2096
|
-
id:
|
|
2119
|
+
id: import_lazy_zod3.z.string(),
|
|
2097
2120
|
/** User subject identifier */
|
|
2098
|
-
userSub:
|
|
2121
|
+
userSub: import_lazy_zod3.z.string(),
|
|
2099
2122
|
/** User email (unencrypted for display) */
|
|
2100
|
-
userEmail:
|
|
2123
|
+
userEmail: import_lazy_zod3.z.string().optional(),
|
|
2101
2124
|
/** User name (unencrypted for display) */
|
|
2102
|
-
userName:
|
|
2125
|
+
userName: import_lazy_zod3.z.string().optional(),
|
|
2103
2126
|
/** Client ID that created this session */
|
|
2104
|
-
clientId:
|
|
2127
|
+
clientId: import_lazy_zod3.z.string(),
|
|
2105
2128
|
/** Creation timestamp */
|
|
2106
|
-
createdAt:
|
|
2129
|
+
createdAt: import_lazy_zod3.z.number(),
|
|
2107
2130
|
/** Last access timestamp */
|
|
2108
|
-
lastAccessAt:
|
|
2131
|
+
lastAccessAt: import_lazy_zod3.z.number(),
|
|
2109
2132
|
/** Encrypted sensitive data (provider tokens, credentials, consent) */
|
|
2110
2133
|
encryptedData: encryptedDataSchema,
|
|
2111
2134
|
/** Apps that are fully authorized (unencrypted for quick lookup) */
|
|
2112
|
-
authorizedAppIds:
|
|
2135
|
+
authorizedAppIds: import_lazy_zod3.z.array(import_lazy_zod3.z.string()),
|
|
2113
2136
|
/** Apps that were skipped (unencrypted for quick lookup) */
|
|
2114
|
-
skippedAppIds:
|
|
2137
|
+
skippedAppIds: import_lazy_zod3.z.array(import_lazy_zod3.z.string()),
|
|
2115
2138
|
/** Pending auth IDs (unencrypted for lookup, actual URLs encrypted) */
|
|
2116
|
-
pendingAuthIds:
|
|
2139
|
+
pendingAuthIds: import_lazy_zod3.z.array(import_lazy_zod3.z.string()).default([])
|
|
2117
2140
|
});
|
|
2118
2141
|
|
|
2119
2142
|
// libs/auth/src/session/token.vault.ts
|
|
@@ -2176,98 +2199,98 @@ var TokenVault = class {
|
|
|
2176
2199
|
};
|
|
2177
2200
|
|
|
2178
2201
|
// libs/auth/src/session/index.ts
|
|
2179
|
-
var
|
|
2202
|
+
var import_utils23 = require("@frontmcp/utils");
|
|
2180
2203
|
|
|
2181
2204
|
// libs/auth/src/session/transport-session.types.ts
|
|
2182
|
-
var
|
|
2183
|
-
var transportProtocolSchema =
|
|
2205
|
+
var import_lazy_zod4 = require("@frontmcp/lazy-zod");
|
|
2206
|
+
var transportProtocolSchema = import_lazy_zod4.z.enum([
|
|
2184
2207
|
"legacy-sse",
|
|
2185
2208
|
"sse",
|
|
2186
2209
|
"streamable-http",
|
|
2187
2210
|
"stateful-http",
|
|
2188
2211
|
"stateless-http"
|
|
2189
2212
|
]);
|
|
2190
|
-
var sseTransportStateSchema =
|
|
2191
|
-
type:
|
|
2192
|
-
lastEventId:
|
|
2193
|
-
lastPing:
|
|
2194
|
-
connectionState:
|
|
2213
|
+
var sseTransportStateSchema = import_lazy_zod4.z.object({
|
|
2214
|
+
type: import_lazy_zod4.z.literal("sse"),
|
|
2215
|
+
lastEventId: import_lazy_zod4.z.string().optional(),
|
|
2216
|
+
lastPing: import_lazy_zod4.z.number().optional(),
|
|
2217
|
+
connectionState: import_lazy_zod4.z.enum(["connecting", "open", "closed"]).optional()
|
|
2195
2218
|
});
|
|
2196
|
-
var streamableHttpTransportStateSchema =
|
|
2197
|
-
type:
|
|
2198
|
-
requestSeq:
|
|
2199
|
-
activeStreamId:
|
|
2200
|
-
pendingRequests:
|
|
2219
|
+
var streamableHttpTransportStateSchema = import_lazy_zod4.z.object({
|
|
2220
|
+
type: import_lazy_zod4.z.literal("streamable-http"),
|
|
2221
|
+
requestSeq: import_lazy_zod4.z.number(),
|
|
2222
|
+
activeStreamId: import_lazy_zod4.z.string().optional(),
|
|
2223
|
+
pendingRequests: import_lazy_zod4.z.array(import_lazy_zod4.z.string()).optional()
|
|
2201
2224
|
});
|
|
2202
|
-
var statefulHttpTransportStateSchema =
|
|
2203
|
-
type:
|
|
2204
|
-
requestSeq:
|
|
2205
|
-
pendingResponses:
|
|
2206
|
-
lastActivity:
|
|
2225
|
+
var statefulHttpTransportStateSchema = import_lazy_zod4.z.object({
|
|
2226
|
+
type: import_lazy_zod4.z.literal("stateful-http"),
|
|
2227
|
+
requestSeq: import_lazy_zod4.z.number(),
|
|
2228
|
+
pendingResponses: import_lazy_zod4.z.array(import_lazy_zod4.z.string()).optional(),
|
|
2229
|
+
lastActivity: import_lazy_zod4.z.number().optional()
|
|
2207
2230
|
});
|
|
2208
|
-
var statelessHttpTransportStateSchema =
|
|
2209
|
-
type:
|
|
2210
|
-
requestCount:
|
|
2211
|
-
windowStart:
|
|
2231
|
+
var statelessHttpTransportStateSchema = import_lazy_zod4.z.object({
|
|
2232
|
+
type: import_lazy_zod4.z.literal("stateless-http"),
|
|
2233
|
+
requestCount: import_lazy_zod4.z.number(),
|
|
2234
|
+
windowStart: import_lazy_zod4.z.number().optional()
|
|
2212
2235
|
});
|
|
2213
|
-
var legacySseTransportStateSchema =
|
|
2214
|
-
type:
|
|
2215
|
-
messagePath:
|
|
2216
|
-
lastEventId:
|
|
2217
|
-
connectionState:
|
|
2236
|
+
var legacySseTransportStateSchema = import_lazy_zod4.z.object({
|
|
2237
|
+
type: import_lazy_zod4.z.literal("legacy-sse"),
|
|
2238
|
+
messagePath: import_lazy_zod4.z.string(),
|
|
2239
|
+
lastEventId: import_lazy_zod4.z.string().optional(),
|
|
2240
|
+
connectionState: import_lazy_zod4.z.enum(["connecting", "open", "closed"]).optional()
|
|
2218
2241
|
});
|
|
2219
|
-
var transportStateSchema =
|
|
2242
|
+
var transportStateSchema = import_lazy_zod4.z.discriminatedUnion("type", [
|
|
2220
2243
|
sseTransportStateSchema,
|
|
2221
2244
|
streamableHttpTransportStateSchema,
|
|
2222
2245
|
statefulHttpTransportStateSchema,
|
|
2223
2246
|
statelessHttpTransportStateSchema,
|
|
2224
2247
|
legacySseTransportStateSchema
|
|
2225
2248
|
]);
|
|
2226
|
-
var transportSessionSchema =
|
|
2227
|
-
id:
|
|
2228
|
-
authorizationId:
|
|
2249
|
+
var transportSessionSchema = import_lazy_zod4.z.object({
|
|
2250
|
+
id: import_lazy_zod4.z.string(),
|
|
2251
|
+
authorizationId: import_lazy_zod4.z.string(),
|
|
2229
2252
|
protocol: transportProtocolSchema,
|
|
2230
|
-
createdAt:
|
|
2231
|
-
expiresAt:
|
|
2232
|
-
nodeId:
|
|
2233
|
-
clientFingerprint:
|
|
2253
|
+
createdAt: import_lazy_zod4.z.number(),
|
|
2254
|
+
expiresAt: import_lazy_zod4.z.number().optional(),
|
|
2255
|
+
nodeId: import_lazy_zod4.z.string(),
|
|
2256
|
+
clientFingerprint: import_lazy_zod4.z.string().optional(),
|
|
2234
2257
|
transportState: transportStateSchema.optional()
|
|
2235
2258
|
});
|
|
2236
|
-
var sessionJwtPayloadSchema =
|
|
2237
|
-
sid:
|
|
2238
|
-
aid:
|
|
2259
|
+
var sessionJwtPayloadSchema = import_lazy_zod4.z.object({
|
|
2260
|
+
sid: import_lazy_zod4.z.string(),
|
|
2261
|
+
aid: import_lazy_zod4.z.string(),
|
|
2239
2262
|
proto: transportProtocolSchema,
|
|
2240
|
-
nid:
|
|
2241
|
-
iat:
|
|
2242
|
-
exp:
|
|
2263
|
+
nid: import_lazy_zod4.z.string(),
|
|
2264
|
+
iat: import_lazy_zod4.z.number(),
|
|
2265
|
+
exp: import_lazy_zod4.z.number().optional()
|
|
2243
2266
|
});
|
|
2244
|
-
var encryptedBlobSchema =
|
|
2245
|
-
alg:
|
|
2246
|
-
kid:
|
|
2247
|
-
iv:
|
|
2248
|
-
tag:
|
|
2249
|
-
data:
|
|
2250
|
-
exp:
|
|
2251
|
-
meta:
|
|
2267
|
+
var encryptedBlobSchema = import_lazy_zod4.z.object({
|
|
2268
|
+
alg: import_lazy_zod4.z.literal("A256GCM"),
|
|
2269
|
+
kid: import_lazy_zod4.z.string().optional(),
|
|
2270
|
+
iv: import_lazy_zod4.z.string(),
|
|
2271
|
+
tag: import_lazy_zod4.z.string(),
|
|
2272
|
+
data: import_lazy_zod4.z.string(),
|
|
2273
|
+
exp: import_lazy_zod4.z.number().optional(),
|
|
2274
|
+
meta: import_lazy_zod4.z.record(import_lazy_zod4.z.string(), import_lazy_zod4.z.unknown()).optional()
|
|
2252
2275
|
});
|
|
2253
|
-
var storedSessionSchema =
|
|
2276
|
+
var storedSessionSchema = import_lazy_zod4.z.object({
|
|
2254
2277
|
session: transportSessionSchema,
|
|
2255
|
-
authorizationId:
|
|
2256
|
-
tokens:
|
|
2257
|
-
createdAt:
|
|
2258
|
-
lastAccessedAt:
|
|
2259
|
-
initialized:
|
|
2260
|
-
maxLifetimeAt:
|
|
2261
|
-
clientCapabilities:
|
|
2278
|
+
authorizationId: import_lazy_zod4.z.string(),
|
|
2279
|
+
tokens: import_lazy_zod4.z.record(import_lazy_zod4.z.string(), encryptedBlobSchema).optional(),
|
|
2280
|
+
createdAt: import_lazy_zod4.z.number(),
|
|
2281
|
+
lastAccessedAt: import_lazy_zod4.z.number(),
|
|
2282
|
+
initialized: import_lazy_zod4.z.boolean().optional(),
|
|
2283
|
+
maxLifetimeAt: import_lazy_zod4.z.number().optional(),
|
|
2284
|
+
clientCapabilities: import_lazy_zod4.z.record(import_lazy_zod4.z.string(), import_lazy_zod4.z.unknown()).optional()
|
|
2262
2285
|
});
|
|
2263
|
-
var redisConfigSchema =
|
|
2264
|
-
host:
|
|
2265
|
-
port:
|
|
2266
|
-
password:
|
|
2267
|
-
db:
|
|
2268
|
-
tls:
|
|
2269
|
-
keyPrefix:
|
|
2270
|
-
defaultTtlMs:
|
|
2286
|
+
var redisConfigSchema = import_lazy_zod4.z.object({
|
|
2287
|
+
host: import_lazy_zod4.z.string().min(1),
|
|
2288
|
+
port: import_lazy_zod4.z.number().int().positive().optional().default(6379),
|
|
2289
|
+
password: import_lazy_zod4.z.string().optional(),
|
|
2290
|
+
db: import_lazy_zod4.z.number().int().nonnegative().optional().default(0),
|
|
2291
|
+
tls: import_lazy_zod4.z.boolean().optional().default(false),
|
|
2292
|
+
keyPrefix: import_lazy_zod4.z.string().optional().default("mcp:session:"),
|
|
2293
|
+
defaultTtlMs: import_lazy_zod4.z.number().int().positive().optional().default(36e5)
|
|
2271
2294
|
// 1 hour default
|
|
2272
2295
|
});
|
|
2273
2296
|
|
|
@@ -2658,97 +2681,26 @@ function extractBearerToken(header) {
|
|
|
2658
2681
|
}
|
|
2659
2682
|
|
|
2660
2683
|
// libs/auth/src/session/utils/session-crypto.utils.ts
|
|
2661
|
-
var import_utils12 = require("@frontmcp/utils");
|
|
2662
|
-
|
|
2663
|
-
// libs/auth/src/machine-id/machine-id.ts
|
|
2664
2684
|
var import_utils11 = require("@frontmcp/utils");
|
|
2665
|
-
var DEFAULT_MACHINE_ID_PATH = ".frontmcp/machine-id";
|
|
2666
|
-
function isDevPersistenceEnabled() {
|
|
2667
|
-
if ((0, import_utils11.isBrowser)()) return false;
|
|
2668
|
-
return !(0, import_utils11.isProduction)();
|
|
2669
|
-
}
|
|
2670
|
-
function resolveMachineIdPath() {
|
|
2671
|
-
if ((0, import_utils11.isBrowser)()) return DEFAULT_MACHINE_ID_PATH;
|
|
2672
|
-
const path = require("path");
|
|
2673
|
-
const machineIdPath = (0, import_utils11.getEnv)("MACHINE_ID_PATH") ?? DEFAULT_MACHINE_ID_PATH;
|
|
2674
|
-
return path.isAbsolute(machineIdPath) ? machineIdPath : path.resolve((0, import_utils11.getCwd)(), machineIdPath);
|
|
2675
|
-
}
|
|
2676
|
-
function loadMachineIdSync() {
|
|
2677
|
-
if (!isDevPersistenceEnabled()) {
|
|
2678
|
-
return null;
|
|
2679
|
-
}
|
|
2680
|
-
const machineIdPath = resolveMachineIdPath();
|
|
2681
|
-
try {
|
|
2682
|
-
const content = (0, import_utils11.readFileSync)(machineIdPath, "utf8").trim();
|
|
2683
|
-
if (/^[0-9a-f-]{32,36}$/i.test(content)) {
|
|
2684
|
-
return content;
|
|
2685
|
-
}
|
|
2686
|
-
console.warn(`[MachineId] Invalid format at ${machineIdPath}, will regenerate`);
|
|
2687
|
-
return null;
|
|
2688
|
-
} catch (error) {
|
|
2689
|
-
if (error.code !== "ENOENT") {
|
|
2690
|
-
console.warn(`[MachineId] Failed to load from ${machineIdPath}: ${error.message}`);
|
|
2691
|
-
}
|
|
2692
|
-
return null;
|
|
2693
|
-
}
|
|
2694
|
-
}
|
|
2695
|
-
function saveMachineIdAsync(machineId2) {
|
|
2696
|
-
if (!isDevPersistenceEnabled()) {
|
|
2697
|
-
return;
|
|
2698
|
-
}
|
|
2699
|
-
const machineIdPath = resolveMachineIdPath();
|
|
2700
|
-
const path = require("path");
|
|
2701
|
-
const dir = path.dirname(machineIdPath);
|
|
2702
|
-
(async () => {
|
|
2703
|
-
try {
|
|
2704
|
-
await (0, import_utils11.mkdir)(dir, { recursive: true, mode: 448 });
|
|
2705
|
-
await (0, import_utils11.writeFile)(machineIdPath, machineId2, { mode: 384 });
|
|
2706
|
-
} catch (error) {
|
|
2707
|
-
console.warn(`[MachineId] Failed to save to ${machineIdPath}: ${error.message}`);
|
|
2708
|
-
}
|
|
2709
|
-
})();
|
|
2710
|
-
}
|
|
2711
|
-
var machineId = (() => {
|
|
2712
|
-
const envMachineId = (0, import_utils11.getEnv)("MACHINE_ID");
|
|
2713
|
-
if (envMachineId) {
|
|
2714
|
-
return envMachineId;
|
|
2715
|
-
}
|
|
2716
|
-
const loadedId = loadMachineIdSync();
|
|
2717
|
-
if (loadedId) {
|
|
2718
|
-
return loadedId;
|
|
2719
|
-
}
|
|
2720
|
-
const newId = (0, import_utils11.randomUUID)();
|
|
2721
|
-
saveMachineIdAsync(newId);
|
|
2722
|
-
return newId;
|
|
2723
|
-
})();
|
|
2724
|
-
var machineIdOverride;
|
|
2725
|
-
function getMachineId() {
|
|
2726
|
-
return machineIdOverride ?? machineId;
|
|
2727
|
-
}
|
|
2728
|
-
function setMachineIdOverride(id) {
|
|
2729
|
-
machineIdOverride = id;
|
|
2730
|
-
}
|
|
2731
|
-
|
|
2732
|
-
// libs/auth/src/session/utils/session-crypto.utils.ts
|
|
2733
2685
|
var cachedKey = null;
|
|
2734
2686
|
function getKey() {
|
|
2735
2687
|
if (cachedKey) return cachedKey;
|
|
2736
|
-
const secret = (0,
|
|
2688
|
+
const secret = (0, import_utils11.getEnv)("MCP_SESSION_SECRET");
|
|
2737
2689
|
if (!secret) {
|
|
2738
|
-
if ((0,
|
|
2690
|
+
if ((0, import_utils11.isProduction)()) {
|
|
2739
2691
|
throw new SessionSecretRequiredError("session ID encryption");
|
|
2740
2692
|
}
|
|
2741
2693
|
console.warn(
|
|
2742
2694
|
"[SessionIdUtils] Using machine ID as session encryption secret - NOT SECURE FOR PRODUCTION. Set MCP_SESSION_SECRET environment variable for secure session encryption."
|
|
2743
2695
|
);
|
|
2744
2696
|
}
|
|
2745
|
-
const base = secret || getMachineId();
|
|
2746
|
-
cachedKey = (0,
|
|
2697
|
+
const base = secret || (0, import_utils11.getMachineId)();
|
|
2698
|
+
cachedKey = (0, import_utils11.sha256)(new TextEncoder().encode(base));
|
|
2747
2699
|
return cachedKey;
|
|
2748
2700
|
}
|
|
2749
2701
|
function encryptJson(obj) {
|
|
2750
2702
|
const key = getKey();
|
|
2751
|
-
const encrypted = (0,
|
|
2703
|
+
const encrypted = (0, import_utils11.encryptValue)(obj, key);
|
|
2752
2704
|
return `${encrypted.iv}.${encrypted.tag}.${encrypted.data}`;
|
|
2753
2705
|
}
|
|
2754
2706
|
function decryptSessionJson(sessionId) {
|
|
@@ -2757,7 +2709,7 @@ function decryptSessionJson(sessionId) {
|
|
|
2757
2709
|
const [ivB64, tagB64, ctB64] = parts;
|
|
2758
2710
|
if (!ivB64 || !tagB64 || !ctB64) return null;
|
|
2759
2711
|
const key = getKey();
|
|
2760
|
-
return (0,
|
|
2712
|
+
return (0, import_utils11.decryptValue)({ alg: "A256GCM", iv: ivB64, tag: tagB64, data: ctB64 }, key);
|
|
2761
2713
|
}
|
|
2762
2714
|
function safeDecrypt(sessionId) {
|
|
2763
2715
|
try {
|
|
@@ -2771,11 +2723,11 @@ function resetCachedKey() {
|
|
|
2771
2723
|
}
|
|
2772
2724
|
|
|
2773
2725
|
// libs/auth/src/session/storage/index.ts
|
|
2726
|
+
var import_utils15 = require("@frontmcp/utils");
|
|
2774
2727
|
var import_utils16 = require("@frontmcp/utils");
|
|
2775
|
-
var import_utils17 = require("@frontmcp/utils");
|
|
2776
2728
|
|
|
2777
2729
|
// libs/auth/src/session/storage/storage-token-store.ts
|
|
2778
|
-
var
|
|
2730
|
+
var import_utils12 = require("@frontmcp/utils");
|
|
2779
2731
|
var StorageTokenStore = class {
|
|
2780
2732
|
storage;
|
|
2781
2733
|
namespace;
|
|
@@ -2787,13 +2739,13 @@ var StorageTokenStore = class {
|
|
|
2787
2739
|
this.defaultTtlSeconds = options.defaultTtlSeconds;
|
|
2788
2740
|
this.storageIsNamespaced = "namespace" in storage && typeof storage.namespace === "function";
|
|
2789
2741
|
const namespacedStorage = this.storageIsNamespaced ? storage.namespace(this.namespace) : storage;
|
|
2790
|
-
this.storage = new
|
|
2742
|
+
this.storage = new import_utils12.TypedStorage(namespacedStorage);
|
|
2791
2743
|
}
|
|
2792
2744
|
/**
|
|
2793
2745
|
* Allocate a new unique ID for a token record.
|
|
2794
2746
|
*/
|
|
2795
2747
|
allocId() {
|
|
2796
|
-
return (0,
|
|
2748
|
+
return (0, import_utils12.randomUUID)();
|
|
2797
2749
|
}
|
|
2798
2750
|
/**
|
|
2799
2751
|
* Store an encrypted token blob.
|
|
@@ -2856,7 +2808,7 @@ var StorageTokenStore = class {
|
|
|
2856
2808
|
};
|
|
2857
2809
|
|
|
2858
2810
|
// libs/auth/src/session/storage/storage-authorization-vault.ts
|
|
2859
|
-
var
|
|
2811
|
+
var import_utils13 = require("@frontmcp/utils");
|
|
2860
2812
|
var StorageAuthorizationVault = class {
|
|
2861
2813
|
storage;
|
|
2862
2814
|
namespace;
|
|
@@ -2865,7 +2817,7 @@ var StorageAuthorizationVault = class {
|
|
|
2865
2817
|
this.namespace = options.namespace ?? "vault";
|
|
2866
2818
|
this.pendingAuthTtlMs = options.pendingAuthTtlMs ?? 10 * 60 * 1e3;
|
|
2867
2819
|
const namespacedStorage = this.isNamespacedStorage(storage) ? storage.namespace(this.namespace) : storage;
|
|
2868
|
-
this.storage = new
|
|
2820
|
+
this.storage = new import_utils13.TypedStorage(namespacedStorage, {
|
|
2869
2821
|
schema: options.validateOnRead ? authorizationVaultEntrySchema : void 0,
|
|
2870
2822
|
throwOnInvalid: false
|
|
2871
2823
|
});
|
|
@@ -2876,7 +2828,7 @@ var StorageAuthorizationVault = class {
|
|
|
2876
2828
|
async create(params) {
|
|
2877
2829
|
const now = Date.now();
|
|
2878
2830
|
const entry = {
|
|
2879
|
-
id: (0,
|
|
2831
|
+
id: (0, import_utils13.randomUUID)(),
|
|
2880
2832
|
userSub: params.userSub,
|
|
2881
2833
|
userEmail: params.userEmail,
|
|
2882
2834
|
userName: params.userName,
|
|
@@ -2950,7 +2902,7 @@ var StorageAuthorizationVault = class {
|
|
|
2950
2902
|
}
|
|
2951
2903
|
const now = Date.now();
|
|
2952
2904
|
const pendingAuth = {
|
|
2953
|
-
id: (0,
|
|
2905
|
+
id: (0, import_utils13.randomUUID)(),
|
|
2954
2906
|
appId: params.appId,
|
|
2955
2907
|
toolId: params.toolId,
|
|
2956
2908
|
authUrl: params.authUrl,
|
|
@@ -3154,11 +3106,11 @@ var StorageAuthorizationVault = class {
|
|
|
3154
3106
|
};
|
|
3155
3107
|
|
|
3156
3108
|
// libs/auth/src/session/storage/in-memory-authorization-vault.ts
|
|
3157
|
-
var
|
|
3109
|
+
var import_utils14 = require("@frontmcp/utils");
|
|
3158
3110
|
var InMemoryAuthorizationVault = class extends StorageAuthorizationVault {
|
|
3159
3111
|
memoryAdapter;
|
|
3160
3112
|
constructor(options = {}) {
|
|
3161
|
-
const memoryAdapter = new
|
|
3113
|
+
const memoryAdapter = new import_utils14.MemoryStorageAdapter();
|
|
3162
3114
|
super(memoryAdapter, {
|
|
3163
3115
|
namespace: options.namespace ?? "vault",
|
|
3164
3116
|
pendingAuthTtlMs: options.pendingAuthTtlMs
|
|
@@ -3179,7 +3131,7 @@ var InMemoryAuthorizationVault = class extends StorageAuthorizationVault {
|
|
|
3179
3131
|
};
|
|
3180
3132
|
|
|
3181
3133
|
// libs/auth/src/session/redis-session.store.ts
|
|
3182
|
-
var
|
|
3134
|
+
var import_utils17 = require("@frontmcp/utils");
|
|
3183
3135
|
var RedisSessionStore = class {
|
|
3184
3136
|
storage;
|
|
3185
3137
|
keyPrefix;
|
|
@@ -3201,14 +3153,14 @@ var RedisSessionStore = class {
|
|
|
3201
3153
|
});
|
|
3202
3154
|
}
|
|
3203
3155
|
if ("redis" in config && config.redis) {
|
|
3204
|
-
this.storage = new
|
|
3156
|
+
this.storage = new import_utils17.RedisStorageAdapter({
|
|
3205
3157
|
client: config.redis,
|
|
3206
3158
|
keyPrefix: this.keyPrefix
|
|
3207
3159
|
});
|
|
3208
3160
|
this.externalInstance = true;
|
|
3209
3161
|
} else {
|
|
3210
3162
|
const redisConfig = config;
|
|
3211
|
-
this.storage = new
|
|
3163
|
+
this.storage = new import_utils17.RedisStorageAdapter({
|
|
3212
3164
|
config: {
|
|
3213
3165
|
host: redisConfig.host,
|
|
3214
3166
|
port: redisConfig.port ?? 6379,
|
|
@@ -3390,7 +3342,7 @@ var RedisSessionStore = class {
|
|
|
3390
3342
|
* Allocate a new session ID
|
|
3391
3343
|
*/
|
|
3392
3344
|
allocId() {
|
|
3393
|
-
return (0,
|
|
3345
|
+
return (0, import_utils17.randomUUID)();
|
|
3394
3346
|
}
|
|
3395
3347
|
/**
|
|
3396
3348
|
* Disconnect from Redis (only if we created the connection)
|
|
@@ -3426,7 +3378,7 @@ var RedisSessionStore = class {
|
|
|
3426
3378
|
};
|
|
3427
3379
|
|
|
3428
3380
|
// libs/auth/src/session/vercel-kv-session.store.ts
|
|
3429
|
-
var
|
|
3381
|
+
var import_utils18 = require("@frontmcp/utils");
|
|
3430
3382
|
var VercelKvSessionStore = class {
|
|
3431
3383
|
storage;
|
|
3432
3384
|
keyPrefix;
|
|
@@ -3446,7 +3398,7 @@ var VercelKvSessionStore = class {
|
|
|
3446
3398
|
maxRequests: this.security.rateLimiting?.maxRequests
|
|
3447
3399
|
});
|
|
3448
3400
|
}
|
|
3449
|
-
this.storage = new
|
|
3401
|
+
this.storage = new import_utils18.VercelKvStorageAdapter({
|
|
3450
3402
|
url: config.url,
|
|
3451
3403
|
token: config.token,
|
|
3452
3404
|
keyPrefix: this.keyPrefix
|
|
@@ -3620,7 +3572,7 @@ var VercelKvSessionStore = class {
|
|
|
3620
3572
|
* Allocate a new session ID
|
|
3621
3573
|
*/
|
|
3622
3574
|
allocId() {
|
|
3623
|
-
return (0,
|
|
3575
|
+
return (0, import_utils18.randomUUID)();
|
|
3624
3576
|
}
|
|
3625
3577
|
/**
|
|
3626
3578
|
* Disconnect from Vercel KV
|
|
@@ -3649,7 +3601,7 @@ var VercelKvSessionStore = class {
|
|
|
3649
3601
|
};
|
|
3650
3602
|
|
|
3651
3603
|
// libs/auth/src/session/orchestrated-token.store.ts
|
|
3652
|
-
var
|
|
3604
|
+
var import_utils19 = require("@frontmcp/utils");
|
|
3653
3605
|
var InMemoryOrchestratedTokenStore = class {
|
|
3654
3606
|
/** Token storage: Map<compositeKey, ProviderTokenRecord> */
|
|
3655
3607
|
tokens = /* @__PURE__ */ new Map();
|
|
@@ -3691,7 +3643,7 @@ var InMemoryOrchestratedTokenStore = class {
|
|
|
3691
3643
|
}
|
|
3692
3644
|
const info = new TextEncoder().encode(`orchestrated-token:${compositeKey}`);
|
|
3693
3645
|
const salt = new TextEncoder().encode("frontmcp-token-store");
|
|
3694
|
-
const derivedKey = (0,
|
|
3646
|
+
const derivedKey = (0, import_utils19.hkdfSha256)(this.encryptionKey, salt, info, 32);
|
|
3695
3647
|
this.derivedKeys.set(compositeKey, derivedKey);
|
|
3696
3648
|
return derivedKey;
|
|
3697
3649
|
}
|
|
@@ -3701,8 +3653,8 @@ var InMemoryOrchestratedTokenStore = class {
|
|
|
3701
3653
|
async encryptRecord(compositeKey, record) {
|
|
3702
3654
|
const key = await this.deriveKeyForRecord(compositeKey);
|
|
3703
3655
|
const plaintext = JSON.stringify(record);
|
|
3704
|
-
const iv = (0,
|
|
3705
|
-
const { ciphertext, tag } = (0,
|
|
3656
|
+
const iv = (0, import_utils19.randomBytes)(12);
|
|
3657
|
+
const { ciphertext, tag } = (0, import_utils19.encryptAesGcm)(key, new TextEncoder().encode(plaintext), iv);
|
|
3706
3658
|
return JSON.stringify({
|
|
3707
3659
|
iv: Buffer.from(iv).toString("base64url"),
|
|
3708
3660
|
tag: Buffer.from(tag).toString("base64url"),
|
|
@@ -3718,7 +3670,7 @@ var InMemoryOrchestratedTokenStore = class {
|
|
|
3718
3670
|
const ivBytes = Buffer.from(iv, "base64url");
|
|
3719
3671
|
const tagBytes = Buffer.from(tag, "base64url");
|
|
3720
3672
|
const ciphertextBytes = Buffer.from(data, "base64url");
|
|
3721
|
-
const plaintext = (0,
|
|
3673
|
+
const plaintext = (0, import_utils19.decryptAesGcm)(key, ciphertextBytes, ivBytes, tagBytes);
|
|
3722
3674
|
return JSON.parse(new TextDecoder().decode(plaintext));
|
|
3723
3675
|
}
|
|
3724
3676
|
/**
|
|
@@ -3920,7 +3872,7 @@ var InMemoryOrchestratedTokenStore = class {
|
|
|
3920
3872
|
};
|
|
3921
3873
|
|
|
3922
3874
|
// libs/auth/src/session/federated-auth.session.ts
|
|
3923
|
-
var
|
|
3875
|
+
var import_utils20 = require("@frontmcp/utils");
|
|
3924
3876
|
function toSessionRecord(session) {
|
|
3925
3877
|
return {
|
|
3926
3878
|
...session,
|
|
@@ -3995,7 +3947,7 @@ var InMemoryFederatedAuthSessionStore = class {
|
|
|
3995
3947
|
createSession(params) {
|
|
3996
3948
|
const now = Date.now();
|
|
3997
3949
|
return {
|
|
3998
|
-
id: (0,
|
|
3950
|
+
id: (0, import_utils20.randomUUID)(),
|
|
3999
3951
|
pendingAuthId: params.pendingAuthId,
|
|
4000
3952
|
clientId: params.clientId,
|
|
4001
3953
|
redirectUri: params.redirectUri,
|
|
@@ -4027,7 +3979,7 @@ var InMemoryFederatedAuthSessionStore = class {
|
|
|
4027
3979
|
function createFederatedAuthSession(params, ttlMs = 15 * 60 * 1e3) {
|
|
4028
3980
|
const now = Date.now();
|
|
4029
3981
|
return {
|
|
4030
|
-
id: (0,
|
|
3982
|
+
id: (0, import_utils20.randomUUID)(),
|
|
4031
3983
|
pendingAuthId: params.pendingAuthId,
|
|
4032
3984
|
clientId: params.clientId,
|
|
4033
3985
|
redirectUri: params.redirectUri,
|
|
@@ -4084,34 +4036,33 @@ function startNextProvider(session, pkce, state) {
|
|
|
4084
4036
|
}
|
|
4085
4037
|
|
|
4086
4038
|
// libs/auth/src/session/encrypted-authorization-vault.ts
|
|
4087
|
-
var
|
|
4088
|
-
var
|
|
4089
|
-
var
|
|
4090
|
-
var redisVaultEntrySchema = import_zod5.z.object({
|
|
4039
|
+
var import_lazy_zod5 = require("@frontmcp/lazy-zod");
|
|
4040
|
+
var import_utils21 = require("@frontmcp/utils");
|
|
4041
|
+
var redisVaultEntrySchema = import_lazy_zod5.z.object({
|
|
4091
4042
|
/** Vault ID */
|
|
4092
|
-
id:
|
|
4043
|
+
id: import_lazy_zod5.z.string(),
|
|
4093
4044
|
/** User sub (for lookup) */
|
|
4094
|
-
userSub:
|
|
4045
|
+
userSub: import_lazy_zod5.z.string(),
|
|
4095
4046
|
/** User email (optional, for display) */
|
|
4096
|
-
userEmail:
|
|
4047
|
+
userEmail: import_lazy_zod5.z.string().optional(),
|
|
4097
4048
|
/** User name (optional, for display) */
|
|
4098
|
-
userName:
|
|
4049
|
+
userName: import_lazy_zod5.z.string().optional(),
|
|
4099
4050
|
/** Client ID */
|
|
4100
|
-
clientId:
|
|
4051
|
+
clientId: import_lazy_zod5.z.string(),
|
|
4101
4052
|
/** Creation timestamp */
|
|
4102
|
-
createdAt:
|
|
4053
|
+
createdAt: import_lazy_zod5.z.number(),
|
|
4103
4054
|
/** Last access timestamp */
|
|
4104
|
-
lastAccessAt:
|
|
4055
|
+
lastAccessAt: import_lazy_zod5.z.number(),
|
|
4105
4056
|
/** Authorized app IDs (unencrypted for quick auth checks) */
|
|
4106
|
-
authorizedAppIds:
|
|
4057
|
+
authorizedAppIds: import_lazy_zod5.z.array(import_lazy_zod5.z.string()),
|
|
4107
4058
|
/** Skipped app IDs (unencrypted for quick checks) */
|
|
4108
|
-
skippedAppIds:
|
|
4059
|
+
skippedAppIds: import_lazy_zod5.z.array(import_lazy_zod5.z.string()),
|
|
4109
4060
|
/** Pending auth request IDs (unencrypted for lookup) */
|
|
4110
|
-
pendingAuthIds:
|
|
4061
|
+
pendingAuthIds: import_lazy_zod5.z.array(import_lazy_zod5.z.string()),
|
|
4111
4062
|
/** Encrypted sensitive data blob */
|
|
4112
4063
|
encrypted: encryptedDataSchema
|
|
4113
4064
|
});
|
|
4114
|
-
var encryptionContextStorage = new
|
|
4065
|
+
var encryptionContextStorage = new import_utils21.AsyncLocalStorage();
|
|
4115
4066
|
var EncryptedRedisVault = class {
|
|
4116
4067
|
constructor(redis, encryption, namespace = "vault:") {
|
|
4117
4068
|
this.redis = redis;
|
|
@@ -4244,7 +4195,7 @@ var EncryptedRedisVault = class {
|
|
|
4244
4195
|
async create(params) {
|
|
4245
4196
|
const now = Date.now();
|
|
4246
4197
|
const entry = {
|
|
4247
|
-
id: (0,
|
|
4198
|
+
id: (0, import_utils21.randomUUID)(),
|
|
4248
4199
|
userSub: params.userSub,
|
|
4249
4200
|
userEmail: params.userEmail,
|
|
4250
4201
|
userName: params.userName,
|
|
@@ -4303,7 +4254,7 @@ var EncryptedRedisVault = class {
|
|
|
4303
4254
|
}
|
|
4304
4255
|
const now = Date.now();
|
|
4305
4256
|
const pendingAuth = {
|
|
4306
|
-
id: (0,
|
|
4257
|
+
id: (0, import_utils21.randomUUID)(),
|
|
4307
4258
|
appId: params.appId,
|
|
4308
4259
|
toolId: params.toolId,
|
|
4309
4260
|
authUrl: params.authUrl,
|
|
@@ -4481,7 +4432,7 @@ function createEncryptedVault(redis, config = {}) {
|
|
|
4481
4432
|
}
|
|
4482
4433
|
|
|
4483
4434
|
// libs/auth/src/session/token.refresh.ts
|
|
4484
|
-
var
|
|
4435
|
+
var import_utils22 = require("@frontmcp/utils");
|
|
4485
4436
|
function toEpochSeconds(exp) {
|
|
4486
4437
|
if (exp == null) return void 0;
|
|
4487
4438
|
if (exp instanceof Date) return Math.floor(exp.getTime() / 1e3);
|
|
@@ -4503,7 +4454,7 @@ function tryJwtExp(token) {
|
|
|
4503
4454
|
const parts = token.split(".");
|
|
4504
4455
|
if (parts.length < 2) return void 0;
|
|
4505
4456
|
try {
|
|
4506
|
-
const json = JSON.parse(new TextDecoder().decode((0,
|
|
4457
|
+
const json = JSON.parse(new TextDecoder().decode((0, import_utils22.base64urlDecode)(parts[1])));
|
|
4507
4458
|
const e = json?.exp;
|
|
4508
4459
|
return typeof e === "number" ? toEpochSeconds(e) : void 0;
|
|
4509
4460
|
} catch {
|
|
@@ -4512,37 +4463,37 @@ function tryJwtExp(token) {
|
|
|
4512
4463
|
}
|
|
4513
4464
|
|
|
4514
4465
|
// libs/auth/src/authorization/authorization.types.ts
|
|
4515
|
-
var
|
|
4516
|
-
var authModeSchema =
|
|
4517
|
-
var authUserSchema =
|
|
4518
|
-
sub:
|
|
4519
|
-
name:
|
|
4520
|
-
email:
|
|
4521
|
-
picture:
|
|
4522
|
-
anonymous:
|
|
4466
|
+
var import_lazy_zod6 = require("@frontmcp/lazy-zod");
|
|
4467
|
+
var authModeSchema = import_lazy_zod6.z.enum(["public", "transparent", "orchestrated"]);
|
|
4468
|
+
var authUserSchema = import_lazy_zod6.z.object({
|
|
4469
|
+
sub: import_lazy_zod6.z.string(),
|
|
4470
|
+
name: import_lazy_zod6.z.string().optional(),
|
|
4471
|
+
email: import_lazy_zod6.z.string().email().optional(),
|
|
4472
|
+
picture: import_lazy_zod6.z.string().url().optional(),
|
|
4473
|
+
anonymous: import_lazy_zod6.z.boolean().optional()
|
|
4523
4474
|
});
|
|
4524
|
-
var authorizedToolSchema =
|
|
4525
|
-
executionPath:
|
|
4526
|
-
scopes:
|
|
4527
|
-
details:
|
|
4475
|
+
var authorizedToolSchema = import_lazy_zod6.z.object({
|
|
4476
|
+
executionPath: import_lazy_zod6.z.tuple([import_lazy_zod6.z.string(), import_lazy_zod6.z.string()]),
|
|
4477
|
+
scopes: import_lazy_zod6.z.array(import_lazy_zod6.z.string()).optional(),
|
|
4478
|
+
details: import_lazy_zod6.z.record(import_lazy_zod6.z.string(), import_lazy_zod6.z.unknown()).optional()
|
|
4528
4479
|
});
|
|
4529
|
-
var authorizedPromptSchema =
|
|
4530
|
-
executionPath:
|
|
4531
|
-
scopes:
|
|
4532
|
-
details:
|
|
4480
|
+
var authorizedPromptSchema = import_lazy_zod6.z.object({
|
|
4481
|
+
executionPath: import_lazy_zod6.z.tuple([import_lazy_zod6.z.string(), import_lazy_zod6.z.string()]),
|
|
4482
|
+
scopes: import_lazy_zod6.z.array(import_lazy_zod6.z.string()).optional(),
|
|
4483
|
+
details: import_lazy_zod6.z.record(import_lazy_zod6.z.string(), import_lazy_zod6.z.unknown()).optional()
|
|
4533
4484
|
});
|
|
4534
|
-
var llmSafeAuthContextSchema =
|
|
4535
|
-
authorizationId:
|
|
4536
|
-
sessionId:
|
|
4485
|
+
var llmSafeAuthContextSchema = import_lazy_zod6.z.object({
|
|
4486
|
+
authorizationId: import_lazy_zod6.z.string(),
|
|
4487
|
+
sessionId: import_lazy_zod6.z.string(),
|
|
4537
4488
|
mode: authModeSchema,
|
|
4538
|
-
isAnonymous:
|
|
4539
|
-
user:
|
|
4540
|
-
sub:
|
|
4541
|
-
name:
|
|
4489
|
+
isAnonymous: import_lazy_zod6.z.boolean(),
|
|
4490
|
+
user: import_lazy_zod6.z.object({
|
|
4491
|
+
sub: import_lazy_zod6.z.string(),
|
|
4492
|
+
name: import_lazy_zod6.z.string().optional()
|
|
4542
4493
|
}),
|
|
4543
|
-
scopes:
|
|
4544
|
-
authorizedToolIds:
|
|
4545
|
-
authorizedPromptIds:
|
|
4494
|
+
scopes: import_lazy_zod6.z.array(import_lazy_zod6.z.string()),
|
|
4495
|
+
authorizedToolIds: import_lazy_zod6.z.array(import_lazy_zod6.z.string()),
|
|
4496
|
+
authorizedPromptIds: import_lazy_zod6.z.array(import_lazy_zod6.z.string())
|
|
4546
4497
|
});
|
|
4547
4498
|
var AppAuthState = /* @__PURE__ */ ((AppAuthState2) => {
|
|
4548
4499
|
AppAuthState2["AUTHORIZED"] = "authorized";
|
|
@@ -4550,23 +4501,23 @@ var AppAuthState = /* @__PURE__ */ ((AppAuthState2) => {
|
|
|
4550
4501
|
AppAuthState2["PENDING"] = "pending";
|
|
4551
4502
|
return AppAuthState2;
|
|
4552
4503
|
})(AppAuthState || {});
|
|
4553
|
-
var appAuthStateSchema =
|
|
4554
|
-
var appAuthorizationRecordSchema =
|
|
4555
|
-
appId:
|
|
4504
|
+
var appAuthStateSchema = import_lazy_zod6.z.nativeEnum(AppAuthState);
|
|
4505
|
+
var appAuthorizationRecordSchema = import_lazy_zod6.z.object({
|
|
4506
|
+
appId: import_lazy_zod6.z.string(),
|
|
4556
4507
|
state: appAuthStateSchema,
|
|
4557
|
-
stateChangedAt:
|
|
4558
|
-
grantedScopes:
|
|
4559
|
-
authProviderId:
|
|
4560
|
-
toolIds:
|
|
4508
|
+
stateChangedAt: import_lazy_zod6.z.number(),
|
|
4509
|
+
grantedScopes: import_lazy_zod6.z.array(import_lazy_zod6.z.string()).optional(),
|
|
4510
|
+
authProviderId: import_lazy_zod6.z.string().optional(),
|
|
4511
|
+
toolIds: import_lazy_zod6.z.array(import_lazy_zod6.z.string())
|
|
4561
4512
|
});
|
|
4562
|
-
var progressiveAuthStateSchema =
|
|
4563
|
-
apps:
|
|
4564
|
-
initiallyAuthorized:
|
|
4565
|
-
initiallySkipped:
|
|
4513
|
+
var progressiveAuthStateSchema = import_lazy_zod6.z.object({
|
|
4514
|
+
apps: import_lazy_zod6.z.record(import_lazy_zod6.z.string(), appAuthorizationRecordSchema),
|
|
4515
|
+
initiallyAuthorized: import_lazy_zod6.z.array(import_lazy_zod6.z.string()),
|
|
4516
|
+
initiallySkipped: import_lazy_zod6.z.array(import_lazy_zod6.z.string())
|
|
4566
4517
|
});
|
|
4567
4518
|
|
|
4568
4519
|
// libs/auth/src/authorization/authorization.class.ts
|
|
4569
|
-
var
|
|
4520
|
+
var import_utils25 = require("@frontmcp/utils");
|
|
4570
4521
|
var AuthorizationBase = class _AuthorizationBase {
|
|
4571
4522
|
id;
|
|
4572
4523
|
isAnonymous;
|
|
@@ -4614,14 +4565,14 @@ var AuthorizationBase = class _AuthorizationBase {
|
|
|
4614
4565
|
* @param fingerprint - Optional client fingerprint for tracking
|
|
4615
4566
|
*/
|
|
4616
4567
|
createTransportSession(protocol, fingerprint) {
|
|
4617
|
-
const sessionId = (0,
|
|
4568
|
+
const sessionId = (0, import_utils25.randomUUID)();
|
|
4618
4569
|
const session = {
|
|
4619
4570
|
id: sessionId,
|
|
4620
4571
|
authorizationId: this.id,
|
|
4621
4572
|
protocol,
|
|
4622
4573
|
createdAt: Date.now(),
|
|
4623
4574
|
expiresAt: this.expiresAt,
|
|
4624
|
-
nodeId: getMachineId(),
|
|
4575
|
+
nodeId: (0, import_utils25.getMachineId)(),
|
|
4625
4576
|
clientFingerprint: fingerprint
|
|
4626
4577
|
};
|
|
4627
4578
|
this.#sessions.set(session.id, session);
|
|
@@ -4751,7 +4702,7 @@ var AuthorizationBase = class _AuthorizationBase {
|
|
|
4751
4702
|
*/
|
|
4752
4703
|
static isJwtHeader(segment) {
|
|
4753
4704
|
try {
|
|
4754
|
-
const bytes = (0,
|
|
4705
|
+
const bytes = (0, import_utils25.base64urlDecode)(segment);
|
|
4755
4706
|
const text = new TextDecoder().decode(bytes);
|
|
4756
4707
|
const parsed = JSON.parse(text);
|
|
4757
4708
|
return typeof parsed === "object" && parsed !== null && typeof parsed.alg === "string";
|
|
@@ -4803,7 +4754,7 @@ var AuthorizationBase = class _AuthorizationBase {
|
|
|
4803
4754
|
};
|
|
4804
4755
|
|
|
4805
4756
|
// libs/auth/src/authorization/public.authorization.ts
|
|
4806
|
-
var
|
|
4757
|
+
var import_utils26 = require("@frontmcp/utils");
|
|
4807
4758
|
var PublicAuthorization = class _PublicAuthorization extends AuthorizationBase {
|
|
4808
4759
|
mode = "public";
|
|
4809
4760
|
/**
|
|
@@ -4839,7 +4790,7 @@ var PublicAuthorization = class _PublicAuthorization extends AuthorizationBase {
|
|
|
4839
4790
|
allowedTools = "all",
|
|
4840
4791
|
allowedPrompts = "all"
|
|
4841
4792
|
} = ctx;
|
|
4842
|
-
const uuid = (0,
|
|
4793
|
+
const uuid = (0, import_utils26.randomUUID)();
|
|
4843
4794
|
const sub = `${prefix}:${uuid}`;
|
|
4844
4795
|
const user = {
|
|
4845
4796
|
sub,
|
|
@@ -4923,7 +4874,7 @@ var PublicAuthorization = class _PublicAuthorization extends AuthorizationBase {
|
|
|
4923
4874
|
};
|
|
4924
4875
|
|
|
4925
4876
|
// libs/auth/src/authorization/transparent.authorization.ts
|
|
4926
|
-
var
|
|
4877
|
+
var import_utils27 = require("@frontmcp/utils");
|
|
4927
4878
|
var TransparentAuthorization = class _TransparentAuthorization extends AuthorizationBase {
|
|
4928
4879
|
mode = "transparent";
|
|
4929
4880
|
/**
|
|
@@ -5023,7 +4974,7 @@ var TransparentAuthorization = class _TransparentAuthorization extends Authoriza
|
|
|
5023
4974
|
static generateAuthorizationId(token) {
|
|
5024
4975
|
const parts = token.split(".");
|
|
5025
4976
|
const signature = parts[2] || token;
|
|
5026
|
-
return (0,
|
|
4977
|
+
return (0, import_utils27.sha256Hex)(signature).substring(0, 16);
|
|
5027
4978
|
}
|
|
5028
4979
|
/**
|
|
5029
4980
|
* Get the issuer from the token claims
|
|
@@ -5049,11 +5000,11 @@ var TransparentAuthorization = class _TransparentAuthorization extends Authoriza
|
|
|
5049
5000
|
};
|
|
5050
5001
|
|
|
5051
5002
|
// libs/auth/src/utils/authorization-id.utils.ts
|
|
5052
|
-
var
|
|
5003
|
+
var import_utils28 = require("@frontmcp/utils");
|
|
5053
5004
|
function deriveAuthorizationId(token) {
|
|
5054
5005
|
const parts = token.split(".");
|
|
5055
5006
|
const signature = parts[2] || token;
|
|
5056
|
-
return (0,
|
|
5007
|
+
return (0, import_utils28.sha256Hex)(signature).substring(0, 16);
|
|
5057
5008
|
}
|
|
5058
5009
|
|
|
5059
5010
|
// libs/auth/src/authorization/orchestrated.authorization.ts
|
|
@@ -5421,42 +5372,42 @@ var OrchestratedAuthAccessorAdapter = class {
|
|
|
5421
5372
|
};
|
|
5422
5373
|
|
|
5423
5374
|
// libs/auth/src/common/jwt.types.ts
|
|
5424
|
-
var
|
|
5425
|
-
var jwkParametersSchema =
|
|
5426
|
-
kty:
|
|
5427
|
-
alg:
|
|
5428
|
-
key_ops:
|
|
5429
|
-
ext:
|
|
5430
|
-
use:
|
|
5431
|
-
x5c:
|
|
5432
|
-
x5t:
|
|
5433
|
-
"x5t#S256":
|
|
5434
|
-
x5u:
|
|
5435
|
-
kid:
|
|
5375
|
+
var import_lazy_zod7 = require("@frontmcp/lazy-zod");
|
|
5376
|
+
var jwkParametersSchema = import_lazy_zod7.z.object({
|
|
5377
|
+
kty: import_lazy_zod7.z.string().optional(),
|
|
5378
|
+
alg: import_lazy_zod7.z.string().optional(),
|
|
5379
|
+
key_ops: import_lazy_zod7.z.array(import_lazy_zod7.z.string()).optional(),
|
|
5380
|
+
ext: import_lazy_zod7.z.boolean().optional(),
|
|
5381
|
+
use: import_lazy_zod7.z.string().optional(),
|
|
5382
|
+
x5c: import_lazy_zod7.z.array(import_lazy_zod7.z.string()).optional(),
|
|
5383
|
+
x5t: import_lazy_zod7.z.string().optional(),
|
|
5384
|
+
"x5t#S256": import_lazy_zod7.z.string().optional(),
|
|
5385
|
+
x5u: import_lazy_zod7.z.string().optional(),
|
|
5386
|
+
kid: import_lazy_zod7.z.string().optional()
|
|
5436
5387
|
});
|
|
5437
5388
|
var jwkSchema = jwkParametersSchema.extend({
|
|
5438
|
-
crv:
|
|
5439
|
-
d:
|
|
5440
|
-
dp:
|
|
5441
|
-
dq:
|
|
5442
|
-
e:
|
|
5443
|
-
k:
|
|
5444
|
-
n:
|
|
5445
|
-
p:
|
|
5446
|
-
q:
|
|
5447
|
-
qi:
|
|
5448
|
-
x:
|
|
5449
|
-
y:
|
|
5450
|
-
pub:
|
|
5451
|
-
priv:
|
|
5389
|
+
crv: import_lazy_zod7.z.string().optional(),
|
|
5390
|
+
d: import_lazy_zod7.z.string().optional(),
|
|
5391
|
+
dp: import_lazy_zod7.z.string().optional(),
|
|
5392
|
+
dq: import_lazy_zod7.z.string().optional(),
|
|
5393
|
+
e: import_lazy_zod7.z.string().optional(),
|
|
5394
|
+
k: import_lazy_zod7.z.string().optional(),
|
|
5395
|
+
n: import_lazy_zod7.z.string().optional(),
|
|
5396
|
+
p: import_lazy_zod7.z.string().optional(),
|
|
5397
|
+
q: import_lazy_zod7.z.string().optional(),
|
|
5398
|
+
qi: import_lazy_zod7.z.string().optional(),
|
|
5399
|
+
x: import_lazy_zod7.z.string().optional(),
|
|
5400
|
+
y: import_lazy_zod7.z.string().optional(),
|
|
5401
|
+
pub: import_lazy_zod7.z.string().optional(),
|
|
5402
|
+
priv: import_lazy_zod7.z.string().optional()
|
|
5452
5403
|
});
|
|
5453
|
-
var jsonWebKeySetSchema =
|
|
5454
|
-
keys:
|
|
5404
|
+
var jsonWebKeySetSchema = import_lazy_zod7.z.object({
|
|
5405
|
+
keys: import_lazy_zod7.z.array(jwkSchema)
|
|
5455
5406
|
});
|
|
5456
5407
|
|
|
5457
5408
|
// libs/auth/src/common/session.types.ts
|
|
5458
|
-
var
|
|
5459
|
-
var aiPlatformTypeSchema =
|
|
5409
|
+
var import_lazy_zod8 = require("@frontmcp/lazy-zod");
|
|
5410
|
+
var aiPlatformTypeSchema = import_lazy_zod8.z.enum([
|
|
5460
5411
|
"openai",
|
|
5461
5412
|
"claude",
|
|
5462
5413
|
"gemini",
|
|
@@ -5467,45 +5418,45 @@ var aiPlatformTypeSchema = import_zod8.z.enum([
|
|
|
5467
5418
|
"ext-apps",
|
|
5468
5419
|
"unknown"
|
|
5469
5420
|
]);
|
|
5470
|
-
var userClaimSchema =
|
|
5471
|
-
iss:
|
|
5472
|
-
sid:
|
|
5473
|
-
sub:
|
|
5474
|
-
exp:
|
|
5475
|
-
iat:
|
|
5476
|
-
aud:
|
|
5477
|
-
email:
|
|
5478
|
-
username:
|
|
5479
|
-
preferred_username:
|
|
5480
|
-
name:
|
|
5481
|
-
picture:
|
|
5421
|
+
var userClaimSchema = import_lazy_zod8.z.object({
|
|
5422
|
+
iss: import_lazy_zod8.z.string(),
|
|
5423
|
+
sid: import_lazy_zod8.z.string().optional(),
|
|
5424
|
+
sub: import_lazy_zod8.z.string(),
|
|
5425
|
+
exp: import_lazy_zod8.z.number().optional(),
|
|
5426
|
+
iat: import_lazy_zod8.z.number().optional(),
|
|
5427
|
+
aud: import_lazy_zod8.z.union([import_lazy_zod8.z.string(), import_lazy_zod8.z.array(import_lazy_zod8.z.string())]).optional(),
|
|
5428
|
+
email: import_lazy_zod8.z.string().optional(),
|
|
5429
|
+
username: import_lazy_zod8.z.string().optional(),
|
|
5430
|
+
preferred_username: import_lazy_zod8.z.string().optional(),
|
|
5431
|
+
name: import_lazy_zod8.z.string().optional(),
|
|
5432
|
+
picture: import_lazy_zod8.z.string().optional()
|
|
5482
5433
|
}).passthrough();
|
|
5483
|
-
var sessionIdPayloadSchema =
|
|
5484
|
-
nodeId:
|
|
5485
|
-
authSig:
|
|
5486
|
-
uuid:
|
|
5487
|
-
iat:
|
|
5488
|
-
protocol:
|
|
5489
|
-
isPublic:
|
|
5434
|
+
var sessionIdPayloadSchema = import_lazy_zod8.z.object({
|
|
5435
|
+
nodeId: import_lazy_zod8.z.string(),
|
|
5436
|
+
authSig: import_lazy_zod8.z.string(),
|
|
5437
|
+
uuid: import_lazy_zod8.z.string().uuid(),
|
|
5438
|
+
iat: import_lazy_zod8.z.number(),
|
|
5439
|
+
protocol: import_lazy_zod8.z.enum(["legacy-sse", "sse", "streamable-http", "stateful-http", "stateless-http"]).optional(),
|
|
5440
|
+
isPublic: import_lazy_zod8.z.boolean().optional(),
|
|
5490
5441
|
platformType: aiPlatformTypeSchema.optional(),
|
|
5491
|
-
clientName:
|
|
5492
|
-
clientVersion:
|
|
5493
|
-
supportsElicitation:
|
|
5494
|
-
skillsOnlyMode:
|
|
5442
|
+
clientName: import_lazy_zod8.z.string().optional(),
|
|
5443
|
+
clientVersion: import_lazy_zod8.z.string().optional(),
|
|
5444
|
+
supportsElicitation: import_lazy_zod8.z.boolean().optional(),
|
|
5445
|
+
skillsOnlyMode: import_lazy_zod8.z.boolean().optional()
|
|
5495
5446
|
});
|
|
5496
|
-
var sessionIdSchema =
|
|
5497
|
-
id:
|
|
5447
|
+
var sessionIdSchema = import_lazy_zod8.z.object({
|
|
5448
|
+
id: import_lazy_zod8.z.string(),
|
|
5498
5449
|
/** Payload is optional - may be undefined when session validation failed but ID is passed for transport lookup */
|
|
5499
5450
|
payload: sessionIdPayloadSchema.optional()
|
|
5500
5451
|
});
|
|
5501
|
-
var authorizationSchema =
|
|
5502
|
-
token:
|
|
5452
|
+
var authorizationSchema = import_lazy_zod8.z.object({
|
|
5453
|
+
token: import_lazy_zod8.z.string(),
|
|
5503
5454
|
session: sessionIdSchema.optional(),
|
|
5504
5455
|
user: userClaimSchema
|
|
5505
5456
|
});
|
|
5506
5457
|
|
|
5507
5458
|
// libs/auth/src/options/shared.schemas.ts
|
|
5508
|
-
var
|
|
5459
|
+
var import_lazy_zod10 = require("@frontmcp/lazy-zod");
|
|
5509
5460
|
|
|
5510
5461
|
// libs/auth/src/cimd/cimd.logger.ts
|
|
5511
5462
|
var noopLogger = {
|
|
@@ -5521,169 +5472,169 @@ var noopLogger = {
|
|
|
5521
5472
|
};
|
|
5522
5473
|
|
|
5523
5474
|
// libs/auth/src/cimd/cimd.types.ts
|
|
5524
|
-
var
|
|
5525
|
-
var clientMetadataDocumentSchema =
|
|
5475
|
+
var import_lazy_zod9 = require("@frontmcp/lazy-zod");
|
|
5476
|
+
var clientMetadataDocumentSchema = import_lazy_zod9.z.object({
|
|
5526
5477
|
// REQUIRED per CIMD spec
|
|
5527
5478
|
/**
|
|
5528
5479
|
* Client identifier - MUST match the URL from which this document was fetched.
|
|
5529
5480
|
*/
|
|
5530
|
-
client_id:
|
|
5481
|
+
client_id: import_lazy_zod9.z.string().url(),
|
|
5531
5482
|
/**
|
|
5532
5483
|
* Human-readable name of the client.
|
|
5533
5484
|
*/
|
|
5534
|
-
client_name:
|
|
5485
|
+
client_name: import_lazy_zod9.z.string().min(1),
|
|
5535
5486
|
/**
|
|
5536
5487
|
* Array of redirect URIs for authorization responses.
|
|
5537
5488
|
* At least one is required.
|
|
5538
5489
|
*/
|
|
5539
|
-
redirect_uris:
|
|
5490
|
+
redirect_uris: import_lazy_zod9.z.array(import_lazy_zod9.z.string().url()).min(1),
|
|
5540
5491
|
// OPTIONAL per RFC 7591
|
|
5541
5492
|
/**
|
|
5542
5493
|
* Token endpoint authentication method.
|
|
5543
5494
|
* @default 'none'
|
|
5544
5495
|
*/
|
|
5545
|
-
token_endpoint_auth_method:
|
|
5496
|
+
token_endpoint_auth_method: import_lazy_zod9.z.enum(["none", "client_secret_basic", "client_secret_post", "private_key_jwt"]).default("none"),
|
|
5546
5497
|
/**
|
|
5547
5498
|
* OAuth grant types the client can use.
|
|
5548
5499
|
* @default ['authorization_code']
|
|
5549
5500
|
*/
|
|
5550
|
-
grant_types:
|
|
5501
|
+
grant_types: import_lazy_zod9.z.array(import_lazy_zod9.z.string()).default(["authorization_code"]),
|
|
5551
5502
|
/**
|
|
5552
5503
|
* OAuth response types the client can request.
|
|
5553
5504
|
* @default ['code']
|
|
5554
5505
|
*/
|
|
5555
|
-
response_types:
|
|
5506
|
+
response_types: import_lazy_zod9.z.array(import_lazy_zod9.z.string()).default(["code"]),
|
|
5556
5507
|
/**
|
|
5557
5508
|
* URL of the client's home page.
|
|
5558
5509
|
*/
|
|
5559
|
-
client_uri:
|
|
5510
|
+
client_uri: import_lazy_zod9.z.string().url().optional(),
|
|
5560
5511
|
/**
|
|
5561
5512
|
* URL of the client's logo image.
|
|
5562
5513
|
*/
|
|
5563
|
-
logo_uri:
|
|
5514
|
+
logo_uri: import_lazy_zod9.z.string().url().optional(),
|
|
5564
5515
|
/**
|
|
5565
5516
|
* URL of the client's JWKS (for private_key_jwt).
|
|
5566
5517
|
*/
|
|
5567
|
-
jwks_uri:
|
|
5518
|
+
jwks_uri: import_lazy_zod9.z.string().url().optional(),
|
|
5568
5519
|
/**
|
|
5569
5520
|
* Inline JWKS (for private_key_jwt).
|
|
5570
5521
|
*/
|
|
5571
|
-
jwks:
|
|
5572
|
-
keys:
|
|
5522
|
+
jwks: import_lazy_zod9.z.object({
|
|
5523
|
+
keys: import_lazy_zod9.z.array(import_lazy_zod9.z.record(import_lazy_zod9.z.string(), import_lazy_zod9.z.unknown()))
|
|
5573
5524
|
}).optional(),
|
|
5574
5525
|
/**
|
|
5575
5526
|
* URL of the client's terms of service.
|
|
5576
5527
|
*/
|
|
5577
|
-
tos_uri:
|
|
5528
|
+
tos_uri: import_lazy_zod9.z.string().url().optional(),
|
|
5578
5529
|
/**
|
|
5579
5530
|
* URL of the client's privacy policy.
|
|
5580
5531
|
*/
|
|
5581
|
-
policy_uri:
|
|
5532
|
+
policy_uri: import_lazy_zod9.z.string().url().optional(),
|
|
5582
5533
|
/**
|
|
5583
5534
|
* Requested OAuth scopes.
|
|
5584
5535
|
*/
|
|
5585
|
-
scope:
|
|
5536
|
+
scope: import_lazy_zod9.z.string().optional(),
|
|
5586
5537
|
/**
|
|
5587
5538
|
* Array of contact emails for the client.
|
|
5588
5539
|
*/
|
|
5589
|
-
contacts:
|
|
5540
|
+
contacts: import_lazy_zod9.z.array(import_lazy_zod9.z.string().email()).optional(),
|
|
5590
5541
|
/**
|
|
5591
5542
|
* Software statement (signed JWT).
|
|
5592
5543
|
*/
|
|
5593
|
-
software_statement:
|
|
5544
|
+
software_statement: import_lazy_zod9.z.string().optional(),
|
|
5594
5545
|
/**
|
|
5595
5546
|
* Unique identifier for the client software.
|
|
5596
5547
|
*/
|
|
5597
|
-
software_id:
|
|
5548
|
+
software_id: import_lazy_zod9.z.string().optional(),
|
|
5598
5549
|
/**
|
|
5599
5550
|
* Version of the client software.
|
|
5600
5551
|
*/
|
|
5601
|
-
software_version:
|
|
5552
|
+
software_version: import_lazy_zod9.z.string().optional()
|
|
5602
5553
|
});
|
|
5603
|
-
var cimdRedisCacheConfigSchema =
|
|
5554
|
+
var cimdRedisCacheConfigSchema = import_lazy_zod9.z.object({
|
|
5604
5555
|
/**
|
|
5605
5556
|
* Redis connection URL.
|
|
5606
5557
|
* e.g., "redis://user:pass@host:6379/0"
|
|
5607
5558
|
*/
|
|
5608
|
-
url:
|
|
5559
|
+
url: import_lazy_zod9.z.string().optional(),
|
|
5609
5560
|
/**
|
|
5610
5561
|
* Redis host.
|
|
5611
5562
|
*/
|
|
5612
|
-
host:
|
|
5563
|
+
host: import_lazy_zod9.z.string().optional(),
|
|
5613
5564
|
/**
|
|
5614
5565
|
* Redis port.
|
|
5615
5566
|
* @default 6379
|
|
5616
5567
|
*/
|
|
5617
|
-
port:
|
|
5568
|
+
port: import_lazy_zod9.z.number().optional(),
|
|
5618
5569
|
/**
|
|
5619
5570
|
* Redis password.
|
|
5620
5571
|
*/
|
|
5621
|
-
password:
|
|
5572
|
+
password: import_lazy_zod9.z.string().optional(),
|
|
5622
5573
|
/**
|
|
5623
5574
|
* Redis database number.
|
|
5624
5575
|
* @default 0
|
|
5625
5576
|
*/
|
|
5626
|
-
db:
|
|
5577
|
+
db: import_lazy_zod9.z.number().optional(),
|
|
5627
5578
|
/**
|
|
5628
5579
|
* Enable TLS for Redis connection.
|
|
5629
5580
|
* @default false
|
|
5630
5581
|
*/
|
|
5631
|
-
tls:
|
|
5582
|
+
tls: import_lazy_zod9.z.boolean().optional(),
|
|
5632
5583
|
/**
|
|
5633
5584
|
* Key prefix for CIMD cache entries.
|
|
5634
5585
|
* @default 'cimd:'
|
|
5635
5586
|
*/
|
|
5636
|
-
keyPrefix:
|
|
5587
|
+
keyPrefix: import_lazy_zod9.z.string().default("cimd:")
|
|
5637
5588
|
});
|
|
5638
|
-
var cimdCacheConfigSchema =
|
|
5589
|
+
var cimdCacheConfigSchema = import_lazy_zod9.z.object({
|
|
5639
5590
|
/**
|
|
5640
5591
|
* Cache storage type.
|
|
5641
5592
|
* - 'memory': In-memory cache (default, suitable for dev/single-instance)
|
|
5642
5593
|
* - 'redis': Redis-backed cache (for production/distributed deployments)
|
|
5643
5594
|
* @default 'memory'
|
|
5644
5595
|
*/
|
|
5645
|
-
type:
|
|
5596
|
+
type: import_lazy_zod9.z.enum(["memory", "redis"]).default("memory"),
|
|
5646
5597
|
/**
|
|
5647
5598
|
* Default TTL for cached metadata documents.
|
|
5648
5599
|
* @default 3600000 (1 hour)
|
|
5649
5600
|
*/
|
|
5650
|
-
defaultTtlMs:
|
|
5601
|
+
defaultTtlMs: import_lazy_zod9.z.number().min(0).default(36e5),
|
|
5651
5602
|
/**
|
|
5652
5603
|
* Maximum TTL (even if server suggests longer).
|
|
5653
5604
|
* @default 86400000 (24 hours)
|
|
5654
5605
|
*/
|
|
5655
|
-
maxTtlMs:
|
|
5606
|
+
maxTtlMs: import_lazy_zod9.z.number().min(0).default(864e5),
|
|
5656
5607
|
/**
|
|
5657
5608
|
* Minimum TTL (even if server suggests shorter).
|
|
5658
5609
|
* @default 60000 (1 minute)
|
|
5659
5610
|
*/
|
|
5660
|
-
minTtlMs:
|
|
5611
|
+
minTtlMs: import_lazy_zod9.z.number().min(0).default(6e4),
|
|
5661
5612
|
/**
|
|
5662
5613
|
* Redis configuration (required when type is 'redis').
|
|
5663
5614
|
*/
|
|
5664
5615
|
redis: cimdRedisCacheConfigSchema.optional()
|
|
5665
5616
|
});
|
|
5666
|
-
var cimdSecurityConfigSchema =
|
|
5617
|
+
var cimdSecurityConfigSchema = import_lazy_zod9.z.object({
|
|
5667
5618
|
/**
|
|
5668
5619
|
* Block fetching from private/internal IP addresses (SSRF protection).
|
|
5669
5620
|
* @default true
|
|
5670
5621
|
*/
|
|
5671
|
-
blockPrivateIPs:
|
|
5622
|
+
blockPrivateIPs: import_lazy_zod9.z.boolean().default(true),
|
|
5672
5623
|
/**
|
|
5673
5624
|
* Explicit list of allowed domains.
|
|
5674
5625
|
* If set, only these domains can host CIMD documents.
|
|
5675
5626
|
*/
|
|
5676
|
-
allowedDomains:
|
|
5627
|
+
allowedDomains: import_lazy_zod9.z.array(import_lazy_zod9.z.string()).optional(),
|
|
5677
5628
|
/**
|
|
5678
5629
|
* Explicit list of blocked domains.
|
|
5679
5630
|
* These domains cannot host CIMD documents.
|
|
5680
5631
|
*/
|
|
5681
|
-
blockedDomains:
|
|
5632
|
+
blockedDomains: import_lazy_zod9.z.array(import_lazy_zod9.z.string()).optional(),
|
|
5682
5633
|
/**
|
|
5683
5634
|
* Warn when a client has only localhost redirect URIs.
|
|
5684
5635
|
* @default true
|
|
5685
5636
|
*/
|
|
5686
|
-
warnOnLocalhostRedirects:
|
|
5637
|
+
warnOnLocalhostRedirects: import_lazy_zod9.z.boolean().default(true),
|
|
5687
5638
|
/**
|
|
5688
5639
|
* Allow HTTP (instead of HTTPS) for localhost CIMD URLs.
|
|
5689
5640
|
*
|
|
@@ -5694,19 +5645,19 @@ var cimdSecurityConfigSchema = import_zod9.z.object({
|
|
|
5694
5645
|
*
|
|
5695
5646
|
* @default false
|
|
5696
5647
|
*/
|
|
5697
|
-
allowInsecureForTesting:
|
|
5648
|
+
allowInsecureForTesting: import_lazy_zod9.z.boolean().default(false)
|
|
5698
5649
|
});
|
|
5699
|
-
var cimdNetworkConfigSchema =
|
|
5650
|
+
var cimdNetworkConfigSchema = import_lazy_zod9.z.object({
|
|
5700
5651
|
/**
|
|
5701
5652
|
* Request timeout in milliseconds.
|
|
5702
5653
|
* @default 5000 (5 seconds)
|
|
5703
5654
|
*/
|
|
5704
|
-
timeoutMs:
|
|
5655
|
+
timeoutMs: import_lazy_zod9.z.number().min(100).default(5e3),
|
|
5705
5656
|
/**
|
|
5706
5657
|
* Maximum response body size in bytes.
|
|
5707
5658
|
* @default 65536 (64KB)
|
|
5708
5659
|
*/
|
|
5709
|
-
maxResponseSizeBytes:
|
|
5660
|
+
maxResponseSizeBytes: import_lazy_zod9.z.number().min(1024).default(65536),
|
|
5710
5661
|
/**
|
|
5711
5662
|
* Redirect handling policy for CIMD fetches.
|
|
5712
5663
|
* - 'deny': reject redirects (default, safest)
|
|
@@ -5714,19 +5665,19 @@ var cimdNetworkConfigSchema = import_zod9.z.object({
|
|
|
5714
5665
|
* - 'allow': allow redirects to any origin
|
|
5715
5666
|
* @default 'deny'
|
|
5716
5667
|
*/
|
|
5717
|
-
redirectPolicy:
|
|
5668
|
+
redirectPolicy: import_lazy_zod9.z.enum(["deny", "same-origin", "allow"]).default("deny"),
|
|
5718
5669
|
/**
|
|
5719
5670
|
* Maximum number of redirects to follow when redirects are allowed.
|
|
5720
5671
|
* @default 5
|
|
5721
5672
|
*/
|
|
5722
|
-
maxRedirects:
|
|
5673
|
+
maxRedirects: import_lazy_zod9.z.number().int().min(0).default(5)
|
|
5723
5674
|
});
|
|
5724
|
-
var cimdConfigSchema =
|
|
5675
|
+
var cimdConfigSchema = import_lazy_zod9.z.object({
|
|
5725
5676
|
/**
|
|
5726
5677
|
* Enable CIMD support.
|
|
5727
5678
|
* @default true
|
|
5728
5679
|
*/
|
|
5729
|
-
enabled:
|
|
5680
|
+
enabled: import_lazy_zod9.z.boolean().default(true),
|
|
5730
5681
|
/**
|
|
5731
5682
|
* Cache configuration.
|
|
5732
5683
|
*/
|
|
@@ -6380,29 +6331,29 @@ function normalizeRedirectUri(uri) {
|
|
|
6380
6331
|
}
|
|
6381
6332
|
|
|
6382
6333
|
// libs/auth/src/options/shared.schemas.ts
|
|
6383
|
-
var publicAccessConfigSchema =
|
|
6334
|
+
var publicAccessConfigSchema = import_lazy_zod10.z.object({
|
|
6384
6335
|
/**
|
|
6385
6336
|
* Allow all tools or explicit whitelist
|
|
6386
6337
|
* @default 'all'
|
|
6387
6338
|
*/
|
|
6388
|
-
tools:
|
|
6339
|
+
tools: import_lazy_zod10.z.union([import_lazy_zod10.z.literal("all"), import_lazy_zod10.z.array(import_lazy_zod10.z.string())]).default("all"),
|
|
6389
6340
|
/**
|
|
6390
6341
|
* Allow all prompts or explicit whitelist
|
|
6391
6342
|
* @default 'all'
|
|
6392
6343
|
*/
|
|
6393
|
-
prompts:
|
|
6344
|
+
prompts: import_lazy_zod10.z.union([import_lazy_zod10.z.literal("all"), import_lazy_zod10.z.array(import_lazy_zod10.z.string())]).default("all"),
|
|
6394
6345
|
/**
|
|
6395
6346
|
* Rate limit per IP per minute
|
|
6396
6347
|
* @default 60
|
|
6397
6348
|
*/
|
|
6398
|
-
rateLimit:
|
|
6349
|
+
rateLimit: import_lazy_zod10.z.number().default(60)
|
|
6399
6350
|
});
|
|
6400
|
-
var localSigningConfigSchema =
|
|
6351
|
+
var localSigningConfigSchema = import_lazy_zod10.z.object({
|
|
6401
6352
|
/**
|
|
6402
6353
|
* Private key for signing tokens
|
|
6403
6354
|
* @default auto-generated
|
|
6404
6355
|
*/
|
|
6405
|
-
signKey: jwkSchema.or(
|
|
6356
|
+
signKey: jwkSchema.or(import_lazy_zod10.z.instanceof(Uint8Array)).optional(),
|
|
6406
6357
|
/**
|
|
6407
6358
|
* JWKS for token verification
|
|
6408
6359
|
* @default auto-generated
|
|
@@ -6412,52 +6363,52 @@ var localSigningConfigSchema = import_zod10.z.object({
|
|
|
6412
6363
|
* Issuer identifier for tokens
|
|
6413
6364
|
* @default auto-derived from server URL
|
|
6414
6365
|
*/
|
|
6415
|
-
issuer:
|
|
6366
|
+
issuer: import_lazy_zod10.z.string().optional()
|
|
6416
6367
|
});
|
|
6417
|
-
var providerConfigSchema =
|
|
6368
|
+
var providerConfigSchema = import_lazy_zod10.z.object({
|
|
6418
6369
|
/** Provider display name */
|
|
6419
|
-
name:
|
|
6370
|
+
name: import_lazy_zod10.z.string().optional(),
|
|
6420
6371
|
/**
|
|
6421
6372
|
* Unique identifier for this provider
|
|
6422
6373
|
* @default derived from provider URL
|
|
6423
6374
|
*/
|
|
6424
|
-
id:
|
|
6375
|
+
id: import_lazy_zod10.z.string().optional(),
|
|
6425
6376
|
/**
|
|
6426
6377
|
* Inline JWKS for offline token verification
|
|
6427
6378
|
* Falls back to fetching from provider's /.well-known/jwks.json
|
|
6428
6379
|
*/
|
|
6429
6380
|
jwks: jsonWebKeySetSchema.optional(),
|
|
6430
6381
|
/** Custom JWKS URI if not at standard path */
|
|
6431
|
-
jwksUri:
|
|
6382
|
+
jwksUri: import_lazy_zod10.z.string().url().optional(),
|
|
6432
6383
|
/**
|
|
6433
6384
|
* Enable Dynamic Client Registration (DCR)
|
|
6434
6385
|
* @default false
|
|
6435
6386
|
*/
|
|
6436
|
-
dcrEnabled:
|
|
6387
|
+
dcrEnabled: import_lazy_zod10.z.boolean().default(false),
|
|
6437
6388
|
/** Authorization endpoint override */
|
|
6438
|
-
authEndpoint:
|
|
6389
|
+
authEndpoint: import_lazy_zod10.z.string().url().optional(),
|
|
6439
6390
|
/** Token endpoint override */
|
|
6440
|
-
tokenEndpoint:
|
|
6391
|
+
tokenEndpoint: import_lazy_zod10.z.string().url().optional(),
|
|
6441
6392
|
/** Registration endpoint override (for DCR) */
|
|
6442
|
-
registrationEndpoint:
|
|
6393
|
+
registrationEndpoint: import_lazy_zod10.z.string().url().optional(),
|
|
6443
6394
|
/** User info endpoint override */
|
|
6444
|
-
userInfoEndpoint:
|
|
6395
|
+
userInfoEndpoint: import_lazy_zod10.z.string().url().optional()
|
|
6445
6396
|
});
|
|
6446
|
-
var remoteProviderConfigSchema =
|
|
6397
|
+
var remoteProviderConfigSchema = import_lazy_zod10.z.object({
|
|
6447
6398
|
/**
|
|
6448
6399
|
* OAuth provider base URL
|
|
6449
6400
|
* @example 'https://auth.example.com'
|
|
6450
6401
|
*/
|
|
6451
|
-
provider:
|
|
6402
|
+
provider: import_lazy_zod10.z.string().url(),
|
|
6452
6403
|
/**
|
|
6453
6404
|
* Provider display name
|
|
6454
6405
|
*/
|
|
6455
|
-
name:
|
|
6406
|
+
name: import_lazy_zod10.z.string().optional(),
|
|
6456
6407
|
/**
|
|
6457
6408
|
* Unique identifier for this provider
|
|
6458
6409
|
* @default derived from provider URL
|
|
6459
6410
|
*/
|
|
6460
|
-
id:
|
|
6411
|
+
id: import_lazy_zod10.z.string().optional(),
|
|
6461
6412
|
/**
|
|
6462
6413
|
* Inline JWKS for offline token verification
|
|
6463
6414
|
* Falls back to fetching from provider's /.well-known/jwks.json
|
|
@@ -6466,133 +6417,133 @@ var remoteProviderConfigSchema = import_zod10.z.object({
|
|
|
6466
6417
|
/**
|
|
6467
6418
|
* Custom JWKS URI if not at standard path
|
|
6468
6419
|
*/
|
|
6469
|
-
jwksUri:
|
|
6420
|
+
jwksUri: import_lazy_zod10.z.string().url().optional(),
|
|
6470
6421
|
/**
|
|
6471
6422
|
* Client ID for this MCP server
|
|
6472
6423
|
*/
|
|
6473
|
-
clientId:
|
|
6424
|
+
clientId: import_lazy_zod10.z.string().optional(),
|
|
6474
6425
|
/**
|
|
6475
6426
|
* Client secret (for confidential clients)
|
|
6476
6427
|
*/
|
|
6477
|
-
clientSecret:
|
|
6428
|
+
clientSecret: import_lazy_zod10.z.string().optional(),
|
|
6478
6429
|
/**
|
|
6479
6430
|
* Scopes to request from the upstream provider
|
|
6480
6431
|
*/
|
|
6481
|
-
scopes:
|
|
6432
|
+
scopes: import_lazy_zod10.z.array(import_lazy_zod10.z.string()).optional(),
|
|
6482
6433
|
/**
|
|
6483
6434
|
* Enable Dynamic Client Registration (DCR)
|
|
6484
6435
|
* @default false
|
|
6485
6436
|
*/
|
|
6486
|
-
dcrEnabled:
|
|
6437
|
+
dcrEnabled: import_lazy_zod10.z.boolean().default(false),
|
|
6487
6438
|
/**
|
|
6488
6439
|
* Authorization endpoint override
|
|
6489
6440
|
*/
|
|
6490
|
-
authEndpoint:
|
|
6441
|
+
authEndpoint: import_lazy_zod10.z.string().url().optional(),
|
|
6491
6442
|
/**
|
|
6492
6443
|
* Token endpoint override
|
|
6493
6444
|
*/
|
|
6494
|
-
tokenEndpoint:
|
|
6445
|
+
tokenEndpoint: import_lazy_zod10.z.string().url().optional(),
|
|
6495
6446
|
/**
|
|
6496
6447
|
* Registration endpoint override (for DCR)
|
|
6497
6448
|
*/
|
|
6498
|
-
registrationEndpoint:
|
|
6449
|
+
registrationEndpoint: import_lazy_zod10.z.string().url().optional(),
|
|
6499
6450
|
/**
|
|
6500
6451
|
* User info endpoint override
|
|
6501
6452
|
*/
|
|
6502
|
-
userInfoEndpoint:
|
|
6453
|
+
userInfoEndpoint: import_lazy_zod10.z.string().url().optional()
|
|
6503
6454
|
});
|
|
6504
6455
|
var flatRemoteProviderFields = {
|
|
6505
6456
|
/**
|
|
6506
6457
|
* OAuth provider base URL (required)
|
|
6507
6458
|
* @example 'https://auth.example.com'
|
|
6508
6459
|
*/
|
|
6509
|
-
provider:
|
|
6460
|
+
provider: import_lazy_zod10.z.string().url(),
|
|
6510
6461
|
/** Client ID for this MCP server */
|
|
6511
|
-
clientId:
|
|
6462
|
+
clientId: import_lazy_zod10.z.string().optional(),
|
|
6512
6463
|
/** Client secret (for confidential clients) */
|
|
6513
|
-
clientSecret:
|
|
6464
|
+
clientSecret: import_lazy_zod10.z.string().optional(),
|
|
6514
6465
|
/** Scopes to request from the upstream provider */
|
|
6515
|
-
scopes:
|
|
6466
|
+
scopes: import_lazy_zod10.z.array(import_lazy_zod10.z.string()).optional(),
|
|
6516
6467
|
/** Advanced provider configuration */
|
|
6517
6468
|
providerConfig: providerConfigSchema.optional()
|
|
6518
6469
|
};
|
|
6519
|
-
var tokenStorageConfigSchema =
|
|
6520
|
-
var tokenRefreshConfigSchema =
|
|
6470
|
+
var tokenStorageConfigSchema = import_lazy_zod10.z.union([import_lazy_zod10.z.literal("memory"), import_lazy_zod10.z.object({ redis: redisConfigSchema })]);
|
|
6471
|
+
var tokenRefreshConfigSchema = import_lazy_zod10.z.object({
|
|
6521
6472
|
/**
|
|
6522
6473
|
* Enable automatic token refresh
|
|
6523
6474
|
* @default true
|
|
6524
6475
|
*/
|
|
6525
|
-
enabled:
|
|
6476
|
+
enabled: import_lazy_zod10.z.boolean().default(true),
|
|
6526
6477
|
/**
|
|
6527
6478
|
* Refresh token before expiry by this many seconds
|
|
6528
6479
|
* @default 60
|
|
6529
6480
|
*/
|
|
6530
|
-
skewSeconds:
|
|
6481
|
+
skewSeconds: import_lazy_zod10.z.number().default(60)
|
|
6531
6482
|
});
|
|
6532
|
-
var skippedAppBehaviorSchema =
|
|
6533
|
-
var consentConfigSchema =
|
|
6483
|
+
var skippedAppBehaviorSchema = import_lazy_zod10.z.enum(["anonymous", "require-auth"]);
|
|
6484
|
+
var consentConfigSchema = import_lazy_zod10.z.object({
|
|
6534
6485
|
/**
|
|
6535
6486
|
* Enable consent flow for tool selection
|
|
6536
6487
|
* When enabled, users can choose which tools to expose to the LLM
|
|
6537
6488
|
* @default false
|
|
6538
6489
|
*/
|
|
6539
|
-
enabled:
|
|
6490
|
+
enabled: import_lazy_zod10.z.boolean().default(false),
|
|
6540
6491
|
/**
|
|
6541
6492
|
* Group tools by app in the consent UI
|
|
6542
6493
|
* @default true
|
|
6543
6494
|
*/
|
|
6544
|
-
groupByApp:
|
|
6495
|
+
groupByApp: import_lazy_zod10.z.boolean().default(true),
|
|
6545
6496
|
/**
|
|
6546
6497
|
* Show tool descriptions in consent UI
|
|
6547
6498
|
* @default true
|
|
6548
6499
|
*/
|
|
6549
|
-
showDescriptions:
|
|
6500
|
+
showDescriptions: import_lazy_zod10.z.boolean().default(true),
|
|
6550
6501
|
/**
|
|
6551
6502
|
* Allow selecting all tools at once
|
|
6552
6503
|
* @default true
|
|
6553
6504
|
*/
|
|
6554
|
-
allowSelectAll:
|
|
6505
|
+
allowSelectAll: import_lazy_zod10.z.boolean().default(true),
|
|
6555
6506
|
/**
|
|
6556
6507
|
* Require at least one tool to be selected
|
|
6557
6508
|
* @default true
|
|
6558
6509
|
*/
|
|
6559
|
-
requireSelection:
|
|
6510
|
+
requireSelection: import_lazy_zod10.z.boolean().default(true),
|
|
6560
6511
|
/**
|
|
6561
6512
|
* Custom message to display on consent page
|
|
6562
6513
|
*/
|
|
6563
|
-
customMessage:
|
|
6514
|
+
customMessage: import_lazy_zod10.z.string().optional(),
|
|
6564
6515
|
/**
|
|
6565
6516
|
* Remember consent for future sessions
|
|
6566
6517
|
* @default true
|
|
6567
6518
|
*/
|
|
6568
|
-
rememberConsent:
|
|
6519
|
+
rememberConsent: import_lazy_zod10.z.boolean().default(true),
|
|
6569
6520
|
/**
|
|
6570
6521
|
* Tools to exclude from consent (always available)
|
|
6571
6522
|
* Useful for essential tools that should always be accessible
|
|
6572
6523
|
*/
|
|
6573
|
-
excludedTools:
|
|
6524
|
+
excludedTools: import_lazy_zod10.z.array(import_lazy_zod10.z.string()).optional(),
|
|
6574
6525
|
/**
|
|
6575
6526
|
* Tools to always include in consent (pre-selected)
|
|
6576
6527
|
*/
|
|
6577
|
-
defaultSelectedTools:
|
|
6528
|
+
defaultSelectedTools: import_lazy_zod10.z.array(import_lazy_zod10.z.string()).optional()
|
|
6578
6529
|
});
|
|
6579
|
-
var federatedAuthConfigSchema =
|
|
6530
|
+
var federatedAuthConfigSchema = import_lazy_zod10.z.object({
|
|
6580
6531
|
/**
|
|
6581
6532
|
* How strictly to validate the OAuth state parameter on provider callbacks.
|
|
6582
6533
|
* - 'strict': require exact match to stored state (default, safest)
|
|
6583
6534
|
* - 'format': validate only "federated:{sessionId}:{nonce}" format
|
|
6584
6535
|
* @default 'strict'
|
|
6585
6536
|
*/
|
|
6586
|
-
stateValidation:
|
|
6537
|
+
stateValidation: import_lazy_zod10.z.enum(["strict", "format"]).default("strict")
|
|
6587
6538
|
});
|
|
6588
|
-
var incrementalAuthConfigSchema =
|
|
6539
|
+
var incrementalAuthConfigSchema = import_lazy_zod10.z.object({
|
|
6589
6540
|
/**
|
|
6590
6541
|
* Enable incremental (progressive) authorization
|
|
6591
6542
|
* When enabled, users can skip app authorizations during initial auth
|
|
6592
6543
|
* and authorize individual apps later when needed
|
|
6593
6544
|
* @default true
|
|
6594
6545
|
*/
|
|
6595
|
-
enabled:
|
|
6546
|
+
enabled: import_lazy_zod10.z.boolean().default(true),
|
|
6596
6547
|
/**
|
|
6597
6548
|
* Behavior when a tool from a skipped app is called
|
|
6598
6549
|
* - 'anonymous': If app supports anonymous access, use it; otherwise require auth
|
|
@@ -6604,33 +6555,33 @@ var incrementalAuthConfigSchema = import_zod10.z.object({
|
|
|
6604
6555
|
* Allow users to skip app authorization during initial auth flow
|
|
6605
6556
|
* @default true
|
|
6606
6557
|
*/
|
|
6607
|
-
allowSkip:
|
|
6558
|
+
allowSkip: import_lazy_zod10.z.boolean().default(true),
|
|
6608
6559
|
/**
|
|
6609
6560
|
* Show all apps in a single authorization page (vs step-by-step)
|
|
6610
6561
|
* @default true
|
|
6611
6562
|
*/
|
|
6612
|
-
showAllAppsAtOnce:
|
|
6563
|
+
showAllAppsAtOnce: import_lazy_zod10.z.boolean().default(true)
|
|
6613
6564
|
});
|
|
6614
6565
|
|
|
6615
6566
|
// libs/auth/src/options/public.schema.ts
|
|
6616
|
-
var
|
|
6617
|
-
var publicAuthOptionsSchema =
|
|
6618
|
-
mode:
|
|
6567
|
+
var import_lazy_zod11 = require("@frontmcp/lazy-zod");
|
|
6568
|
+
var publicAuthOptionsSchema = import_lazy_zod11.z.object({
|
|
6569
|
+
mode: import_lazy_zod11.z.literal("public"),
|
|
6619
6570
|
/**
|
|
6620
6571
|
* Issuer identifier for anonymous JWTs
|
|
6621
6572
|
* @default auto-derived from server URL
|
|
6622
6573
|
*/
|
|
6623
|
-
issuer:
|
|
6574
|
+
issuer: import_lazy_zod11.z.string().optional(),
|
|
6624
6575
|
/**
|
|
6625
6576
|
* Anonymous session TTL in seconds
|
|
6626
6577
|
* @default 3600 (1 hour)
|
|
6627
6578
|
*/
|
|
6628
|
-
sessionTtl:
|
|
6579
|
+
sessionTtl: import_lazy_zod11.z.number().default(3600),
|
|
6629
6580
|
/**
|
|
6630
6581
|
* Scopes granted to anonymous sessions
|
|
6631
6582
|
* @default ['anonymous']
|
|
6632
6583
|
*/
|
|
6633
|
-
anonymousScopes:
|
|
6584
|
+
anonymousScopes: import_lazy_zod11.z.array(import_lazy_zod11.z.string()).default(["anonymous"]),
|
|
6634
6585
|
/**
|
|
6635
6586
|
* Tool/prompt access configuration for anonymous users
|
|
6636
6587
|
*/
|
|
@@ -6644,13 +6595,13 @@ var publicAuthOptionsSchema = import_zod11.z.object({
|
|
|
6644
6595
|
* Private key for signing anonymous tokens
|
|
6645
6596
|
* @default auto-generated
|
|
6646
6597
|
*/
|
|
6647
|
-
signKey: jwkSchema.or(
|
|
6598
|
+
signKey: jwkSchema.or(import_lazy_zod11.z.instanceof(Uint8Array)).optional()
|
|
6648
6599
|
});
|
|
6649
6600
|
|
|
6650
6601
|
// libs/auth/src/options/transparent.schema.ts
|
|
6651
|
-
var
|
|
6652
|
-
var transparentAuthOptionsSchema =
|
|
6653
|
-
mode:
|
|
6602
|
+
var import_lazy_zod12 = require("@frontmcp/lazy-zod");
|
|
6603
|
+
var transparentAuthOptionsSchema = import_lazy_zod12.z.object({
|
|
6604
|
+
mode: import_lazy_zod12.z.literal("transparent"),
|
|
6654
6605
|
/**
|
|
6655
6606
|
* Flattened remote provider fields (provider, clientId, clientSecret, scopes, providerConfig)
|
|
6656
6607
|
*/
|
|
@@ -6659,23 +6610,23 @@ var transparentAuthOptionsSchema = import_zod12.z.object({
|
|
|
6659
6610
|
* Expected token audience
|
|
6660
6611
|
* If not set, defaults to the resource URL
|
|
6661
6612
|
*/
|
|
6662
|
-
expectedAudience:
|
|
6613
|
+
expectedAudience: import_lazy_zod12.z.union([import_lazy_zod12.z.string(), import_lazy_zod12.z.array(import_lazy_zod12.z.string())]).optional(),
|
|
6663
6614
|
/**
|
|
6664
6615
|
* Required scopes for access
|
|
6665
6616
|
* Empty array means any valid token is accepted
|
|
6666
6617
|
* @default []
|
|
6667
6618
|
*/
|
|
6668
|
-
requiredScopes:
|
|
6619
|
+
requiredScopes: import_lazy_zod12.z.array(import_lazy_zod12.z.string()).default([]),
|
|
6669
6620
|
/**
|
|
6670
6621
|
* Allow anonymous fallback when no token is provided
|
|
6671
6622
|
* @default false
|
|
6672
6623
|
*/
|
|
6673
|
-
allowAnonymous:
|
|
6624
|
+
allowAnonymous: import_lazy_zod12.z.boolean().default(false),
|
|
6674
6625
|
/**
|
|
6675
6626
|
* Scopes granted to anonymous sessions (when allowAnonymous=true)
|
|
6676
6627
|
* @default ['anonymous']
|
|
6677
6628
|
*/
|
|
6678
|
-
anonymousScopes:
|
|
6629
|
+
anonymousScopes: import_lazy_zod12.z.array(import_lazy_zod12.z.string()).default(["anonymous"]),
|
|
6679
6630
|
/**
|
|
6680
6631
|
* Public access config for anonymous users (when allowAnonymous=true)
|
|
6681
6632
|
*/
|
|
@@ -6683,26 +6634,26 @@ var transparentAuthOptionsSchema = import_zod12.z.object({
|
|
|
6683
6634
|
});
|
|
6684
6635
|
|
|
6685
6636
|
// libs/auth/src/options/orchestrated.schema.ts
|
|
6686
|
-
var
|
|
6637
|
+
var import_lazy_zod13 = require("@frontmcp/lazy-zod");
|
|
6687
6638
|
var sharedAuthFields = {
|
|
6688
6639
|
local: localSigningConfigSchema.optional(),
|
|
6689
6640
|
tokenStorage: tokenStorageConfigSchema.default("memory"),
|
|
6690
|
-
allowDefaultPublic:
|
|
6691
|
-
anonymousScopes:
|
|
6641
|
+
allowDefaultPublic: import_lazy_zod13.z.boolean().default(false),
|
|
6642
|
+
anonymousScopes: import_lazy_zod13.z.array(import_lazy_zod13.z.string()).default(["anonymous"]),
|
|
6692
6643
|
publicAccess: publicAccessConfigSchema.optional(),
|
|
6693
6644
|
consent: consentConfigSchema.optional(),
|
|
6694
6645
|
federatedAuth: federatedAuthConfigSchema.optional(),
|
|
6695
6646
|
refresh: tokenRefreshConfigSchema.optional(),
|
|
6696
|
-
expectedAudience:
|
|
6647
|
+
expectedAudience: import_lazy_zod13.z.union([import_lazy_zod13.z.string(), import_lazy_zod13.z.array(import_lazy_zod13.z.string())]).optional(),
|
|
6697
6648
|
incrementalAuth: incrementalAuthConfigSchema.optional(),
|
|
6698
6649
|
cimd: cimdConfigSchema.optional()
|
|
6699
6650
|
};
|
|
6700
|
-
var localAuthSchema =
|
|
6701
|
-
mode:
|
|
6651
|
+
var localAuthSchema = import_lazy_zod13.z.object({
|
|
6652
|
+
mode: import_lazy_zod13.z.literal("local"),
|
|
6702
6653
|
...sharedAuthFields
|
|
6703
6654
|
});
|
|
6704
|
-
var remoteAuthSchema =
|
|
6705
|
-
mode:
|
|
6655
|
+
var remoteAuthSchema = import_lazy_zod13.z.object({
|
|
6656
|
+
mode: import_lazy_zod13.z.literal("remote"),
|
|
6706
6657
|
...flatRemoteProviderFields,
|
|
6707
6658
|
...sharedAuthFields
|
|
6708
6659
|
});
|
|
@@ -6710,8 +6661,8 @@ var orchestratedLocalSchema = localAuthSchema;
|
|
|
6710
6661
|
var orchestratedRemoteSchema = remoteAuthSchema;
|
|
6711
6662
|
|
|
6712
6663
|
// libs/auth/src/options/schema.ts
|
|
6713
|
-
var
|
|
6714
|
-
var authOptionsSchema =
|
|
6664
|
+
var import_lazy_zod14 = require("@frontmcp/lazy-zod");
|
|
6665
|
+
var authOptionsSchema = import_lazy_zod14.z.union([
|
|
6715
6666
|
publicAuthOptionsSchema,
|
|
6716
6667
|
transparentAuthOptionsSchema,
|
|
6717
6668
|
localAuthSchema,
|
|
@@ -6719,12 +6670,12 @@ var authOptionsSchema = import_zod14.z.union([
|
|
|
6719
6670
|
]);
|
|
6720
6671
|
|
|
6721
6672
|
// libs/auth/src/options/app-auth.schema.ts
|
|
6722
|
-
var
|
|
6673
|
+
var import_lazy_zod15 = require("@frontmcp/lazy-zod");
|
|
6723
6674
|
var standaloneOptionSchema = {
|
|
6724
|
-
standalone:
|
|
6725
|
-
excludeFromParent:
|
|
6675
|
+
standalone: import_lazy_zod15.z.boolean().optional(),
|
|
6676
|
+
excludeFromParent: import_lazy_zod15.z.boolean().optional()
|
|
6726
6677
|
};
|
|
6727
|
-
var appAuthOptionsSchema =
|
|
6678
|
+
var appAuthOptionsSchema = import_lazy_zod15.z.union([
|
|
6728
6679
|
publicAuthOptionsSchema.extend(standaloneOptionSchema),
|
|
6729
6680
|
transparentAuthOptionsSchema.extend(standaloneOptionSchema),
|
|
6730
6681
|
localAuthSchema.extend(standaloneOptionSchema),
|
|
@@ -6764,108 +6715,108 @@ function allowsPublicAccess(options) {
|
|
|
6764
6715
|
}
|
|
6765
6716
|
|
|
6766
6717
|
// libs/auth/src/consent/consent.types.ts
|
|
6767
|
-
var
|
|
6768
|
-
var consentToolItemSchema =
|
|
6718
|
+
var import_lazy_zod16 = require("@frontmcp/lazy-zod");
|
|
6719
|
+
var consentToolItemSchema = import_lazy_zod16.z.object({
|
|
6769
6720
|
/** Tool ID (e.g., 'slack:send_message') */
|
|
6770
|
-
id:
|
|
6721
|
+
id: import_lazy_zod16.z.string().min(1),
|
|
6771
6722
|
/** Tool name for display */
|
|
6772
|
-
name:
|
|
6723
|
+
name: import_lazy_zod16.z.string().min(1),
|
|
6773
6724
|
/** Tool description */
|
|
6774
|
-
description:
|
|
6725
|
+
description: import_lazy_zod16.z.string().optional(),
|
|
6775
6726
|
/** App ID this tool belongs to */
|
|
6776
|
-
appId:
|
|
6727
|
+
appId: import_lazy_zod16.z.string().min(1),
|
|
6777
6728
|
/** App name for display */
|
|
6778
|
-
appName:
|
|
6729
|
+
appName: import_lazy_zod16.z.string().min(1),
|
|
6779
6730
|
/** Whether the tool is selected by default */
|
|
6780
|
-
defaultSelected:
|
|
6731
|
+
defaultSelected: import_lazy_zod16.z.boolean().default(true),
|
|
6781
6732
|
/** Whether this tool requires specific scopes */
|
|
6782
|
-
requiredScopes:
|
|
6733
|
+
requiredScopes: import_lazy_zod16.z.array(import_lazy_zod16.z.string()).optional(),
|
|
6783
6734
|
/** Category for grouping (e.g., 'read', 'write', 'admin') */
|
|
6784
|
-
category:
|
|
6735
|
+
category: import_lazy_zod16.z.string().optional()
|
|
6785
6736
|
});
|
|
6786
|
-
var consentSelectionSchema =
|
|
6737
|
+
var consentSelectionSchema = import_lazy_zod16.z.object({
|
|
6787
6738
|
/** Selected tool IDs */
|
|
6788
|
-
selectedTools:
|
|
6739
|
+
selectedTools: import_lazy_zod16.z.array(import_lazy_zod16.z.string()),
|
|
6789
6740
|
/** Whether all tools were selected */
|
|
6790
|
-
allSelected:
|
|
6741
|
+
allSelected: import_lazy_zod16.z.boolean(),
|
|
6791
6742
|
/** Timestamp when consent was given */
|
|
6792
|
-
consentedAt:
|
|
6743
|
+
consentedAt: import_lazy_zod16.z.string().datetime(),
|
|
6793
6744
|
/** Consent version for tracking changes */
|
|
6794
|
-
consentVersion:
|
|
6745
|
+
consentVersion: import_lazy_zod16.z.string().default("1.0")
|
|
6795
6746
|
});
|
|
6796
|
-
var consentStateSchema =
|
|
6747
|
+
var consentStateSchema = import_lazy_zod16.z.object({
|
|
6797
6748
|
/** Whether consent flow is enabled */
|
|
6798
|
-
enabled:
|
|
6749
|
+
enabled: import_lazy_zod16.z.boolean(),
|
|
6799
6750
|
/** Available tools for consent */
|
|
6800
|
-
availableTools:
|
|
6751
|
+
availableTools: import_lazy_zod16.z.array(consentToolItemSchema),
|
|
6801
6752
|
/** Pre-selected tools (from previous consent or defaults) */
|
|
6802
|
-
preselectedTools:
|
|
6753
|
+
preselectedTools: import_lazy_zod16.z.array(import_lazy_zod16.z.string()).optional(),
|
|
6803
6754
|
/** Whether to show all tools or group by app */
|
|
6804
|
-
groupByApp:
|
|
6755
|
+
groupByApp: import_lazy_zod16.z.boolean().default(true),
|
|
6805
6756
|
/** Custom consent message */
|
|
6806
|
-
customMessage:
|
|
6757
|
+
customMessage: import_lazy_zod16.z.string().optional()
|
|
6807
6758
|
});
|
|
6808
|
-
var federatedProviderItemSchema =
|
|
6759
|
+
var federatedProviderItemSchema = import_lazy_zod16.z.object({
|
|
6809
6760
|
/** Provider ID (derived or explicit) */
|
|
6810
|
-
id:
|
|
6761
|
+
id: import_lazy_zod16.z.string().min(1),
|
|
6811
6762
|
/** Provider display name */
|
|
6812
|
-
name:
|
|
6763
|
+
name: import_lazy_zod16.z.string().min(1),
|
|
6813
6764
|
/** Provider description */
|
|
6814
|
-
description:
|
|
6765
|
+
description: import_lazy_zod16.z.string().optional(),
|
|
6815
6766
|
/** Provider icon URL or emoji */
|
|
6816
|
-
icon:
|
|
6767
|
+
icon: import_lazy_zod16.z.string().optional(),
|
|
6817
6768
|
/** Provider type */
|
|
6818
|
-
type:
|
|
6769
|
+
type: import_lazy_zod16.z.enum(["local", "remote", "transparent"]),
|
|
6819
6770
|
/** OAuth provider URL (for remote providers) */
|
|
6820
|
-
providerUrl:
|
|
6771
|
+
providerUrl: import_lazy_zod16.z.string().url().optional(),
|
|
6821
6772
|
/** Apps using this provider */
|
|
6822
|
-
appIds:
|
|
6773
|
+
appIds: import_lazy_zod16.z.array(import_lazy_zod16.z.string()),
|
|
6823
6774
|
/** App names using this provider */
|
|
6824
|
-
appNames:
|
|
6775
|
+
appNames: import_lazy_zod16.z.array(import_lazy_zod16.z.string()),
|
|
6825
6776
|
/** Scopes required by this provider */
|
|
6826
|
-
scopes:
|
|
6777
|
+
scopes: import_lazy_zod16.z.array(import_lazy_zod16.z.string()),
|
|
6827
6778
|
/** Whether this is the primary/parent provider */
|
|
6828
|
-
isPrimary:
|
|
6779
|
+
isPrimary: import_lazy_zod16.z.boolean(),
|
|
6829
6780
|
/** Whether this provider is optional (can be skipped) */
|
|
6830
|
-
isOptional:
|
|
6781
|
+
isOptional: import_lazy_zod16.z.boolean().default(false)
|
|
6831
6782
|
});
|
|
6832
|
-
var federatedLoginStateSchema =
|
|
6783
|
+
var federatedLoginStateSchema = import_lazy_zod16.z.object({
|
|
6833
6784
|
/** All available providers */
|
|
6834
|
-
providers:
|
|
6785
|
+
providers: import_lazy_zod16.z.array(federatedProviderItemSchema),
|
|
6835
6786
|
/** Primary provider ID (if any) */
|
|
6836
|
-
primaryProviderId:
|
|
6787
|
+
primaryProviderId: import_lazy_zod16.z.string().optional(),
|
|
6837
6788
|
/** Whether user can skip optional providers */
|
|
6838
|
-
allowSkip:
|
|
6789
|
+
allowSkip: import_lazy_zod16.z.boolean().default(true),
|
|
6839
6790
|
/** Pre-selected provider IDs (from previous session) */
|
|
6840
|
-
preselectedProviders:
|
|
6791
|
+
preselectedProviders: import_lazy_zod16.z.array(import_lazy_zod16.z.string()).optional()
|
|
6841
6792
|
});
|
|
6842
|
-
var federatedSelectionSchema =
|
|
6793
|
+
var federatedSelectionSchema = import_lazy_zod16.z.object({
|
|
6843
6794
|
/** Selected provider IDs */
|
|
6844
|
-
selectedProviders:
|
|
6795
|
+
selectedProviders: import_lazy_zod16.z.array(import_lazy_zod16.z.string()),
|
|
6845
6796
|
/** Skipped provider IDs */
|
|
6846
|
-
skippedProviders:
|
|
6797
|
+
skippedProviders: import_lazy_zod16.z.array(import_lazy_zod16.z.string()),
|
|
6847
6798
|
/** Provider-specific metadata */
|
|
6848
|
-
providerMetadata:
|
|
6799
|
+
providerMetadata: import_lazy_zod16.z.record(import_lazy_zod16.z.string(), import_lazy_zod16.z.unknown()).optional()
|
|
6849
6800
|
});
|
|
6850
6801
|
|
|
6851
6802
|
// libs/auth/src/detection/auth-provider-detection.ts
|
|
6852
|
-
var
|
|
6853
|
-
var detectedAuthProviderSchema =
|
|
6854
|
-
id:
|
|
6855
|
-
providerUrl:
|
|
6856
|
-
mode:
|
|
6857
|
-
appIds:
|
|
6858
|
-
scopes:
|
|
6859
|
-
isParentProvider:
|
|
6803
|
+
var import_lazy_zod17 = require("@frontmcp/lazy-zod");
|
|
6804
|
+
var detectedAuthProviderSchema = import_lazy_zod17.z.object({
|
|
6805
|
+
id: import_lazy_zod17.z.string(),
|
|
6806
|
+
providerUrl: import_lazy_zod17.z.string().optional(),
|
|
6807
|
+
mode: import_lazy_zod17.z.enum(["public", "transparent", "local", "remote"]),
|
|
6808
|
+
appIds: import_lazy_zod17.z.array(import_lazy_zod17.z.string()),
|
|
6809
|
+
scopes: import_lazy_zod17.z.array(import_lazy_zod17.z.string()),
|
|
6810
|
+
isParentProvider: import_lazy_zod17.z.boolean()
|
|
6860
6811
|
});
|
|
6861
|
-
var authProviderDetectionResultSchema =
|
|
6862
|
-
providers:
|
|
6863
|
-
requiresOrchestration:
|
|
6864
|
-
parentProviderId:
|
|
6865
|
-
childProviderIds:
|
|
6866
|
-
uniqueProviderCount:
|
|
6867
|
-
validationErrors:
|
|
6868
|
-
warnings:
|
|
6812
|
+
var authProviderDetectionResultSchema = import_lazy_zod17.z.object({
|
|
6813
|
+
providers: import_lazy_zod17.z.map(import_lazy_zod17.z.string(), detectedAuthProviderSchema),
|
|
6814
|
+
requiresOrchestration: import_lazy_zod17.z.boolean(),
|
|
6815
|
+
parentProviderId: import_lazy_zod17.z.string().optional(),
|
|
6816
|
+
childProviderIds: import_lazy_zod17.z.array(import_lazy_zod17.z.string()),
|
|
6817
|
+
uniqueProviderCount: import_lazy_zod17.z.number(),
|
|
6818
|
+
validationErrors: import_lazy_zod17.z.array(import_lazy_zod17.z.string()),
|
|
6819
|
+
warnings: import_lazy_zod17.z.array(import_lazy_zod17.z.string())
|
|
6869
6820
|
});
|
|
6870
6821
|
function deriveProviderId(options) {
|
|
6871
6822
|
if (isPublicMode(options)) {
|
|
@@ -7255,43 +7206,43 @@ var AudienceValidator = class _AudienceValidator {
|
|
|
7255
7206
|
};
|
|
7256
7207
|
|
|
7257
7208
|
// libs/auth/src/vault/auth-providers.types.ts
|
|
7258
|
-
var
|
|
7259
|
-
var credentialScopeSchema =
|
|
7260
|
-
var loadingStrategySchema =
|
|
7261
|
-
var getCredentialOptionsSchema =
|
|
7262
|
-
forceRefresh:
|
|
7263
|
-
scopes:
|
|
7264
|
-
timeout:
|
|
7209
|
+
var import_lazy_zod18 = require("@frontmcp/lazy-zod");
|
|
7210
|
+
var credentialScopeSchema = import_lazy_zod18.z.enum(["global", "user", "session"]);
|
|
7211
|
+
var loadingStrategySchema = import_lazy_zod18.z.enum(["eager", "lazy"]);
|
|
7212
|
+
var getCredentialOptionsSchema = import_lazy_zod18.z.object({
|
|
7213
|
+
forceRefresh: import_lazy_zod18.z.boolean().optional(),
|
|
7214
|
+
scopes: import_lazy_zod18.z.array(import_lazy_zod18.z.string()).optional(),
|
|
7215
|
+
timeout: import_lazy_zod18.z.number().positive().optional()
|
|
7265
7216
|
}).strict();
|
|
7266
|
-
var credentialProviderConfigSchema =
|
|
7267
|
-
name:
|
|
7268
|
-
description:
|
|
7217
|
+
var credentialProviderConfigSchema = import_lazy_zod18.z.object({
|
|
7218
|
+
name: import_lazy_zod18.z.string().min(1),
|
|
7219
|
+
description: import_lazy_zod18.z.string().optional(),
|
|
7269
7220
|
scope: credentialScopeSchema,
|
|
7270
7221
|
loading: loadingStrategySchema,
|
|
7271
|
-
cacheTtl:
|
|
7222
|
+
cacheTtl: import_lazy_zod18.z.number().nonnegative().optional(),
|
|
7272
7223
|
// Functions validated at runtime, not via Zod (Zod 4 compatibility)
|
|
7273
|
-
factory:
|
|
7274
|
-
refresh:
|
|
7275
|
-
toHeaders:
|
|
7276
|
-
metadata:
|
|
7277
|
-
required:
|
|
7224
|
+
factory: import_lazy_zod18.z.any(),
|
|
7225
|
+
refresh: import_lazy_zod18.z.any().optional(),
|
|
7226
|
+
toHeaders: import_lazy_zod18.z.any().optional(),
|
|
7227
|
+
metadata: import_lazy_zod18.z.record(import_lazy_zod18.z.string(), import_lazy_zod18.z.unknown()).optional(),
|
|
7228
|
+
required: import_lazy_zod18.z.boolean().optional()
|
|
7278
7229
|
}).strict();
|
|
7279
|
-
var authProviderMappingSchema =
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
name:
|
|
7283
|
-
required:
|
|
7284
|
-
scopes:
|
|
7285
|
-
alias:
|
|
7230
|
+
var authProviderMappingSchema = import_lazy_zod18.z.union([
|
|
7231
|
+
import_lazy_zod18.z.string(),
|
|
7232
|
+
import_lazy_zod18.z.object({
|
|
7233
|
+
name: import_lazy_zod18.z.string().min(1),
|
|
7234
|
+
required: import_lazy_zod18.z.boolean().optional().default(true),
|
|
7235
|
+
scopes: import_lazy_zod18.z.array(import_lazy_zod18.z.string()).optional(),
|
|
7236
|
+
alias: import_lazy_zod18.z.string().optional()
|
|
7286
7237
|
}).strict()
|
|
7287
7238
|
]);
|
|
7288
|
-
var authProvidersVaultOptionsSchema =
|
|
7289
|
-
enabled:
|
|
7290
|
-
useSharedStorage:
|
|
7291
|
-
namespace:
|
|
7292
|
-
defaultCacheTtl:
|
|
7293
|
-
maxCredentialsPerSession:
|
|
7294
|
-
providers:
|
|
7239
|
+
var authProvidersVaultOptionsSchema = import_lazy_zod18.z.object({
|
|
7240
|
+
enabled: import_lazy_zod18.z.boolean().optional(),
|
|
7241
|
+
useSharedStorage: import_lazy_zod18.z.boolean().optional().default(true),
|
|
7242
|
+
namespace: import_lazy_zod18.z.string().optional().default("authproviders:"),
|
|
7243
|
+
defaultCacheTtl: import_lazy_zod18.z.number().nonnegative().optional().default(36e5),
|
|
7244
|
+
maxCredentialsPerSession: import_lazy_zod18.z.number().positive().optional().default(100),
|
|
7245
|
+
providers: import_lazy_zod18.z.array(credentialProviderConfigSchema).optional()
|
|
7295
7246
|
}).strict();
|
|
7296
7247
|
|
|
7297
7248
|
// libs/auth/src/vault/credential-helpers.ts
|
|
@@ -7496,7 +7447,7 @@ var CredentialCache = class {
|
|
|
7496
7447
|
var AUTH_PROVIDERS_ACCESSOR = /* @__PURE__ */ Symbol.for("frontmcp:AUTH_PROVIDERS_ACCESSOR");
|
|
7497
7448
|
|
|
7498
7449
|
// libs/auth/src/vault/auth-providers.accessor.impl.ts
|
|
7499
|
-
var
|
|
7450
|
+
var import_utils31 = require("@frontmcp/utils");
|
|
7500
7451
|
var AuthProvidersAccessorImpl = class {
|
|
7501
7452
|
constructor(registry, vault, cache, loader, context, logger) {
|
|
7502
7453
|
this.registry = registry;
|
|
@@ -7705,7 +7656,7 @@ var AuthProvidersAccessorImpl = class {
|
|
|
7705
7656
|
return { [credential.headerName]: credential.key };
|
|
7706
7657
|
case "basic": {
|
|
7707
7658
|
const value = `${credential.username}:${credential.password}`;
|
|
7708
|
-
const encoded = credential.encodedValue ?? (0,
|
|
7659
|
+
const encoded = credential.encodedValue ?? (0, import_utils31.base64Encode)(new TextEncoder().encode(value));
|
|
7709
7660
|
return { Authorization: `Basic ${encoded}` };
|
|
7710
7661
|
}
|
|
7711
7662
|
case "custom":
|
|
@@ -8256,6 +8207,971 @@ var LazyCredentialLoader = class {
|
|
|
8256
8207
|
this.loading.clear();
|
|
8257
8208
|
}
|
|
8258
8209
|
};
|
|
8210
|
+
|
|
8211
|
+
// libs/auth/src/authorities/authorities.context.ts
|
|
8212
|
+
function resolveDotPath(obj, path) {
|
|
8213
|
+
if (path in obj) {
|
|
8214
|
+
return obj[path];
|
|
8215
|
+
}
|
|
8216
|
+
const segments = path.split(".");
|
|
8217
|
+
let current = obj;
|
|
8218
|
+
for (const segment of segments) {
|
|
8219
|
+
if (current === null || current === void 0 || typeof current !== "object") {
|
|
8220
|
+
return void 0;
|
|
8221
|
+
}
|
|
8222
|
+
current = current[segment];
|
|
8223
|
+
}
|
|
8224
|
+
return current;
|
|
8225
|
+
}
|
|
8226
|
+
function toStringArray(value) {
|
|
8227
|
+
if (Array.isArray(value)) {
|
|
8228
|
+
return value.filter((v) => typeof v === "string");
|
|
8229
|
+
}
|
|
8230
|
+
if (typeof value === "string") {
|
|
8231
|
+
return value.split(/\s+/).filter(Boolean);
|
|
8232
|
+
}
|
|
8233
|
+
return [];
|
|
8234
|
+
}
|
|
8235
|
+
var noopRelationshipResolver = {
|
|
8236
|
+
async check() {
|
|
8237
|
+
return false;
|
|
8238
|
+
}
|
|
8239
|
+
};
|
|
8240
|
+
var AuthoritiesContextBuilder = class {
|
|
8241
|
+
claimsMapping;
|
|
8242
|
+
claimsResolver;
|
|
8243
|
+
relationshipResolver;
|
|
8244
|
+
constructor(options = {}) {
|
|
8245
|
+
this.claimsMapping = options.claimsMapping;
|
|
8246
|
+
this.claimsResolver = options.claimsResolver;
|
|
8247
|
+
this.relationshipResolver = options.relationshipResolver ?? noopRelationshipResolver;
|
|
8248
|
+
}
|
|
8249
|
+
/**
|
|
8250
|
+
* Build an evaluation context from AuthInfo and tool input.
|
|
8251
|
+
*/
|
|
8252
|
+
build(authInfo, input = {}, env = {}) {
|
|
8253
|
+
if (this.claimsResolver) {
|
|
8254
|
+
const resolved = this.claimsResolver(authInfo);
|
|
8255
|
+
return {
|
|
8256
|
+
user: {
|
|
8257
|
+
sub: authInfo?.user?.sub ?? "",
|
|
8258
|
+
roles: resolved.roles,
|
|
8259
|
+
permissions: resolved.permissions,
|
|
8260
|
+
claims: resolved.claims
|
|
8261
|
+
},
|
|
8262
|
+
input,
|
|
8263
|
+
env,
|
|
8264
|
+
relationships: this.relationshipResolver
|
|
8265
|
+
};
|
|
8266
|
+
}
|
|
8267
|
+
const user = authInfo?.user ?? {};
|
|
8268
|
+
const authorization = authInfo?.extra?.["authorization"];
|
|
8269
|
+
const authorizationClaims = authorization?.["claims"] ?? {};
|
|
8270
|
+
const rawClaims = {
|
|
8271
|
+
...authorizationClaims,
|
|
8272
|
+
...user
|
|
8273
|
+
};
|
|
8274
|
+
let roles;
|
|
8275
|
+
if (this.claimsMapping?.roles) {
|
|
8276
|
+
roles = toStringArray(resolveDotPath(rawClaims, this.claimsMapping.roles));
|
|
8277
|
+
} else {
|
|
8278
|
+
roles = toStringArray(
|
|
8279
|
+
user["roles"] ?? authorization?.["scopes"] ?? []
|
|
8280
|
+
);
|
|
8281
|
+
}
|
|
8282
|
+
let permissions;
|
|
8283
|
+
if (this.claimsMapping?.permissions) {
|
|
8284
|
+
permissions = toStringArray(resolveDotPath(rawClaims, this.claimsMapping.permissions));
|
|
8285
|
+
} else {
|
|
8286
|
+
permissions = toStringArray(user["permissions"] ?? []);
|
|
8287
|
+
}
|
|
8288
|
+
const sub = this.claimsMapping?.userId ? String(resolveDotPath(rawClaims, this.claimsMapping.userId) ?? "") : user.sub ?? "";
|
|
8289
|
+
return {
|
|
8290
|
+
user: {
|
|
8291
|
+
sub,
|
|
8292
|
+
roles,
|
|
8293
|
+
permissions,
|
|
8294
|
+
claims: rawClaims
|
|
8295
|
+
},
|
|
8296
|
+
input,
|
|
8297
|
+
env,
|
|
8298
|
+
relationships: this.relationshipResolver
|
|
8299
|
+
};
|
|
8300
|
+
}
|
|
8301
|
+
};
|
|
8302
|
+
|
|
8303
|
+
// libs/auth/src/context/frontmcp-auth-context.impl.ts
|
|
8304
|
+
function toStringArray2(value) {
|
|
8305
|
+
if (Array.isArray(value)) {
|
|
8306
|
+
return value.filter((v) => typeof v === "string");
|
|
8307
|
+
}
|
|
8308
|
+
if (typeof value === "string") {
|
|
8309
|
+
return value.split(/\s+/).filter(Boolean);
|
|
8310
|
+
}
|
|
8311
|
+
return [];
|
|
8312
|
+
}
|
|
8313
|
+
var FrontMcpAuthContextImpl = class {
|
|
8314
|
+
user;
|
|
8315
|
+
isAnonymous;
|
|
8316
|
+
mode;
|
|
8317
|
+
sessionId;
|
|
8318
|
+
scopes;
|
|
8319
|
+
claims;
|
|
8320
|
+
roles;
|
|
8321
|
+
permissions;
|
|
8322
|
+
constructor(source, claimsMapping) {
|
|
8323
|
+
const rawUser = source.user ?? {};
|
|
8324
|
+
const sub = claimsMapping?.userId ? String(resolveDotPath(this.buildRawClaims(source), claimsMapping.userId) ?? rawUser.sub ?? "") : String(rawUser.sub ?? "");
|
|
8325
|
+
this.user = Object.freeze({
|
|
8326
|
+
sub,
|
|
8327
|
+
name: rawUser.name,
|
|
8328
|
+
email: rawUser.email,
|
|
8329
|
+
picture: rawUser.picture
|
|
8330
|
+
});
|
|
8331
|
+
this.isAnonymous = sub === "" || sub.startsWith("anon:");
|
|
8332
|
+
const extraAuth = source.extra?.["authorization"];
|
|
8333
|
+
this.mode = String(
|
|
8334
|
+
source.extra?.["authMode"] ?? extraAuth?.["mode"] ?? (source.extra?.["isPublic"] === true || rawUser["anonymous"] === true ? "public" : "authenticated")
|
|
8335
|
+
);
|
|
8336
|
+
this.sessionId = typeof source.sessionId === "string" ? source.sessionId : "";
|
|
8337
|
+
this.scopes = Object.freeze(
|
|
8338
|
+
Array.isArray(source.scopes) ? source.scopes.filter((s) => typeof s === "string") : []
|
|
8339
|
+
);
|
|
8340
|
+
const rawClaims = this.buildRawClaims(source);
|
|
8341
|
+
this.claims = Object.freeze({ ...rawClaims });
|
|
8342
|
+
if (claimsMapping?.roles) {
|
|
8343
|
+
this.roles = Object.freeze([...toStringArray2(resolveDotPath(rawClaims, claimsMapping.roles))]);
|
|
8344
|
+
} else {
|
|
8345
|
+
this.roles = Object.freeze([
|
|
8346
|
+
...toStringArray2(rawUser["roles"] ?? extraAuth?.["scopes"] ?? [])
|
|
8347
|
+
]);
|
|
8348
|
+
}
|
|
8349
|
+
if (claimsMapping?.permissions) {
|
|
8350
|
+
this.permissions = Object.freeze([...toStringArray2(resolveDotPath(rawClaims, claimsMapping.permissions))]);
|
|
8351
|
+
} else {
|
|
8352
|
+
this.permissions = Object.freeze([...toStringArray2(rawUser["permissions"] ?? [])]);
|
|
8353
|
+
}
|
|
8354
|
+
}
|
|
8355
|
+
// -- Query methods -------------------------------------------------
|
|
8356
|
+
hasRole(role) {
|
|
8357
|
+
return this.roles.includes(role);
|
|
8358
|
+
}
|
|
8359
|
+
hasAllRoles(roles) {
|
|
8360
|
+
return roles.every((r) => this.roles.includes(r));
|
|
8361
|
+
}
|
|
8362
|
+
hasAnyRole(roles) {
|
|
8363
|
+
return roles.some((r) => this.roles.includes(r));
|
|
8364
|
+
}
|
|
8365
|
+
hasPermission(permission) {
|
|
8366
|
+
return this.permissions.includes(permission);
|
|
8367
|
+
}
|
|
8368
|
+
hasAllPermissions(permissions) {
|
|
8369
|
+
return permissions.every((p) => this.permissions.includes(p));
|
|
8370
|
+
}
|
|
8371
|
+
hasAnyPermission(permissions) {
|
|
8372
|
+
return permissions.some((p) => this.permissions.includes(p));
|
|
8373
|
+
}
|
|
8374
|
+
hasScope(scope) {
|
|
8375
|
+
return this.scopes.includes(scope);
|
|
8376
|
+
}
|
|
8377
|
+
hasAllScopes(scopes) {
|
|
8378
|
+
return scopes.every((s) => this.scopes.includes(s));
|
|
8379
|
+
}
|
|
8380
|
+
hasAnyScope(scopes) {
|
|
8381
|
+
return scopes.some((s) => this.scopes.includes(s));
|
|
8382
|
+
}
|
|
8383
|
+
// -- Internal helpers ----------------------------------------------
|
|
8384
|
+
/**
|
|
8385
|
+
* Build the merged raw claims map from user fields + extra.authorization.claims.
|
|
8386
|
+
* Mirrors the logic in AuthoritiesContextBuilder.build().
|
|
8387
|
+
*/
|
|
8388
|
+
buildRawClaims(source) {
|
|
8389
|
+
const rawUser = source.user ?? {};
|
|
8390
|
+
const extraAuth = source.extra?.["authorization"];
|
|
8391
|
+
const authorizationClaims = extraAuth?.["claims"] ?? {};
|
|
8392
|
+
return {
|
|
8393
|
+
...authorizationClaims,
|
|
8394
|
+
...rawUser
|
|
8395
|
+
};
|
|
8396
|
+
}
|
|
8397
|
+
};
|
|
8398
|
+
|
|
8399
|
+
// libs/auth/src/context/frontmcp-auth-context.factory.ts
|
|
8400
|
+
function buildAuthContext(authInfo, claimsMapping, pipes) {
|
|
8401
|
+
const base = new FrontMcpAuthContextImpl(authInfo, claimsMapping);
|
|
8402
|
+
if (!pipes || pipes.length === 0) {
|
|
8403
|
+
return base;
|
|
8404
|
+
}
|
|
8405
|
+
return runPipes(base, pipes);
|
|
8406
|
+
}
|
|
8407
|
+
async function runPipes(base, pipes) {
|
|
8408
|
+
const extensions = {};
|
|
8409
|
+
for (const pipe of pipes) {
|
|
8410
|
+
try {
|
|
8411
|
+
const result = await pipe(base.claims);
|
|
8412
|
+
if (result && typeof result === "object") {
|
|
8413
|
+
Object.assign(extensions, result);
|
|
8414
|
+
}
|
|
8415
|
+
} catch (error) {
|
|
8416
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
8417
|
+
console.warn(`[FrontMcpAuth] pipe failed: ${message}`);
|
|
8418
|
+
}
|
|
8419
|
+
}
|
|
8420
|
+
const merged = Object.create(Object.getPrototypeOf(base));
|
|
8421
|
+
Object.assign(merged, base, extensions);
|
|
8422
|
+
return Object.freeze(merged);
|
|
8423
|
+
}
|
|
8424
|
+
|
|
8425
|
+
// libs/auth/src/authorities/authorities.scope-mapping.ts
|
|
8426
|
+
function resolveRequiredScopes(denial, mapping, authorities) {
|
|
8427
|
+
const scopes = /* @__PURE__ */ new Set();
|
|
8428
|
+
if (typeof authorities === "string" && mapping.profiles?.[authorities]) {
|
|
8429
|
+
mapping.profiles[authorities].forEach((s) => scopes.add(s));
|
|
8430
|
+
}
|
|
8431
|
+
if (Array.isArray(authorities)) {
|
|
8432
|
+
for (const profileName of authorities) {
|
|
8433
|
+
if (typeof profileName === "string" && mapping.profiles?.[profileName]) {
|
|
8434
|
+
mapping.profiles[profileName].forEach((s) => scopes.add(s));
|
|
8435
|
+
}
|
|
8436
|
+
}
|
|
8437
|
+
}
|
|
8438
|
+
if (denial.kind === "roles" && denial.missing && mapping.roles) {
|
|
8439
|
+
for (const role of denial.missing) {
|
|
8440
|
+
const mapped = mapping.roles[role];
|
|
8441
|
+
if (mapped) mapped.forEach((s) => scopes.add(s));
|
|
8442
|
+
}
|
|
8443
|
+
}
|
|
8444
|
+
if (denial.kind === "permissions" && denial.missing && mapping.permissions) {
|
|
8445
|
+
for (const perm of denial.missing) {
|
|
8446
|
+
const mapped = mapping.permissions[perm];
|
|
8447
|
+
if (mapped) mapped.forEach((s) => scopes.add(s));
|
|
8448
|
+
}
|
|
8449
|
+
}
|
|
8450
|
+
return scopes.size > 0 ? [...scopes].sort() : void 0;
|
|
8451
|
+
}
|
|
8452
|
+
|
|
8453
|
+
// libs/auth/src/authorities/authorities.schema.ts
|
|
8454
|
+
var import_lazy_zod19 = require("@frontmcp/lazy-zod");
|
|
8455
|
+
var rbacRolesPolicySchema = import_lazy_zod19.z.object({
|
|
8456
|
+
all: import_lazy_zod19.z.array(import_lazy_zod19.z.string().min(1)).optional(),
|
|
8457
|
+
any: import_lazy_zod19.z.array(import_lazy_zod19.z.string().min(1)).optional()
|
|
8458
|
+
}).refine((data) => data.all !== void 0 || data.any !== void 0, {
|
|
8459
|
+
message: 'Roles policy must have at least "all" or "any"'
|
|
8460
|
+
});
|
|
8461
|
+
var rbacPermissionsPolicySchema = import_lazy_zod19.z.object({
|
|
8462
|
+
all: import_lazy_zod19.z.array(import_lazy_zod19.z.string().min(1)).optional(),
|
|
8463
|
+
any: import_lazy_zod19.z.array(import_lazy_zod19.z.string().min(1)).optional()
|
|
8464
|
+
}).refine((data) => data.all !== void 0 || data.any !== void 0, {
|
|
8465
|
+
message: 'Permissions policy must have at least "all" or "any"'
|
|
8466
|
+
});
|
|
8467
|
+
var abacOperatorSchema = import_lazy_zod19.z.enum([
|
|
8468
|
+
"eq",
|
|
8469
|
+
"neq",
|
|
8470
|
+
"in",
|
|
8471
|
+
"notIn",
|
|
8472
|
+
"gt",
|
|
8473
|
+
"gte",
|
|
8474
|
+
"lt",
|
|
8475
|
+
"lte",
|
|
8476
|
+
"contains",
|
|
8477
|
+
"startsWith",
|
|
8478
|
+
"endsWith",
|
|
8479
|
+
"exists",
|
|
8480
|
+
"matches"
|
|
8481
|
+
]);
|
|
8482
|
+
var abacConditionSchema = import_lazy_zod19.z.object({
|
|
8483
|
+
path: import_lazy_zod19.z.string().min(1),
|
|
8484
|
+
op: abacOperatorSchema,
|
|
8485
|
+
value: import_lazy_zod19.z.unknown()
|
|
8486
|
+
});
|
|
8487
|
+
var abacPolicySchema = import_lazy_zod19.z.object({
|
|
8488
|
+
match: import_lazy_zod19.z.record(import_lazy_zod19.z.string(), import_lazy_zod19.z.unknown()).optional(),
|
|
8489
|
+
conditions: import_lazy_zod19.z.array(abacConditionSchema).optional()
|
|
8490
|
+
}).refine((data) => data.match !== void 0 || data.conditions !== void 0, {
|
|
8491
|
+
message: 'Attributes policy must have at least "match" or "conditions"'
|
|
8492
|
+
});
|
|
8493
|
+
var resourceIdRefSchema = import_lazy_zod19.z.union([
|
|
8494
|
+
import_lazy_zod19.z.string().min(1),
|
|
8495
|
+
import_lazy_zod19.z.object({ fromInput: import_lazy_zod19.z.string().min(1) }).strict(),
|
|
8496
|
+
import_lazy_zod19.z.object({ fromClaims: import_lazy_zod19.z.string().min(1) }).strict()
|
|
8497
|
+
]);
|
|
8498
|
+
var rebacPolicySchema = import_lazy_zod19.z.object({
|
|
8499
|
+
type: import_lazy_zod19.z.string().min(1),
|
|
8500
|
+
resource: import_lazy_zod19.z.string().min(1),
|
|
8501
|
+
resourceId: resourceIdRefSchema
|
|
8502
|
+
});
|
|
8503
|
+
var basePolicyShape = {
|
|
8504
|
+
roles: rbacRolesPolicySchema.optional(),
|
|
8505
|
+
permissions: rbacPermissionsPolicySchema.optional(),
|
|
8506
|
+
attributes: abacPolicySchema.optional(),
|
|
8507
|
+
relationships: import_lazy_zod19.z.union([rebacPolicySchema, import_lazy_zod19.z.array(rebacPolicySchema)]).optional(),
|
|
8508
|
+
custom: import_lazy_zod19.z.record(import_lazy_zod19.z.string(), import_lazy_zod19.z.unknown()).optional(),
|
|
8509
|
+
guards: import_lazy_zod19.z.array(import_lazy_zod19.z.instanceof(Function)).optional(),
|
|
8510
|
+
operator: import_lazy_zod19.z.enum(["AND", "OR"]).optional()
|
|
8511
|
+
};
|
|
8512
|
+
var authoritiesPolicySchema = import_lazy_zod19.z.lazy(
|
|
8513
|
+
() => import_lazy_zod19.z.object({
|
|
8514
|
+
...basePolicyShape,
|
|
8515
|
+
not: authoritiesPolicySchema.optional(),
|
|
8516
|
+
anyOf: import_lazy_zod19.z.array(authoritiesPolicySchema).optional(),
|
|
8517
|
+
allOf: import_lazy_zod19.z.array(authoritiesPolicySchema).optional()
|
|
8518
|
+
})
|
|
8519
|
+
);
|
|
8520
|
+
var authoritiesMetadataSchema = import_lazy_zod19.z.union([
|
|
8521
|
+
import_lazy_zod19.z.string().min(1),
|
|
8522
|
+
import_lazy_zod19.z.array(import_lazy_zod19.z.string().min(1)).min(1),
|
|
8523
|
+
authoritiesPolicySchema
|
|
8524
|
+
]);
|
|
8525
|
+
var authoritiesClaimsMappingSchema = import_lazy_zod19.z.record(import_lazy_zod19.z.string(), import_lazy_zod19.z.string().optional()).refine((data) => Object.values(data).some((v) => v !== void 0), {
|
|
8526
|
+
message: "Claims mapping must have at least one mapping"
|
|
8527
|
+
});
|
|
8528
|
+
var authoritiesConfigSchema = import_lazy_zod19.z.object({
|
|
8529
|
+
claimsMapping: authoritiesClaimsMappingSchema.optional(),
|
|
8530
|
+
profiles: import_lazy_zod19.z.record(import_lazy_zod19.z.string().min(1), authoritiesPolicySchema).optional()
|
|
8531
|
+
});
|
|
8532
|
+
|
|
8533
|
+
// libs/auth/src/authorities/authorities.evaluator.ts
|
|
8534
|
+
function evaluateRbacRoles(policy, ctx) {
|
|
8535
|
+
const userRoles = ctx.user.roles;
|
|
8536
|
+
if (policy.all) {
|
|
8537
|
+
const missing = policy.all.filter((r) => !userRoles.includes(r));
|
|
8538
|
+
if (missing.length > 0) {
|
|
8539
|
+
return {
|
|
8540
|
+
granted: false,
|
|
8541
|
+
deniedBy: `roles.all: missing ${missing.map((r) => `'${r}'`).join(", ")}`,
|
|
8542
|
+
denial: { kind: "roles", path: "roles.all", missing },
|
|
8543
|
+
evaluatedPolicies: ["roles.all"]
|
|
8544
|
+
};
|
|
8545
|
+
}
|
|
8546
|
+
}
|
|
8547
|
+
if (policy.any) {
|
|
8548
|
+
const hasAny = policy.any.some((r) => userRoles.includes(r));
|
|
8549
|
+
if (!hasAny) {
|
|
8550
|
+
return {
|
|
8551
|
+
granted: false,
|
|
8552
|
+
deniedBy: `roles.any: user has none of ${policy.any.map((r) => `'${r}'`).join(", ")}`,
|
|
8553
|
+
denial: { kind: "roles", path: "roles.any", missing: policy.any },
|
|
8554
|
+
evaluatedPolicies: ["roles.any"]
|
|
8555
|
+
};
|
|
8556
|
+
}
|
|
8557
|
+
}
|
|
8558
|
+
return { granted: true, evaluatedPolicies: ["roles"] };
|
|
8559
|
+
}
|
|
8560
|
+
function evaluateRbacPermissions(policy, ctx) {
|
|
8561
|
+
const userPerms = ctx.user.permissions;
|
|
8562
|
+
if (policy.all) {
|
|
8563
|
+
const missing = policy.all.filter((p) => !userPerms.includes(p));
|
|
8564
|
+
if (missing.length > 0) {
|
|
8565
|
+
return {
|
|
8566
|
+
granted: false,
|
|
8567
|
+
deniedBy: `permissions.all: missing ${missing.map((p) => `'${p}'`).join(", ")}`,
|
|
8568
|
+
denial: { kind: "permissions", path: "permissions.all", missing },
|
|
8569
|
+
evaluatedPolicies: ["permissions.all"]
|
|
8570
|
+
};
|
|
8571
|
+
}
|
|
8572
|
+
}
|
|
8573
|
+
if (policy.any) {
|
|
8574
|
+
const hasAny = policy.any.some((p) => userPerms.includes(p));
|
|
8575
|
+
if (!hasAny) {
|
|
8576
|
+
return {
|
|
8577
|
+
granted: false,
|
|
8578
|
+
deniedBy: `permissions.any: user has none of ${policy.any.map((p) => `'${p}'`).join(", ")}`,
|
|
8579
|
+
denial: { kind: "permissions", path: "permissions.any", missing: policy.any },
|
|
8580
|
+
evaluatedPolicies: ["permissions.any"]
|
|
8581
|
+
};
|
|
8582
|
+
}
|
|
8583
|
+
}
|
|
8584
|
+
return { granted: true, evaluatedPolicies: ["permissions"] };
|
|
8585
|
+
}
|
|
8586
|
+
function buildContextEnvelope(ctx) {
|
|
8587
|
+
return {
|
|
8588
|
+
user: ctx.user,
|
|
8589
|
+
claims: ctx.user.claims,
|
|
8590
|
+
input: ctx.input,
|
|
8591
|
+
env: ctx.env
|
|
8592
|
+
};
|
|
8593
|
+
}
|
|
8594
|
+
function resolveValue(value, ctx) {
|
|
8595
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
8596
|
+
const obj = value;
|
|
8597
|
+
if ("fromInput" in obj && typeof obj["fromInput"] === "string") {
|
|
8598
|
+
return ctx.input[obj["fromInput"]];
|
|
8599
|
+
}
|
|
8600
|
+
if ("fromClaims" in obj && typeof obj["fromClaims"] === "string") {
|
|
8601
|
+
return resolveDotPath(ctx.user.claims, obj["fromClaims"]);
|
|
8602
|
+
}
|
|
8603
|
+
}
|
|
8604
|
+
return value;
|
|
8605
|
+
}
|
|
8606
|
+
function applyOperator(actual, op, expected) {
|
|
8607
|
+
switch (op) {
|
|
8608
|
+
case "eq":
|
|
8609
|
+
return actual === expected;
|
|
8610
|
+
case "neq":
|
|
8611
|
+
return actual !== expected;
|
|
8612
|
+
case "in":
|
|
8613
|
+
return Array.isArray(expected) && expected.includes(actual);
|
|
8614
|
+
case "notIn":
|
|
8615
|
+
return Array.isArray(expected) && !expected.includes(actual);
|
|
8616
|
+
case "gt":
|
|
8617
|
+
return typeof actual === "number" && typeof expected === "number" && actual > expected;
|
|
8618
|
+
case "gte":
|
|
8619
|
+
return typeof actual === "number" && typeof expected === "number" && actual >= expected;
|
|
8620
|
+
case "lt":
|
|
8621
|
+
return typeof actual === "number" && typeof expected === "number" && actual < expected;
|
|
8622
|
+
case "lte":
|
|
8623
|
+
return typeof actual === "number" && typeof expected === "number" && actual <= expected;
|
|
8624
|
+
case "contains":
|
|
8625
|
+
if (typeof actual === "string" && typeof expected === "string") return actual.includes(expected);
|
|
8626
|
+
if (Array.isArray(actual)) return actual.includes(expected);
|
|
8627
|
+
return false;
|
|
8628
|
+
case "startsWith":
|
|
8629
|
+
return typeof actual === "string" && typeof expected === "string" && actual.startsWith(expected);
|
|
8630
|
+
case "endsWith":
|
|
8631
|
+
return typeof actual === "string" && typeof expected === "string" && actual.endsWith(expected);
|
|
8632
|
+
case "exists":
|
|
8633
|
+
return expected ? actual !== void 0 && actual !== null : actual === void 0 || actual === null;
|
|
8634
|
+
case "matches":
|
|
8635
|
+
if (typeof actual !== "string" || typeof expected !== "string") return false;
|
|
8636
|
+
if (expected.length > 256) return false;
|
|
8637
|
+
if (/(\+\+|\*\*|\{\d+,\d*\}\{)/.test(expected)) return false;
|
|
8638
|
+
try {
|
|
8639
|
+
return new RegExp(expected).test(actual);
|
|
8640
|
+
} catch {
|
|
8641
|
+
return false;
|
|
8642
|
+
}
|
|
8643
|
+
default:
|
|
8644
|
+
return false;
|
|
8645
|
+
}
|
|
8646
|
+
}
|
|
8647
|
+
function evaluateCondition(condition, envelope, ctx) {
|
|
8648
|
+
const actual = resolveDotPath(envelope, condition.path);
|
|
8649
|
+
const expected = resolveValue(condition.value, ctx);
|
|
8650
|
+
return applyOperator(actual, condition.op, expected);
|
|
8651
|
+
}
|
|
8652
|
+
function evaluateAbac(policy, ctx) {
|
|
8653
|
+
const envelope = buildContextEnvelope(ctx);
|
|
8654
|
+
if (policy.match) {
|
|
8655
|
+
for (const [path, expectedRaw] of Object.entries(policy.match)) {
|
|
8656
|
+
const actual = resolveDotPath(envelope, path);
|
|
8657
|
+
const expected = resolveValue(expectedRaw, ctx);
|
|
8658
|
+
if (actual !== expected) {
|
|
8659
|
+
return {
|
|
8660
|
+
granted: false,
|
|
8661
|
+
deniedBy: `attributes.match: '${path}' expected '${String(expected)}' but got '${String(actual)}'`,
|
|
8662
|
+
denial: { kind: "attributes", path: "attributes.match", expected, actual },
|
|
8663
|
+
evaluatedPolicies: ["attributes.match"]
|
|
8664
|
+
};
|
|
8665
|
+
}
|
|
8666
|
+
}
|
|
8667
|
+
}
|
|
8668
|
+
if (policy.conditions) {
|
|
8669
|
+
for (let i = 0; i < policy.conditions.length; i++) {
|
|
8670
|
+
const condition = policy.conditions[i];
|
|
8671
|
+
if (!evaluateCondition(condition, envelope, ctx)) {
|
|
8672
|
+
const expected = resolveValue(condition.value, ctx);
|
|
8673
|
+
const actual = resolveDotPath(envelope, condition.path);
|
|
8674
|
+
return {
|
|
8675
|
+
granted: false,
|
|
8676
|
+
deniedBy: `attributes.conditions: '${condition.path}' failed '${condition.op}' check against '${String(expected)}'`,
|
|
8677
|
+
denial: { kind: "attributes", path: `attributes.conditions[${i}]`, expected, actual },
|
|
8678
|
+
evaluatedPolicies: ["attributes.conditions"]
|
|
8679
|
+
};
|
|
8680
|
+
}
|
|
8681
|
+
}
|
|
8682
|
+
}
|
|
8683
|
+
return { granted: true, evaluatedPolicies: ["attributes"] };
|
|
8684
|
+
}
|
|
8685
|
+
function resolveResourceId(ref, ctx) {
|
|
8686
|
+
if (typeof ref === "string") return ref;
|
|
8687
|
+
if ("fromInput" in ref) {
|
|
8688
|
+
const val = ctx.input[ref.fromInput];
|
|
8689
|
+
return typeof val === "string" ? val : void 0;
|
|
8690
|
+
}
|
|
8691
|
+
if ("fromClaims" in ref) {
|
|
8692
|
+
const val = resolveDotPath(ctx.user.claims, ref.fromClaims);
|
|
8693
|
+
return typeof val === "string" ? val : void 0;
|
|
8694
|
+
}
|
|
8695
|
+
return void 0;
|
|
8696
|
+
}
|
|
8697
|
+
async function evaluateSingleRebac(policy, ctx) {
|
|
8698
|
+
const resourceId = resolveResourceId(policy.resourceId, ctx);
|
|
8699
|
+
if (resourceId === void 0) {
|
|
8700
|
+
return {
|
|
8701
|
+
granted: false,
|
|
8702
|
+
deniedBy: `relationships: could not resolve resourceId for ${policy.resource}`,
|
|
8703
|
+
denial: {
|
|
8704
|
+
kind: "relationships",
|
|
8705
|
+
path: "relationships",
|
|
8706
|
+
expected: `${policy.resource}:resourceId`,
|
|
8707
|
+
actual: void 0
|
|
8708
|
+
},
|
|
8709
|
+
evaluatedPolicies: ["relationships"]
|
|
8710
|
+
};
|
|
8711
|
+
}
|
|
8712
|
+
const hasRelationship = await ctx.relationships.check(policy.type, policy.resource, resourceId, ctx.user.sub, ctx);
|
|
8713
|
+
if (!hasRelationship) {
|
|
8714
|
+
return {
|
|
8715
|
+
granted: false,
|
|
8716
|
+
deniedBy: `relationships: user '${ctx.user.sub}' is not '${policy.type}' of ${policy.resource}:${resourceId}`,
|
|
8717
|
+
denial: {
|
|
8718
|
+
kind: "relationships",
|
|
8719
|
+
path: "relationships",
|
|
8720
|
+
expected: `${policy.type}:${policy.resource}:${resourceId}`
|
|
8721
|
+
},
|
|
8722
|
+
evaluatedPolicies: ["relationships"]
|
|
8723
|
+
};
|
|
8724
|
+
}
|
|
8725
|
+
return { granted: true, evaluatedPolicies: ["relationships"] };
|
|
8726
|
+
}
|
|
8727
|
+
async function evaluateRebac(policy, ctx) {
|
|
8728
|
+
const policies = Array.isArray(policy) ? policy : [policy];
|
|
8729
|
+
for (const p of policies) {
|
|
8730
|
+
const result = await evaluateSingleRebac(p, ctx);
|
|
8731
|
+
if (!result.granted) return result;
|
|
8732
|
+
}
|
|
8733
|
+
return { granted: true, evaluatedPolicies: ["relationships"] };
|
|
8734
|
+
}
|
|
8735
|
+
|
|
8736
|
+
// libs/auth/src/authorities/authorities.engine.ts
|
|
8737
|
+
function mergeResult(base, ...others) {
|
|
8738
|
+
const evaluatedPolicies = [...base.evaluatedPolicies];
|
|
8739
|
+
for (const other of others) {
|
|
8740
|
+
evaluatedPolicies.push(...other.evaluatedPolicies);
|
|
8741
|
+
}
|
|
8742
|
+
return { ...base, evaluatedPolicies };
|
|
8743
|
+
}
|
|
8744
|
+
function granted(policies) {
|
|
8745
|
+
return { granted: true, evaluatedPolicies: policies };
|
|
8746
|
+
}
|
|
8747
|
+
var AuthoritiesEngine = class {
|
|
8748
|
+
constructor(profiles, evaluators) {
|
|
8749
|
+
this.profiles = profiles;
|
|
8750
|
+
this.evaluators = evaluators;
|
|
8751
|
+
}
|
|
8752
|
+
/**
|
|
8753
|
+
* Evaluate an AuthoritiesMetadata value (string, string[], or policy object).
|
|
8754
|
+
*/
|
|
8755
|
+
async evaluate(authorities, ctx) {
|
|
8756
|
+
if (typeof authorities === "string") {
|
|
8757
|
+
return this.evaluateProfile(authorities, ctx);
|
|
8758
|
+
}
|
|
8759
|
+
if (Array.isArray(authorities)) {
|
|
8760
|
+
return this.evaluateProfileArray(authorities, ctx);
|
|
8761
|
+
}
|
|
8762
|
+
return this.evaluatePolicy(authorities, ctx);
|
|
8763
|
+
}
|
|
8764
|
+
/**
|
|
8765
|
+
* Resolve and evaluate a single named profile.
|
|
8766
|
+
*/
|
|
8767
|
+
async evaluateProfile(name, ctx) {
|
|
8768
|
+
const policy = this.profiles.resolve(name);
|
|
8769
|
+
if (!policy) {
|
|
8770
|
+
return {
|
|
8771
|
+
granted: false,
|
|
8772
|
+
deniedBy: `profile '${name}' is not registered`,
|
|
8773
|
+
evaluatedPolicies: [`profile:${name}`]
|
|
8774
|
+
};
|
|
8775
|
+
}
|
|
8776
|
+
const result = await this.evaluatePolicy(policy, ctx);
|
|
8777
|
+
if (!result.granted) {
|
|
8778
|
+
return {
|
|
8779
|
+
...result,
|
|
8780
|
+
deniedBy: `profile:${name}: ${result.deniedBy}`,
|
|
8781
|
+
evaluatedPolicies: [`profile:${name}`, ...result.evaluatedPolicies]
|
|
8782
|
+
};
|
|
8783
|
+
}
|
|
8784
|
+
return mergeResult(result, { granted: true, evaluatedPolicies: [`profile:${name}`] });
|
|
8785
|
+
}
|
|
8786
|
+
/**
|
|
8787
|
+
* Evaluate an array of profile names (AND semantics).
|
|
8788
|
+
*/
|
|
8789
|
+
async evaluateProfileArray(names, ctx) {
|
|
8790
|
+
const allPolicies = [];
|
|
8791
|
+
for (const name of names) {
|
|
8792
|
+
const result = await this.evaluateProfile(name, ctx);
|
|
8793
|
+
allPolicies.push(...result.evaluatedPolicies);
|
|
8794
|
+
if (!result.granted) {
|
|
8795
|
+
return { ...result, evaluatedPolicies: allPolicies };
|
|
8796
|
+
}
|
|
8797
|
+
}
|
|
8798
|
+
return { granted: true, evaluatedPolicies: allPolicies };
|
|
8799
|
+
}
|
|
8800
|
+
/**
|
|
8801
|
+
* Evaluate an inline policy object.
|
|
8802
|
+
*/
|
|
8803
|
+
async evaluatePolicy(policy, ctx) {
|
|
8804
|
+
const operator = policy.operator ?? "AND";
|
|
8805
|
+
const results = [];
|
|
8806
|
+
if (policy.roles) {
|
|
8807
|
+
results.push(evaluateRbacRoles(policy.roles, ctx));
|
|
8808
|
+
}
|
|
8809
|
+
if (policy.permissions) {
|
|
8810
|
+
results.push(evaluateRbacPermissions(policy.permissions, ctx));
|
|
8811
|
+
}
|
|
8812
|
+
if (policy.attributes) {
|
|
8813
|
+
results.push(evaluateAbac(policy.attributes, ctx));
|
|
8814
|
+
}
|
|
8815
|
+
if (policy.relationships) {
|
|
8816
|
+
results.push(await evaluateRebac(policy.relationships, ctx));
|
|
8817
|
+
}
|
|
8818
|
+
if (policy.custom) {
|
|
8819
|
+
results.push(await this.evaluateCustom(policy.custom, ctx));
|
|
8820
|
+
}
|
|
8821
|
+
if (policy.guards && policy.guards.length > 0) {
|
|
8822
|
+
results.push(await this.evaluateGuards(policy.guards, ctx));
|
|
8823
|
+
}
|
|
8824
|
+
if (policy.allOf) {
|
|
8825
|
+
results.push(await this.evaluateAllOf(policy.allOf, ctx));
|
|
8826
|
+
}
|
|
8827
|
+
if (policy.anyOf) {
|
|
8828
|
+
results.push(await this.evaluateAnyOf(policy.anyOf, ctx));
|
|
8829
|
+
}
|
|
8830
|
+
if (policy.not) {
|
|
8831
|
+
results.push(await this.evaluateNot(policy.not, ctx));
|
|
8832
|
+
}
|
|
8833
|
+
if (results.length === 0) {
|
|
8834
|
+
return granted([]);
|
|
8835
|
+
}
|
|
8836
|
+
return this.combineResults(results, operator);
|
|
8837
|
+
}
|
|
8838
|
+
/**
|
|
8839
|
+
* Combine results with AND or OR semantics.
|
|
8840
|
+
*/
|
|
8841
|
+
combineResults(results, operator) {
|
|
8842
|
+
const allPolicies = results.flatMap((r) => r.evaluatedPolicies);
|
|
8843
|
+
if (operator === "AND") {
|
|
8844
|
+
const denied = results.find((r) => !r.granted);
|
|
8845
|
+
if (denied) {
|
|
8846
|
+
return { ...denied, evaluatedPolicies: allPolicies };
|
|
8847
|
+
}
|
|
8848
|
+
return { granted: true, evaluatedPolicies: allPolicies };
|
|
8849
|
+
}
|
|
8850
|
+
const anyGranted = results.some((r) => r.granted);
|
|
8851
|
+
if (anyGranted) {
|
|
8852
|
+
return { granted: true, evaluatedPolicies: allPolicies };
|
|
8853
|
+
}
|
|
8854
|
+
const firstDenied = results.find((r) => !r.granted);
|
|
8855
|
+
return {
|
|
8856
|
+
granted: false,
|
|
8857
|
+
deniedBy: firstDenied?.deniedBy ?? "all policies denied (OR)",
|
|
8858
|
+
evaluatedPolicies: allPolicies
|
|
8859
|
+
};
|
|
8860
|
+
}
|
|
8861
|
+
/**
|
|
8862
|
+
* Evaluate custom evaluators.
|
|
8863
|
+
*/
|
|
8864
|
+
async evaluateCustom(custom, ctx) {
|
|
8865
|
+
const allPolicies = [];
|
|
8866
|
+
for (const [name, config] of Object.entries(custom)) {
|
|
8867
|
+
const evaluator = this.evaluators.get(name);
|
|
8868
|
+
if (!evaluator) {
|
|
8869
|
+
return {
|
|
8870
|
+
granted: false,
|
|
8871
|
+
deniedBy: `custom evaluator '${name}' is not registered`,
|
|
8872
|
+
evaluatedPolicies: [...allPolicies, `custom.${name}`]
|
|
8873
|
+
};
|
|
8874
|
+
}
|
|
8875
|
+
const result = await evaluator.evaluate(config, ctx);
|
|
8876
|
+
allPolicies.push(`custom.${name}`, ...result.evaluatedPolicies);
|
|
8877
|
+
if (!result.granted) {
|
|
8878
|
+
return { ...result, evaluatedPolicies: allPolicies };
|
|
8879
|
+
}
|
|
8880
|
+
}
|
|
8881
|
+
return { granted: true, evaluatedPolicies: allPolicies };
|
|
8882
|
+
}
|
|
8883
|
+
/**
|
|
8884
|
+
* Evaluate async guard functions in sequence.
|
|
8885
|
+
* Each guard returns true (granted) or a string (denial message).
|
|
8886
|
+
*/
|
|
8887
|
+
async evaluateGuards(guards, ctx) {
|
|
8888
|
+
for (let i = 0; i < guards.length; i++) {
|
|
8889
|
+
const guard = guards[i];
|
|
8890
|
+
const result = await guard(ctx);
|
|
8891
|
+
if (result === false || typeof result === "string") {
|
|
8892
|
+
const denialMessage = typeof result === "string" ? result : `guard[${i}] denied`;
|
|
8893
|
+
return {
|
|
8894
|
+
granted: false,
|
|
8895
|
+
deniedBy: `guards[${i}]: ${denialMessage}`,
|
|
8896
|
+
denial: { kind: "custom", path: `guards[${i}]` },
|
|
8897
|
+
evaluatedPolicies: ["guards"]
|
|
8898
|
+
};
|
|
8899
|
+
}
|
|
8900
|
+
}
|
|
8901
|
+
return { granted: true, evaluatedPolicies: ["guards"] };
|
|
8902
|
+
}
|
|
8903
|
+
/**
|
|
8904
|
+
* allOf combinator — all nested policies must pass.
|
|
8905
|
+
*/
|
|
8906
|
+
async evaluateAllOf(policies, ctx) {
|
|
8907
|
+
const allPolicies = ["allOf"];
|
|
8908
|
+
for (const policy of policies) {
|
|
8909
|
+
const result = await this.evaluatePolicy(policy, ctx);
|
|
8910
|
+
allPolicies.push(...result.evaluatedPolicies);
|
|
8911
|
+
if (!result.granted) {
|
|
8912
|
+
return { ...result, evaluatedPolicies: allPolicies };
|
|
8913
|
+
}
|
|
8914
|
+
}
|
|
8915
|
+
return { granted: true, evaluatedPolicies: allPolicies };
|
|
8916
|
+
}
|
|
8917
|
+
/**
|
|
8918
|
+
* anyOf combinator — at least one nested policy must pass.
|
|
8919
|
+
*/
|
|
8920
|
+
async evaluateAnyOf(policies, ctx) {
|
|
8921
|
+
const allPolicies = ["anyOf"];
|
|
8922
|
+
let lastDenied;
|
|
8923
|
+
for (const policy of policies) {
|
|
8924
|
+
const result = await this.evaluatePolicy(policy, ctx);
|
|
8925
|
+
allPolicies.push(...result.evaluatedPolicies);
|
|
8926
|
+
if (result.granted) {
|
|
8927
|
+
return { granted: true, evaluatedPolicies: allPolicies };
|
|
8928
|
+
}
|
|
8929
|
+
lastDenied = result;
|
|
8930
|
+
}
|
|
8931
|
+
return {
|
|
8932
|
+
granted: false,
|
|
8933
|
+
deniedBy: lastDenied?.deniedBy ?? "no policies in anyOf",
|
|
8934
|
+
denial: lastDenied?.denial ?? { kind: "anyOf", path: "anyOf" },
|
|
8935
|
+
evaluatedPolicies: allPolicies
|
|
8936
|
+
};
|
|
8937
|
+
}
|
|
8938
|
+
/**
|
|
8939
|
+
* not combinator — inverts the nested policy result.
|
|
8940
|
+
*/
|
|
8941
|
+
async evaluateNot(policy, ctx) {
|
|
8942
|
+
const result = await this.evaluatePolicy(policy, ctx);
|
|
8943
|
+
return {
|
|
8944
|
+
granted: !result.granted,
|
|
8945
|
+
deniedBy: result.granted ? "not: inner policy was granted (negated to denied)" : void 0,
|
|
8946
|
+
denial: result.granted ? { kind: "not", path: "not" } : void 0,
|
|
8947
|
+
evaluatedPolicies: ["not", ...result.evaluatedPolicies]
|
|
8948
|
+
};
|
|
8949
|
+
}
|
|
8950
|
+
};
|
|
8951
|
+
|
|
8952
|
+
// libs/auth/src/authorities/authorities.registry.ts
|
|
8953
|
+
var AuthoritiesProfileRegistry = class {
|
|
8954
|
+
profiles = /* @__PURE__ */ new Map();
|
|
8955
|
+
/**
|
|
8956
|
+
* Register a named profile.
|
|
8957
|
+
* Overwrites any existing profile with the same name.
|
|
8958
|
+
*/
|
|
8959
|
+
register(name, policy) {
|
|
8960
|
+
this.profiles.set(name, policy);
|
|
8961
|
+
}
|
|
8962
|
+
/**
|
|
8963
|
+
* Register multiple profiles at once.
|
|
8964
|
+
*/
|
|
8965
|
+
registerAll(profiles) {
|
|
8966
|
+
for (const [name, policy] of Object.entries(profiles)) {
|
|
8967
|
+
this.profiles.set(name, policy);
|
|
8968
|
+
}
|
|
8969
|
+
}
|
|
8970
|
+
/**
|
|
8971
|
+
* Resolve a profile name to its policy.
|
|
8972
|
+
* Returns `undefined` if the profile is not registered.
|
|
8973
|
+
*/
|
|
8974
|
+
resolve(name) {
|
|
8975
|
+
return this.profiles.get(name);
|
|
8976
|
+
}
|
|
8977
|
+
/**
|
|
8978
|
+
* Check if a profile is registered.
|
|
8979
|
+
*/
|
|
8980
|
+
has(name) {
|
|
8981
|
+
return this.profiles.has(name);
|
|
8982
|
+
}
|
|
8983
|
+
/**
|
|
8984
|
+
* Get all registered profiles.
|
|
8985
|
+
*/
|
|
8986
|
+
getAll() {
|
|
8987
|
+
const result = {};
|
|
8988
|
+
for (const [name, policy] of this.profiles) {
|
|
8989
|
+
result[name] = policy;
|
|
8990
|
+
}
|
|
8991
|
+
return result;
|
|
8992
|
+
}
|
|
8993
|
+
/**
|
|
8994
|
+
* Get the number of registered profiles.
|
|
8995
|
+
*/
|
|
8996
|
+
get size() {
|
|
8997
|
+
return this.profiles.size;
|
|
8998
|
+
}
|
|
8999
|
+
/**
|
|
9000
|
+
* Remove a profile by name.
|
|
9001
|
+
*/
|
|
9002
|
+
remove(name) {
|
|
9003
|
+
return this.profiles.delete(name);
|
|
9004
|
+
}
|
|
9005
|
+
/**
|
|
9006
|
+
* Clear all profiles.
|
|
9007
|
+
*/
|
|
9008
|
+
clear() {
|
|
9009
|
+
this.profiles.clear();
|
|
9010
|
+
}
|
|
9011
|
+
};
|
|
9012
|
+
var AuthoritiesEvaluatorRegistry = class {
|
|
9013
|
+
evaluators = /* @__PURE__ */ new Map();
|
|
9014
|
+
/**
|
|
9015
|
+
* Register a custom evaluator.
|
|
9016
|
+
* The evaluator's name must match the key used in `custom.*`.
|
|
9017
|
+
*/
|
|
9018
|
+
register(name, evaluator) {
|
|
9019
|
+
this.evaluators.set(name, evaluator);
|
|
9020
|
+
}
|
|
9021
|
+
/**
|
|
9022
|
+
* Register multiple evaluators at once.
|
|
9023
|
+
*/
|
|
9024
|
+
registerAll(evaluators) {
|
|
9025
|
+
for (const [name, evaluator] of Object.entries(evaluators)) {
|
|
9026
|
+
this.evaluators.set(name, evaluator);
|
|
9027
|
+
}
|
|
9028
|
+
}
|
|
9029
|
+
/**
|
|
9030
|
+
* Get an evaluator by name.
|
|
9031
|
+
*/
|
|
9032
|
+
get(name) {
|
|
9033
|
+
return this.evaluators.get(name);
|
|
9034
|
+
}
|
|
9035
|
+
/**
|
|
9036
|
+
* Check if an evaluator is registered.
|
|
9037
|
+
*/
|
|
9038
|
+
has(name) {
|
|
9039
|
+
return this.evaluators.has(name);
|
|
9040
|
+
}
|
|
9041
|
+
/**
|
|
9042
|
+
* Get the number of registered evaluators.
|
|
9043
|
+
*/
|
|
9044
|
+
get size() {
|
|
9045
|
+
return this.evaluators.size;
|
|
9046
|
+
}
|
|
9047
|
+
/**
|
|
9048
|
+
* Remove an evaluator by name.
|
|
9049
|
+
*/
|
|
9050
|
+
remove(name) {
|
|
9051
|
+
return this.evaluators.delete(name);
|
|
9052
|
+
}
|
|
9053
|
+
/**
|
|
9054
|
+
* Clear all evaluators.
|
|
9055
|
+
*/
|
|
9056
|
+
clear() {
|
|
9057
|
+
this.evaluators.clear();
|
|
9058
|
+
}
|
|
9059
|
+
};
|
|
9060
|
+
|
|
9061
|
+
// libs/auth/src/authorities/authorities.errors.ts
|
|
9062
|
+
var FORBIDDEN_CODE = -32003;
|
|
9063
|
+
var AuthorityDeniedError = class extends Error {
|
|
9064
|
+
/** MCP error code for JSON-RPC responses */
|
|
9065
|
+
mcpErrorCode = FORBIDDEN_CODE;
|
|
9066
|
+
/** HTTP status code equivalent */
|
|
9067
|
+
statusCode = 403;
|
|
9068
|
+
/** Error classification code */
|
|
9069
|
+
code = "AUTHORITY_DENIED";
|
|
9070
|
+
/** Entry type that was denied */
|
|
9071
|
+
entryType;
|
|
9072
|
+
/** Entry name that was denied */
|
|
9073
|
+
entryName;
|
|
9074
|
+
/** Policy that caused the denial */
|
|
9075
|
+
deniedBy;
|
|
9076
|
+
/** Structured denial data (machine-parsable) */
|
|
9077
|
+
denial;
|
|
9078
|
+
/** Required scopes for scope challenges */
|
|
9079
|
+
requiredScopes;
|
|
9080
|
+
constructor(params) {
|
|
9081
|
+
const msg = params.message ?? `Access denied to ${params.entryType} "${params.entryName}": ${params.deniedBy}`;
|
|
9082
|
+
super(msg);
|
|
9083
|
+
this.name = "AuthorityDeniedError";
|
|
9084
|
+
this.entryType = params.entryType;
|
|
9085
|
+
this.entryName = params.entryName;
|
|
9086
|
+
this.deniedBy = params.deniedBy;
|
|
9087
|
+
this.denial = params.denial;
|
|
9088
|
+
this.requiredScopes = params.requiredScopes;
|
|
9089
|
+
}
|
|
9090
|
+
/**
|
|
9091
|
+
* Convert to JSON-RPC error format.
|
|
9092
|
+
*/
|
|
9093
|
+
toJsonRpcError() {
|
|
9094
|
+
const data = {
|
|
9095
|
+
entryType: this.entryType,
|
|
9096
|
+
entryName: this.entryName,
|
|
9097
|
+
deniedBy: this.deniedBy
|
|
9098
|
+
};
|
|
9099
|
+
if (this.denial !== void 0) data["denial"] = this.denial;
|
|
9100
|
+
if (this.requiredScopes !== void 0) data["requiredScopes"] = this.requiredScopes;
|
|
9101
|
+
return {
|
|
9102
|
+
code: this.mcpErrorCode,
|
|
9103
|
+
message: this.message,
|
|
9104
|
+
data
|
|
9105
|
+
};
|
|
9106
|
+
}
|
|
9107
|
+
};
|
|
9108
|
+
|
|
9109
|
+
// libs/auth/src/fetch/fetch-credential-middleware.ts
|
|
9110
|
+
var bearerApplier = {
|
|
9111
|
+
apply(token, _url, init) {
|
|
9112
|
+
const headers = new Headers(init.headers);
|
|
9113
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
9114
|
+
return { init: { ...init, headers } };
|
|
9115
|
+
}
|
|
9116
|
+
};
|
|
9117
|
+
function headerApplier(headerName, prefix) {
|
|
9118
|
+
return {
|
|
9119
|
+
apply(token, _url, init) {
|
|
9120
|
+
const headers = new Headers(init.headers);
|
|
9121
|
+
headers.set(headerName, prefix ? `${prefix} ${token}` : token);
|
|
9122
|
+
return { init: { ...init, headers } };
|
|
9123
|
+
}
|
|
9124
|
+
};
|
|
9125
|
+
}
|
|
9126
|
+
function queryApplier(paramName) {
|
|
9127
|
+
return {
|
|
9128
|
+
apply(token, url, init) {
|
|
9129
|
+
const urlObj = new URL(url);
|
|
9130
|
+
urlObj.searchParams.set(paramName, token);
|
|
9131
|
+
return { init, url: urlObj.toString() };
|
|
9132
|
+
}
|
|
9133
|
+
};
|
|
9134
|
+
}
|
|
9135
|
+
var basicApplier = {
|
|
9136
|
+
apply(token, _url, init) {
|
|
9137
|
+
const headers = new Headers(init.headers);
|
|
9138
|
+
const encoded = typeof btoa === "function" ? btoa(token) : Buffer.from(token).toString("base64");
|
|
9139
|
+
headers.set("Authorization", `Basic ${encoded}`);
|
|
9140
|
+
return { init: { ...init, headers } };
|
|
9141
|
+
}
|
|
9142
|
+
};
|
|
9143
|
+
function isFrontMcpCredentials(creds) {
|
|
9144
|
+
return typeof creds === "object" && creds !== null && "provider" in creds && typeof creds.provider === "string" && creds.provider.length > 0;
|
|
9145
|
+
}
|
|
9146
|
+
var FetchCredentialMiddleware = class {
|
|
9147
|
+
constructor(tokenAccessor, appliers) {
|
|
9148
|
+
this.tokenAccessor = tokenAccessor;
|
|
9149
|
+
this.appliers = new Map(Object.entries(appliers ?? {}));
|
|
9150
|
+
}
|
|
9151
|
+
appliers;
|
|
9152
|
+
/**
|
|
9153
|
+
* Inspect the `credentials` field. If it references a named provider,
|
|
9154
|
+
* resolve the token and delegate to the provider's applier.
|
|
9155
|
+
*/
|
|
9156
|
+
async applyCredentials(url, init) {
|
|
9157
|
+
const creds = init.credentials;
|
|
9158
|
+
if (!creds || typeof creds === "string") {
|
|
9159
|
+
return { init };
|
|
9160
|
+
}
|
|
9161
|
+
if (!isFrontMcpCredentials(creds)) {
|
|
9162
|
+
const { credentials: _removed2, ...rest } = init;
|
|
9163
|
+
return { init: rest };
|
|
9164
|
+
}
|
|
9165
|
+
const token = await this.tokenAccessor.getToken(creds.provider);
|
|
9166
|
+
if (!token) {
|
|
9167
|
+
const { credentials: _removed2, ...rest } = init;
|
|
9168
|
+
return { init: rest };
|
|
9169
|
+
}
|
|
9170
|
+
const applier = this.appliers.get(creds.provider) ?? bearerApplier;
|
|
9171
|
+
const { credentials: _removed, ...cleanInit } = init;
|
|
9172
|
+
return applier.apply(token, url, cleanInit);
|
|
9173
|
+
}
|
|
9174
|
+
};
|
|
8259
9175
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8260
9176
|
0 && (module.exports = {
|
|
8261
9177
|
AUTH_PROVIDERS_ACCESSOR,
|
|
@@ -8269,6 +9185,11 @@ var LazyCredentialLoader = class {
|
|
|
8269
9185
|
AuthProvidersNotConfiguredError,
|
|
8270
9186
|
AuthProvidersRegistry,
|
|
8271
9187
|
AuthProvidersVault,
|
|
9188
|
+
AuthoritiesContextBuilder,
|
|
9189
|
+
AuthoritiesEngine,
|
|
9190
|
+
AuthoritiesEvaluatorRegistry,
|
|
9191
|
+
AuthoritiesProfileRegistry,
|
|
9192
|
+
AuthorityDeniedError,
|
|
8272
9193
|
AuthorizationBase,
|
|
8273
9194
|
CDN,
|
|
8274
9195
|
CimdClientIdMismatchError,
|
|
@@ -8290,6 +9211,8 @@ var LazyCredentialLoader = class {
|
|
|
8290
9211
|
EncryptedTypedStorage,
|
|
8291
9212
|
EncryptionContextNotSetError,
|
|
8292
9213
|
EncryptionKeyNotConfiguredError,
|
|
9214
|
+
FetchCredentialMiddleware,
|
|
9215
|
+
FrontMcpAuthContextImpl,
|
|
8293
9216
|
InMemoryAuthorizationStore,
|
|
8294
9217
|
InMemoryAuthorizationVault,
|
|
8295
9218
|
InMemoryCimdCache,
|
|
@@ -8328,6 +9251,9 @@ var LazyCredentialLoader = class {
|
|
|
8328
9251
|
VaultLoadError,
|
|
8329
9252
|
VaultNotFoundError,
|
|
8330
9253
|
VercelKvSessionStore,
|
|
9254
|
+
abacConditionSchema,
|
|
9255
|
+
abacOperatorSchema,
|
|
9256
|
+
abacPolicySchema,
|
|
8331
9257
|
aiPlatformTypeSchema,
|
|
8332
9258
|
allowsPublicAccess,
|
|
8333
9259
|
apiKeyCredentialSchema,
|
|
@@ -8343,13 +9269,20 @@ var LazyCredentialLoader = class {
|
|
|
8343
9269
|
authProviderMappingSchema,
|
|
8344
9270
|
authProvidersVaultOptionsSchema,
|
|
8345
9271
|
authUserSchema,
|
|
9272
|
+
authoritiesClaimsMappingSchema,
|
|
9273
|
+
authoritiesConfigSchema,
|
|
9274
|
+
authoritiesMetadataSchema,
|
|
9275
|
+
authoritiesPolicySchema,
|
|
8346
9276
|
authorizationCodeRecordSchema,
|
|
8347
9277
|
authorizationVaultEntrySchema,
|
|
8348
9278
|
authorizedPromptSchema,
|
|
8349
9279
|
authorizedToolSchema,
|
|
8350
9280
|
baseLayout,
|
|
9281
|
+
basicApplier,
|
|
8351
9282
|
basicAuthCredentialSchema,
|
|
9283
|
+
bearerApplier,
|
|
8352
9284
|
bearerCredentialSchema,
|
|
9285
|
+
buildAuthContext,
|
|
8353
9286
|
buildConsentPage,
|
|
8354
9287
|
buildErrorPage,
|
|
8355
9288
|
buildFederatedLoginPage,
|
|
@@ -8414,15 +9347,16 @@ var LazyCredentialLoader = class {
|
|
|
8414
9347
|
generatePkceChallenge,
|
|
8415
9348
|
getCredentialOptionsSchema,
|
|
8416
9349
|
getKey,
|
|
8417
|
-
getMachineId,
|
|
8418
9350
|
getNextProvider,
|
|
8419
9351
|
getProviderApps,
|
|
8420
9352
|
getProviderScopes,
|
|
8421
9353
|
getTokenSignatureFingerprint,
|
|
8422
9354
|
hasOnlyLocalhostRedirectUris,
|
|
9355
|
+
headerApplier,
|
|
8423
9356
|
hkdfSha256,
|
|
8424
9357
|
incrementalAuthConfigSchema,
|
|
8425
9358
|
isCimdClientId,
|
|
9359
|
+
isFrontMcpCredentials,
|
|
8426
9360
|
isJwt,
|
|
8427
9361
|
isLocalMode,
|
|
8428
9362
|
isOrchestratedLocal,
|
|
@@ -8460,17 +9394,22 @@ var LazyCredentialLoader = class {
|
|
|
8460
9394
|
providerConfigSchema,
|
|
8461
9395
|
publicAccessConfigSchema,
|
|
8462
9396
|
publicAuthOptionsSchema,
|
|
9397
|
+
queryApplier,
|
|
9398
|
+
rbacPermissionsPolicySchema,
|
|
9399
|
+
rbacRolesPolicySchema,
|
|
9400
|
+
rebacPolicySchema,
|
|
8463
9401
|
redisConfigSchema,
|
|
8464
9402
|
redisVaultEntrySchema,
|
|
8465
9403
|
remoteAuthSchema,
|
|
8466
9404
|
remoteProviderConfigSchema,
|
|
8467
9405
|
renderToHtml,
|
|
8468
9406
|
resetCachedKey,
|
|
9407
|
+
resolveRequiredScopes,
|
|
9408
|
+
resourceIdRefSchema,
|
|
8469
9409
|
safeDecrypt,
|
|
8470
9410
|
serviceAccountCredentialSchema,
|
|
8471
9411
|
sessionIdPayloadSchema,
|
|
8472
9412
|
sessionJwtPayloadSchema,
|
|
8473
|
-
setMachineIdOverride,
|
|
8474
9413
|
signSession,
|
|
8475
9414
|
skippedAppBehaviorSchema,
|
|
8476
9415
|
sseTransportStateSchema,
|