@naylence/runtime 0.4.0 → 0.4.2
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/dist/browser/index.cjs +516 -407
- package/dist/browser/index.mjs +501 -408
- package/dist/cjs/naylence/fame/factory-manifest.js +2 -0
- package/dist/cjs/naylence/fame/node/default-node-identity-policy.js +9 -41
- package/dist/cjs/naylence/fame/security/auth/authorization-profile-factory.js +165 -0
- package/dist/cjs/naylence/fame/security/index.js +19 -1
- package/dist/cjs/naylence/fame/security/node-security-profile-factory.js +14 -74
- package/dist/cjs/version.js +2 -2
- package/dist/esm/naylence/fame/factory-manifest.js +2 -0
- package/dist/esm/naylence/fame/node/default-node-identity-policy.js +9 -41
- package/dist/esm/naylence/fame/security/auth/authorization-profile-factory.js +161 -0
- package/dist/esm/naylence/fame/security/index.js +2 -1
- package/dist/esm/naylence/fame/security/node-security-profile-factory.js +13 -73
- package/dist/esm/version.js +2 -2
- package/dist/node/index.cjs +516 -407
- package/dist/node/index.mjs +501 -408
- package/dist/node/node.cjs +508 -399
- package/dist/node/node.mjs +493 -400
- package/dist/types/naylence/fame/factory-manifest.d.ts +1 -1
- package/dist/types/naylence/fame/node/default-node-identity-policy.d.ts +6 -0
- package/dist/types/naylence/fame/security/auth/authorization-profile-factory.d.ts +29 -0
- package/dist/types/naylence/fame/security/index.d.ts +3 -1
- package/dist/types/naylence/fame/security/node-security-profile-factory.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/browser/index.cjs
CHANGED
|
@@ -128,6 +128,7 @@ const MODULES = [
|
|
|
128
128
|
"./node/node-identity-policy-profile-factory.js",
|
|
129
129
|
"./node/token-subject-node-identity-policy-factory.js",
|
|
130
130
|
"./placement/static-node-placement-strategy-factory.js",
|
|
131
|
+
"./security/auth/authorization-profile-factory.js",
|
|
131
132
|
"./security/auth/bearer-token-header-auth-injection-strategy-factory.js",
|
|
132
133
|
"./security/auth/default-authorizer-factory.js",
|
|
133
134
|
"./security/auth/default-policy-authorizer-factory.js",
|
|
@@ -210,6 +211,7 @@ const MODULE_LOADERS = {
|
|
|
210
211
|
"./node/node-identity-policy-profile-factory.js": () => Promise.resolve().then(function () { return nodeIdentityPolicyProfileFactory; }),
|
|
211
212
|
"./node/token-subject-node-identity-policy-factory.js": () => Promise.resolve().then(function () { return tokenSubjectNodeIdentityPolicyFactory; }),
|
|
212
213
|
"./placement/static-node-placement-strategy-factory.js": () => Promise.resolve().then(function () { return staticNodePlacementStrategyFactory; }),
|
|
214
|
+
"./security/auth/authorization-profile-factory.js": () => Promise.resolve().then(function () { return authorizationProfileFactory; }),
|
|
213
215
|
"./security/auth/bearer-token-header-auth-injection-strategy-factory.js": () => Promise.resolve().then(function () { return bearerTokenHeaderAuthInjectionStrategyFactory; }),
|
|
214
216
|
"./security/auth/default-authorizer-factory.js": () => Promise.resolve().then(function () { return defaultAuthorizerFactory; }),
|
|
215
217
|
"./security/auth/default-policy-authorizer-factory.js": () => Promise.resolve().then(function () { return defaultPolicyAuthorizerFactory; }),
|
|
@@ -523,12 +525,12 @@ async function ensureRuntimeFactoriesRegistered(registry = factory.Registry) {
|
|
|
523
525
|
}
|
|
524
526
|
|
|
525
527
|
// This file is auto-generated during build - do not edit manually
|
|
526
|
-
// Generated from package.json version: 0.4.
|
|
528
|
+
// Generated from package.json version: 0.4.2
|
|
527
529
|
/**
|
|
528
530
|
* The package version, injected at build time.
|
|
529
531
|
* @internal
|
|
530
532
|
*/
|
|
531
|
-
const VERSION = '0.4.
|
|
533
|
+
const VERSION = '0.4.2';
|
|
532
534
|
|
|
533
535
|
let initialized = false;
|
|
534
536
|
const runtimePlugin = {
|
|
@@ -3732,7 +3734,7 @@ class EnvCredentialProviderFactory extends CredentialProviderFactory {
|
|
|
3732
3734
|
return new EnvCredentialProvider(resolved.varName);
|
|
3733
3735
|
}
|
|
3734
3736
|
}
|
|
3735
|
-
const FACTORY_META$
|
|
3737
|
+
const FACTORY_META$1g = {
|
|
3736
3738
|
base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
|
|
3737
3739
|
key: 'EnvCredentialProvider',
|
|
3738
3740
|
};
|
|
@@ -3740,7 +3742,7 @@ const FACTORY_META$1f = {
|
|
|
3740
3742
|
var envCredentialProviderFactory = /*#__PURE__*/Object.freeze({
|
|
3741
3743
|
__proto__: null,
|
|
3742
3744
|
EnvCredentialProviderFactory: EnvCredentialProviderFactory,
|
|
3743
|
-
FACTORY_META: FACTORY_META$
|
|
3745
|
+
FACTORY_META: FACTORY_META$1g,
|
|
3744
3746
|
default: EnvCredentialProviderFactory,
|
|
3745
3747
|
normalizeEnvConfig: normalizeEnvConfig
|
|
3746
3748
|
});
|
|
@@ -3838,14 +3840,14 @@ class PromptCredentialProviderFactory extends CredentialProviderFactory {
|
|
|
3838
3840
|
return new PromptCredentialProvider(resolved.credentialName);
|
|
3839
3841
|
}
|
|
3840
3842
|
}
|
|
3841
|
-
const FACTORY_META$
|
|
3843
|
+
const FACTORY_META$1f = {
|
|
3842
3844
|
base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
|
|
3843
3845
|
key: 'PromptCredentialProvider',
|
|
3844
3846
|
};
|
|
3845
3847
|
|
|
3846
3848
|
var promptCredentialProviderFactory = /*#__PURE__*/Object.freeze({
|
|
3847
3849
|
__proto__: null,
|
|
3848
|
-
FACTORY_META: FACTORY_META$
|
|
3850
|
+
FACTORY_META: FACTORY_META$1f,
|
|
3849
3851
|
PromptCredentialProviderFactory: PromptCredentialProviderFactory,
|
|
3850
3852
|
default: PromptCredentialProviderFactory,
|
|
3851
3853
|
normalizePromptConfig: normalizePromptConfig
|
|
@@ -3899,14 +3901,14 @@ class SecretStoreCredentialProviderFactory extends CredentialProviderFactory {
|
|
|
3899
3901
|
return new SecretStoreCredentialProvider(resolved.secretName);
|
|
3900
3902
|
}
|
|
3901
3903
|
}
|
|
3902
|
-
const FACTORY_META$
|
|
3904
|
+
const FACTORY_META$1e = {
|
|
3903
3905
|
base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
|
|
3904
3906
|
key: 'SecretStoreCredentialProvider',
|
|
3905
3907
|
};
|
|
3906
3908
|
|
|
3907
3909
|
var secretStoreCredentialProviderFactory = /*#__PURE__*/Object.freeze({
|
|
3908
3910
|
__proto__: null,
|
|
3909
|
-
FACTORY_META: FACTORY_META$
|
|
3911
|
+
FACTORY_META: FACTORY_META$1e,
|
|
3910
3912
|
SecretStoreCredentialProviderFactory: SecretStoreCredentialProviderFactory,
|
|
3911
3913
|
default: SecretStoreCredentialProviderFactory,
|
|
3912
3914
|
normalizeSecretStoreConfig: normalizeSecretStoreConfig
|
|
@@ -3955,14 +3957,14 @@ class StaticCredentialProviderFactory extends CredentialProviderFactory {
|
|
|
3955
3957
|
return new StaticCredentialProvider(resolved.credentialValue);
|
|
3956
3958
|
}
|
|
3957
3959
|
}
|
|
3958
|
-
const FACTORY_META$
|
|
3960
|
+
const FACTORY_META$1d = {
|
|
3959
3961
|
base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
|
|
3960
3962
|
key: 'StaticCredentialProvider',
|
|
3961
3963
|
};
|
|
3962
3964
|
|
|
3963
3965
|
var staticCredentialProviderFactory = /*#__PURE__*/Object.freeze({
|
|
3964
3966
|
__proto__: null,
|
|
3965
|
-
FACTORY_META: FACTORY_META$
|
|
3967
|
+
FACTORY_META: FACTORY_META$1d,
|
|
3966
3968
|
StaticCredentialProviderFactory: StaticCredentialProviderFactory,
|
|
3967
3969
|
default: StaticCredentialProviderFactory,
|
|
3968
3970
|
normalizeStaticConfig: normalizeStaticConfig
|
|
@@ -4206,7 +4208,7 @@ const BASE_PROFILE_MAP = {
|
|
|
4206
4208
|
[PROFILE_NAME_INDEXEDDB]: INDEXEDDB_PROFILE_CONFIG,
|
|
4207
4209
|
};
|
|
4208
4210
|
// Extended profile map - can be augmented by Node.js environment
|
|
4209
|
-
const PROFILE_MAP$
|
|
4211
|
+
const PROFILE_MAP$7 = {
|
|
4210
4212
|
...BASE_PROFILE_MAP,
|
|
4211
4213
|
};
|
|
4212
4214
|
class StorageProfileFactory extends StorageProviderFactory {
|
|
@@ -4221,9 +4223,9 @@ class StorageProfileFactory extends StorageProviderFactory {
|
|
|
4221
4223
|
type: 'StorageProfile',
|
|
4222
4224
|
});
|
|
4223
4225
|
const profileName = (parsed.profile ?? PROFILE_NAME_MEMORY).toLowerCase();
|
|
4224
|
-
const profileConfig = PROFILE_MAP$
|
|
4226
|
+
const profileConfig = PROFILE_MAP$7[profileName];
|
|
4225
4227
|
if (!profileConfig) {
|
|
4226
|
-
throw new Error(`Unknown storage profile '${profileName}'. Supported profiles: ${Object.keys(PROFILE_MAP$
|
|
4228
|
+
throw new Error(`Unknown storage profile '${profileName}'. Supported profiles: ${Object.keys(PROFILE_MAP$7).join(', ')}`);
|
|
4227
4229
|
}
|
|
4228
4230
|
const createOptions = {
|
|
4229
4231
|
...options,
|
|
@@ -13251,44 +13253,12 @@ class ConnectionRetryPolicyFactory extends factory.AbstractResourceFactory {
|
|
|
13251
13253
|
}
|
|
13252
13254
|
}
|
|
13253
13255
|
|
|
13254
|
-
|
|
13255
|
-
|
|
13256
|
-
|
|
13257
|
-
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
throw new Error('Failed to create token provider from configuration');
|
|
13261
|
-
}
|
|
13262
|
-
return provider;
|
|
13263
|
-
}
|
|
13264
|
-
let provider = null;
|
|
13265
|
-
try {
|
|
13266
|
-
provider = await factory.createDefaultResource(TOKEN_PROVIDER_FACTORY_BASE_TYPE, null, options);
|
|
13267
|
-
}
|
|
13268
|
-
catch (error) {
|
|
13269
|
-
const message = 'Failed to create default token provider' +
|
|
13270
|
-
(error instanceof Error && error.message ? `: ${error.message}` : '');
|
|
13271
|
-
throw new Error(message);
|
|
13272
|
-
}
|
|
13273
|
-
if (!provider) {
|
|
13274
|
-
throw new Error('Failed to create default token provider');
|
|
13275
|
-
}
|
|
13276
|
-
return provider;
|
|
13277
|
-
}
|
|
13278
|
-
}
|
|
13279
|
-
|
|
13280
|
-
function isTokenProvider(candidate) {
|
|
13281
|
-
return (typeof candidate === 'object' &&
|
|
13282
|
-
candidate !== null &&
|
|
13283
|
-
typeof candidate.getToken === 'function');
|
|
13284
|
-
}
|
|
13285
|
-
function isIdentityExposingTokenProvider(candidate) {
|
|
13286
|
-
return (isTokenProvider(candidate) &&
|
|
13287
|
-
typeof candidate.getIdentity ===
|
|
13288
|
-
'function');
|
|
13289
|
-
}
|
|
13290
|
-
|
|
13291
|
-
const logger$12 = getLogger('naylence.fame.node.default_node_identity_policy');
|
|
13256
|
+
/**
|
|
13257
|
+
* Default node identity policy that preserves the current node ID.
|
|
13258
|
+
*
|
|
13259
|
+
* This policy does NOT derive identity from tokens or grants.
|
|
13260
|
+
* For token-subject-based identity, use TokenSubjectNodeIdentityPolicy.
|
|
13261
|
+
*/
|
|
13292
13262
|
class DefaultNodeIdentityPolicy {
|
|
13293
13263
|
async resolveInitialNodeId(context) {
|
|
13294
13264
|
if (context.configuredId) {
|
|
@@ -13300,44 +13270,10 @@ class DefaultNodeIdentityPolicy {
|
|
|
13300
13270
|
return await core.generateIdAsync({ mode: 'fingerprint' });
|
|
13301
13271
|
}
|
|
13302
13272
|
async resolveAdmissionNodeId(context) {
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
for (const grant of context.grants) {
|
|
13306
|
-
try {
|
|
13307
|
-
const auth = grant.auth;
|
|
13308
|
-
if (!auth) {
|
|
13309
|
-
continue;
|
|
13310
|
-
}
|
|
13311
|
-
const tokenProviderConfig = (auth.tokenProvider ??
|
|
13312
|
-
auth.token_provider);
|
|
13313
|
-
if (!tokenProviderConfig ||
|
|
13314
|
-
typeof tokenProviderConfig.type !== 'string') {
|
|
13315
|
-
continue;
|
|
13316
|
-
}
|
|
13317
|
-
const provider = await TokenProviderFactory.createTokenProvider(tokenProviderConfig);
|
|
13318
|
-
if (isIdentityExposingTokenProvider(provider)) {
|
|
13319
|
-
const identity = await provider.getIdentity();
|
|
13320
|
-
if (identity && identity.subject) {
|
|
13321
|
-
logger$12.debug('identity_extracted_from_grant', {
|
|
13322
|
-
identity_id: identity.subject,
|
|
13323
|
-
grant_type: grant.type,
|
|
13324
|
-
});
|
|
13325
|
-
return identity.subject;
|
|
13326
|
-
}
|
|
13327
|
-
}
|
|
13328
|
-
}
|
|
13329
|
-
catch (error) {
|
|
13330
|
-
logger$12.warning('identity_extraction_failed', {
|
|
13331
|
-
error: error instanceof Error ? error.message : String(error),
|
|
13332
|
-
grant_type: grant.type,
|
|
13333
|
-
});
|
|
13334
|
-
}
|
|
13335
|
-
}
|
|
13273
|
+
if (context.currentNodeId) {
|
|
13274
|
+
return context.currentNodeId;
|
|
13336
13275
|
}
|
|
13337
|
-
|
|
13338
|
-
return await core.generateIdAsync({ mode: 'fingerprint' });
|
|
13339
|
-
}
|
|
13340
|
-
return context.currentNodeId;
|
|
13276
|
+
return await core.generateIdAsync({ mode: 'fingerprint' });
|
|
13341
13277
|
}
|
|
13342
13278
|
}
|
|
13343
13279
|
|
|
@@ -13411,7 +13347,7 @@ class AttachmentKeyValidator {
|
|
|
13411
13347
|
}
|
|
13412
13348
|
}
|
|
13413
13349
|
|
|
13414
|
-
const logger$
|
|
13350
|
+
const logger$12 = getLogger('naylence.fame.node.admission.default_node_attach_client');
|
|
13415
13351
|
const HANDSHAKE_POLL_INTERVAL_MS = 20;
|
|
13416
13352
|
class DefaultNodeAttachClient {
|
|
13417
13353
|
constructor(options = {}) {
|
|
@@ -13435,7 +13371,7 @@ class DefaultNodeAttachClient {
|
|
|
13435
13371
|
}
|
|
13436
13372
|
else {
|
|
13437
13373
|
// Silently ignore frames from other agents during concurrent handshakes
|
|
13438
|
-
logger$
|
|
13374
|
+
logger$12.debug('handshake_ignoring_frame_from_different_system', {
|
|
13439
13375
|
frame_type: envelope.frame.type,
|
|
13440
13376
|
frame_system_id: frameSystemId,
|
|
13441
13377
|
expected_system_id: this.expectedSystemId,
|
|
@@ -13478,7 +13414,7 @@ class DefaultNodeAttachClient {
|
|
|
13478
13414
|
}
|
|
13479
13415
|
}
|
|
13480
13416
|
catch (error) {
|
|
13481
|
-
logger$
|
|
13417
|
+
logger$12.debug('stickiness_offer_skipped', {
|
|
13482
13418
|
error: error instanceof Error ? error.message : String(error),
|
|
13483
13419
|
});
|
|
13484
13420
|
}
|
|
@@ -13499,7 +13435,7 @@ class DefaultNodeAttachClient {
|
|
|
13499
13435
|
if (!processedEnvelope) {
|
|
13500
13436
|
throw new Error('Envelope was blocked by onForwardUpstream event');
|
|
13501
13437
|
}
|
|
13502
|
-
logger$
|
|
13438
|
+
logger$12.debug('sending_node_attach_envelope', {
|
|
13503
13439
|
envp_id: processedEnvelope.id ?? envelope.id ?? null,
|
|
13504
13440
|
frame_type: processedEnvelope.frame?.type ?? 'unknown',
|
|
13505
13441
|
trace_id: processedEnvelope.traceId ?? envelope.traceId ?? null,
|
|
@@ -13535,7 +13471,7 @@ class DefaultNodeAttachClient {
|
|
|
13535
13471
|
try {
|
|
13536
13472
|
const keyInfos = await this.attachmentKeyValidator.validateKeys(parentKeys);
|
|
13537
13473
|
if (Array.isArray(keyInfos) && keyInfos.length > 0) {
|
|
13538
|
-
logger$
|
|
13474
|
+
logger$12.debug('parent_certificate_validation_passed', {
|
|
13539
13475
|
parent_id: parentId,
|
|
13540
13476
|
correlation_id: corrId,
|
|
13541
13477
|
validated_keys: keyInfos.length,
|
|
@@ -13544,7 +13480,7 @@ class DefaultNodeAttachClient {
|
|
|
13544
13480
|
}
|
|
13545
13481
|
catch (error) {
|
|
13546
13482
|
if (error instanceof KeyValidationError) {
|
|
13547
|
-
logger$
|
|
13483
|
+
logger$12.error('parent_certificate_validation_failed', {
|
|
13548
13484
|
parent_id: parentId,
|
|
13549
13485
|
correlation_id: corrId,
|
|
13550
13486
|
error_code: error.code,
|
|
@@ -13558,12 +13494,12 @@ class DefaultNodeAttachClient {
|
|
|
13558
13494
|
}
|
|
13559
13495
|
}
|
|
13560
13496
|
else {
|
|
13561
|
-
logger$
|
|
13497
|
+
logger$12.debug('parent_certificate_validation_skipped', {
|
|
13562
13498
|
parent_id: parentId,
|
|
13563
13499
|
reason: 'no_validator',
|
|
13564
13500
|
});
|
|
13565
13501
|
}
|
|
13566
|
-
logger$
|
|
13502
|
+
logger$12.debug('processing_node_attach_ack', {
|
|
13567
13503
|
parent_id: ackFrame.targetSystemId,
|
|
13568
13504
|
});
|
|
13569
13505
|
this.inHandshake = false;
|
|
@@ -13594,7 +13530,7 @@ class DefaultNodeAttachClient {
|
|
|
13594
13530
|
}
|
|
13595
13531
|
}
|
|
13596
13532
|
catch (error) {
|
|
13597
|
-
logger$
|
|
13533
|
+
logger$12.debug('stickiness_accept_skipped', {
|
|
13598
13534
|
error: error instanceof Error ? error.message : String(error),
|
|
13599
13535
|
});
|
|
13600
13536
|
}
|
|
@@ -13648,7 +13584,7 @@ class DefaultNodeAttachClient {
|
|
|
13648
13584
|
// NodeAttach frames during handshake are expected in multi-agent scenarios
|
|
13649
13585
|
// where multiple agents attach concurrently to the same channel
|
|
13650
13586
|
if (envelope.frame.type === 'NodeAttach') {
|
|
13651
|
-
logger$
|
|
13587
|
+
logger$12.debug('handshake_ignoring_concurrent_attach', {
|
|
13652
13588
|
frame_type: envelope.frame.type,
|
|
13653
13589
|
frame_system_id: envelope.frame?.systemId ??
|
|
13654
13590
|
'unknown',
|
|
@@ -13656,7 +13592,7 @@ class DefaultNodeAttachClient {
|
|
|
13656
13592
|
}
|
|
13657
13593
|
else {
|
|
13658
13594
|
// Other unexpected frames are still logged as errors
|
|
13659
|
-
logger$
|
|
13595
|
+
logger$12.error('unexpected_frame_during_handshake', {
|
|
13660
13596
|
frame_type: envelope.frame.type,
|
|
13661
13597
|
});
|
|
13662
13598
|
}
|
|
@@ -13796,7 +13732,7 @@ class TraceEmitterFactory extends factory.AbstractResourceFactory {
|
|
|
13796
13732
|
// void import('./trace-emitter-profile-factory.js');
|
|
13797
13733
|
|
|
13798
13734
|
const BINDING_STORE_NAMESPACE = '__binding_store';
|
|
13799
|
-
const logger$
|
|
13735
|
+
const logger$11 = getLogger('naylence.fame.node.factory_commons');
|
|
13800
13736
|
function isPlainRecord$2(value) {
|
|
13801
13737
|
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
13802
13738
|
}
|
|
@@ -13990,7 +13926,7 @@ async function resolveNodeIdentityPolicy(config, options) {
|
|
|
13990
13926
|
return await NodeIdentityPolicyFactory.createNodeIdentityPolicy(config ?? undefined, cloneCreateOptions(options));
|
|
13991
13927
|
}
|
|
13992
13928
|
catch (error) {
|
|
13993
|
-
logger$
|
|
13929
|
+
logger$11.warning('node_identity_policy_creation_failed', {
|
|
13994
13930
|
error: error instanceof Error ? error.message : String(error),
|
|
13995
13931
|
});
|
|
13996
13932
|
return null;
|
|
@@ -14001,7 +13937,7 @@ async function resolveConnectionRetryPolicy(config, options) {
|
|
|
14001
13937
|
return await ConnectionRetryPolicyFactory.createConnectionRetryPolicy(config ?? undefined, cloneCreateOptions(options));
|
|
14002
13938
|
}
|
|
14003
13939
|
catch (error) {
|
|
14004
|
-
logger$
|
|
13940
|
+
logger$11.warning('connection_retry_policy_creation_failed', {
|
|
14005
13941
|
error: error instanceof Error ? error.message : String(error),
|
|
14006
13942
|
});
|
|
14007
13943
|
return null;
|
|
@@ -14013,7 +13949,7 @@ async function resolveStorageProvider(config, options) {
|
|
|
14013
13949
|
return await StorageProviderFactory.createStorageProvider(config, cloneCreateOptions(options));
|
|
14014
13950
|
}
|
|
14015
13951
|
catch (error) {
|
|
14016
|
-
logger$
|
|
13952
|
+
logger$11.warning('storage_provider_creation_failed', {
|
|
14017
13953
|
error: error instanceof Error ? error.message : String(error),
|
|
14018
13954
|
});
|
|
14019
13955
|
}
|
|
@@ -14035,7 +13971,7 @@ async function resolveAdmissionClient(config, options, identityPolicy) {
|
|
|
14035
13971
|
return await AdmissionClientFactory.createAdmissionClient((config ?? null), createOptions);
|
|
14036
13972
|
}
|
|
14037
13973
|
catch (error) {
|
|
14038
|
-
logger$
|
|
13974
|
+
logger$11.warning('admission_client_creation_failed', {
|
|
14039
13975
|
error: error instanceof Error ? error.message : String(error),
|
|
14040
13976
|
});
|
|
14041
13977
|
return null;
|
|
@@ -14062,7 +13998,7 @@ async function resolveReplicaStickinessManager(hasParent, requestedLogicals, opt
|
|
|
14062
13998
|
return await ReplicaStickinessManagerFactory.createReplicaStickinessManager(undefined, cloneCreateOptions(options));
|
|
14063
13999
|
}
|
|
14064
14000
|
catch (error) {
|
|
14065
|
-
logger$
|
|
14001
|
+
logger$11.debug('replica_stickiness_manager_unavailable', { error });
|
|
14066
14002
|
return null;
|
|
14067
14003
|
}
|
|
14068
14004
|
}
|
|
@@ -14071,7 +14007,7 @@ async function resolveAttachmentKeyValidator(config, options) {
|
|
|
14071
14007
|
return await AttachmentKeyValidatorFactory.createAttachmentKeyValidator(config ?? undefined, cloneCreateOptions(options));
|
|
14072
14008
|
}
|
|
14073
14009
|
catch (error) {
|
|
14074
|
-
logger$
|
|
14010
|
+
logger$11.warning('attachment_key_validator_creation_failed', {
|
|
14075
14011
|
error: error instanceof Error ? error.message : String(error),
|
|
14076
14012
|
});
|
|
14077
14013
|
return null;
|
|
@@ -14089,7 +14025,7 @@ async function resolveDeliveryPolicy(config, options) {
|
|
|
14089
14025
|
return await DeliveryPolicyFactory.createDeliveryPolicy(config ?? undefined, cloneCreateOptions(options));
|
|
14090
14026
|
}
|
|
14091
14027
|
catch (error) {
|
|
14092
|
-
logger$
|
|
14028
|
+
logger$11.warning('delivery_policy_creation_failed', {
|
|
14093
14029
|
error: error instanceof Error ? error.message : String(error),
|
|
14094
14030
|
});
|
|
14095
14031
|
return null;
|
|
@@ -14103,7 +14039,7 @@ async function resolveTransportListeners(configs, eventListeners, options) {
|
|
|
14103
14039
|
return await TransportListenerFactory.createTransportListeners(configs, eventListeners, cloneCreateOptions(options));
|
|
14104
14040
|
}
|
|
14105
14041
|
catch (error) {
|
|
14106
|
-
logger$
|
|
14042
|
+
logger$11.warning('transport_listener_creation_failed', {
|
|
14107
14043
|
error: error instanceof Error ? error.message : String(error),
|
|
14108
14044
|
});
|
|
14109
14045
|
return [];
|
|
@@ -14114,7 +14050,7 @@ async function resolveTraceEmitter(config, options) {
|
|
|
14114
14050
|
return await TraceEmitterFactory.createTraceEmitter(config ?? undefined, cloneCreateOptions(options));
|
|
14115
14051
|
}
|
|
14116
14052
|
catch (error) {
|
|
14117
|
-
logger$
|
|
14053
|
+
logger$11.warning('trace_emitter_creation_failed', {
|
|
14118
14054
|
error: error instanceof Error ? error.message : String(error),
|
|
14119
14055
|
});
|
|
14120
14056
|
return null;
|
|
@@ -14170,7 +14106,7 @@ async function createSecurityManagerFromConfig(config, overrides, options) {
|
|
|
14170
14106
|
return manager ?? null;
|
|
14171
14107
|
}
|
|
14172
14108
|
catch (error) {
|
|
14173
|
-
logger$
|
|
14109
|
+
logger$11.warning('security_manager_creation_failed', {
|
|
14174
14110
|
error: error instanceof Error ? error.message : String(error),
|
|
14175
14111
|
});
|
|
14176
14112
|
return null;
|
|
@@ -14199,7 +14135,7 @@ async function resolveCryptoProvider(config, options) {
|
|
|
14199
14135
|
// This happens with overlay security profiles that need envelope signing
|
|
14200
14136
|
if (requiresCryptoProvider(config)) {
|
|
14201
14137
|
try {
|
|
14202
|
-
logger$
|
|
14138
|
+
logger$11.debug('auto_creating_crypto_provider', {
|
|
14203
14139
|
reason: 'overlay_security_requires_signing',
|
|
14204
14140
|
});
|
|
14205
14141
|
// Dynamically import to avoid circular dependencies
|
|
@@ -14219,7 +14155,7 @@ async function resolveCryptoProvider(config, options) {
|
|
|
14219
14155
|
});
|
|
14220
14156
|
}
|
|
14221
14157
|
catch (error) {
|
|
14222
|
-
logger$
|
|
14158
|
+
logger$11.error('failed_to_auto_create_crypto_provider', {
|
|
14223
14159
|
error: error instanceof Error ? error.message : String(error),
|
|
14224
14160
|
});
|
|
14225
14161
|
throw error;
|
|
@@ -14765,7 +14701,7 @@ class NodeLikeFactory extends factory.AbstractResourceFactory {
|
|
|
14765
14701
|
// registerFactory(NODE_LIKE_FACTORY_BASE_TYPE, type, factory);
|
|
14766
14702
|
// }
|
|
14767
14703
|
|
|
14768
|
-
const FACTORY_META$
|
|
14704
|
+
const FACTORY_META$1c = {
|
|
14769
14705
|
base: NODE_LIKE_FACTORY_BASE_TYPE,
|
|
14770
14706
|
key: 'Node',
|
|
14771
14707
|
};
|
|
@@ -14807,7 +14743,7 @@ class NodeFactory extends NodeLikeFactory {
|
|
|
14807
14743
|
|
|
14808
14744
|
var nodeFactory = /*#__PURE__*/Object.freeze({
|
|
14809
14745
|
__proto__: null,
|
|
14810
|
-
FACTORY_META: FACTORY_META$
|
|
14746
|
+
FACTORY_META: FACTORY_META$1c,
|
|
14811
14747
|
NodeFactory: NodeFactory,
|
|
14812
14748
|
default: NodeFactory
|
|
14813
14749
|
});
|
|
@@ -15384,7 +15320,7 @@ function normalizeSecurityRequirements(value) {
|
|
|
15384
15320
|
};
|
|
15385
15321
|
}
|
|
15386
15322
|
|
|
15387
|
-
const logger
|
|
15323
|
+
const logger$10 = getLogger('naylence.fame.node.envelope_security_handler');
|
|
15388
15324
|
const ENCRYPTION_OPTION_ALIAS_PAIRS = [
|
|
15389
15325
|
['recipKid', 'recip_kid'],
|
|
15390
15326
|
['recipientKeyId', 'recipient_key_id'],
|
|
@@ -15433,7 +15369,7 @@ class EnvelopeSecurityHandler {
|
|
|
15433
15369
|
const shouldSign = this.securityPolicy
|
|
15434
15370
|
? await this.securityPolicy.shouldSignEnvelope(envelope, context, this.node)
|
|
15435
15371
|
: false;
|
|
15436
|
-
logger
|
|
15372
|
+
logger$10.debug('checking_signing', {
|
|
15437
15373
|
has_signer: Boolean(this.envelopeSigner),
|
|
15438
15374
|
should_sign: shouldSign,
|
|
15439
15375
|
envp_id: envelope.id,
|
|
@@ -15455,7 +15391,7 @@ class EnvelopeSecurityHandler {
|
|
|
15455
15391
|
const shouldEncrypt = this.securityPolicy
|
|
15456
15392
|
? await this.securityPolicy.shouldEncryptEnvelope(envelope, context, this.node)
|
|
15457
15393
|
: false;
|
|
15458
|
-
logger
|
|
15394
|
+
logger$10.debug('checking_encryption', {
|
|
15459
15395
|
has_encryption_manager: Boolean(this.encryptionManager),
|
|
15460
15396
|
should_encrypt: shouldEncrypt,
|
|
15461
15397
|
envp_id: envelope.id,
|
|
@@ -15463,7 +15399,7 @@ class EnvelopeSecurityHandler {
|
|
|
15463
15399
|
});
|
|
15464
15400
|
if (this.encryptionManager && this.securityPolicy) {
|
|
15465
15401
|
if (envelope.sec?.enc) {
|
|
15466
|
-
logger
|
|
15402
|
+
logger$10.debug('skipping_encryption_already_encrypted', {
|
|
15467
15403
|
envp_id: envelope.id,
|
|
15468
15404
|
destination: envelope.to ? String(envelope.to) : undefined,
|
|
15469
15405
|
});
|
|
@@ -15476,7 +15412,7 @@ class EnvelopeSecurityHandler {
|
|
|
15476
15412
|
exports.CryptoLevel.PLAINTEXT;
|
|
15477
15413
|
desiredCryptoLevel =
|
|
15478
15414
|
await this.securityPolicy.decideResponseCryptoLevel(requestCryptoLevel, envelope, context);
|
|
15479
|
-
logger
|
|
15415
|
+
logger$10.debug('response_crypto_level_decided', {
|
|
15480
15416
|
envp_id: envelope.id,
|
|
15481
15417
|
crypto_level: desiredCryptoLevel,
|
|
15482
15418
|
destination: envelope.to ? String(envelope.to) : undefined,
|
|
@@ -15487,7 +15423,7 @@ class EnvelopeSecurityHandler {
|
|
|
15487
15423
|
else {
|
|
15488
15424
|
desiredCryptoLevel =
|
|
15489
15425
|
await this.securityPolicy.decideOutboundCryptoLevel(envelope, context, this.node);
|
|
15490
|
-
logger
|
|
15426
|
+
logger$10.debug('outbound_crypto_level_decided', {
|
|
15491
15427
|
envp_id: envelope.id,
|
|
15492
15428
|
frame_type: envelope.frame.type,
|
|
15493
15429
|
crypto_level: desiredCryptoLevel,
|
|
@@ -15495,11 +15431,11 @@ class EnvelopeSecurityHandler {
|
|
|
15495
15431
|
});
|
|
15496
15432
|
}
|
|
15497
15433
|
if (desiredCryptoLevel === exports.CryptoLevel.SEALED) {
|
|
15498
|
-
logger
|
|
15434
|
+
logger$10.debug('applying_sealed_encryption', { envp_id: envelope.id });
|
|
15499
15435
|
return await this.handleSealedEncryption(envelope, context);
|
|
15500
15436
|
}
|
|
15501
15437
|
if (desiredCryptoLevel === exports.CryptoLevel.CHANNEL) {
|
|
15502
|
-
logger
|
|
15438
|
+
logger$10.debug('applying_channel_encryption', { envp_id: envelope.id });
|
|
15503
15439
|
return await this.handleChannelEncryption(envelope, context);
|
|
15504
15440
|
}
|
|
15505
15441
|
}
|
|
@@ -15550,7 +15486,7 @@ class EnvelopeSecurityHandler {
|
|
|
15550
15486
|
frameType === 'KeyAnnounce' ||
|
|
15551
15487
|
frameType === 'SecureOpen' ||
|
|
15552
15488
|
frameType === 'SecureAccept') {
|
|
15553
|
-
logger
|
|
15489
|
+
logger$10.error('critical_frame_unsigned_rejected', {
|
|
15554
15490
|
envp_id: envelope.id,
|
|
15555
15491
|
frame_type: frameType,
|
|
15556
15492
|
reason: 'critical_frames_must_be_signed',
|
|
@@ -15558,7 +15494,7 @@ class EnvelopeSecurityHandler {
|
|
|
15558
15494
|
return [envelope, false];
|
|
15559
15495
|
}
|
|
15560
15496
|
const action = this.securityPolicy.getUnsignedViolationAction(envelope, context);
|
|
15561
|
-
logger
|
|
15497
|
+
logger$10.warning('unsigned_envelope_violation', {
|
|
15562
15498
|
envp_id: envelope.id,
|
|
15563
15499
|
frame_type: frameType,
|
|
15564
15500
|
action,
|
|
@@ -15570,26 +15506,26 @@ class EnvelopeSecurityHandler {
|
|
|
15570
15506
|
return [envelope, true];
|
|
15571
15507
|
}
|
|
15572
15508
|
async handleChannelHandshakeComplete(channelId, destination) {
|
|
15573
|
-
logger
|
|
15509
|
+
logger$10.debug('channel_handshake_completed', {
|
|
15574
15510
|
channel_id: channelId,
|
|
15575
15511
|
destination,
|
|
15576
15512
|
});
|
|
15577
15513
|
if (this.encryptionManager?.notifyChannelEstablished) {
|
|
15578
15514
|
await this.encryptionManager.notifyChannelEstablished(channelId);
|
|
15579
|
-
logger
|
|
15515
|
+
logger$10.debug('notified_encryption_manager_channel_ready', {
|
|
15580
15516
|
channel_id: channelId,
|
|
15581
15517
|
});
|
|
15582
15518
|
}
|
|
15583
15519
|
}
|
|
15584
15520
|
async handleChannelHandshakeFailed(channelId, destination, reason = 'handshake_failed') {
|
|
15585
|
-
logger
|
|
15521
|
+
logger$10.debug('channel_handshake_failed', {
|
|
15586
15522
|
channel_id: channelId,
|
|
15587
15523
|
destination,
|
|
15588
15524
|
reason,
|
|
15589
15525
|
});
|
|
15590
15526
|
if (this.encryptionManager?.notifyChannelFailed) {
|
|
15591
15527
|
await this.encryptionManager.notifyChannelFailed(channelId, reason);
|
|
15592
|
-
logger
|
|
15528
|
+
logger$10.debug('notified_encryption_manager_channel_failed', {
|
|
15593
15529
|
channel_id: channelId,
|
|
15594
15530
|
reason,
|
|
15595
15531
|
});
|
|
@@ -15636,7 +15572,7 @@ class EnvelopeSecurityHandler {
|
|
|
15636
15572
|
checkPayload: false,
|
|
15637
15573
|
});
|
|
15638
15574
|
if (verified) {
|
|
15639
|
-
logger
|
|
15575
|
+
logger$10.debug('envelope_verified', {
|
|
15640
15576
|
envp_id: envelope.id,
|
|
15641
15577
|
sid: envelope.sid,
|
|
15642
15578
|
kid,
|
|
@@ -15647,7 +15583,7 @@ class EnvelopeSecurityHandler {
|
|
|
15647
15583
|
}
|
|
15648
15584
|
this.keyManagementHandler.queuePendingSignedEnvelope(kid, envelope, context);
|
|
15649
15585
|
await this.keyManagementHandler.maybeRequestSigningKey(kid, context.originType, fromSystemId);
|
|
15650
|
-
logger
|
|
15586
|
+
logger$10.debug('queued_envelope_missing_signing_key', {
|
|
15651
15587
|
kid,
|
|
15652
15588
|
envp_id: envelope.id,
|
|
15653
15589
|
});
|
|
@@ -15655,7 +15591,7 @@ class EnvelopeSecurityHandler {
|
|
|
15655
15591
|
}
|
|
15656
15592
|
async handleSealedEncryption(envelope, context) {
|
|
15657
15593
|
if (!envelope.to) {
|
|
15658
|
-
logger
|
|
15594
|
+
logger$10.warning('sealed_encryption_requested_but_no_destination', {
|
|
15659
15595
|
envp_id: envelope.id,
|
|
15660
15596
|
});
|
|
15661
15597
|
return true;
|
|
@@ -15667,20 +15603,20 @@ class EnvelopeSecurityHandler {
|
|
|
15667
15603
|
: undefined;
|
|
15668
15604
|
if (options) {
|
|
15669
15605
|
if (options.encryptionType === 'channel') {
|
|
15670
|
-
logger
|
|
15606
|
+
logger$10.warning('policy_returned_channel_for_sealed_request', {
|
|
15671
15607
|
envp_id: envelope.id,
|
|
15672
15608
|
});
|
|
15673
15609
|
return await this.handleToBeEncryptedEnvelopeWithOptions(envelope, context, normalizeEncryptionOptions({
|
|
15674
15610
|
requestAddress: envelope.to,
|
|
15675
15611
|
}));
|
|
15676
15612
|
}
|
|
15677
|
-
logger
|
|
15613
|
+
logger$10.debug('using_sealed_encryption_options', {
|
|
15678
15614
|
envp_id: envelope.id,
|
|
15679
15615
|
options,
|
|
15680
15616
|
});
|
|
15681
15617
|
return await this.handleToBeEncryptedEnvelopeWithOptions(envelope, context, options);
|
|
15682
15618
|
}
|
|
15683
|
-
logger
|
|
15619
|
+
logger$10.debug('no_encryption_options_requesting_key', {
|
|
15684
15620
|
envp_id: envelope.id,
|
|
15685
15621
|
});
|
|
15686
15622
|
return await this.handleToBeEncryptedEnvelopeWithOptions(envelope, context, normalizeEncryptionOptions({
|
|
@@ -15688,7 +15624,7 @@ class EnvelopeSecurityHandler {
|
|
|
15688
15624
|
}));
|
|
15689
15625
|
}
|
|
15690
15626
|
catch (error) {
|
|
15691
|
-
logger
|
|
15627
|
+
logger$10.debug('sealed_key_lookup_failed_requesting', {
|
|
15692
15628
|
envp_id: envelope.id,
|
|
15693
15629
|
error: error instanceof Error ? error.message : String(error),
|
|
15694
15630
|
});
|
|
@@ -15699,7 +15635,7 @@ class EnvelopeSecurityHandler {
|
|
|
15699
15635
|
}
|
|
15700
15636
|
async handleChannelEncryption(envelope, context) {
|
|
15701
15637
|
if (!envelope.to) {
|
|
15702
|
-
logger
|
|
15638
|
+
logger$10.warning('channel_encryption_requested_but_no_destination', {
|
|
15703
15639
|
envp_id: envelope.id,
|
|
15704
15640
|
});
|
|
15705
15641
|
return true;
|
|
@@ -15714,13 +15650,13 @@ class EnvelopeSecurityHandler {
|
|
|
15714
15650
|
return true;
|
|
15715
15651
|
}
|
|
15716
15652
|
if (context.originType !== core.DeliveryOriginType.LOCAL) {
|
|
15717
|
-
logger
|
|
15653
|
+
logger$10.warning('envelope_encryption_rejected_non_local', {
|
|
15718
15654
|
origin: context.originType,
|
|
15719
15655
|
});
|
|
15720
15656
|
return true;
|
|
15721
15657
|
}
|
|
15722
15658
|
if (!isDataFrame$4(envelope.frame)) {
|
|
15723
|
-
logger
|
|
15659
|
+
logger$10.trace('skipping_encryption_non_dataframe', {
|
|
15724
15660
|
envp_id: envelope.id,
|
|
15725
15661
|
frame_type: envelope.frame.type,
|
|
15726
15662
|
});
|
|
@@ -15731,7 +15667,7 @@ class EnvelopeSecurityHandler {
|
|
|
15731
15667
|
? normalizeEncryptionOptions(rawOptions)
|
|
15732
15668
|
: undefined;
|
|
15733
15669
|
if (!options) {
|
|
15734
|
-
logger
|
|
15670
|
+
logger$10.warning('no_encryption_options_provided', {
|
|
15735
15671
|
envp_id: envelope.id,
|
|
15736
15672
|
});
|
|
15737
15673
|
return true;
|
|
@@ -15743,13 +15679,13 @@ class EnvelopeSecurityHandler {
|
|
|
15743
15679
|
return true;
|
|
15744
15680
|
}
|
|
15745
15681
|
if (context.originType !== core.DeliveryOriginType.LOCAL) {
|
|
15746
|
-
logger
|
|
15682
|
+
logger$10.warning('envelope_encryption_rejected_non_local', {
|
|
15747
15683
|
origin: context.originType,
|
|
15748
15684
|
});
|
|
15749
15685
|
return true;
|
|
15750
15686
|
}
|
|
15751
15687
|
if (!isDataFrame$4(envelope.frame)) {
|
|
15752
|
-
logger
|
|
15688
|
+
logger$10.trace('skipping_encryption_non_dataframe', {
|
|
15753
15689
|
envp_id: envelope.id,
|
|
15754
15690
|
frame_type: envelope.frame.type,
|
|
15755
15691
|
});
|
|
@@ -15766,7 +15702,7 @@ class EnvelopeSecurityHandler {
|
|
|
15766
15702
|
// Skip encryption if envelope is already encrypted
|
|
15767
15703
|
// This prevents re-queuing when replayed envelopes go through security again
|
|
15768
15704
|
if (envelope.sec?.enc) {
|
|
15769
|
-
logger
|
|
15705
|
+
logger$10.debug('skipping_encryption_already_encrypted', {
|
|
15770
15706
|
envp_id: envelope.id,
|
|
15771
15707
|
destination: envelope.to ? String(envelope.to) : undefined,
|
|
15772
15708
|
});
|
|
@@ -15775,14 +15711,14 @@ class EnvelopeSecurityHandler {
|
|
|
15775
15711
|
try {
|
|
15776
15712
|
const result = await this.encryptionManager.encryptEnvelope(envelope, normalizedOptions);
|
|
15777
15713
|
if (result.status === exports.EncryptionStatus.QUEUED) {
|
|
15778
|
-
logger
|
|
15714
|
+
logger$10.debug('envelope_queued_for_encryption', {
|
|
15779
15715
|
envp_id: envelope.id,
|
|
15780
15716
|
});
|
|
15781
15717
|
await this.handleEncryptionQueueing(envelope, context, normalizedOptions);
|
|
15782
15718
|
return false;
|
|
15783
15719
|
}
|
|
15784
15720
|
if (result.status === exports.EncryptionStatus.OK) {
|
|
15785
|
-
logger
|
|
15721
|
+
logger$10.debug('envelope_encrypted', { envp_id: envelope.id });
|
|
15786
15722
|
if (result.envelope) {
|
|
15787
15723
|
envelope.frame = result.envelope.frame;
|
|
15788
15724
|
envelope.sec = result.envelope.sec;
|
|
@@ -15790,17 +15726,17 @@ class EnvelopeSecurityHandler {
|
|
|
15790
15726
|
return true;
|
|
15791
15727
|
}
|
|
15792
15728
|
if (result.status === exports.EncryptionStatus.SKIPPED) {
|
|
15793
|
-
logger
|
|
15729
|
+
logger$10.debug('envelope_encryption_skipped', { envp_id: envelope.id });
|
|
15794
15730
|
return true;
|
|
15795
15731
|
}
|
|
15796
|
-
logger
|
|
15732
|
+
logger$10.warning('unknown_encryption_status', {
|
|
15797
15733
|
envp_id: envelope.id,
|
|
15798
15734
|
status: result.status,
|
|
15799
15735
|
});
|
|
15800
15736
|
return true;
|
|
15801
15737
|
}
|
|
15802
15738
|
catch (error) {
|
|
15803
|
-
logger
|
|
15739
|
+
logger$10.error('encryption_failed', {
|
|
15804
15740
|
envp_id: envelope.id,
|
|
15805
15741
|
error: error instanceof Error ? error.message : String(error),
|
|
15806
15742
|
});
|
|
@@ -15839,7 +15775,7 @@ class EnvelopeSecurityHandler {
|
|
|
15839
15775
|
return;
|
|
15840
15776
|
}
|
|
15841
15777
|
if (normalizedOptions.encryptionType === 'channel') {
|
|
15842
|
-
logger
|
|
15778
|
+
logger$10.debug('channel_encryption_queueing_handled_internally', {
|
|
15843
15779
|
envp_id: envelope.id,
|
|
15844
15780
|
destination: normalizedOptions.destination
|
|
15845
15781
|
? String(normalizedOptions.destination)
|
|
@@ -15847,13 +15783,13 @@ class EnvelopeSecurityHandler {
|
|
|
15847
15783
|
});
|
|
15848
15784
|
return;
|
|
15849
15785
|
}
|
|
15850
|
-
logger
|
|
15786
|
+
logger$10.warning('unknown_encryption_queueing_options', {
|
|
15851
15787
|
envp_id: envelope.id,
|
|
15852
15788
|
options: normalizedOptions,
|
|
15853
15789
|
});
|
|
15854
15790
|
}
|
|
15855
15791
|
async handleFailedChannelEnvelopeCleanup(destination, reason) {
|
|
15856
|
-
logger
|
|
15792
|
+
logger$10.debug('channel_handshake_failure_cleanup_attempted', {
|
|
15857
15793
|
destination,
|
|
15858
15794
|
reason,
|
|
15859
15795
|
note: 'envelope_cleanup_handled_by_encryption_manager',
|
|
@@ -15864,7 +15800,7 @@ class EnvelopeSecurityHandler {
|
|
|
15864
15800
|
}
|
|
15865
15801
|
}
|
|
15866
15802
|
|
|
15867
|
-
const logger
|
|
15803
|
+
const logger$$ = getLogger('naylence.fame.node.secure_channel_frame_handler');
|
|
15868
15804
|
function isPlainRecord$1(value) {
|
|
15869
15805
|
if (typeof value !== 'object' || value === null) {
|
|
15870
15806
|
return false;
|
|
@@ -15954,7 +15890,7 @@ class SecureChannelFrameHandler {
|
|
|
15954
15890
|
assertSecureChannelManager(this.secureChannelManager);
|
|
15955
15891
|
const frame = envelope.frame;
|
|
15956
15892
|
assertFrameType(frame, 'SecureOpen');
|
|
15957
|
-
logger
|
|
15893
|
+
logger$$.debug('received_secure_open', {
|
|
15958
15894
|
cid: frame.cid,
|
|
15959
15895
|
algorithm: frame.alg,
|
|
15960
15896
|
});
|
|
@@ -15977,13 +15913,13 @@ class SecureChannelFrameHandler {
|
|
|
15977
15913
|
stickySid: envelope.sid ?? undefined,
|
|
15978
15914
|
expectedResponseType: core.FameResponseType.NONE,
|
|
15979
15915
|
};
|
|
15980
|
-
logger
|
|
15916
|
+
logger$$.debug('stickiness_requested_for_channel_encryption', {
|
|
15981
15917
|
cid: frame.cid,
|
|
15982
15918
|
reason: 'secure_channel_established',
|
|
15983
15919
|
});
|
|
15984
15920
|
}
|
|
15985
15921
|
await this.sendCallback(responseEnvelope, responseContext);
|
|
15986
|
-
logger
|
|
15922
|
+
logger$$.debug('sent_secure_accept', { cid: frame.cid, ok: acceptFrame.ok });
|
|
15987
15923
|
if (acceptFrame.ok && this.envelopeSecurityHandler) {
|
|
15988
15924
|
const destination = extractDestinationFromChannelId(frame.cid);
|
|
15989
15925
|
if (destination) {
|
|
@@ -15995,13 +15931,13 @@ class SecureChannelFrameHandler {
|
|
|
15995
15931
|
assertSecureChannelManager(this.secureChannelManager);
|
|
15996
15932
|
const frame = envelope.frame;
|
|
15997
15933
|
assertFrameType(frame, 'SecureAccept');
|
|
15998
|
-
logger
|
|
15934
|
+
logger$$.debug('received_secure_accept', { cid: frame.cid, ok: frame.ok });
|
|
15999
15935
|
const success = await this.secureChannelManager.handleAcceptFrame(frame);
|
|
16000
15936
|
if (!success) {
|
|
16001
|
-
logger
|
|
15937
|
+
logger$$.warning('failed_to_complete_channel', { cid: frame.cid });
|
|
16002
15938
|
}
|
|
16003
15939
|
else {
|
|
16004
|
-
logger
|
|
15940
|
+
logger$$.debug('channel_established', { cid: frame.cid });
|
|
16005
15941
|
if (this.envelopeSecurityHandler) {
|
|
16006
15942
|
const destination = extractDestinationFromChannelId(frame.cid);
|
|
16007
15943
|
if (destination) {
|
|
@@ -16013,7 +15949,7 @@ class SecureChannelFrameHandler {
|
|
|
16013
15949
|
const destination = extractDestinationFromChannelId(frame.cid);
|
|
16014
15950
|
if (destination) {
|
|
16015
15951
|
await this.envelopeSecurityHandler.handleChannelHandshakeFailed(frame.cid, destination, 'negative_secure_accept');
|
|
16016
|
-
logger
|
|
15952
|
+
logger$$.debug('notified_handshake_failure', {
|
|
16017
15953
|
cid: frame.cid,
|
|
16018
15954
|
destination,
|
|
16019
15955
|
});
|
|
@@ -16024,7 +15960,7 @@ class SecureChannelFrameHandler {
|
|
|
16024
15960
|
assertSecureChannelManager(this.secureChannelManager);
|
|
16025
15961
|
const frame = envelope.frame;
|
|
16026
15962
|
assertFrameType(frame, 'SecureClose');
|
|
16027
|
-
logger
|
|
15963
|
+
logger$$.debug('received_secure_close', {
|
|
16028
15964
|
cid: frame.cid,
|
|
16029
15965
|
reason: frame.reason,
|
|
16030
15966
|
});
|
|
@@ -16082,7 +16018,7 @@ function createNodeDeliveryContext(options = {}) {
|
|
|
16082
16018
|
class FameEnvironmentContext {
|
|
16083
16019
|
}
|
|
16084
16020
|
|
|
16085
|
-
const FACTORY_META$
|
|
16021
|
+
const FACTORY_META$1b = {
|
|
16086
16022
|
base: NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE,
|
|
16087
16023
|
key: 'DefaultNodeIdentityPolicy',
|
|
16088
16024
|
};
|
|
@@ -16100,11 +16036,48 @@ class DefaultNodeIdentityPolicyFactory extends NodeIdentityPolicyFactory {
|
|
|
16100
16036
|
var defaultNodeIdentityPolicyFactory = /*#__PURE__*/Object.freeze({
|
|
16101
16037
|
__proto__: null,
|
|
16102
16038
|
DefaultNodeIdentityPolicyFactory: DefaultNodeIdentityPolicyFactory,
|
|
16103
|
-
FACTORY_META: FACTORY_META$
|
|
16039
|
+
FACTORY_META: FACTORY_META$1b,
|
|
16104
16040
|
default: DefaultNodeIdentityPolicyFactory
|
|
16105
16041
|
});
|
|
16106
16042
|
|
|
16107
|
-
const
|
|
16043
|
+
const TOKEN_PROVIDER_FACTORY_BASE_TYPE = 'TokenProviderFactory';
|
|
16044
|
+
class TokenProviderFactory extends factory.AbstractResourceFactory {
|
|
16045
|
+
static async createTokenProvider(config, options = {}) {
|
|
16046
|
+
if (config) {
|
|
16047
|
+
const provider = await factory.createResource(TOKEN_PROVIDER_FACTORY_BASE_TYPE, config, options);
|
|
16048
|
+
if (!provider) {
|
|
16049
|
+
throw new Error('Failed to create token provider from configuration');
|
|
16050
|
+
}
|
|
16051
|
+
return provider;
|
|
16052
|
+
}
|
|
16053
|
+
let provider = null;
|
|
16054
|
+
try {
|
|
16055
|
+
provider = await factory.createDefaultResource(TOKEN_PROVIDER_FACTORY_BASE_TYPE, null, options);
|
|
16056
|
+
}
|
|
16057
|
+
catch (error) {
|
|
16058
|
+
const message = 'Failed to create default token provider' +
|
|
16059
|
+
(error instanceof Error && error.message ? `: ${error.message}` : '');
|
|
16060
|
+
throw new Error(message);
|
|
16061
|
+
}
|
|
16062
|
+
if (!provider) {
|
|
16063
|
+
throw new Error('Failed to create default token provider');
|
|
16064
|
+
}
|
|
16065
|
+
return provider;
|
|
16066
|
+
}
|
|
16067
|
+
}
|
|
16068
|
+
|
|
16069
|
+
function isTokenProvider(candidate) {
|
|
16070
|
+
return (typeof candidate === 'object' &&
|
|
16071
|
+
candidate !== null &&
|
|
16072
|
+
typeof candidate.getToken === 'function');
|
|
16073
|
+
}
|
|
16074
|
+
function isIdentityExposingTokenProvider(candidate) {
|
|
16075
|
+
return (isTokenProvider(candidate) &&
|
|
16076
|
+
typeof candidate.getIdentity ===
|
|
16077
|
+
'function');
|
|
16078
|
+
}
|
|
16079
|
+
|
|
16080
|
+
const logger$_ = getLogger('naylence.fame.node.token_subject_node_identity_policy');
|
|
16108
16081
|
class TokenSubjectNodeIdentityPolicy {
|
|
16109
16082
|
async resolveInitialNodeId(context) {
|
|
16110
16083
|
if (context.configuredId) {
|
|
@@ -16116,7 +16089,7 @@ class TokenSubjectNodeIdentityPolicy {
|
|
|
16116
16089
|
return core.generateIdAsync();
|
|
16117
16090
|
}
|
|
16118
16091
|
async resolveAdmissionNodeId(context) {
|
|
16119
|
-
logger$
|
|
16092
|
+
logger$_.debug('resolve_admission_node_id_start', {
|
|
16120
16093
|
grantsCount: context.grants?.length ?? 0,
|
|
16121
16094
|
currentNodeId: context.currentNodeId,
|
|
16122
16095
|
});
|
|
@@ -16125,31 +16098,31 @@ class TokenSubjectNodeIdentityPolicy {
|
|
|
16125
16098
|
try {
|
|
16126
16099
|
const auth = grant.auth;
|
|
16127
16100
|
if (!auth) {
|
|
16128
|
-
logger$
|
|
16101
|
+
logger$_.debug('skipping_grant_no_auth', { grantType: grant.type });
|
|
16129
16102
|
continue;
|
|
16130
16103
|
}
|
|
16131
16104
|
const tokenProviderConfig = (auth.tokenProvider ??
|
|
16132
16105
|
auth.token_provider);
|
|
16133
16106
|
if (!tokenProviderConfig ||
|
|
16134
16107
|
typeof tokenProviderConfig.type !== 'string') {
|
|
16135
|
-
logger$
|
|
16108
|
+
logger$_.debug('skipping_grant_invalid_token_provider_config', {
|
|
16136
16109
|
grantType: grant.type,
|
|
16137
16110
|
config: tokenProviderConfig,
|
|
16138
16111
|
});
|
|
16139
16112
|
continue;
|
|
16140
16113
|
}
|
|
16141
|
-
logger$
|
|
16114
|
+
logger$_.debug('creating_token_provider', {
|
|
16142
16115
|
type: tokenProviderConfig.type,
|
|
16143
16116
|
});
|
|
16144
16117
|
const provider = await TokenProviderFactory.createTokenProvider(tokenProviderConfig);
|
|
16145
16118
|
const isExposing = isIdentityExposingTokenProvider(provider);
|
|
16146
|
-
logger$
|
|
16119
|
+
logger$_.debug('token_provider_created', {
|
|
16147
16120
|
type: tokenProviderConfig.type,
|
|
16148
16121
|
isIdentityExposing: isExposing,
|
|
16149
16122
|
});
|
|
16150
16123
|
if (isExposing) {
|
|
16151
16124
|
const identity = await provider.getIdentity();
|
|
16152
|
-
logger$
|
|
16125
|
+
logger$_.debug('retrieved_identity', { identity });
|
|
16153
16126
|
if (identity && identity.subject) {
|
|
16154
16127
|
const hashedSubject = await core.generateIdAsync({
|
|
16155
16128
|
mode: 'fingerprint',
|
|
@@ -16157,7 +16130,7 @@ class TokenSubjectNodeIdentityPolicy {
|
|
|
16157
16130
|
length: 8,
|
|
16158
16131
|
});
|
|
16159
16132
|
const newNodeId = `${hashedSubject}-${context.currentNodeId}`;
|
|
16160
|
-
logger$
|
|
16133
|
+
logger$_.info('resolved_identity_from_token', {
|
|
16161
16134
|
subject: identity.subject,
|
|
16162
16135
|
hashedSubject,
|
|
16163
16136
|
newNodeId,
|
|
@@ -16165,17 +16138,17 @@ class TokenSubjectNodeIdentityPolicy {
|
|
|
16165
16138
|
return newNodeId;
|
|
16166
16139
|
}
|
|
16167
16140
|
else {
|
|
16168
|
-
logger$
|
|
16141
|
+
logger$_.debug('identity_missing_subject', { identity });
|
|
16169
16142
|
}
|
|
16170
16143
|
}
|
|
16171
16144
|
}
|
|
16172
16145
|
catch (err) {
|
|
16173
|
-
logger$
|
|
16146
|
+
logger$_.warning('failed_to_extract_identity_from_grant', { error: err });
|
|
16174
16147
|
}
|
|
16175
16148
|
}
|
|
16176
16149
|
}
|
|
16177
16150
|
else {
|
|
16178
|
-
logger$
|
|
16151
|
+
logger$_.debug('no_grants_available');
|
|
16179
16152
|
}
|
|
16180
16153
|
return context.currentNodeId;
|
|
16181
16154
|
}
|
|
@@ -16186,7 +16159,7 @@ var tokenSubjectNodeIdentityPolicy = /*#__PURE__*/Object.freeze({
|
|
|
16186
16159
|
TokenSubjectNodeIdentityPolicy: TokenSubjectNodeIdentityPolicy
|
|
16187
16160
|
});
|
|
16188
16161
|
|
|
16189
|
-
const FACTORY_META$
|
|
16162
|
+
const FACTORY_META$1a = {
|
|
16190
16163
|
base: NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE,
|
|
16191
16164
|
key: 'TokenSubjectNodeIdentityPolicy',
|
|
16192
16165
|
};
|
|
@@ -16205,27 +16178,27 @@ class TokenSubjectNodeIdentityPolicyFactory extends NodeIdentityPolicyFactory {
|
|
|
16205
16178
|
|
|
16206
16179
|
var tokenSubjectNodeIdentityPolicyFactory = /*#__PURE__*/Object.freeze({
|
|
16207
16180
|
__proto__: null,
|
|
16208
|
-
FACTORY_META: FACTORY_META$
|
|
16181
|
+
FACTORY_META: FACTORY_META$1a,
|
|
16209
16182
|
TokenSubjectNodeIdentityPolicyFactory: TokenSubjectNodeIdentityPolicyFactory,
|
|
16210
16183
|
default: TokenSubjectNodeIdentityPolicyFactory
|
|
16211
16184
|
});
|
|
16212
16185
|
|
|
16213
|
-
const logger$
|
|
16214
|
-
const PROFILE_NAME_DEFAULT = 'default';
|
|
16186
|
+
const logger$Z = getLogger('naylence.fame.node.node_identity_policy_profile_factory');
|
|
16187
|
+
const PROFILE_NAME_DEFAULT$1 = 'default';
|
|
16215
16188
|
const PROFILE_NAME_TOKEN_SUBJECT = 'token-subject';
|
|
16216
16189
|
const PROFILE_NAME_TOKEN_SUBJECT_ALIAS = 'token_subject';
|
|
16217
|
-
const DEFAULT_PROFILE = {
|
|
16190
|
+
const DEFAULT_PROFILE$1 = {
|
|
16218
16191
|
type: 'DefaultNodeIdentityPolicy',
|
|
16219
16192
|
};
|
|
16220
16193
|
const TOKEN_SUBJECT_PROFILE = {
|
|
16221
16194
|
type: 'TokenSubjectNodeIdentityPolicy',
|
|
16222
16195
|
};
|
|
16223
|
-
const PROFILE_MAP$
|
|
16224
|
-
[PROFILE_NAME_DEFAULT]: DEFAULT_PROFILE,
|
|
16196
|
+
const PROFILE_MAP$6 = {
|
|
16197
|
+
[PROFILE_NAME_DEFAULT$1]: DEFAULT_PROFILE$1,
|
|
16225
16198
|
[PROFILE_NAME_TOKEN_SUBJECT]: TOKEN_SUBJECT_PROFILE,
|
|
16226
16199
|
[PROFILE_NAME_TOKEN_SUBJECT_ALIAS]: TOKEN_SUBJECT_PROFILE,
|
|
16227
16200
|
};
|
|
16228
|
-
const FACTORY_META$
|
|
16201
|
+
const FACTORY_META$19 = {
|
|
16229
16202
|
base: NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE,
|
|
16230
16203
|
key: 'NodeIdentityPolicyProfile',
|
|
16231
16204
|
};
|
|
@@ -16235,17 +16208,17 @@ class NodeIdentityPolicyProfileFactory extends NodeIdentityPolicyFactory {
|
|
|
16235
16208
|
this.type = 'NodeIdentityPolicyProfile';
|
|
16236
16209
|
}
|
|
16237
16210
|
async create(config) {
|
|
16238
|
-
const normalized = normalizeConfig$
|
|
16239
|
-
const profileConfig = resolveProfileConfig$
|
|
16240
|
-
logger$
|
|
16211
|
+
const normalized = normalizeConfig$x(config);
|
|
16212
|
+
const profileConfig = resolveProfileConfig$5(normalized.profile);
|
|
16213
|
+
logger$Z.debug('enabling_node_identity_policy_profile', {
|
|
16241
16214
|
profile: normalized.profile,
|
|
16242
16215
|
});
|
|
16243
16216
|
return NodeIdentityPolicyFactory.createNodeIdentityPolicy(profileConfig);
|
|
16244
16217
|
}
|
|
16245
16218
|
}
|
|
16246
|
-
function normalizeConfig$
|
|
16219
|
+
function normalizeConfig$x(config) {
|
|
16247
16220
|
if (!config) {
|
|
16248
|
-
return { profile: PROFILE_NAME_DEFAULT };
|
|
16221
|
+
return { profile: PROFILE_NAME_DEFAULT$1 };
|
|
16249
16222
|
}
|
|
16250
16223
|
const candidate = config;
|
|
16251
16224
|
const profileValue = typeof candidate.profile === 'string' && candidate.profile.trim().length > 0
|
|
@@ -16256,24 +16229,24 @@ function normalizeConfig$w(config) {
|
|
|
16256
16229
|
: typeof candidate.profileName === 'string' &&
|
|
16257
16230
|
candidate.profileName.trim().length > 0
|
|
16258
16231
|
? candidate.profileName
|
|
16259
|
-
: PROFILE_NAME_DEFAULT;
|
|
16232
|
+
: PROFILE_NAME_DEFAULT$1;
|
|
16260
16233
|
const normalizedProfile = profileValue.trim().toLowerCase();
|
|
16261
16234
|
return { profile: normalizedProfile };
|
|
16262
16235
|
}
|
|
16263
|
-
function resolveProfileConfig$
|
|
16264
|
-
const profile = PROFILE_MAP$
|
|
16236
|
+
function resolveProfileConfig$5(profileName) {
|
|
16237
|
+
const profile = PROFILE_MAP$6[profileName];
|
|
16265
16238
|
if (!profile) {
|
|
16266
16239
|
throw new Error(`Unknown node identity policy profile: ${profileName}`);
|
|
16267
16240
|
}
|
|
16268
|
-
return deepClone$
|
|
16241
|
+
return deepClone$5(profile);
|
|
16269
16242
|
}
|
|
16270
|
-
function deepClone$
|
|
16243
|
+
function deepClone$5(value) {
|
|
16271
16244
|
return JSON.parse(JSON.stringify(value));
|
|
16272
16245
|
}
|
|
16273
16246
|
|
|
16274
16247
|
var nodeIdentityPolicyProfileFactory = /*#__PURE__*/Object.freeze({
|
|
16275
16248
|
__proto__: null,
|
|
16276
|
-
FACTORY_META: FACTORY_META$
|
|
16249
|
+
FACTORY_META: FACTORY_META$19,
|
|
16277
16250
|
NodeIdentityPolicyProfileFactory: NodeIdentityPolicyProfileFactory,
|
|
16278
16251
|
default: NodeIdentityPolicyProfileFactory
|
|
16279
16252
|
});
|
|
@@ -16326,8 +16299,8 @@ class DefaultConnectionRetryPolicy {
|
|
|
16326
16299
|
}
|
|
16327
16300
|
}
|
|
16328
16301
|
|
|
16329
|
-
const logger$
|
|
16330
|
-
const FACTORY_META$
|
|
16302
|
+
const logger$Y = getLogger('naylence.fame.node.default-connection-retry-policy-factory');
|
|
16303
|
+
const FACTORY_META$18 = {
|
|
16331
16304
|
base: CONNECTION_RETRY_POLICY_FACTORY_BASE_TYPE,
|
|
16332
16305
|
key: 'DefaultConnectionRetryPolicy',
|
|
16333
16306
|
};
|
|
@@ -16348,7 +16321,7 @@ class DefaultConnectionRetryPolicyFactory extends ConnectionRetryPolicyFactory {
|
|
|
16348
16321
|
}
|
|
16349
16322
|
}
|
|
16350
16323
|
const policy = new DefaultConnectionRetryPolicy(options);
|
|
16351
|
-
logger$
|
|
16324
|
+
logger$Y.debug('connection_retry_policy_created', {
|
|
16352
16325
|
maxInitialAttempts: policy.maxInitialAttempts,
|
|
16353
16326
|
});
|
|
16354
16327
|
return policy;
|
|
@@ -16358,7 +16331,7 @@ class DefaultConnectionRetryPolicyFactory extends ConnectionRetryPolicyFactory {
|
|
|
16358
16331
|
var defaultConnectionRetryPolicyFactory = /*#__PURE__*/Object.freeze({
|
|
16359
16332
|
__proto__: null,
|
|
16360
16333
|
DefaultConnectionRetryPolicyFactory: DefaultConnectionRetryPolicyFactory,
|
|
16361
|
-
FACTORY_META: FACTORY_META$
|
|
16334
|
+
FACTORY_META: FACTORY_META$18,
|
|
16362
16335
|
default: DefaultConnectionRetryPolicyFactory
|
|
16363
16336
|
});
|
|
16364
16337
|
|
|
@@ -16373,7 +16346,7 @@ class LoadBalancerStickinessManagerFactory extends factory.AbstractResourceFacto
|
|
|
16373
16346
|
}
|
|
16374
16347
|
}
|
|
16375
16348
|
|
|
16376
|
-
const logger$
|
|
16349
|
+
const logger$X = getLogger('naylence.fame.sentinel.load_balancing.composite_load_balancing_strategy');
|
|
16377
16350
|
class CompositeLoadBalancingStrategy {
|
|
16378
16351
|
constructor(strategies) {
|
|
16379
16352
|
if (!strategies.length) {
|
|
@@ -16390,7 +16363,7 @@ class CompositeLoadBalancingStrategy {
|
|
|
16390
16363
|
try {
|
|
16391
16364
|
const result = strategy.choose(poolKey, segments, envelope);
|
|
16392
16365
|
if (result !== null) {
|
|
16393
|
-
logger$
|
|
16366
|
+
logger$X.debug('composite_strategy_success', {
|
|
16394
16367
|
envelopeId: envelope.id,
|
|
16395
16368
|
poolKey,
|
|
16396
16369
|
strategyIndex: index,
|
|
@@ -16401,7 +16374,7 @@ class CompositeLoadBalancingStrategy {
|
|
|
16401
16374
|
}
|
|
16402
16375
|
}
|
|
16403
16376
|
catch (error) {
|
|
16404
|
-
logger$
|
|
16377
|
+
logger$X.warning('composite_strategy_error', {
|
|
16405
16378
|
envelopeId: envelope.id,
|
|
16406
16379
|
poolKey,
|
|
16407
16380
|
strategyIndex: index,
|
|
@@ -16410,7 +16383,7 @@ class CompositeLoadBalancingStrategy {
|
|
|
16410
16383
|
});
|
|
16411
16384
|
}
|
|
16412
16385
|
}
|
|
16413
|
-
logger$
|
|
16386
|
+
logger$X.debug('composite_strategy_all_failed', {
|
|
16414
16387
|
envelopeId: envelope.id,
|
|
16415
16388
|
poolKey,
|
|
16416
16389
|
strategyCount: this.strategies.length,
|
|
@@ -16419,7 +16392,7 @@ class CompositeLoadBalancingStrategy {
|
|
|
16419
16392
|
}
|
|
16420
16393
|
}
|
|
16421
16394
|
|
|
16422
|
-
const logger$
|
|
16395
|
+
const logger$W = getLogger('naylence.fame.sentinel.load_balancing.sticky_load_balancing_strategy');
|
|
16423
16396
|
class StickyLoadBalancingStrategy {
|
|
16424
16397
|
constructor(stickinessManager) {
|
|
16425
16398
|
this.lastChosenReplica = null;
|
|
@@ -16434,7 +16407,7 @@ class StickyLoadBalancingStrategy {
|
|
|
16434
16407
|
}
|
|
16435
16408
|
const stickyReplica = this.stickinessManager.getStickyReplicaSegment(envelope, segments);
|
|
16436
16409
|
if (stickyReplica && segments.includes(stickyReplica)) {
|
|
16437
|
-
logger$
|
|
16410
|
+
logger$W.debug('routing_via_stickiness', {
|
|
16438
16411
|
envelopeId: envelope.id,
|
|
16439
16412
|
poolKey,
|
|
16440
16413
|
replicaId: stickyReplica,
|
|
@@ -16444,7 +16417,7 @@ class StickyLoadBalancingStrategy {
|
|
|
16444
16417
|
this.lastChosenReplica = stickyReplica;
|
|
16445
16418
|
return stickyReplica;
|
|
16446
16419
|
}
|
|
16447
|
-
logger$
|
|
16420
|
+
logger$W.debug('no_stickiness_match_fallback', {
|
|
16448
16421
|
envelopeId: envelope.id,
|
|
16449
16422
|
poolKey,
|
|
16450
16423
|
aftPresent: Boolean(envelope.aft),
|
|
@@ -16532,7 +16505,7 @@ class RouteStoreFactory extends factory.AbstractResourceFactory {
|
|
|
16532
16505
|
return store ?? null;
|
|
16533
16506
|
}
|
|
16534
16507
|
}
|
|
16535
|
-
const FACTORY_META$
|
|
16508
|
+
const FACTORY_META$17 = {
|
|
16536
16509
|
base: ROUTE_STORE_FACTORY_BASE_TYPE,
|
|
16537
16510
|
key: 'InMemoryRouteStore',
|
|
16538
16511
|
};
|
|
@@ -16550,7 +16523,7 @@ class InMemoryRouteStoreFactory extends RouteStoreFactory {
|
|
|
16550
16523
|
|
|
16551
16524
|
var routeStoreFactory = /*#__PURE__*/Object.freeze({
|
|
16552
16525
|
__proto__: null,
|
|
16553
|
-
FACTORY_META: FACTORY_META$
|
|
16526
|
+
FACTORY_META: FACTORY_META$17,
|
|
16554
16527
|
InMemoryRouteStoreFactory: InMemoryRouteStoreFactory,
|
|
16555
16528
|
ROUTE_STORE_FACTORY_BASE_TYPE: ROUTE_STORE_FACTORY_BASE_TYPE,
|
|
16556
16529
|
RouteStoreFactory: RouteStoreFactory,
|
|
@@ -16782,7 +16755,7 @@ function resolveRecordArray(primary, secondary) {
|
|
|
16782
16755
|
return pickRecordArray(candidate) ?? undefined;
|
|
16783
16756
|
}
|
|
16784
16757
|
|
|
16785
|
-
const logger$
|
|
16758
|
+
const logger$V = getLogger('naylence.fame.sentinel.route_manager');
|
|
16786
16759
|
const DEFAULT_CONNECTOR_CLEANUP_DELAY_MS$1 = 200;
|
|
16787
16760
|
function normalizeRouteManagerOptions(options) {
|
|
16788
16761
|
const { route_store, get_id, cleanup_delay_ms, retain_address_bindings_on_disconnect, ...rest } = options;
|
|
@@ -16866,7 +16839,7 @@ class RouteManager extends TaskSpawner {
|
|
|
16866
16839
|
await this.safeStop(entry.connector);
|
|
16867
16840
|
}
|
|
16868
16841
|
catch (error) {
|
|
16869
|
-
logger$
|
|
16842
|
+
logger$V.debug('pending_route_stop_failed', {
|
|
16870
16843
|
error: error instanceof Error ? error.message : String(error),
|
|
16871
16844
|
});
|
|
16872
16845
|
}
|
|
@@ -16889,7 +16862,7 @@ class RouteManager extends TaskSpawner {
|
|
|
16889
16862
|
this.cancelPendingCleanup(segment);
|
|
16890
16863
|
this.downstreamRoutes.set(segment, route);
|
|
16891
16864
|
});
|
|
16892
|
-
logger$
|
|
16865
|
+
logger$V.debug('registered_downstream_route', { route: segment });
|
|
16893
16866
|
}
|
|
16894
16867
|
async unregisterDownstreamRoute(segment, options) {
|
|
16895
16868
|
const normalizedOptions = normalizeRouteRemovalOptions(options);
|
|
@@ -16905,7 +16878,7 @@ class RouteManager extends TaskSpawner {
|
|
|
16905
16878
|
this.cancelPendingCleanup(segment);
|
|
16906
16879
|
this._peer_routes.set(segment, route);
|
|
16907
16880
|
});
|
|
16908
|
-
logger$
|
|
16881
|
+
logger$V.debug('registered_peer_route', { route: segment });
|
|
16909
16882
|
}
|
|
16910
16883
|
async unregisterPeerRoute(segment, options) {
|
|
16911
16884
|
const normalizedOptions = normalizeRouteRemovalOptions(options);
|
|
@@ -16923,11 +16896,11 @@ class RouteManager extends TaskSpawner {
|
|
|
16923
16896
|
await Promise.all(entryTuples.map(async ([segment, entry]) => {
|
|
16924
16897
|
const normalized = this.normalizeEntry(entry);
|
|
16925
16898
|
if (!normalized.connectorConfig) {
|
|
16926
|
-
logger$
|
|
16899
|
+
logger$V.warning('route_restore_missing_config', { segment });
|
|
16927
16900
|
return;
|
|
16928
16901
|
}
|
|
16929
16902
|
if (normalized.attachExpiresAt && normalized.attachExpiresAt < now) {
|
|
16930
|
-
logger$
|
|
16903
|
+
logger$V.debug('skipping_expired_route', { segment });
|
|
16931
16904
|
return;
|
|
16932
16905
|
}
|
|
16933
16906
|
const authorization = this.parseAuthorization(normalized.metadata);
|
|
@@ -16960,7 +16933,7 @@ class RouteManager extends TaskSpawner {
|
|
|
16960
16933
|
}
|
|
16961
16934
|
catch (error) {
|
|
16962
16935
|
if (this.isTransientError(error)) {
|
|
16963
|
-
logger$
|
|
16936
|
+
logger$V.warning('transient_restore_failure', {
|
|
16964
16937
|
segment,
|
|
16965
16938
|
attempt,
|
|
16966
16939
|
error: error instanceof Error ? error.message : String(error),
|
|
@@ -16969,7 +16942,7 @@ class RouteManager extends TaskSpawner {
|
|
|
16969
16942
|
backoff *= 2;
|
|
16970
16943
|
continue;
|
|
16971
16944
|
}
|
|
16972
|
-
logger$
|
|
16945
|
+
logger$V.error('failed_to_restore_route', {
|
|
16973
16946
|
segment,
|
|
16974
16947
|
error: error instanceof Error ? error.message : String(error),
|
|
16975
16948
|
});
|
|
@@ -16998,13 +16971,13 @@ class RouteManager extends TaskSpawner {
|
|
|
16998
16971
|
await this._downstream_route_store
|
|
16999
16972
|
.delete(segment)
|
|
17000
16973
|
.catch((error) => {
|
|
17001
|
-
logger$
|
|
16974
|
+
logger$V.warning('route_expiration_delete_failed', {
|
|
17002
16975
|
segment,
|
|
17003
16976
|
error: error instanceof Error ? error.message : String(error),
|
|
17004
16977
|
});
|
|
17005
16978
|
});
|
|
17006
16979
|
this.purgeRouteReferences(segment);
|
|
17007
|
-
logger$
|
|
16980
|
+
logger$V.debug('expired_route', { route: segment });
|
|
17008
16981
|
}
|
|
17009
16982
|
async removeDownstreamRoute(segment, options) {
|
|
17010
16983
|
const normalizedOptions = normalizeRouteRemovalOptions(options);
|
|
@@ -17062,7 +17035,7 @@ class RouteManager extends TaskSpawner {
|
|
|
17062
17035
|
this.purgeRouteReferences(segment);
|
|
17063
17036
|
}
|
|
17064
17037
|
await store.delete(segment).catch((error) => {
|
|
17065
|
-
logger$
|
|
17038
|
+
logger$V.warning('route_delete_failed', {
|
|
17066
17039
|
segment,
|
|
17067
17040
|
error: error instanceof Error ? error.message : String(error),
|
|
17068
17041
|
});
|
|
@@ -17081,7 +17054,7 @@ class RouteManager extends TaskSpawner {
|
|
|
17081
17054
|
caller_stack: captureStack ? captureCallerStack() : undefined,
|
|
17082
17055
|
retained_addresses: retainAddresses,
|
|
17083
17056
|
};
|
|
17084
|
-
logger$
|
|
17057
|
+
logger$V.debug('removed_route', removalMeta);
|
|
17085
17058
|
}
|
|
17086
17059
|
purgeRouteReferences(segment) {
|
|
17087
17060
|
for (const [address, info] of this._downstream_addresses_routes.entries()) {
|
|
@@ -17136,10 +17109,10 @@ class RouteManager extends TaskSpawner {
|
|
|
17136
17109
|
}
|
|
17137
17110
|
catch (error) {
|
|
17138
17111
|
if (combined.signal.aborted) {
|
|
17139
|
-
logger$
|
|
17112
|
+
logger$V.debug('connector_cleanup_cancelled', { segment });
|
|
17140
17113
|
}
|
|
17141
17114
|
else {
|
|
17142
|
-
logger$
|
|
17115
|
+
logger$V.debug('connector_cleanup_delay_failed', {
|
|
17143
17116
|
segment,
|
|
17144
17117
|
error: error instanceof Error ? error.message : String(error),
|
|
17145
17118
|
});
|
|
@@ -17162,7 +17135,7 @@ class RouteManager extends TaskSpawner {
|
|
|
17162
17135
|
}
|
|
17163
17136
|
catch (error) {
|
|
17164
17137
|
if (error instanceof Error) {
|
|
17165
|
-
logger$
|
|
17138
|
+
logger$V.debug('connector_stop_ignored', { error: error.message });
|
|
17166
17139
|
}
|
|
17167
17140
|
}
|
|
17168
17141
|
for (const [flowId, peer] of this.flowRoutes.entries()) {
|
|
@@ -17187,12 +17160,12 @@ class RouteManager extends TaskSpawner {
|
|
|
17187
17160
|
}
|
|
17188
17161
|
}
|
|
17189
17162
|
catch (error) {
|
|
17190
|
-
logger$
|
|
17163
|
+
logger$V.error('janitor_loop_error', {
|
|
17191
17164
|
error: error instanceof Error ? error.message : String(error),
|
|
17192
17165
|
});
|
|
17193
17166
|
}
|
|
17194
17167
|
finally {
|
|
17195
|
-
logger$
|
|
17168
|
+
logger$V.debug('janitor_loop_exited');
|
|
17196
17169
|
}
|
|
17197
17170
|
}
|
|
17198
17171
|
async scanStoreForExpirations(store, now, kind) {
|
|
@@ -17212,13 +17185,13 @@ class RouteManager extends TaskSpawner {
|
|
|
17212
17185
|
}
|
|
17213
17186
|
});
|
|
17214
17187
|
await store.delete(segment).catch((error) => {
|
|
17215
|
-
logger$
|
|
17188
|
+
logger$V.warning('route_auto_expire_delete_failed', {
|
|
17216
17189
|
segment,
|
|
17217
17190
|
error: error instanceof Error ? error.message : String(error),
|
|
17218
17191
|
});
|
|
17219
17192
|
});
|
|
17220
17193
|
this.purgeRouteReferences(segment);
|
|
17221
|
-
logger$
|
|
17194
|
+
logger$V.debug('auto_expired_route', { segment });
|
|
17222
17195
|
}));
|
|
17223
17196
|
}
|
|
17224
17197
|
parseAuthorization(metadata) {
|
|
@@ -17241,7 +17214,7 @@ class RouteManager extends TaskSpawner {
|
|
|
17241
17214
|
return { ...base, ...extraFields };
|
|
17242
17215
|
}
|
|
17243
17216
|
catch (error) {
|
|
17244
|
-
logger$
|
|
17217
|
+
logger$V.error('corrupt_route_metadata', {
|
|
17245
17218
|
error: error instanceof Error ? error.message : String(error),
|
|
17246
17219
|
});
|
|
17247
17220
|
return null;
|
|
@@ -17317,12 +17290,12 @@ function captureCallerStack(skip = 3, depth = 6) {
|
|
|
17317
17290
|
return frames.map((frame) => frame.trim()).join(' | ');
|
|
17318
17291
|
}
|
|
17319
17292
|
|
|
17320
|
-
const logger$
|
|
17293
|
+
const logger$U = getLogger('naylence.fame.sentinel.router');
|
|
17321
17294
|
const ZERO_EPH_PUB_BASE64 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=';
|
|
17322
17295
|
class Drop {
|
|
17323
17296
|
async execute(envelope, router, state, context) {
|
|
17324
17297
|
await emitDeliveryNack(envelope, router, state, 'NO_ROUTE', context ?? undefined);
|
|
17325
|
-
logger$
|
|
17298
|
+
logger$U.debug('dropped_envelope', Object.assign(summarizeEnvelope(envelope, ''), {
|
|
17326
17299
|
localAddresses: Array.from(state.local.values()),
|
|
17327
17300
|
downstreamRoutes: Array.from(state.downstreamAddressRoutes.entries()),
|
|
17328
17301
|
peerRoutes: Array.from(state.peerAddressRoutes.entries()),
|
|
@@ -17352,7 +17325,7 @@ class ForwardChild {
|
|
|
17352
17325
|
}
|
|
17353
17326
|
catch (error) {
|
|
17354
17327
|
if (error instanceof FameTransportClose) {
|
|
17355
|
-
logger$
|
|
17328
|
+
logger$U.error('transport_closed_forward_child', {
|
|
17356
17329
|
segment: this.segment,
|
|
17357
17330
|
error: error.message,
|
|
17358
17331
|
});
|
|
@@ -17384,7 +17357,7 @@ class ForwardPeer {
|
|
|
17384
17357
|
}
|
|
17385
17358
|
catch (error) {
|
|
17386
17359
|
if (error instanceof FameTransportClose) {
|
|
17387
|
-
logger$
|
|
17360
|
+
logger$U.error('transport_closed_forward_peer', {
|
|
17388
17361
|
segment: this.segment,
|
|
17389
17362
|
error: error.message,
|
|
17390
17363
|
});
|
|
@@ -17419,7 +17392,7 @@ class Deny {
|
|
|
17419
17392
|
async execute(envelope, router, state, context) {
|
|
17420
17393
|
const { internalReason, deniedAction, matchedRule, context: extraContext, disclosure = 'opaque', } = this.options;
|
|
17421
17394
|
// Log detailed denial internally
|
|
17422
|
-
logger$
|
|
17395
|
+
logger$U.warning('route_authorization_denied', {
|
|
17423
17396
|
envp_id: envelope.id,
|
|
17424
17397
|
frame_type: envelope.frame?.type ?? null,
|
|
17425
17398
|
to: envelope.to?.toString() ?? null,
|
|
@@ -17465,7 +17438,7 @@ function mapRoutingActionToAuthorizationAction(action) {
|
|
|
17465
17438
|
return null;
|
|
17466
17439
|
}
|
|
17467
17440
|
// Unknown RoutingAction: return null, caller should deny by default
|
|
17468
|
-
logger$
|
|
17441
|
+
logger$U.warning('unknown_routing_action_for_authorization', {
|
|
17469
17442
|
action_type: action?.constructor?.name ?? 'unknown',
|
|
17470
17443
|
});
|
|
17471
17444
|
return null;
|
|
@@ -17498,7 +17471,7 @@ async function emitDeliveryNack(envelope, routingNode, state, code, context) {
|
|
|
17498
17471
|
return;
|
|
17499
17472
|
}
|
|
17500
17473
|
if (!state.envelopeFactory) {
|
|
17501
|
-
logger$
|
|
17474
|
+
logger$U.warning('router_missing_envelope_factory', summarizeEnvelope(envelope));
|
|
17502
17475
|
return;
|
|
17503
17476
|
}
|
|
17504
17477
|
const nackFrame = createNackFrame(envelope, code);
|
|
@@ -17529,7 +17502,7 @@ async function emitDeliveryNack(envelope, routingNode, state, code, context) {
|
|
|
17529
17502
|
}
|
|
17530
17503
|
}
|
|
17531
17504
|
catch (error) {
|
|
17532
|
-
logger$
|
|
17505
|
+
logger$U.warning('nack_forward_failed', {
|
|
17533
17506
|
error: error instanceof Error ? error.message : String(error),
|
|
17534
17507
|
...summarizeEnvelope(envelope),
|
|
17535
17508
|
});
|
|
@@ -17735,7 +17708,7 @@ class HRWLoadBalancingStrategy {
|
|
|
17735
17708
|
}
|
|
17736
17709
|
}
|
|
17737
17710
|
|
|
17738
|
-
const logger$
|
|
17711
|
+
const logger$T = getLogger('naylence.fame.sentinel.capability_aware_routing_policy');
|
|
17739
17712
|
function normalizeOptions$i(options) {
|
|
17740
17713
|
if (!options || typeof options !== 'object') {
|
|
17741
17714
|
return {};
|
|
@@ -17787,7 +17760,7 @@ class CapabilityAwareRoutingPolicy {
|
|
|
17787
17760
|
if (chosenSegment) {
|
|
17788
17761
|
return new ForwardChild(chosenSegment);
|
|
17789
17762
|
}
|
|
17790
|
-
logger$
|
|
17763
|
+
logger$T.warning('capability_policy_lb_failed', {
|
|
17791
17764
|
segments: providerSegments,
|
|
17792
17765
|
capabilities,
|
|
17793
17766
|
...summarizeEnvelope(envelope),
|
|
@@ -17816,7 +17789,7 @@ class CapabilityAwareRoutingPolicy {
|
|
|
17816
17789
|
}
|
|
17817
17790
|
}
|
|
17818
17791
|
catch (error) {
|
|
17819
|
-
logger$
|
|
17792
|
+
logger$T.warning('capability_policy_resolve_failed', {
|
|
17820
17793
|
error: error instanceof Error ? error.message : String(error),
|
|
17821
17794
|
});
|
|
17822
17795
|
}
|
|
@@ -18053,7 +18026,7 @@ function toFameAddress(address) {
|
|
|
18053
18026
|
return address instanceof core.FameAddress ? address : new core.FameAddress(address);
|
|
18054
18027
|
}
|
|
18055
18028
|
|
|
18056
|
-
const logger$
|
|
18029
|
+
const logger$S = getLogger('naylence.fame.sentinel.node_attach_frame_handler');
|
|
18057
18030
|
const DOWNSTREAM_ORIGINS = new Set([
|
|
18058
18031
|
core.DeliveryOriginType.DOWNSTREAM,
|
|
18059
18032
|
core.DeliveryOriginType.PEER,
|
|
@@ -18146,7 +18119,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18146
18119
|
this.maxTtlSec = options.maxTtlSec ?? null;
|
|
18147
18120
|
}
|
|
18148
18121
|
async acceptNodeAttach(envelope, context) {
|
|
18149
|
-
logger$
|
|
18122
|
+
logger$S.debug('handling_node_attach_request');
|
|
18150
18123
|
const normalizedContext = this.normalizeContext(context);
|
|
18151
18124
|
const frame = this.normalizeNodeAttachFrame(envelope.frame);
|
|
18152
18125
|
if (frame.type !== 'NodeAttach') {
|
|
@@ -18191,14 +18164,14 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18191
18164
|
let isRebind = false;
|
|
18192
18165
|
if (frame.originType === core.DeliveryOriginType.DOWNSTREAM) {
|
|
18193
18166
|
const hasExistingRoute = this.routeManager.downstreamRoutes.has(attachedSystemId);
|
|
18194
|
-
logger$
|
|
18167
|
+
logger$S.debug('checking_for_existing_route', {
|
|
18195
18168
|
system_id: attachedSystemId,
|
|
18196
18169
|
has_existing: hasExistingRoute,
|
|
18197
18170
|
existing_routes: Array.from(this.routeManager.downstreamRoutes.keys()),
|
|
18198
18171
|
});
|
|
18199
18172
|
if (hasExistingRoute) {
|
|
18200
18173
|
isRebind = true;
|
|
18201
|
-
logger$
|
|
18174
|
+
logger$S.warning('rebinding_existing_downstream_route', {
|
|
18202
18175
|
system_id: attachedSystemId,
|
|
18203
18176
|
});
|
|
18204
18177
|
oldAssignedPath = buildAssignedPath$1(this.routingNode.physicalPath, attachedSystemId);
|
|
@@ -18217,7 +18190,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18217
18190
|
meta: { systemId: attachedSystemId },
|
|
18218
18191
|
})
|
|
18219
18192
|
.catch((error) => {
|
|
18220
|
-
logger$
|
|
18193
|
+
logger$S.warning('failed_to_unregister_downstream_route_before_rebind', {
|
|
18221
18194
|
system_id: attachedSystemId,
|
|
18222
18195
|
error: error instanceof Error ? error.message : String(error),
|
|
18223
18196
|
});
|
|
@@ -18234,7 +18207,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18234
18207
|
for (const address of orphanedAddresses) {
|
|
18235
18208
|
encryptionMgr.clearChannelCacheForDestination(address);
|
|
18236
18209
|
}
|
|
18237
|
-
logger$
|
|
18210
|
+
logger$S.debug('cleared_channel_cache_for_rebind', {
|
|
18238
18211
|
system_id: attachedSystemId,
|
|
18239
18212
|
addresses: orphanedAddresses,
|
|
18240
18213
|
});
|
|
@@ -18246,7 +18219,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18246
18219
|
encryptionMgr.removeChannelsForDestination(address);
|
|
18247
18220
|
}
|
|
18248
18221
|
if (totalRemoved > 0) {
|
|
18249
|
-
logger$
|
|
18222
|
+
logger$S.debug('removed_channel_states_for_rebind', {
|
|
18250
18223
|
system_id: attachedSystemId,
|
|
18251
18224
|
channels_removed: totalRemoved,
|
|
18252
18225
|
});
|
|
@@ -18254,7 +18227,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18254
18227
|
}
|
|
18255
18228
|
}
|
|
18256
18229
|
catch (error) {
|
|
18257
|
-
logger$
|
|
18230
|
+
logger$S.warning('failed_to_cleanup_channels_for_rebind', {
|
|
18258
18231
|
system_id: attachedSystemId,
|
|
18259
18232
|
error: error instanceof Error ? error.message : String(error),
|
|
18260
18233
|
});
|
|
@@ -18277,7 +18250,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18277
18250
|
meta: { systemId: attachedSystemId },
|
|
18278
18251
|
})
|
|
18279
18252
|
.catch((error) => {
|
|
18280
|
-
logger$
|
|
18253
|
+
logger$S.warning('failed_to_unregister_peer_route_before_rebind', {
|
|
18281
18254
|
system_id: attachedSystemId,
|
|
18282
18255
|
error: error instanceof Error ? error.message : String(error),
|
|
18283
18256
|
});
|
|
@@ -18315,7 +18288,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18315
18288
|
? { stickiness: negotiatedStickiness }
|
|
18316
18289
|
: {}),
|
|
18317
18290
|
});
|
|
18318
|
-
logger$
|
|
18291
|
+
logger$S.debug('sending_node_attach_ack', {
|
|
18319
18292
|
env_id: ackEnvelope.id ?? 'unknown',
|
|
18320
18293
|
});
|
|
18321
18294
|
await this.sendAndNotify(connector, ackEnvelope, attachedSystemId, normalizedContext);
|
|
@@ -18362,7 +18335,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18362
18335
|
return this.stickinessManager.negotiate(stickiness);
|
|
18363
18336
|
}
|
|
18364
18337
|
catch (error) {
|
|
18365
|
-
logger$
|
|
18338
|
+
logger$S.debug('stickiness_negotiate_skipped', {
|
|
18366
18339
|
error: error instanceof Error ? error.message : String(error),
|
|
18367
18340
|
});
|
|
18368
18341
|
return null;
|
|
@@ -18378,13 +18351,13 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18378
18351
|
}
|
|
18379
18352
|
if (!attachExpiresAt || earliestKeyExpiry < attachExpiresAt) {
|
|
18380
18353
|
if (attachExpiresAt) {
|
|
18381
|
-
logger$
|
|
18354
|
+
logger$S.warning('attachment_ttl_limited_by_key_expiry', {
|
|
18382
18355
|
limited_attach_expires_at: earliestKeyExpiry.toISOString(),
|
|
18383
18356
|
original_attach_expires_at: attachExpiresAt.toISOString(),
|
|
18384
18357
|
});
|
|
18385
18358
|
}
|
|
18386
18359
|
else {
|
|
18387
|
-
logger$
|
|
18360
|
+
logger$S.debug('attachment_ttl_set_by_key_expiry', {
|
|
18388
18361
|
attach_expires_at: earliestKeyExpiry.toISOString(),
|
|
18389
18362
|
reason: 'no_max_ttl_configured',
|
|
18390
18363
|
});
|
|
@@ -18395,7 +18368,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18395
18368
|
}
|
|
18396
18369
|
async validateAttachmentKeys(frame, envelope, connector, context, systemId) {
|
|
18397
18370
|
if (!this.attachmentKeyValidator) {
|
|
18398
|
-
logger$
|
|
18371
|
+
logger$S.debug('child_key_validation_skipped', {
|
|
18399
18372
|
child_id: systemId,
|
|
18400
18373
|
reason: 'no_validator',
|
|
18401
18374
|
});
|
|
@@ -18411,7 +18384,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18411
18384
|
}
|
|
18412
18385
|
}
|
|
18413
18386
|
if (keyInfos.length > 0) {
|
|
18414
|
-
logger$
|
|
18387
|
+
logger$S.debug('node_attach_key_validation_passed', {
|
|
18415
18388
|
system_id: systemId,
|
|
18416
18389
|
instance_id: frame.instanceId,
|
|
18417
18390
|
correlation_id: envelope.corrId,
|
|
@@ -18431,13 +18404,13 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18431
18404
|
reason: `Certificate validation failed: ${error.message}`,
|
|
18432
18405
|
});
|
|
18433
18406
|
await this.sendAndNotify(connector, rejectionAck, systemId, context).catch((sendError) => {
|
|
18434
|
-
logger$
|
|
18407
|
+
logger$S.error('failed_sending_negative_attach_ack', {
|
|
18435
18408
|
error: sendError instanceof Error
|
|
18436
18409
|
? sendError.message
|
|
18437
18410
|
: String(sendError),
|
|
18438
18411
|
});
|
|
18439
18412
|
});
|
|
18440
|
-
logger$
|
|
18413
|
+
logger$S.error('node_attach_key_validation_failed', {
|
|
18441
18414
|
system_id: systemId,
|
|
18442
18415
|
instance_id: frame.instanceId,
|
|
18443
18416
|
correlation_id: envelope.corrId,
|
|
@@ -18503,10 +18476,10 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18503
18476
|
try {
|
|
18504
18477
|
await delay(delaySeconds * 1000);
|
|
18505
18478
|
await connector.close(1008, 'attach-unauthorized');
|
|
18506
|
-
logger$
|
|
18479
|
+
logger$S.debug('closed_unauthorized_connection');
|
|
18507
18480
|
}
|
|
18508
18481
|
catch (error) {
|
|
18509
|
-
logger$
|
|
18482
|
+
logger$S.error('failed_to_close_unauthorized_connection', {
|
|
18510
18483
|
error: error instanceof Error ? error.message : String(error),
|
|
18511
18484
|
});
|
|
18512
18485
|
}
|
|
@@ -18619,7 +18592,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
|
|
|
18619
18592
|
}
|
|
18620
18593
|
}
|
|
18621
18594
|
|
|
18622
|
-
const logger$
|
|
18595
|
+
const logger$R = getLogger('naylence.fame.sentinel.address_bind_frame_handler');
|
|
18623
18596
|
const RESERVED_ADDRESS_NAMES = new Set(['__sys__', '__rpc__']);
|
|
18624
18597
|
function pickManagerField(manager, keys) {
|
|
18625
18598
|
const record = manager;
|
|
@@ -18943,7 +18916,7 @@ class AddressBindFrameHandler {
|
|
|
18943
18916
|
if (this.routingNode.forwardToPeers) {
|
|
18944
18917
|
await this.routingNode.forwardToPeers(envelope, undefined, [sourceSystemId], context);
|
|
18945
18918
|
}
|
|
18946
|
-
logger$
|
|
18919
|
+
logger$R.debug('address_bound', {
|
|
18947
18920
|
address: addressStr,
|
|
18948
18921
|
segment: sourceSystemId,
|
|
18949
18922
|
});
|
|
@@ -19041,7 +19014,7 @@ class AddressBindFrameHandler {
|
|
|
19041
19014
|
}
|
|
19042
19015
|
await this.routingNode.forwardToRoute(sourceSystemId, ackEnvelope, ackContext);
|
|
19043
19016
|
}
|
|
19044
|
-
logger$
|
|
19017
|
+
logger$R.debug('address_unbound', {
|
|
19045
19018
|
address: addressStr,
|
|
19046
19019
|
segment: sourceSystemId,
|
|
19047
19020
|
});
|
|
@@ -19059,7 +19032,7 @@ class AddressBindFrameHandler {
|
|
|
19059
19032
|
}
|
|
19060
19033
|
}
|
|
19061
19034
|
|
|
19062
|
-
const logger$
|
|
19035
|
+
const logger$Q = getLogger('naylence.fame.sentinel.node_heartbeat_frame_handler');
|
|
19063
19036
|
function normalizeOptions$h(options) {
|
|
19064
19037
|
if (!options || typeof options !== 'object') {
|
|
19065
19038
|
throw new Error('NodeHeartbeatFrameHandler requires a routingNode option');
|
|
@@ -19096,7 +19069,7 @@ class NodeHeartbeatFrameHandler {
|
|
|
19096
19069
|
if (!frame || frame.type !== 'NodeHeartbeat') {
|
|
19097
19070
|
throw new Error(`Invalid envelope frame. Expected: NodeHeartbeatFrame, actual: ${frame?.type ?? 'unknown'}`);
|
|
19098
19071
|
}
|
|
19099
|
-
logger$
|
|
19072
|
+
logger$Q.trace('handling_heartbeat', {
|
|
19100
19073
|
hb_system_id: frame.systemId ?? 'unknown',
|
|
19101
19074
|
hb_env_id: envelope.id ?? 'unknown',
|
|
19102
19075
|
hb_corr_id: envelope.corrId ?? 'unknown',
|
|
@@ -19124,7 +19097,7 @@ class NodeHeartbeatFrameHandler {
|
|
|
19124
19097
|
...(envelope.corrId ? { corrId: envelope.corrId } : {}),
|
|
19125
19098
|
...(envelope.traceId ? { traceId: envelope.traceId } : {}),
|
|
19126
19099
|
});
|
|
19127
|
-
logger$
|
|
19100
|
+
logger$Q.debug('sending_heartbeat_ack', {
|
|
19128
19101
|
hb_ack_env_id: ackEnvelope.id ?? 'unknown',
|
|
19129
19102
|
hb_ack_corr_id: ackEnvelope.corrId ?? 'unknown',
|
|
19130
19103
|
});
|
|
@@ -19152,7 +19125,7 @@ class NodeHeartbeatFrameHandler {
|
|
|
19152
19125
|
}
|
|
19153
19126
|
}
|
|
19154
19127
|
|
|
19155
|
-
const logger$
|
|
19128
|
+
const logger$P = getLogger('naylence.fame.sentinel.capability_frame_handler');
|
|
19156
19129
|
class CapabilityFrameHandler {
|
|
19157
19130
|
constructor(options) {
|
|
19158
19131
|
this.capabilityRoutes = new Map();
|
|
@@ -19179,7 +19152,7 @@ class CapabilityFrameHandler {
|
|
|
19179
19152
|
const segment = this.getSourceSystemId(context);
|
|
19180
19153
|
const downstreamRoutes = getDownstreamRoutes(this.routeManager);
|
|
19181
19154
|
if (!segment || !hasRoute(downstreamRoutes, segment)) {
|
|
19182
|
-
logger$
|
|
19155
|
+
logger$P.debug('capability_advertise_unknown_segment', { segment });
|
|
19183
19156
|
return;
|
|
19184
19157
|
}
|
|
19185
19158
|
const addressKey = this.normalizeAddress(frame.address);
|
|
@@ -19212,7 +19185,7 @@ class CapabilityFrameHandler {
|
|
|
19212
19185
|
}
|
|
19213
19186
|
const segment = this.getSourceSystemId(context);
|
|
19214
19187
|
if (!segment) {
|
|
19215
|
-
logger$
|
|
19188
|
+
logger$P.debug('capability_withdraw_missing_segment');
|
|
19216
19189
|
return;
|
|
19217
19190
|
}
|
|
19218
19191
|
const addressKey = this.normalizeAddress(frame.address);
|
|
@@ -19266,7 +19239,7 @@ class CapabilityFrameHandler {
|
|
|
19266
19239
|
async forwardAckToSegment(segment, ackFrame, originalEnvelope, ackContext) {
|
|
19267
19240
|
const envelopeFactory = this.routingNode.envelopeFactory;
|
|
19268
19241
|
if (!envelopeFactory) {
|
|
19269
|
-
logger$
|
|
19242
|
+
logger$P.warning('missing_envelope_factory_for_capability_ack');
|
|
19270
19243
|
return;
|
|
19271
19244
|
}
|
|
19272
19245
|
const ackEnvelope = envelopeFactory.createEnvelope({
|
|
@@ -19329,7 +19302,7 @@ function getStickySid(context) {
|
|
|
19329
19302
|
return typed.stickySid ?? typed.sticky_sid ?? undefined;
|
|
19330
19303
|
}
|
|
19331
19304
|
|
|
19332
|
-
const logger$
|
|
19305
|
+
const logger$O = getLogger('naylence.fame.sentinel.credit_update_frame_handler');
|
|
19333
19306
|
function normalizeOptions$g(options) {
|
|
19334
19307
|
if (!options || typeof options !== 'object') {
|
|
19335
19308
|
throw new Error('CreditUpdateFrameHandler requires a routeManager option');
|
|
@@ -19349,12 +19322,12 @@ class CreditUpdateFrameHandler {
|
|
|
19349
19322
|
async acceptCreditUpdate(envelope, context) {
|
|
19350
19323
|
const flowId = envelope.flowId;
|
|
19351
19324
|
if (!flowId) {
|
|
19352
|
-
logger$
|
|
19325
|
+
logger$O.warning('credit_update_missing_flow_id');
|
|
19353
19326
|
return;
|
|
19354
19327
|
}
|
|
19355
19328
|
const targetConnector = this.routeManager.getFlowRoute(flowId);
|
|
19356
19329
|
if (!targetConnector) {
|
|
19357
|
-
logger$
|
|
19330
|
+
logger$O.warning('credit_update_unknown_flow', { flowId });
|
|
19358
19331
|
return;
|
|
19359
19332
|
}
|
|
19360
19333
|
if (context?.fromConnector && context.fromConnector === targetConnector) {
|
|
@@ -19364,7 +19337,7 @@ class CreditUpdateFrameHandler {
|
|
|
19364
19337
|
}
|
|
19365
19338
|
}
|
|
19366
19339
|
|
|
19367
|
-
const logger$
|
|
19340
|
+
const logger$N = getLogger('naylence.fame.sentinel.sentinel');
|
|
19368
19341
|
const ALLOWED_BEFORE_ATTACH = new Set(['NodeAttach']);
|
|
19369
19342
|
const SYSTEM_INBOX = '__sys__';
|
|
19370
19343
|
const RESERVED_UPSTREAM_ADDRESS_NAMES = new Set(['__sys__', '__rpc__']);
|
|
@@ -19458,7 +19431,7 @@ class Sentinel extends FameNode {
|
|
|
19458
19431
|
routeStore = createPersistentRouteStore(this.storageProvider);
|
|
19459
19432
|
}
|
|
19460
19433
|
catch (error) {
|
|
19461
|
-
logger$
|
|
19434
|
+
logger$N.warning('persistent_route_store_unavailable', {
|
|
19462
19435
|
error: error instanceof Error ? error.message : String(error),
|
|
19463
19436
|
});
|
|
19464
19437
|
routeStore = getDefaultRouteStore();
|
|
@@ -19540,7 +19513,7 @@ class Sentinel extends FameNode {
|
|
|
19540
19513
|
bumpRoutingEpoch() {
|
|
19541
19514
|
const previousEpoch = this.routingEpochValue;
|
|
19542
19515
|
this.routingEpochValue = core.generateId();
|
|
19543
|
-
logger$
|
|
19516
|
+
logger$N.debug('routing_epoch_bumped', {
|
|
19544
19517
|
previous_epoch: previousEpoch,
|
|
19545
19518
|
new_epoch: this.routingEpochValue,
|
|
19546
19519
|
});
|
|
@@ -19631,7 +19604,7 @@ class Sentinel extends FameNode {
|
|
|
19631
19604
|
}
|
|
19632
19605
|
async forwardToRoute(nextSegment, envelope, context) {
|
|
19633
19606
|
if (this.originMatches(context, nextSegment, core.DeliveryOriginType.DOWNSTREAM)) {
|
|
19634
|
-
logger$
|
|
19607
|
+
logger$N.debug('downstream_loop_detected', {
|
|
19635
19608
|
envp_id: envelope.id,
|
|
19636
19609
|
segment: nextSegment,
|
|
19637
19610
|
});
|
|
@@ -19644,14 +19617,14 @@ class Sentinel extends FameNode {
|
|
|
19644
19617
|
}
|
|
19645
19618
|
const connector = this.routeManager.downstreamRoutes.get(nextSegment);
|
|
19646
19619
|
if (!connector) {
|
|
19647
|
-
logger$
|
|
19620
|
+
logger$N.warning('no_route_for_child_segment', { segment: nextSegment });
|
|
19648
19621
|
await this.emitDeliveryNack(processed, {
|
|
19649
19622
|
code: 'CHILD_UNREACHABLE',
|
|
19650
19623
|
context: context ?? null,
|
|
19651
19624
|
});
|
|
19652
19625
|
return;
|
|
19653
19626
|
}
|
|
19654
|
-
logger$
|
|
19627
|
+
logger$N.debug('forwarding_downstream', {
|
|
19655
19628
|
...summarizeEnvelope(processed, ''),
|
|
19656
19629
|
route: nextSegment,
|
|
19657
19630
|
});
|
|
@@ -19668,7 +19641,7 @@ class Sentinel extends FameNode {
|
|
|
19668
19641
|
}
|
|
19669
19642
|
async forwardToPeer(peerSegment, envelope, context) {
|
|
19670
19643
|
if (this.originMatches(context, peerSegment, core.DeliveryOriginType.PEER)) {
|
|
19671
|
-
logger$
|
|
19644
|
+
logger$N.debug('peer_loop_detected', {
|
|
19672
19645
|
envp_id: envelope.id,
|
|
19673
19646
|
segment: peerSegment,
|
|
19674
19647
|
});
|
|
@@ -19679,7 +19652,7 @@ class Sentinel extends FameNode {
|
|
|
19679
19652
|
}
|
|
19680
19653
|
const connector = this.routeManager._peer_routes.get(peerSegment);
|
|
19681
19654
|
if (!connector) {
|
|
19682
|
-
logger$
|
|
19655
|
+
logger$N.warning('no_route_for_peer_segment', {
|
|
19683
19656
|
peer_segment: peerSegment,
|
|
19684
19657
|
});
|
|
19685
19658
|
await this.emitDeliveryNack(processed, {
|
|
@@ -19722,7 +19695,7 @@ class Sentinel extends FameNode {
|
|
|
19722
19695
|
}
|
|
19723
19696
|
async forwardUpstream(envelope, context) {
|
|
19724
19697
|
if (context?.originType === core.DeliveryOriginType.UPSTREAM) {
|
|
19725
|
-
logger$
|
|
19698
|
+
logger$N.debug('skipping_forward_upstream', {
|
|
19726
19699
|
envp_id: envelope.id,
|
|
19727
19700
|
origin_type: context.originType,
|
|
19728
19701
|
});
|
|
@@ -19842,7 +19815,7 @@ class Sentinel extends FameNode {
|
|
|
19842
19815
|
}
|
|
19843
19816
|
catch (error) {
|
|
19844
19817
|
if (!combined.signal.aborted) {
|
|
19845
|
-
logger$
|
|
19818
|
+
logger$N.debug('attach_timeout_delay_failed', {
|
|
19846
19819
|
system_id: systemId,
|
|
19847
19820
|
error: error instanceof Error ? error.message : String(error),
|
|
19848
19821
|
});
|
|
@@ -19869,12 +19842,12 @@ class Sentinel extends FameNode {
|
|
|
19869
19842
|
await connector.stop();
|
|
19870
19843
|
}
|
|
19871
19844
|
catch (error) {
|
|
19872
|
-
logger$
|
|
19845
|
+
logger$N.debug('attach_timeout_stop_failed', {
|
|
19873
19846
|
system_id: systemId,
|
|
19874
19847
|
error: error instanceof Error ? error.message : String(error),
|
|
19875
19848
|
});
|
|
19876
19849
|
}
|
|
19877
|
-
logger$
|
|
19850
|
+
logger$N.warning('attach_timeout_expired', {
|
|
19878
19851
|
system_id: systemId,
|
|
19879
19852
|
timeout_ms: timeoutMs,
|
|
19880
19853
|
});
|
|
@@ -19928,7 +19901,7 @@ class Sentinel extends FameNode {
|
|
|
19928
19901
|
return new core.FameAddress(addressKey);
|
|
19929
19902
|
}
|
|
19930
19903
|
catch (error) {
|
|
19931
|
-
logger$
|
|
19904
|
+
logger$N.debug('invalid_capability_address', {
|
|
19932
19905
|
capability,
|
|
19933
19906
|
address: addressKey,
|
|
19934
19907
|
error: error instanceof Error ? error.message : String(error),
|
|
@@ -20084,7 +20057,7 @@ class Sentinel extends FameNode {
|
|
|
20084
20057
|
}
|
|
20085
20058
|
async propagateAddressBindingsUpstream() {
|
|
20086
20059
|
if (!this.hasParent) {
|
|
20087
|
-
logger$
|
|
20060
|
+
logger$N.warning('No upstream defined to rebind addresses');
|
|
20088
20061
|
return;
|
|
20089
20062
|
}
|
|
20090
20063
|
const entries = Array.from(this.routeManager._downstream_addresses_routes.entries());
|
|
@@ -20107,7 +20080,7 @@ class Sentinel extends FameNode {
|
|
|
20107
20080
|
await this.bindAddressUpstream(new core.FameAddress(address), info);
|
|
20108
20081
|
}
|
|
20109
20082
|
catch (error) {
|
|
20110
|
-
logger$
|
|
20083
|
+
logger$N.error('rebind_failed', {
|
|
20111
20084
|
address,
|
|
20112
20085
|
error: error instanceof Error ? error.message : String(error),
|
|
20113
20086
|
});
|
|
@@ -20205,7 +20178,7 @@ class Sentinel extends FameNode {
|
|
|
20205
20178
|
}
|
|
20206
20179
|
catch (error) {
|
|
20207
20180
|
// Hook threw => treat as denial, execute Drop
|
|
20208
|
-
logger$
|
|
20181
|
+
logger$N.warning('routing_action_hook_error', {
|
|
20209
20182
|
envp_id: envelope.id,
|
|
20210
20183
|
error: error instanceof Error ? error.message : String(error),
|
|
20211
20184
|
});
|
|
@@ -20229,7 +20202,7 @@ class Sentinel extends FameNode {
|
|
|
20229
20202
|
}
|
|
20230
20203
|
const abortSignal = signal ?? null;
|
|
20231
20204
|
if (abortSignal?.aborted) {
|
|
20232
|
-
logger$
|
|
20205
|
+
logger$N.info('shutdown_signal_received', { signal: 'abort' });
|
|
20233
20206
|
return;
|
|
20234
20207
|
}
|
|
20235
20208
|
// Build fabric options, preferring rootConfig if provided
|
|
@@ -20245,7 +20218,7 @@ class Sentinel extends FameNode {
|
|
|
20245
20218
|
if (node !== null) {
|
|
20246
20219
|
fabricCreateOptions.node = node;
|
|
20247
20220
|
}
|
|
20248
|
-
logger$
|
|
20221
|
+
logger$N.debug('fabric_create_options', {
|
|
20249
20222
|
hasRootConfig: 'rootConfig' in fabricCreateOptions,
|
|
20250
20223
|
hasNode: 'node' in fabricCreateOptions,
|
|
20251
20224
|
rootConfigKeys: fabricCreateOptions.rootConfig
|
|
@@ -20278,7 +20251,7 @@ class Sentinel extends FameNode {
|
|
|
20278
20251
|
const registerSignalListeners = () => {
|
|
20279
20252
|
for (const sig of signals) {
|
|
20280
20253
|
const listener = () => {
|
|
20281
|
-
logger$
|
|
20254
|
+
logger$N.info('shutdown_signal_received', { signal: sig });
|
|
20282
20255
|
cleanupListeners();
|
|
20283
20256
|
stopResolve();
|
|
20284
20257
|
};
|
|
@@ -20287,7 +20260,7 @@ class Sentinel extends FameNode {
|
|
|
20287
20260
|
}
|
|
20288
20261
|
if (abortSignal) {
|
|
20289
20262
|
abortListener = () => {
|
|
20290
|
-
logger$
|
|
20263
|
+
logger$N.info('shutdown_signal_received', { signal: 'abort' });
|
|
20291
20264
|
cleanupListeners();
|
|
20292
20265
|
stopResolve();
|
|
20293
20266
|
};
|
|
@@ -20300,12 +20273,12 @@ class Sentinel extends FameNode {
|
|
|
20300
20273
|
await providedFabric.enter();
|
|
20301
20274
|
try {
|
|
20302
20275
|
registerSignalListeners();
|
|
20303
|
-
logger$
|
|
20276
|
+
logger$N.info('sentinel_live', {
|
|
20304
20277
|
message: 'Node is live! Press Ctrl+C to stop.',
|
|
20305
20278
|
});
|
|
20306
20279
|
try {
|
|
20307
20280
|
await stopPromise;
|
|
20308
|
-
logger$
|
|
20281
|
+
logger$N.info('sentinel_shutdown_begin');
|
|
20309
20282
|
}
|
|
20310
20283
|
finally {
|
|
20311
20284
|
cleanupListeners();
|
|
@@ -20319,19 +20292,19 @@ class Sentinel extends FameNode {
|
|
|
20319
20292
|
// Use withFabric pattern for automatic lifecycle management
|
|
20320
20293
|
await core.withFabric(fabricCreateOptions, async () => {
|
|
20321
20294
|
registerSignalListeners();
|
|
20322
|
-
logger$
|
|
20295
|
+
logger$N.info('sentinel_live', {
|
|
20323
20296
|
message: 'Node is live! Press Ctrl+C to stop.',
|
|
20324
20297
|
});
|
|
20325
20298
|
try {
|
|
20326
20299
|
await stopPromise;
|
|
20327
|
-
logger$
|
|
20300
|
+
logger$N.info('sentinel_shutdown_begin');
|
|
20328
20301
|
}
|
|
20329
20302
|
finally {
|
|
20330
20303
|
cleanupListeners();
|
|
20331
20304
|
}
|
|
20332
20305
|
});
|
|
20333
20306
|
}
|
|
20334
|
-
logger$
|
|
20307
|
+
logger$N.info('sentinel_shutdown_complete');
|
|
20335
20308
|
}
|
|
20336
20309
|
}
|
|
20337
20310
|
function normalizeServeLogLevel(level) {
|
|
@@ -20476,7 +20449,7 @@ function isPlainRecord(value) {
|
|
|
20476
20449
|
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
20477
20450
|
}
|
|
20478
20451
|
|
|
20479
|
-
const FACTORY_META$
|
|
20452
|
+
const FACTORY_META$16 = {
|
|
20480
20453
|
base: NODE_LIKE_FACTORY_BASE_TYPE,
|
|
20481
20454
|
key: 'Sentinel',
|
|
20482
20455
|
};
|
|
@@ -20660,7 +20633,7 @@ class SentinelFactory extends NodeLikeFactory {
|
|
|
20660
20633
|
|
|
20661
20634
|
var sentinelFactory = /*#__PURE__*/Object.freeze({
|
|
20662
20635
|
__proto__: null,
|
|
20663
|
-
FACTORY_META: FACTORY_META$
|
|
20636
|
+
FACTORY_META: FACTORY_META$16,
|
|
20664
20637
|
SentinelFactory: SentinelFactory,
|
|
20665
20638
|
default: SentinelFactory
|
|
20666
20639
|
});
|
|
@@ -20704,7 +20677,7 @@ function createConnectorConfig(config) {
|
|
|
20704
20677
|
* A transport adapter that works with both Node.js and browser WebSocket APIs.
|
|
20705
20678
|
* Supports both native WebSocket clients and server-side WebSocket connections.
|
|
20706
20679
|
*/
|
|
20707
|
-
const logger$
|
|
20680
|
+
const logger$M = getLogger('naylence.fame.connector.websocket_connector');
|
|
20708
20681
|
/**
|
|
20709
20682
|
* WebSocket state constants (mirrors standard WebSocket states)
|
|
20710
20683
|
*/
|
|
@@ -20745,7 +20718,7 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
20745
20718
|
websocket.send_bytes &&
|
|
20746
20719
|
typeof websocket.receive_bytes === 'function' &&
|
|
20747
20720
|
typeof websocket.send_bytes === 'function');
|
|
20748
|
-
logger$
|
|
20721
|
+
logger$M.debug('websocket_connector_created', {
|
|
20749
20722
|
is_fastapi_like: this._isFastApiLike,
|
|
20750
20723
|
ready_state: websocket.readyState,
|
|
20751
20724
|
url: websocket.url,
|
|
@@ -20760,7 +20733,7 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
20760
20733
|
socketAny.binaryType = 'arraybuffer';
|
|
20761
20734
|
}
|
|
20762
20735
|
catch (error) {
|
|
20763
|
-
logger$
|
|
20736
|
+
logger$M.debug('websocket_set_binary_type_failed', {
|
|
20764
20737
|
error: error instanceof Error ? error.message : String(error),
|
|
20765
20738
|
current_type: socketAny.binaryType,
|
|
20766
20739
|
});
|
|
@@ -20816,7 +20789,7 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
20816
20789
|
else {
|
|
20817
20790
|
this._receiveQueue.push(data);
|
|
20818
20791
|
}
|
|
20819
|
-
logger$
|
|
20792
|
+
logger$M.debug('websocket_message_pushed_to_queue', {
|
|
20820
20793
|
queueLength: this._receiveQueue.length,
|
|
20821
20794
|
waitersLength: this._receiveWaiters.length,
|
|
20822
20795
|
});
|
|
@@ -20869,7 +20842,7 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
20869
20842
|
const result = receiveMethod.call(this._websocket);
|
|
20870
20843
|
// Ensure we have a Promise
|
|
20871
20844
|
if (!result || typeof result.then !== 'function') {
|
|
20872
|
-
logger$
|
|
20845
|
+
logger$M.error('fastapi_receive_not_awaitable', {
|
|
20873
20846
|
result_type: typeof result,
|
|
20874
20847
|
result_str: String(result).substring(0, 100),
|
|
20875
20848
|
});
|
|
@@ -20885,7 +20858,7 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
20885
20858
|
}
|
|
20886
20859
|
// Handle known WebSocket shutdown race condition
|
|
20887
20860
|
if (this._isAwaitFutureError(error)) {
|
|
20888
|
-
logger$
|
|
20861
|
+
logger$M.debug('websocket_shutdown_race_condition_handled', {
|
|
20889
20862
|
note: 'Normal WebSocket close timing - converting to cancellation',
|
|
20890
20863
|
websocket_state: this._websocket.client_state || 'unknown',
|
|
20891
20864
|
});
|
|
@@ -20928,7 +20901,7 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
20928
20901
|
}
|
|
20929
20902
|
catch (error) {
|
|
20930
20903
|
if (this._isAwaitFutureError(error)) {
|
|
20931
|
-
logger$
|
|
20904
|
+
logger$M.debug('websocket_shutdown_race_condition_detected', {
|
|
20932
20905
|
websocket_type: this._websocket.constructor.name,
|
|
20933
20906
|
is_fastapi: this._isFastApiLike,
|
|
20934
20907
|
note: 'Normal WebSocket close timing during shutdown',
|
|
@@ -20974,12 +20947,12 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
20974
20947
|
if (socketAny.readyState !== WebSocketState.CLOSED) {
|
|
20975
20948
|
try {
|
|
20976
20949
|
socketAny.terminate();
|
|
20977
|
-
logger$
|
|
20950
|
+
logger$M.debug('websocket_force_terminated', {
|
|
20978
20951
|
ready_state: socketAny.readyState,
|
|
20979
20952
|
});
|
|
20980
20953
|
}
|
|
20981
20954
|
catch (error) {
|
|
20982
|
-
logger$
|
|
20955
|
+
logger$M.debug('websocket_force_terminate_failed', {
|
|
20983
20956
|
error: error instanceof Error ? error.message : String(error),
|
|
20984
20957
|
});
|
|
20985
20958
|
}
|
|
@@ -20990,7 +20963,7 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
20990
20963
|
}
|
|
20991
20964
|
}
|
|
20992
20965
|
catch (error) {
|
|
20993
|
-
logger$
|
|
20966
|
+
logger$M.error('websocket_close_failed', {
|
|
20994
20967
|
error: error instanceof Error ? error.message : String(error),
|
|
20995
20968
|
});
|
|
20996
20969
|
// Don't re-throw - close errors are not critical during shutdown
|
|
@@ -21211,7 +21184,7 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
21211
21184
|
this._removeReceiveHandlers();
|
|
21212
21185
|
}
|
|
21213
21186
|
catch (error) {
|
|
21214
|
-
logger$
|
|
21187
|
+
logger$M.debug('websocket_remove_handlers_failed', {
|
|
21215
21188
|
error: error instanceof Error ? error.message : String(error),
|
|
21216
21189
|
});
|
|
21217
21190
|
}
|
|
@@ -21263,7 +21236,7 @@ class WebSocketConnector extends BaseAsyncConnector {
|
|
|
21263
21236
|
* Browser-local connector that routes binary frames between peers via an in-page EventTarget.
|
|
21264
21237
|
* Relies on BaseAsyncConnector for flow control and shutdown behavior.
|
|
21265
21238
|
*/
|
|
21266
|
-
const logger$
|
|
21239
|
+
const logger$L = getLogger('naylence.fame.connector.inpage_connector');
|
|
21267
21240
|
const INPAGE_CONNECTOR_TYPE = 'inpage-connector';
|
|
21268
21241
|
const DEFAULT_CHANNEL$6 = 'naylence-fabric';
|
|
21269
21242
|
const DEFAULT_INBOX_CAPACITY$6 = 2048;
|
|
@@ -21361,7 +21334,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21361
21334
|
}
|
|
21362
21335
|
this.localNodeId = normalizedLocalNodeId;
|
|
21363
21336
|
this.targetNodeId = InPageConnector.normalizeTargetNodeId(config.initialTargetNodeId);
|
|
21364
|
-
logger$
|
|
21337
|
+
logger$L.debug('inpage_connector_initialized', {
|
|
21365
21338
|
channel: this.channelName,
|
|
21366
21339
|
connector_id: this.connectorId,
|
|
21367
21340
|
local_node_id: this.localNodeId,
|
|
@@ -21370,7 +21343,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21370
21343
|
});
|
|
21371
21344
|
this.onMsg = (event) => {
|
|
21372
21345
|
if (!this.listenerRegistered) {
|
|
21373
|
-
logger$
|
|
21346
|
+
logger$L.warning('inpage_message_after_unregister', {
|
|
21374
21347
|
channel: this.channelName,
|
|
21375
21348
|
connector_id: this.connectorId,
|
|
21376
21349
|
timestamp: new Date().toISOString(),
|
|
@@ -21379,7 +21352,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21379
21352
|
}
|
|
21380
21353
|
const messageEvent = event;
|
|
21381
21354
|
const message = messageEvent.data;
|
|
21382
|
-
logger$
|
|
21355
|
+
logger$L.debug('inpage_raw_event', {
|
|
21383
21356
|
channel: this.channelName,
|
|
21384
21357
|
connector_id: this.connectorId,
|
|
21385
21358
|
message_type: message && typeof message === 'object'
|
|
@@ -21399,7 +21372,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21399
21372
|
: null;
|
|
21400
21373
|
const senderNodeId = InPageConnector.normalizeNodeId(busMessage.senderNodeId);
|
|
21401
21374
|
if (!senderId || !senderNodeId) {
|
|
21402
|
-
logger$
|
|
21375
|
+
logger$L.debug('inpage_message_rejected', {
|
|
21403
21376
|
channel: this.channelName,
|
|
21404
21377
|
connector_id: this.connectorId,
|
|
21405
21378
|
reason: 'missing_sender_metadata',
|
|
@@ -21407,7 +21380,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21407
21380
|
return;
|
|
21408
21381
|
}
|
|
21409
21382
|
if (senderId === this.connectorId || senderNodeId === this.localNodeId) {
|
|
21410
|
-
logger$
|
|
21383
|
+
logger$L.debug('inpage_message_rejected', {
|
|
21411
21384
|
channel: this.channelName,
|
|
21412
21385
|
connector_id: this.connectorId,
|
|
21413
21386
|
reason: 'self_echo',
|
|
@@ -21421,14 +21394,14 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21421
21394
|
}
|
|
21422
21395
|
const payload = InPageConnector.coercePayload(busMessage.payload);
|
|
21423
21396
|
if (!payload) {
|
|
21424
|
-
logger$
|
|
21397
|
+
logger$L.debug('inpage_payload_rejected', {
|
|
21425
21398
|
channel: this.channelName,
|
|
21426
21399
|
connector_id: this.connectorId,
|
|
21427
21400
|
reason: 'unrecognized_payload_type',
|
|
21428
21401
|
});
|
|
21429
21402
|
return;
|
|
21430
21403
|
}
|
|
21431
|
-
logger$
|
|
21404
|
+
logger$L.debug('inpage_message_received', {
|
|
21432
21405
|
channel: this.channelName,
|
|
21433
21406
|
sender_id: senderId,
|
|
21434
21407
|
sender_node_id: senderNodeId,
|
|
@@ -21457,14 +21430,14 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21457
21430
|
}
|
|
21458
21431
|
catch (error) {
|
|
21459
21432
|
if (error instanceof QueueFullError) {
|
|
21460
|
-
logger$
|
|
21433
|
+
logger$L.warning('inpage_receive_queue_full', {
|
|
21461
21434
|
channel: this.channelName,
|
|
21462
21435
|
inbox_capacity: this.inboxCapacity,
|
|
21463
21436
|
inbox_remaining_capacity: this.inbox.remainingCapacity,
|
|
21464
21437
|
});
|
|
21465
21438
|
}
|
|
21466
21439
|
else {
|
|
21467
|
-
logger$
|
|
21440
|
+
logger$L.error('inpage_receive_error', {
|
|
21468
21441
|
channel: this.channelName,
|
|
21469
21442
|
error: error instanceof Error ? error.message : String(error),
|
|
21470
21443
|
});
|
|
@@ -21476,7 +21449,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21476
21449
|
// Setup visibility change monitoring
|
|
21477
21450
|
this.visibilityChangeHandler = () => {
|
|
21478
21451
|
const isHidden = document.hidden;
|
|
21479
|
-
logger$
|
|
21452
|
+
logger$L.debug('inpage_visibility_changed', {
|
|
21480
21453
|
channel: this.channelName,
|
|
21481
21454
|
connector_id: this.connectorId,
|
|
21482
21455
|
visibility: isHidden ? 'hidden' : 'visible',
|
|
@@ -21485,7 +21458,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21485
21458
|
// Pause/resume connector based on visibility
|
|
21486
21459
|
if (isHidden && this.state === core.ConnectorState.STARTED) {
|
|
21487
21460
|
this.pause().catch((err) => {
|
|
21488
|
-
logger$
|
|
21461
|
+
logger$L.warning('inpage_pause_failed', {
|
|
21489
21462
|
channel: this.channelName,
|
|
21490
21463
|
connector_id: this.connectorId,
|
|
21491
21464
|
error: err instanceof Error ? err.message : String(err),
|
|
@@ -21494,7 +21467,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21494
21467
|
}
|
|
21495
21468
|
else if (!isHidden && this.state === core.ConnectorState.PAUSED) {
|
|
21496
21469
|
this.resume().catch((err) => {
|
|
21497
|
-
logger$
|
|
21470
|
+
logger$L.warning('inpage_resume_failed', {
|
|
21498
21471
|
channel: this.channelName,
|
|
21499
21472
|
connector_id: this.connectorId,
|
|
21500
21473
|
error: err instanceof Error ? err.message : String(err),
|
|
@@ -21508,7 +21481,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21508
21481
|
// Track page lifecycle events to detect browser unload/discard
|
|
21509
21482
|
if (typeof window !== 'undefined') {
|
|
21510
21483
|
const lifecycleLogger = (event) => {
|
|
21511
|
-
logger$
|
|
21484
|
+
logger$L.info('inpage_page_lifecycle', {
|
|
21512
21485
|
channel: this.channelName,
|
|
21513
21486
|
connector_id: this.connectorId,
|
|
21514
21487
|
event_type: event.type,
|
|
@@ -21524,7 +21497,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21524
21497
|
document.addEventListener('resume', lifecycleLogger);
|
|
21525
21498
|
}
|
|
21526
21499
|
// Log initial state with detailed visibility info
|
|
21527
|
-
logger$
|
|
21500
|
+
logger$L.debug('inpage_initial_visibility', {
|
|
21528
21501
|
channel: this.channelName,
|
|
21529
21502
|
connector_id: this.connectorId,
|
|
21530
21503
|
visibility: document.hidden ? 'hidden' : 'visible',
|
|
@@ -21542,7 +21515,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21542
21515
|
await super.start(inboundHandler);
|
|
21543
21516
|
// After transitioning to STARTED, check if tab is already hidden
|
|
21544
21517
|
if (typeof document !== 'undefined' && document.hidden) {
|
|
21545
|
-
logger$
|
|
21518
|
+
logger$L.debug('inpage_start_in_hidden_tab', {
|
|
21546
21519
|
channel: this.channelName,
|
|
21547
21520
|
connector_id: this.connectorId,
|
|
21548
21521
|
document_hidden: document.hidden,
|
|
@@ -21552,7 +21525,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21552
21525
|
});
|
|
21553
21526
|
// Immediately pause if tab is hidden at start time
|
|
21554
21527
|
await this.pause().catch((err) => {
|
|
21555
|
-
logger$
|
|
21528
|
+
logger$L.warning('inpage_initial_pause_failed', {
|
|
21556
21529
|
channel: this.channelName,
|
|
21557
21530
|
connector_id: this.connectorId,
|
|
21558
21531
|
error: err instanceof Error ? err.message : String(err),
|
|
@@ -21582,14 +21555,14 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21582
21555
|
}
|
|
21583
21556
|
catch (error) {
|
|
21584
21557
|
if (error instanceof QueueFullError) {
|
|
21585
|
-
logger$
|
|
21558
|
+
logger$L.warning('inpage_push_queue_full', {
|
|
21586
21559
|
channel: this.channelName,
|
|
21587
21560
|
inbox_capacity: this.inboxCapacity,
|
|
21588
21561
|
inbox_remaining_capacity: this.inbox.remainingCapacity,
|
|
21589
21562
|
});
|
|
21590
21563
|
throw error;
|
|
21591
21564
|
}
|
|
21592
|
-
logger$
|
|
21565
|
+
logger$L.error('inpage_push_failed', {
|
|
21593
21566
|
channel: this.channelName,
|
|
21594
21567
|
error: error instanceof Error ? error.message : String(error),
|
|
21595
21568
|
});
|
|
@@ -21599,7 +21572,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21599
21572
|
async _transportSendBytes(data) {
|
|
21600
21573
|
ensureBrowserEnvironment$2();
|
|
21601
21574
|
const targetNodeId = this.targetNodeId ?? '*';
|
|
21602
|
-
logger$
|
|
21575
|
+
logger$L.debug('inpage_message_sending', {
|
|
21603
21576
|
channel: this.channelName,
|
|
21604
21577
|
sender_id: this.connectorId,
|
|
21605
21578
|
sender_node_id: this.localNodeId,
|
|
@@ -21623,7 +21596,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21623
21596
|
return item;
|
|
21624
21597
|
}
|
|
21625
21598
|
async _transportClose(code, reason) {
|
|
21626
|
-
logger$
|
|
21599
|
+
logger$L.debug('inpage_transport_closing', {
|
|
21627
21600
|
channel: this.channelName,
|
|
21628
21601
|
connector_id: this.connectorId,
|
|
21629
21602
|
code,
|
|
@@ -21632,14 +21605,14 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21632
21605
|
timestamp: new Date().toISOString(),
|
|
21633
21606
|
});
|
|
21634
21607
|
if (this.listenerRegistered) {
|
|
21635
|
-
logger$
|
|
21608
|
+
logger$L.debug('inpage_removing_listener', {
|
|
21636
21609
|
channel: this.channelName,
|
|
21637
21610
|
connector_id: this.connectorId,
|
|
21638
21611
|
timestamp: new Date().toISOString(),
|
|
21639
21612
|
});
|
|
21640
21613
|
getSharedBus$1().removeEventListener(this.channelName, this.onMsg);
|
|
21641
21614
|
this.listenerRegistered = false;
|
|
21642
|
-
logger$
|
|
21615
|
+
logger$L.debug('inpage_listener_removed', {
|
|
21643
21616
|
channel: this.channelName,
|
|
21644
21617
|
connector_id: this.connectorId,
|
|
21645
21618
|
timestamp: new Date().toISOString(),
|
|
@@ -21671,7 +21644,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21671
21644
|
if (targetNodeId &&
|
|
21672
21645
|
targetNodeId !== '*' &&
|
|
21673
21646
|
targetNodeId !== this.localNodeId) {
|
|
21674
|
-
logger$
|
|
21647
|
+
logger$L.debug('inpage_message_rejected', {
|
|
21675
21648
|
channel: this.channelName,
|
|
21676
21649
|
connector_id: this.connectorId,
|
|
21677
21650
|
reason: 'wildcard_target_mismatch',
|
|
@@ -21687,7 +21660,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21687
21660
|
if (expectedSender &&
|
|
21688
21661
|
expectedSender !== '*' &&
|
|
21689
21662
|
senderNodeId !== expectedSender) {
|
|
21690
|
-
logger$
|
|
21663
|
+
logger$L.debug('inpage_message_rejected', {
|
|
21691
21664
|
channel: this.channelName,
|
|
21692
21665
|
connector_id: this.connectorId,
|
|
21693
21666
|
reason: 'unexpected_sender',
|
|
@@ -21700,7 +21673,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21700
21673
|
if (targetNodeId &&
|
|
21701
21674
|
targetNodeId !== '*' &&
|
|
21702
21675
|
targetNodeId !== this.localNodeId) {
|
|
21703
|
-
logger$
|
|
21676
|
+
logger$L.debug('inpage_message_rejected', {
|
|
21704
21677
|
channel: this.channelName,
|
|
21705
21678
|
connector_id: this.connectorId,
|
|
21706
21679
|
reason: 'unexpected_target',
|
|
@@ -21725,7 +21698,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21725
21698
|
return 'unknown';
|
|
21726
21699
|
}
|
|
21727
21700
|
logInboxSnapshot(event, extra = {}) {
|
|
21728
|
-
logger$
|
|
21701
|
+
logger$L.debug(event, {
|
|
21729
21702
|
channel: this.channelName,
|
|
21730
21703
|
connector_id: this.connectorId,
|
|
21731
21704
|
connector_state: this.state,
|
|
@@ -21744,7 +21717,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21744
21717
|
return;
|
|
21745
21718
|
}
|
|
21746
21719
|
this.targetNodeId = normalized;
|
|
21747
|
-
logger$
|
|
21720
|
+
logger$L.debug('inpage_target_updated', {
|
|
21748
21721
|
channel: this.channelName,
|
|
21749
21722
|
connector_id: this.connectorId,
|
|
21750
21723
|
local_node_id: this.localNodeId,
|
|
@@ -21754,7 +21727,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21754
21727
|
}
|
|
21755
21728
|
setWildcardTarget() {
|
|
21756
21729
|
this.targetNodeId = '*';
|
|
21757
|
-
logger$
|
|
21730
|
+
logger$L.debug('inpage_target_updated', {
|
|
21758
21731
|
channel: this.channelName,
|
|
21759
21732
|
connector_id: this.connectorId,
|
|
21760
21733
|
local_node_id: this.localNodeId,
|
|
@@ -21948,6 +21921,185 @@ class AuthorizerFactory extends factory.AbstractResourceFactory {
|
|
|
21948
21921
|
}
|
|
21949
21922
|
}
|
|
21950
21923
|
|
|
21924
|
+
const logger$K = getLogger('naylence.fame.security.auth.authorization_profile_factory');
|
|
21925
|
+
const PROFILE_NAME_DEFAULT = 'jwt';
|
|
21926
|
+
const PROFILE_NAME_OAUTH2 = 'oauth2';
|
|
21927
|
+
const PROFILE_NAME_OAUTH2_GATED = 'oauth2-gated';
|
|
21928
|
+
const PROFILE_NAME_OAUTH2_CALLBACK = 'oauth2-callback';
|
|
21929
|
+
const PROFILE_NAME_NOOP$2 = 'noop';
|
|
21930
|
+
const ENV_VAR_JWT_TRUSTED_ISSUER$1 = 'FAME_JWT_TRUSTED_ISSUER';
|
|
21931
|
+
const ENV_VAR_JWT_ALGORITHM$1 = 'FAME_JWT_ALGORITHM';
|
|
21932
|
+
const ENV_VAR_JWT_AUDIENCE$2 = 'FAME_JWT_AUDIENCE';
|
|
21933
|
+
const ENV_VAR_JWKS_URL$1 = 'FAME_JWKS_URL';
|
|
21934
|
+
const ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1 = 'FAME_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY';
|
|
21935
|
+
const ENV_VAR_TRUSTED_CLIENT_SCOPE$1 = 'FAME_TRUSTED_CLIENT_SCOPE';
|
|
21936
|
+
const ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1 = 'FAME_JWT_REVERSE_AUTH_TRUSTED_ISSUER';
|
|
21937
|
+
const ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1 = 'FAME_JWT_REVERSE_AUTH_AUDIENCE';
|
|
21938
|
+
const ENV_VAR_HMAC_SECRET$1 = 'FAME_HMAC_SECRET';
|
|
21939
|
+
const DEFAULT_REVERSE_AUTH_ISSUER = 'reverse-auth.naylence.ai';
|
|
21940
|
+
const DEFAULT_REVERSE_AUTH_AUDIENCE = 'dev.naylence.ai';
|
|
21941
|
+
const DEFAULT_PROFILE = {
|
|
21942
|
+
type: 'DefaultAuthorizer',
|
|
21943
|
+
verifier: {
|
|
21944
|
+
type: 'JWKSJWTTokenVerifier',
|
|
21945
|
+
jwks_url: factory.Expressions.env(ENV_VAR_JWKS_URL$1),
|
|
21946
|
+
issuer: factory.Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER$1),
|
|
21947
|
+
},
|
|
21948
|
+
};
|
|
21949
|
+
const OAUTH2_PROFILE = {
|
|
21950
|
+
type: 'OAuth2Authorizer',
|
|
21951
|
+
issuer: factory.Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER$1),
|
|
21952
|
+
required_scopes: ['node.connect'],
|
|
21953
|
+
require_scope: true,
|
|
21954
|
+
default_ttl_sec: 3600,
|
|
21955
|
+
max_ttl_sec: 86400,
|
|
21956
|
+
algorithm: factory.Expressions.env(ENV_VAR_JWT_ALGORITHM$1, 'RS256'),
|
|
21957
|
+
audience: factory.Expressions.env(ENV_VAR_JWT_AUDIENCE$2),
|
|
21958
|
+
};
|
|
21959
|
+
const OAUTH2_GATED_PROFILE = {
|
|
21960
|
+
...OAUTH2_PROFILE,
|
|
21961
|
+
enforce_token_subject_node_identity: factory.Expressions.env(ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1, 'false'),
|
|
21962
|
+
trusted_client_scope: factory.Expressions.env(ENV_VAR_TRUSTED_CLIENT_SCOPE$1, 'node.trusted'),
|
|
21963
|
+
};
|
|
21964
|
+
const OAUTH2_CALLBACK_PROFILE = {
|
|
21965
|
+
type: 'OAuth2Authorizer',
|
|
21966
|
+
issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1, DEFAULT_REVERSE_AUTH_ISSUER),
|
|
21967
|
+
audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1),
|
|
21968
|
+
require_scope: true,
|
|
21969
|
+
default_ttl_sec: 3600,
|
|
21970
|
+
max_ttl_sec: 86400,
|
|
21971
|
+
reverse_auth_ttl_sec: 86400,
|
|
21972
|
+
token_verifier_config: {
|
|
21973
|
+
type: 'JWTTokenVerifier',
|
|
21974
|
+
algorithm: 'HS256',
|
|
21975
|
+
hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET$1),
|
|
21976
|
+
issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1, DEFAULT_REVERSE_AUTH_ISSUER),
|
|
21977
|
+
ttl_sec: 86400,
|
|
21978
|
+
},
|
|
21979
|
+
token_issuer_config: {
|
|
21980
|
+
type: 'JWTTokenIssuer',
|
|
21981
|
+
algorithm: 'HS256',
|
|
21982
|
+
hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET$1),
|
|
21983
|
+
kid: 'hmac-reverse-auth-key',
|
|
21984
|
+
issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1, DEFAULT_REVERSE_AUTH_ISSUER),
|
|
21985
|
+
ttl_sec: 86400,
|
|
21986
|
+
audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1, DEFAULT_REVERSE_AUTH_AUDIENCE),
|
|
21987
|
+
},
|
|
21988
|
+
};
|
|
21989
|
+
const NOOP_PROFILE$2 = {
|
|
21990
|
+
type: 'NoopAuthorizer',
|
|
21991
|
+
};
|
|
21992
|
+
const PROFILE_MAP$5 = {
|
|
21993
|
+
[PROFILE_NAME_DEFAULT]: DEFAULT_PROFILE,
|
|
21994
|
+
[PROFILE_NAME_OAUTH2]: OAUTH2_PROFILE,
|
|
21995
|
+
[PROFILE_NAME_OAUTH2_GATED]: OAUTH2_GATED_PROFILE,
|
|
21996
|
+
[PROFILE_NAME_OAUTH2_CALLBACK]: OAUTH2_CALLBACK_PROFILE,
|
|
21997
|
+
[PROFILE_NAME_NOOP$2]: NOOP_PROFILE$2,
|
|
21998
|
+
};
|
|
21999
|
+
const PROFILE_ALIASES$1 = {
|
|
22000
|
+
jwt: PROFILE_NAME_DEFAULT,
|
|
22001
|
+
jwks: PROFILE_NAME_DEFAULT,
|
|
22002
|
+
default: PROFILE_NAME_DEFAULT,
|
|
22003
|
+
oauth2: PROFILE_NAME_OAUTH2,
|
|
22004
|
+
oidc: PROFILE_NAME_OAUTH2,
|
|
22005
|
+
'oauth2-gated': PROFILE_NAME_OAUTH2_GATED,
|
|
22006
|
+
oauth2_gated: PROFILE_NAME_OAUTH2_GATED,
|
|
22007
|
+
'oauth2-callback': PROFILE_NAME_OAUTH2_CALLBACK,
|
|
22008
|
+
oauth2_callback: PROFILE_NAME_OAUTH2_CALLBACK,
|
|
22009
|
+
'reverse-auth': PROFILE_NAME_OAUTH2_CALLBACK,
|
|
22010
|
+
noop: PROFILE_NAME_NOOP$2,
|
|
22011
|
+
'no-op': PROFILE_NAME_NOOP$2,
|
|
22012
|
+
no_op: PROFILE_NAME_NOOP$2,
|
|
22013
|
+
};
|
|
22014
|
+
const FACTORY_META$15 = {
|
|
22015
|
+
base: AUTHORIZER_FACTORY_BASE_TYPE,
|
|
22016
|
+
key: 'AuthorizationProfile',
|
|
22017
|
+
};
|
|
22018
|
+
class AuthorizationProfileFactory extends AuthorizerFactory {
|
|
22019
|
+
constructor() {
|
|
22020
|
+
super(...arguments);
|
|
22021
|
+
this.type = 'AuthorizationProfile';
|
|
22022
|
+
}
|
|
22023
|
+
async create(config, ...factoryArgs) {
|
|
22024
|
+
const normalized = normalizeConfig$w(config);
|
|
22025
|
+
const profileConfig = resolveProfileConfig$4(normalized.profile);
|
|
22026
|
+
logger$K.debug('enabling_authorization_profile', {
|
|
22027
|
+
profile: normalized.profile,
|
|
22028
|
+
});
|
|
22029
|
+
const authorizer = await AuthorizerFactory.createAuthorizer(profileConfig, { factoryArgs });
|
|
22030
|
+
if (!authorizer) {
|
|
22031
|
+
throw new Error(`Failed to create authorizer for profile: ${normalized.profile}`);
|
|
22032
|
+
}
|
|
22033
|
+
return authorizer;
|
|
22034
|
+
}
|
|
22035
|
+
}
|
|
22036
|
+
function normalizeConfig$w(config) {
|
|
22037
|
+
if (!config) {
|
|
22038
|
+
return { profile: PROFILE_NAME_OAUTH2 };
|
|
22039
|
+
}
|
|
22040
|
+
const candidate = config;
|
|
22041
|
+
const profileValue = resolveProfileName$2(candidate);
|
|
22042
|
+
const canonicalProfile = canonicalizeProfileName$1(profileValue);
|
|
22043
|
+
candidate.profile = canonicalProfile;
|
|
22044
|
+
return { profile: canonicalProfile };
|
|
22045
|
+
}
|
|
22046
|
+
function resolveProfileName$2(candidate) {
|
|
22047
|
+
const direct = coerceProfileString$2(candidate.profile);
|
|
22048
|
+
if (direct) {
|
|
22049
|
+
return direct;
|
|
22050
|
+
}
|
|
22051
|
+
const legacyKeys = ['profile_name', 'profileName'];
|
|
22052
|
+
for (const legacyKey of legacyKeys) {
|
|
22053
|
+
const legacyValue = coerceProfileString$2(candidate[legacyKey]);
|
|
22054
|
+
if (legacyValue) {
|
|
22055
|
+
return legacyValue;
|
|
22056
|
+
}
|
|
22057
|
+
}
|
|
22058
|
+
return PROFILE_NAME_OAUTH2;
|
|
22059
|
+
}
|
|
22060
|
+
function coerceProfileString$2(value) {
|
|
22061
|
+
if (typeof value !== 'string') {
|
|
22062
|
+
return null;
|
|
22063
|
+
}
|
|
22064
|
+
const trimmed = value.trim();
|
|
22065
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
22066
|
+
}
|
|
22067
|
+
function canonicalizeProfileName$1(value) {
|
|
22068
|
+
const normalized = value.replace(/[\s_]+/g, '-').toLowerCase();
|
|
22069
|
+
return PROFILE_ALIASES$1[normalized] ?? normalized;
|
|
22070
|
+
}
|
|
22071
|
+
function resolveProfileConfig$4(profileName) {
|
|
22072
|
+
const profile = PROFILE_MAP$5[profileName];
|
|
22073
|
+
if (!profile) {
|
|
22074
|
+
throw new Error(`Unknown authorization profile: ${profileName}`);
|
|
22075
|
+
}
|
|
22076
|
+
return deepClone$4(profile);
|
|
22077
|
+
}
|
|
22078
|
+
function deepClone$4(value) {
|
|
22079
|
+
return JSON.parse(JSON.stringify(value));
|
|
22080
|
+
}
|
|
22081
|
+
|
|
22082
|
+
var authorizationProfileFactory = /*#__PURE__*/Object.freeze({
|
|
22083
|
+
__proto__: null,
|
|
22084
|
+
AuthorizationProfileFactory: AuthorizationProfileFactory,
|
|
22085
|
+
ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY: ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1,
|
|
22086
|
+
ENV_VAR_HMAC_SECRET: ENV_VAR_HMAC_SECRET$1,
|
|
22087
|
+
ENV_VAR_JWKS_URL: ENV_VAR_JWKS_URL$1,
|
|
22088
|
+
ENV_VAR_JWT_ALGORITHM: ENV_VAR_JWT_ALGORITHM$1,
|
|
22089
|
+
ENV_VAR_JWT_AUDIENCE: ENV_VAR_JWT_AUDIENCE$2,
|
|
22090
|
+
ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE: ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1,
|
|
22091
|
+
ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER: ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1,
|
|
22092
|
+
ENV_VAR_JWT_TRUSTED_ISSUER: ENV_VAR_JWT_TRUSTED_ISSUER$1,
|
|
22093
|
+
ENV_VAR_TRUSTED_CLIENT_SCOPE: ENV_VAR_TRUSTED_CLIENT_SCOPE$1,
|
|
22094
|
+
FACTORY_META: FACTORY_META$15,
|
|
22095
|
+
PROFILE_NAME_DEFAULT: PROFILE_NAME_DEFAULT,
|
|
22096
|
+
PROFILE_NAME_NOOP: PROFILE_NAME_NOOP$2,
|
|
22097
|
+
PROFILE_NAME_OAUTH2: PROFILE_NAME_OAUTH2,
|
|
22098
|
+
PROFILE_NAME_OAUTH2_CALLBACK: PROFILE_NAME_OAUTH2_CALLBACK,
|
|
22099
|
+
PROFILE_NAME_OAUTH2_GATED: PROFILE_NAME_OAUTH2_GATED,
|
|
22100
|
+
default: AuthorizationProfileFactory
|
|
22101
|
+
});
|
|
22102
|
+
|
|
21951
22103
|
function isAuthInjectionStrategy(candidate) {
|
|
21952
22104
|
return (typeof candidate === 'object' &&
|
|
21953
22105
|
candidate !== null &&
|
|
@@ -29429,14 +29581,13 @@ const ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER = 'FAME_JWT_REVERSE_AUTH_TRUSTED_I
|
|
|
29429
29581
|
const ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE = 'FAME_JWT_REVERSE_AUTH_AUDIENCE';
|
|
29430
29582
|
const ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY = 'FAME_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY';
|
|
29431
29583
|
const ENV_VAR_TRUSTED_CLIENT_SCOPE = 'FAME_TRUSTED_CLIENT_SCOPE';
|
|
29584
|
+
const ENV_VAR_AUTHORIZATION_PROFILE = 'FAME_AUTHORIZATION_PROFILE';
|
|
29432
29585
|
const PROFILE_NAME_STRICT_OVERLAY = 'strict-overlay';
|
|
29433
29586
|
const PROFILE_NAME_OVERLAY = 'overlay';
|
|
29434
29587
|
const PROFILE_NAME_OVERLAY_CALLBACK = 'overlay-callback';
|
|
29435
29588
|
const PROFILE_NAME_GATED = 'gated';
|
|
29436
29589
|
const PROFILE_NAME_GATED_CALLBACK = 'gated-callback';
|
|
29437
29590
|
const PROFILE_NAME_OPEN$1 = 'open';
|
|
29438
|
-
const DEFAULT_REVERSE_AUTH_ISSUER = 'reverse-auth.naylence.ai';
|
|
29439
|
-
const DEFAULT_REVERSE_AUTH_AUDIENCE = 'dev.naylence.ai';
|
|
29440
29591
|
const STRICT_OVERLAY_PROFILE = {
|
|
29441
29592
|
type: 'DefaultSecurityManager',
|
|
29442
29593
|
security_policy: {
|
|
@@ -29482,12 +29633,8 @@ const STRICT_OVERLAY_PROFILE = {
|
|
|
29482
29633
|
},
|
|
29483
29634
|
},
|
|
29484
29635
|
authorizer: {
|
|
29485
|
-
type: '
|
|
29486
|
-
|
|
29487
|
-
type: 'JWKSJWTTokenVerifier',
|
|
29488
|
-
jwks_url: factory.Expressions.env(ENV_VAR_JWKS_URL),
|
|
29489
|
-
issuer: factory.Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER),
|
|
29490
|
-
},
|
|
29636
|
+
type: 'AuthorizationProfile',
|
|
29637
|
+
profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'jwt'),
|
|
29491
29638
|
},
|
|
29492
29639
|
};
|
|
29493
29640
|
const OVERLAY_PROFILE = {
|
|
@@ -29534,14 +29681,8 @@ const OVERLAY_PROFILE = {
|
|
|
29534
29681
|
},
|
|
29535
29682
|
},
|
|
29536
29683
|
authorizer: {
|
|
29537
|
-
type: '
|
|
29538
|
-
|
|
29539
|
-
required_scopes: ['node.connect'],
|
|
29540
|
-
require_scope: true,
|
|
29541
|
-
default_ttl_sec: 3600,
|
|
29542
|
-
max_ttl_sec: 86400,
|
|
29543
|
-
algorithm: factory.Expressions.env(ENV_VAR_JWT_ALGORITHM, 'RS256'),
|
|
29544
|
-
audience: factory.Expressions.env(ENV_VAR_JWT_AUDIENCE$1),
|
|
29684
|
+
type: 'AuthorizationProfile',
|
|
29685
|
+
profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2'),
|
|
29545
29686
|
},
|
|
29546
29687
|
};
|
|
29547
29688
|
const OVERLAY_CALLBACK_PROFILE = {
|
|
@@ -29588,29 +29729,8 @@ const OVERLAY_CALLBACK_PROFILE = {
|
|
|
29588
29729
|
},
|
|
29589
29730
|
},
|
|
29590
29731
|
authorizer: {
|
|
29591
|
-
type: '
|
|
29592
|
-
|
|
29593
|
-
audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE),
|
|
29594
|
-
require_scope: true,
|
|
29595
|
-
default_ttl_sec: 3600,
|
|
29596
|
-
max_ttl_sec: 86400,
|
|
29597
|
-
reverse_auth_ttl_sec: 86400,
|
|
29598
|
-
token_verifier_config: {
|
|
29599
|
-
type: 'JWTTokenVerifier',
|
|
29600
|
-
algorithm: 'HS256',
|
|
29601
|
-
hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET),
|
|
29602
|
-
issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
|
|
29603
|
-
ttl_sec: 86400,
|
|
29604
|
-
},
|
|
29605
|
-
token_issuer_config: {
|
|
29606
|
-
type: 'JWTTokenIssuer',
|
|
29607
|
-
algorithm: 'HS256',
|
|
29608
|
-
hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET),
|
|
29609
|
-
kid: 'hmac-reverse-auth-key',
|
|
29610
|
-
issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
|
|
29611
|
-
ttl_sec: 86400,
|
|
29612
|
-
audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, DEFAULT_REVERSE_AUTH_AUDIENCE),
|
|
29613
|
-
},
|
|
29732
|
+
type: 'AuthorizationProfile',
|
|
29733
|
+
profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2-callback'),
|
|
29614
29734
|
},
|
|
29615
29735
|
};
|
|
29616
29736
|
const GATED_PROFILE = {
|
|
@@ -29656,16 +29776,8 @@ const GATED_PROFILE = {
|
|
|
29656
29776
|
},
|
|
29657
29777
|
},
|
|
29658
29778
|
authorizer: {
|
|
29659
|
-
type: '
|
|
29660
|
-
|
|
29661
|
-
required_scopes: ['node.connect'],
|
|
29662
|
-
require_scope: true,
|
|
29663
|
-
default_ttl_sec: 3600,
|
|
29664
|
-
max_ttl_sec: 86400,
|
|
29665
|
-
algorithm: factory.Expressions.env(ENV_VAR_JWT_ALGORITHM, 'RS256'),
|
|
29666
|
-
audience: factory.Expressions.env(ENV_VAR_JWT_AUDIENCE$1),
|
|
29667
|
-
enforce_token_subject_node_identity: factory.Expressions.env(ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY, 'false'),
|
|
29668
|
-
trusted_client_scope: factory.Expressions.env(ENV_VAR_TRUSTED_CLIENT_SCOPE, 'node.trusted'),
|
|
29779
|
+
type: 'AuthorizationProfile',
|
|
29780
|
+
profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2-gated'),
|
|
29669
29781
|
},
|
|
29670
29782
|
};
|
|
29671
29783
|
const GATED_CALLBACK_PROFILE = {
|
|
@@ -29711,29 +29823,8 @@ const GATED_CALLBACK_PROFILE = {
|
|
|
29711
29823
|
},
|
|
29712
29824
|
},
|
|
29713
29825
|
authorizer: {
|
|
29714
|
-
type: '
|
|
29715
|
-
|
|
29716
|
-
audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE),
|
|
29717
|
-
require_scope: true,
|
|
29718
|
-
default_ttl_sec: 3600,
|
|
29719
|
-
max_ttl_sec: 86400,
|
|
29720
|
-
reverse_auth_ttl_sec: 86400,
|
|
29721
|
-
token_verifier_config: {
|
|
29722
|
-
type: 'JWTTokenVerifier',
|
|
29723
|
-
algorithm: 'HS256',
|
|
29724
|
-
hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET),
|
|
29725
|
-
issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
|
|
29726
|
-
ttl_sec: 86400,
|
|
29727
|
-
},
|
|
29728
|
-
token_issuer_config: {
|
|
29729
|
-
type: 'JWTTokenIssuer',
|
|
29730
|
-
algorithm: 'HS256',
|
|
29731
|
-
hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET),
|
|
29732
|
-
kid: 'hmac-reverse-auth-key',
|
|
29733
|
-
issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
|
|
29734
|
-
ttl_sec: 86400,
|
|
29735
|
-
audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, DEFAULT_REVERSE_AUTH_AUDIENCE),
|
|
29736
|
-
},
|
|
29826
|
+
type: 'AuthorizationProfile',
|
|
29827
|
+
profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2-callback'),
|
|
29737
29828
|
},
|
|
29738
29829
|
};
|
|
29739
29830
|
const OPEN_PROFILE$1 = {
|
|
@@ -29742,7 +29833,8 @@ const OPEN_PROFILE$1 = {
|
|
|
29742
29833
|
type: 'NoSecurityPolicy',
|
|
29743
29834
|
},
|
|
29744
29835
|
authorizer: {
|
|
29745
|
-
type: '
|
|
29836
|
+
type: 'AuthorizationProfile',
|
|
29837
|
+
profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'noop'),
|
|
29746
29838
|
},
|
|
29747
29839
|
};
|
|
29748
29840
|
const PROFILE_MAP$4 = {
|
|
@@ -29871,6 +29963,7 @@ function deepClone$3(value) {
|
|
|
29871
29963
|
|
|
29872
29964
|
var nodeSecurityProfileFactory = /*#__PURE__*/Object.freeze({
|
|
29873
29965
|
__proto__: null,
|
|
29966
|
+
ENV_VAR_AUTHORIZATION_PROFILE: ENV_VAR_AUTHORIZATION_PROFILE,
|
|
29874
29967
|
ENV_VAR_DEFAULT_ENCRYPTION_LEVEL: ENV_VAR_DEFAULT_ENCRYPTION_LEVEL,
|
|
29875
29968
|
ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY: ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY,
|
|
29876
29969
|
ENV_VAR_HMAC_SECRET: ENV_VAR_HMAC_SECRET,
|
|
@@ -43628,11 +43721,26 @@ exports.AUTHORIZATION_POLICY_FACTORY_BASE_TYPE = AUTHORIZATION_POLICY_FACTORY_BA
|
|
|
43628
43721
|
exports.AUTHORIZATION_POLICY_SOURCE_FACTORY_BASE_TYPE = AUTHORIZATION_POLICY_SOURCE_FACTORY_BASE_TYPE;
|
|
43629
43722
|
exports.AUTHORIZER_FACTORY_BASE_TYPE = AUTHORIZER_FACTORY_BASE_TYPE;
|
|
43630
43723
|
exports.AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE = AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE;
|
|
43724
|
+
exports.AUTH_PROFILE_ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY = ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1;
|
|
43725
|
+
exports.AUTH_PROFILE_ENV_VAR_HMAC_SECRET = ENV_VAR_HMAC_SECRET$1;
|
|
43726
|
+
exports.AUTH_PROFILE_ENV_VAR_JWKS_URL = ENV_VAR_JWKS_URL$1;
|
|
43727
|
+
exports.AUTH_PROFILE_ENV_VAR_JWT_ALGORITHM = ENV_VAR_JWT_ALGORITHM$1;
|
|
43728
|
+
exports.AUTH_PROFILE_ENV_VAR_JWT_AUDIENCE = ENV_VAR_JWT_AUDIENCE$2;
|
|
43729
|
+
exports.AUTH_PROFILE_ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE = ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1;
|
|
43730
|
+
exports.AUTH_PROFILE_ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER = ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1;
|
|
43731
|
+
exports.AUTH_PROFILE_ENV_VAR_JWT_TRUSTED_ISSUER = ENV_VAR_JWT_TRUSTED_ISSUER$1;
|
|
43732
|
+
exports.AUTH_PROFILE_ENV_VAR_TRUSTED_CLIENT_SCOPE = ENV_VAR_TRUSTED_CLIENT_SCOPE$1;
|
|
43733
|
+
exports.AUTH_PROFILE_NAME_DEFAULT = PROFILE_NAME_DEFAULT;
|
|
43734
|
+
exports.AUTH_PROFILE_NAME_NOOP = PROFILE_NAME_NOOP$2;
|
|
43735
|
+
exports.AUTH_PROFILE_NAME_OAUTH2 = PROFILE_NAME_OAUTH2;
|
|
43736
|
+
exports.AUTH_PROFILE_NAME_OAUTH2_CALLBACK = PROFILE_NAME_OAUTH2_CALLBACK;
|
|
43737
|
+
exports.AUTH_PROFILE_NAME_OAUTH2_GATED = PROFILE_NAME_OAUTH2_GATED;
|
|
43631
43738
|
exports.AsyncLock = AsyncLock;
|
|
43632
43739
|
exports.AttachmentKeyValidator = AttachmentKeyValidator;
|
|
43633
43740
|
exports.AuthInjectionStrategyFactory = AuthInjectionStrategyFactory;
|
|
43634
43741
|
exports.AuthorizationPolicyFactory = AuthorizationPolicyFactory;
|
|
43635
43742
|
exports.AuthorizationPolicySourceFactory = AuthorizationPolicySourceFactory;
|
|
43743
|
+
exports.AuthorizationProfileFactory = AuthorizationProfileFactory;
|
|
43636
43744
|
exports.AuthorizerFactory = AuthorizerFactory;
|
|
43637
43745
|
exports.BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE = BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE;
|
|
43638
43746
|
exports.BROADCAST_CHANNEL_CONNECTOR_FACTORY_META = FACTORY_META$$;
|
|
@@ -43675,6 +43783,7 @@ exports.DevFixedKeyCredentialProvider = DevFixedKeyCredentialProvider;
|
|
|
43675
43783
|
exports.ENCRYPTION_MANAGER_FACTORY_BASE_TYPE = ENCRYPTION_MANAGER_FACTORY_BASE_TYPE;
|
|
43676
43784
|
exports.ENVELOPE_SIGNER_FACTORY_BASE_TYPE = ENVELOPE_SIGNER_FACTORY_BASE_TYPE;
|
|
43677
43785
|
exports.ENVELOPE_VERIFIER_FACTORY_BASE_TYPE = ENVELOPE_VERIFIER_FACTORY_BASE_TYPE;
|
|
43786
|
+
exports.ENV_VAR_AUTHORIZATION_PROFILE = ENV_VAR_AUTHORIZATION_PROFILE;
|
|
43678
43787
|
exports.ENV_VAR_DEFAULT_ENCRYPTION_LEVEL = ENV_VAR_DEFAULT_ENCRYPTION_LEVEL;
|
|
43679
43788
|
exports.ENV_VAR_HMAC_SECRET = ENV_VAR_HMAC_SECRET;
|
|
43680
43789
|
exports.ENV_VAR_JWKS_URL = ENV_VAR_JWKS_URL;
|