@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.
@@ -14,12 +14,12 @@ var fastify = require('fastify');
14
14
  var websocketPlugin = require('@fastify/websocket');
15
15
 
16
16
  // This file is auto-generated during build - do not edit manually
17
- // Generated from package.json version: 0.4.0
17
+ // Generated from package.json version: 0.4.2
18
18
  /**
19
19
  * The package version, injected at build time.
20
20
  * @internal
21
21
  */
22
- const VERSION = '0.4.0';
22
+ const VERSION = '0.4.2';
23
23
 
24
24
  /**
25
25
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -3196,7 +3196,7 @@ class EnvCredentialProviderFactory extends CredentialProviderFactory {
3196
3196
  return new EnvCredentialProvider(resolved.varName);
3197
3197
  }
3198
3198
  }
3199
- const FACTORY_META$1f = {
3199
+ const FACTORY_META$1g = {
3200
3200
  base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
3201
3201
  key: 'EnvCredentialProvider',
3202
3202
  };
@@ -3204,7 +3204,7 @@ const FACTORY_META$1f = {
3204
3204
  var envCredentialProviderFactory = /*#__PURE__*/Object.freeze({
3205
3205
  __proto__: null,
3206
3206
  EnvCredentialProviderFactory: EnvCredentialProviderFactory,
3207
- FACTORY_META: FACTORY_META$1f,
3207
+ FACTORY_META: FACTORY_META$1g,
3208
3208
  default: EnvCredentialProviderFactory,
3209
3209
  normalizeEnvConfig: normalizeEnvConfig
3210
3210
  });
@@ -3302,14 +3302,14 @@ class PromptCredentialProviderFactory extends CredentialProviderFactory {
3302
3302
  return new PromptCredentialProvider(resolved.credentialName);
3303
3303
  }
3304
3304
  }
3305
- const FACTORY_META$1e = {
3305
+ const FACTORY_META$1f = {
3306
3306
  base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
3307
3307
  key: 'PromptCredentialProvider',
3308
3308
  };
3309
3309
 
3310
3310
  var promptCredentialProviderFactory = /*#__PURE__*/Object.freeze({
3311
3311
  __proto__: null,
3312
- FACTORY_META: FACTORY_META$1e,
3312
+ FACTORY_META: FACTORY_META$1f,
3313
3313
  PromptCredentialProviderFactory: PromptCredentialProviderFactory,
3314
3314
  default: PromptCredentialProviderFactory,
3315
3315
  normalizePromptConfig: normalizePromptConfig
@@ -3363,14 +3363,14 @@ class SecretStoreCredentialProviderFactory extends CredentialProviderFactory {
3363
3363
  return new SecretStoreCredentialProvider(resolved.secretName);
3364
3364
  }
3365
3365
  }
3366
- const FACTORY_META$1d = {
3366
+ const FACTORY_META$1e = {
3367
3367
  base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
3368
3368
  key: 'SecretStoreCredentialProvider',
3369
3369
  };
3370
3370
 
3371
3371
  var secretStoreCredentialProviderFactory = /*#__PURE__*/Object.freeze({
3372
3372
  __proto__: null,
3373
- FACTORY_META: FACTORY_META$1d,
3373
+ FACTORY_META: FACTORY_META$1e,
3374
3374
  SecretStoreCredentialProviderFactory: SecretStoreCredentialProviderFactory,
3375
3375
  default: SecretStoreCredentialProviderFactory,
3376
3376
  normalizeSecretStoreConfig: normalizeSecretStoreConfig
@@ -3419,14 +3419,14 @@ class StaticCredentialProviderFactory extends CredentialProviderFactory {
3419
3419
  return new StaticCredentialProvider(resolved.credentialValue);
3420
3420
  }
3421
3421
  }
3422
- const FACTORY_META$1c = {
3422
+ const FACTORY_META$1d = {
3423
3423
  base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
3424
3424
  key: 'StaticCredentialProvider',
3425
3425
  };
3426
3426
 
3427
3427
  var staticCredentialProviderFactory = /*#__PURE__*/Object.freeze({
3428
3428
  __proto__: null,
3429
- FACTORY_META: FACTORY_META$1c,
3429
+ FACTORY_META: FACTORY_META$1d,
3430
3430
  StaticCredentialProviderFactory: StaticCredentialProviderFactory,
3431
3431
  default: StaticCredentialProviderFactory,
3432
3432
  normalizeStaticConfig: normalizeStaticConfig
@@ -3670,7 +3670,7 @@ const BASE_PROFILE_MAP = {
3670
3670
  [PROFILE_NAME_INDEXEDDB]: INDEXEDDB_PROFILE_CONFIG,
3671
3671
  };
3672
3672
  // Extended profile map - can be augmented by Node.js environment
3673
- const PROFILE_MAP$6 = {
3673
+ const PROFILE_MAP$7 = {
3674
3674
  ...BASE_PROFILE_MAP,
3675
3675
  };
3676
3676
  class StorageProfileFactory extends StorageProviderFactory {
@@ -3685,9 +3685,9 @@ class StorageProfileFactory extends StorageProviderFactory {
3685
3685
  type: 'StorageProfile',
3686
3686
  });
3687
3687
  const profileName = (parsed.profile ?? PROFILE_NAME_MEMORY).toLowerCase();
3688
- const profileConfig = PROFILE_MAP$6[profileName];
3688
+ const profileConfig = PROFILE_MAP$7[profileName];
3689
3689
  if (!profileConfig) {
3690
- throw new Error(`Unknown storage profile '${profileName}'. Supported profiles: ${Object.keys(PROFILE_MAP$6).join(', ')}`);
3690
+ throw new Error(`Unknown storage profile '${profileName}'. Supported profiles: ${Object.keys(PROFILE_MAP$7).join(', ')}`);
3691
3691
  }
3692
3692
  const createOptions = {
3693
3693
  ...options,
@@ -12715,44 +12715,12 @@ class ConnectionRetryPolicyFactory extends factory.AbstractResourceFactory {
12715
12715
  }
12716
12716
  }
12717
12717
 
12718
- const TOKEN_PROVIDER_FACTORY_BASE_TYPE = 'TokenProviderFactory';
12719
- class TokenProviderFactory extends factory.AbstractResourceFactory {
12720
- static async createTokenProvider(config, options = {}) {
12721
- if (config) {
12722
- const provider = await factory.createResource(TOKEN_PROVIDER_FACTORY_BASE_TYPE, config, options);
12723
- if (!provider) {
12724
- throw new Error('Failed to create token provider from configuration');
12725
- }
12726
- return provider;
12727
- }
12728
- let provider = null;
12729
- try {
12730
- provider = await factory.createDefaultResource(TOKEN_PROVIDER_FACTORY_BASE_TYPE, null, options);
12731
- }
12732
- catch (error) {
12733
- const message = 'Failed to create default token provider' +
12734
- (error instanceof Error && error.message ? `: ${error.message}` : '');
12735
- throw new Error(message);
12736
- }
12737
- if (!provider) {
12738
- throw new Error('Failed to create default token provider');
12739
- }
12740
- return provider;
12741
- }
12742
- }
12743
-
12744
- function isTokenProvider(candidate) {
12745
- return (typeof candidate === 'object' &&
12746
- candidate !== null &&
12747
- typeof candidate.getToken === 'function');
12748
- }
12749
- function isIdentityExposingTokenProvider(candidate) {
12750
- return (isTokenProvider(candidate) &&
12751
- typeof candidate.getIdentity ===
12752
- 'function');
12753
- }
12754
-
12755
- const logger$12 = getLogger('naylence.fame.node.default_node_identity_policy');
12718
+ /**
12719
+ * Default node identity policy that preserves the current node ID.
12720
+ *
12721
+ * This policy does NOT derive identity from tokens or grants.
12722
+ * For token-subject-based identity, use TokenSubjectNodeIdentityPolicy.
12723
+ */
12756
12724
  class DefaultNodeIdentityPolicy {
12757
12725
  async resolveInitialNodeId(context) {
12758
12726
  if (context.configuredId) {
@@ -12764,44 +12732,10 @@ class DefaultNodeIdentityPolicy {
12764
12732
  return await core.generateIdAsync({ mode: 'fingerprint' });
12765
12733
  }
12766
12734
  async resolveAdmissionNodeId(context) {
12767
- // Try to extract identity from grants first
12768
- if (context.grants && context.grants.length > 0) {
12769
- for (const grant of context.grants) {
12770
- try {
12771
- const auth = grant.auth;
12772
- if (!auth) {
12773
- continue;
12774
- }
12775
- const tokenProviderConfig = (auth.tokenProvider ??
12776
- auth.token_provider);
12777
- if (!tokenProviderConfig ||
12778
- typeof tokenProviderConfig.type !== 'string') {
12779
- continue;
12780
- }
12781
- const provider = await TokenProviderFactory.createTokenProvider(tokenProviderConfig);
12782
- if (isIdentityExposingTokenProvider(provider)) {
12783
- const identity = await provider.getIdentity();
12784
- if (identity && identity.subject) {
12785
- logger$12.debug('identity_extracted_from_grant', {
12786
- identity_id: identity.subject,
12787
- grant_type: grant.type,
12788
- });
12789
- return identity.subject;
12790
- }
12791
- }
12792
- }
12793
- catch (error) {
12794
- logger$12.warning('identity_extraction_failed', {
12795
- error: error instanceof Error ? error.message : String(error),
12796
- grant_type: grant.type,
12797
- });
12798
- }
12799
- }
12735
+ if (context.currentNodeId) {
12736
+ return context.currentNodeId;
12800
12737
  }
12801
- if (!context.currentNodeId) {
12802
- return await core.generateIdAsync({ mode: 'fingerprint' });
12803
- }
12804
- return context.currentNodeId;
12738
+ return await core.generateIdAsync({ mode: 'fingerprint' });
12805
12739
  }
12806
12740
  }
12807
12741
 
@@ -12875,7 +12809,7 @@ class AttachmentKeyValidator {
12875
12809
  }
12876
12810
  }
12877
12811
 
12878
- const logger$11 = getLogger('naylence.fame.node.admission.default_node_attach_client');
12812
+ const logger$12 = getLogger('naylence.fame.node.admission.default_node_attach_client');
12879
12813
  const HANDSHAKE_POLL_INTERVAL_MS = 20;
12880
12814
  class DefaultNodeAttachClient {
12881
12815
  constructor(options = {}) {
@@ -12899,7 +12833,7 @@ class DefaultNodeAttachClient {
12899
12833
  }
12900
12834
  else {
12901
12835
  // Silently ignore frames from other agents during concurrent handshakes
12902
- logger$11.debug('handshake_ignoring_frame_from_different_system', {
12836
+ logger$12.debug('handshake_ignoring_frame_from_different_system', {
12903
12837
  frame_type: envelope.frame.type,
12904
12838
  frame_system_id: frameSystemId,
12905
12839
  expected_system_id: this.expectedSystemId,
@@ -12942,7 +12876,7 @@ class DefaultNodeAttachClient {
12942
12876
  }
12943
12877
  }
12944
12878
  catch (error) {
12945
- logger$11.debug('stickiness_offer_skipped', {
12879
+ logger$12.debug('stickiness_offer_skipped', {
12946
12880
  error: error instanceof Error ? error.message : String(error),
12947
12881
  });
12948
12882
  }
@@ -12963,7 +12897,7 @@ class DefaultNodeAttachClient {
12963
12897
  if (!processedEnvelope) {
12964
12898
  throw new Error('Envelope was blocked by onForwardUpstream event');
12965
12899
  }
12966
- logger$11.debug('sending_node_attach_envelope', {
12900
+ logger$12.debug('sending_node_attach_envelope', {
12967
12901
  envp_id: processedEnvelope.id ?? envelope.id ?? null,
12968
12902
  frame_type: processedEnvelope.frame?.type ?? 'unknown',
12969
12903
  trace_id: processedEnvelope.traceId ?? envelope.traceId ?? null,
@@ -12999,7 +12933,7 @@ class DefaultNodeAttachClient {
12999
12933
  try {
13000
12934
  const keyInfos = await this.attachmentKeyValidator.validateKeys(parentKeys);
13001
12935
  if (Array.isArray(keyInfos) && keyInfos.length > 0) {
13002
- logger$11.debug('parent_certificate_validation_passed', {
12936
+ logger$12.debug('parent_certificate_validation_passed', {
13003
12937
  parent_id: parentId,
13004
12938
  correlation_id: corrId,
13005
12939
  validated_keys: keyInfos.length,
@@ -13008,7 +12942,7 @@ class DefaultNodeAttachClient {
13008
12942
  }
13009
12943
  catch (error) {
13010
12944
  if (error instanceof KeyValidationError) {
13011
- logger$11.error('parent_certificate_validation_failed', {
12945
+ logger$12.error('parent_certificate_validation_failed', {
13012
12946
  parent_id: parentId,
13013
12947
  correlation_id: corrId,
13014
12948
  error_code: error.code,
@@ -13022,12 +12956,12 @@ class DefaultNodeAttachClient {
13022
12956
  }
13023
12957
  }
13024
12958
  else {
13025
- logger$11.debug('parent_certificate_validation_skipped', {
12959
+ logger$12.debug('parent_certificate_validation_skipped', {
13026
12960
  parent_id: parentId,
13027
12961
  reason: 'no_validator',
13028
12962
  });
13029
12963
  }
13030
- logger$11.debug('processing_node_attach_ack', {
12964
+ logger$12.debug('processing_node_attach_ack', {
13031
12965
  parent_id: ackFrame.targetSystemId,
13032
12966
  });
13033
12967
  this.inHandshake = false;
@@ -13058,7 +12992,7 @@ class DefaultNodeAttachClient {
13058
12992
  }
13059
12993
  }
13060
12994
  catch (error) {
13061
- logger$11.debug('stickiness_accept_skipped', {
12995
+ logger$12.debug('stickiness_accept_skipped', {
13062
12996
  error: error instanceof Error ? error.message : String(error),
13063
12997
  });
13064
12998
  }
@@ -13112,7 +13046,7 @@ class DefaultNodeAttachClient {
13112
13046
  // NodeAttach frames during handshake are expected in multi-agent scenarios
13113
13047
  // where multiple agents attach concurrently to the same channel
13114
13048
  if (envelope.frame.type === 'NodeAttach') {
13115
- logger$11.debug('handshake_ignoring_concurrent_attach', {
13049
+ logger$12.debug('handshake_ignoring_concurrent_attach', {
13116
13050
  frame_type: envelope.frame.type,
13117
13051
  frame_system_id: envelope.frame?.systemId ??
13118
13052
  'unknown',
@@ -13120,7 +13054,7 @@ class DefaultNodeAttachClient {
13120
13054
  }
13121
13055
  else {
13122
13056
  // Other unexpected frames are still logged as errors
13123
- logger$11.error('unexpected_frame_during_handshake', {
13057
+ logger$12.error('unexpected_frame_during_handshake', {
13124
13058
  frame_type: envelope.frame.type,
13125
13059
  });
13126
13060
  }
@@ -13260,7 +13194,7 @@ class TraceEmitterFactory extends factory.AbstractResourceFactory {
13260
13194
  // void import('./trace-emitter-profile-factory.js');
13261
13195
 
13262
13196
  const BINDING_STORE_NAMESPACE = '__binding_store';
13263
- const logger$10 = getLogger('naylence.fame.node.factory_commons');
13197
+ const logger$11 = getLogger('naylence.fame.node.factory_commons');
13264
13198
  function isPlainRecord$2(value) {
13265
13199
  return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
13266
13200
  }
@@ -13454,7 +13388,7 @@ async function resolveNodeIdentityPolicy(config, options) {
13454
13388
  return await NodeIdentityPolicyFactory.createNodeIdentityPolicy(config ?? undefined, cloneCreateOptions(options));
13455
13389
  }
13456
13390
  catch (error) {
13457
- logger$10.warning('node_identity_policy_creation_failed', {
13391
+ logger$11.warning('node_identity_policy_creation_failed', {
13458
13392
  error: error instanceof Error ? error.message : String(error),
13459
13393
  });
13460
13394
  return null;
@@ -13465,7 +13399,7 @@ async function resolveConnectionRetryPolicy(config, options) {
13465
13399
  return await ConnectionRetryPolicyFactory.createConnectionRetryPolicy(config ?? undefined, cloneCreateOptions(options));
13466
13400
  }
13467
13401
  catch (error) {
13468
- logger$10.warning('connection_retry_policy_creation_failed', {
13402
+ logger$11.warning('connection_retry_policy_creation_failed', {
13469
13403
  error: error instanceof Error ? error.message : String(error),
13470
13404
  });
13471
13405
  return null;
@@ -13477,7 +13411,7 @@ async function resolveStorageProvider(config, options) {
13477
13411
  return await StorageProviderFactory.createStorageProvider(config, cloneCreateOptions(options));
13478
13412
  }
13479
13413
  catch (error) {
13480
- logger$10.warning('storage_provider_creation_failed', {
13414
+ logger$11.warning('storage_provider_creation_failed', {
13481
13415
  error: error instanceof Error ? error.message : String(error),
13482
13416
  });
13483
13417
  }
@@ -13499,7 +13433,7 @@ async function resolveAdmissionClient(config, options, identityPolicy) {
13499
13433
  return await AdmissionClientFactory.createAdmissionClient((config ?? null), createOptions);
13500
13434
  }
13501
13435
  catch (error) {
13502
- logger$10.warning('admission_client_creation_failed', {
13436
+ logger$11.warning('admission_client_creation_failed', {
13503
13437
  error: error instanceof Error ? error.message : String(error),
13504
13438
  });
13505
13439
  return null;
@@ -13526,7 +13460,7 @@ async function resolveReplicaStickinessManager(hasParent, requestedLogicals, opt
13526
13460
  return await ReplicaStickinessManagerFactory.createReplicaStickinessManager(undefined, cloneCreateOptions(options));
13527
13461
  }
13528
13462
  catch (error) {
13529
- logger$10.debug('replica_stickiness_manager_unavailable', { error });
13463
+ logger$11.debug('replica_stickiness_manager_unavailable', { error });
13530
13464
  return null;
13531
13465
  }
13532
13466
  }
@@ -13535,7 +13469,7 @@ async function resolveAttachmentKeyValidator(config, options) {
13535
13469
  return await AttachmentKeyValidatorFactory.createAttachmentKeyValidator(config ?? undefined, cloneCreateOptions(options));
13536
13470
  }
13537
13471
  catch (error) {
13538
- logger$10.warning('attachment_key_validator_creation_failed', {
13472
+ logger$11.warning('attachment_key_validator_creation_failed', {
13539
13473
  error: error instanceof Error ? error.message : String(error),
13540
13474
  });
13541
13475
  return null;
@@ -13553,7 +13487,7 @@ async function resolveDeliveryPolicy(config, options) {
13553
13487
  return await DeliveryPolicyFactory.createDeliveryPolicy(config ?? undefined, cloneCreateOptions(options));
13554
13488
  }
13555
13489
  catch (error) {
13556
- logger$10.warning('delivery_policy_creation_failed', {
13490
+ logger$11.warning('delivery_policy_creation_failed', {
13557
13491
  error: error instanceof Error ? error.message : String(error),
13558
13492
  });
13559
13493
  return null;
@@ -13567,7 +13501,7 @@ async function resolveTransportListeners(configs, eventListeners, options) {
13567
13501
  return await TransportListenerFactory.createTransportListeners(configs, eventListeners, cloneCreateOptions(options));
13568
13502
  }
13569
13503
  catch (error) {
13570
- logger$10.warning('transport_listener_creation_failed', {
13504
+ logger$11.warning('transport_listener_creation_failed', {
13571
13505
  error: error instanceof Error ? error.message : String(error),
13572
13506
  });
13573
13507
  return [];
@@ -13578,7 +13512,7 @@ async function resolveTraceEmitter(config, options) {
13578
13512
  return await TraceEmitterFactory.createTraceEmitter(config ?? undefined, cloneCreateOptions(options));
13579
13513
  }
13580
13514
  catch (error) {
13581
- logger$10.warning('trace_emitter_creation_failed', {
13515
+ logger$11.warning('trace_emitter_creation_failed', {
13582
13516
  error: error instanceof Error ? error.message : String(error),
13583
13517
  });
13584
13518
  return null;
@@ -13634,7 +13568,7 @@ async function createSecurityManagerFromConfig(config, overrides, options) {
13634
13568
  return manager ?? null;
13635
13569
  }
13636
13570
  catch (error) {
13637
- logger$10.warning('security_manager_creation_failed', {
13571
+ logger$11.warning('security_manager_creation_failed', {
13638
13572
  error: error instanceof Error ? error.message : String(error),
13639
13573
  });
13640
13574
  return null;
@@ -13663,7 +13597,7 @@ async function resolveCryptoProvider(config, options) {
13663
13597
  // This happens with overlay security profiles that need envelope signing
13664
13598
  if (requiresCryptoProvider(config)) {
13665
13599
  try {
13666
- logger$10.debug('auto_creating_crypto_provider', {
13600
+ logger$11.debug('auto_creating_crypto_provider', {
13667
13601
  reason: 'overlay_security_requires_signing',
13668
13602
  });
13669
13603
  // Dynamically import to avoid circular dependencies
@@ -13683,7 +13617,7 @@ async function resolveCryptoProvider(config, options) {
13683
13617
  });
13684
13618
  }
13685
13619
  catch (error) {
13686
- logger$10.error('failed_to_auto_create_crypto_provider', {
13620
+ logger$11.error('failed_to_auto_create_crypto_provider', {
13687
13621
  error: error instanceof Error ? error.message : String(error),
13688
13622
  });
13689
13623
  throw error;
@@ -14223,6 +14157,7 @@ const MODULES = [
14223
14157
  "./node/node-identity-policy-profile-factory.js",
14224
14158
  "./node/token-subject-node-identity-policy-factory.js",
14225
14159
  "./placement/static-node-placement-strategy-factory.js",
14160
+ "./security/auth/authorization-profile-factory.js",
14226
14161
  "./security/auth/bearer-token-header-auth-injection-strategy-factory.js",
14227
14162
  "./security/auth/default-authorizer-factory.js",
14228
14163
  "./security/auth/default-policy-authorizer-factory.js",
@@ -14305,6 +14240,7 @@ const MODULE_LOADERS = {
14305
14240
  "./node/node-identity-policy-profile-factory.js": () => Promise.resolve().then(function () { return nodeIdentityPolicyProfileFactory; }),
14306
14241
  "./node/token-subject-node-identity-policy-factory.js": () => Promise.resolve().then(function () { return tokenSubjectNodeIdentityPolicyFactory; }),
14307
14242
  "./placement/static-node-placement-strategy-factory.js": () => Promise.resolve().then(function () { return staticNodePlacementStrategyFactory; }),
14243
+ "./security/auth/authorization-profile-factory.js": () => Promise.resolve().then(function () { return authorizationProfileFactory; }),
14308
14244
  "./security/auth/bearer-token-header-auth-injection-strategy-factory.js": () => Promise.resolve().then(function () { return bearerTokenHeaderAuthInjectionStrategyFactory; }),
14309
14245
  "./security/auth/default-authorizer-factory.js": () => Promise.resolve().then(function () { return defaultAuthorizerFactory; }),
14310
14246
  "./security/auth/default-policy-authorizer-factory.js": () => Promise.resolve().then(function () { return defaultPolicyAuthorizerFactory; }),
@@ -14652,7 +14588,7 @@ class NodeLikeFactory extends factory.AbstractResourceFactory {
14652
14588
  // registerFactory(NODE_LIKE_FACTORY_BASE_TYPE, type, factory);
14653
14589
  // }
14654
14590
 
14655
- const FACTORY_META$1b = {
14591
+ const FACTORY_META$1c = {
14656
14592
  base: NODE_LIKE_FACTORY_BASE_TYPE,
14657
14593
  key: 'Node',
14658
14594
  };
@@ -14694,7 +14630,7 @@ class NodeFactory extends NodeLikeFactory {
14694
14630
 
14695
14631
  var nodeFactory = /*#__PURE__*/Object.freeze({
14696
14632
  __proto__: null,
14697
- FACTORY_META: FACTORY_META$1b,
14633
+ FACTORY_META: FACTORY_META$1c,
14698
14634
  NodeFactory: NodeFactory,
14699
14635
  default: NodeFactory
14700
14636
  });
@@ -15271,7 +15207,7 @@ function normalizeSecurityRequirements(value) {
15271
15207
  };
15272
15208
  }
15273
15209
 
15274
- const logger$$ = getLogger('naylence.fame.node.envelope_security_handler');
15210
+ const logger$10 = getLogger('naylence.fame.node.envelope_security_handler');
15275
15211
  const ENCRYPTION_OPTION_ALIAS_PAIRS = [
15276
15212
  ['recipKid', 'recip_kid'],
15277
15213
  ['recipientKeyId', 'recipient_key_id'],
@@ -15320,7 +15256,7 @@ class EnvelopeSecurityHandler {
15320
15256
  const shouldSign = this.securityPolicy
15321
15257
  ? await this.securityPolicy.shouldSignEnvelope(envelope, context, this.node)
15322
15258
  : false;
15323
- logger$$.debug('checking_signing', {
15259
+ logger$10.debug('checking_signing', {
15324
15260
  has_signer: Boolean(this.envelopeSigner),
15325
15261
  should_sign: shouldSign,
15326
15262
  envp_id: envelope.id,
@@ -15342,7 +15278,7 @@ class EnvelopeSecurityHandler {
15342
15278
  const shouldEncrypt = this.securityPolicy
15343
15279
  ? await this.securityPolicy.shouldEncryptEnvelope(envelope, context, this.node)
15344
15280
  : false;
15345
- logger$$.debug('checking_encryption', {
15281
+ logger$10.debug('checking_encryption', {
15346
15282
  has_encryption_manager: Boolean(this.encryptionManager),
15347
15283
  should_encrypt: shouldEncrypt,
15348
15284
  envp_id: envelope.id,
@@ -15350,7 +15286,7 @@ class EnvelopeSecurityHandler {
15350
15286
  });
15351
15287
  if (this.encryptionManager && this.securityPolicy) {
15352
15288
  if (envelope.sec?.enc) {
15353
- logger$$.debug('skipping_encryption_already_encrypted', {
15289
+ logger$10.debug('skipping_encryption_already_encrypted', {
15354
15290
  envp_id: envelope.id,
15355
15291
  destination: envelope.to ? String(envelope.to) : undefined,
15356
15292
  });
@@ -15363,7 +15299,7 @@ class EnvelopeSecurityHandler {
15363
15299
  exports.CryptoLevel.PLAINTEXT;
15364
15300
  desiredCryptoLevel =
15365
15301
  await this.securityPolicy.decideResponseCryptoLevel(requestCryptoLevel, envelope, context);
15366
- logger$$.debug('response_crypto_level_decided', {
15302
+ logger$10.debug('response_crypto_level_decided', {
15367
15303
  envp_id: envelope.id,
15368
15304
  crypto_level: desiredCryptoLevel,
15369
15305
  destination: envelope.to ? String(envelope.to) : undefined,
@@ -15374,7 +15310,7 @@ class EnvelopeSecurityHandler {
15374
15310
  else {
15375
15311
  desiredCryptoLevel =
15376
15312
  await this.securityPolicy.decideOutboundCryptoLevel(envelope, context, this.node);
15377
- logger$$.debug('outbound_crypto_level_decided', {
15313
+ logger$10.debug('outbound_crypto_level_decided', {
15378
15314
  envp_id: envelope.id,
15379
15315
  frame_type: envelope.frame.type,
15380
15316
  crypto_level: desiredCryptoLevel,
@@ -15382,11 +15318,11 @@ class EnvelopeSecurityHandler {
15382
15318
  });
15383
15319
  }
15384
15320
  if (desiredCryptoLevel === exports.CryptoLevel.SEALED) {
15385
- logger$$.debug('applying_sealed_encryption', { envp_id: envelope.id });
15321
+ logger$10.debug('applying_sealed_encryption', { envp_id: envelope.id });
15386
15322
  return await this.handleSealedEncryption(envelope, context);
15387
15323
  }
15388
15324
  if (desiredCryptoLevel === exports.CryptoLevel.CHANNEL) {
15389
- logger$$.debug('applying_channel_encryption', { envp_id: envelope.id });
15325
+ logger$10.debug('applying_channel_encryption', { envp_id: envelope.id });
15390
15326
  return await this.handleChannelEncryption(envelope, context);
15391
15327
  }
15392
15328
  }
@@ -15437,7 +15373,7 @@ class EnvelopeSecurityHandler {
15437
15373
  frameType === 'KeyAnnounce' ||
15438
15374
  frameType === 'SecureOpen' ||
15439
15375
  frameType === 'SecureAccept') {
15440
- logger$$.error('critical_frame_unsigned_rejected', {
15376
+ logger$10.error('critical_frame_unsigned_rejected', {
15441
15377
  envp_id: envelope.id,
15442
15378
  frame_type: frameType,
15443
15379
  reason: 'critical_frames_must_be_signed',
@@ -15445,7 +15381,7 @@ class EnvelopeSecurityHandler {
15445
15381
  return [envelope, false];
15446
15382
  }
15447
15383
  const action = this.securityPolicy.getUnsignedViolationAction(envelope, context);
15448
- logger$$.warning('unsigned_envelope_violation', {
15384
+ logger$10.warning('unsigned_envelope_violation', {
15449
15385
  envp_id: envelope.id,
15450
15386
  frame_type: frameType,
15451
15387
  action,
@@ -15457,26 +15393,26 @@ class EnvelopeSecurityHandler {
15457
15393
  return [envelope, true];
15458
15394
  }
15459
15395
  async handleChannelHandshakeComplete(channelId, destination) {
15460
- logger$$.debug('channel_handshake_completed', {
15396
+ logger$10.debug('channel_handshake_completed', {
15461
15397
  channel_id: channelId,
15462
15398
  destination,
15463
15399
  });
15464
15400
  if (this.encryptionManager?.notifyChannelEstablished) {
15465
15401
  await this.encryptionManager.notifyChannelEstablished(channelId);
15466
- logger$$.debug('notified_encryption_manager_channel_ready', {
15402
+ logger$10.debug('notified_encryption_manager_channel_ready', {
15467
15403
  channel_id: channelId,
15468
15404
  });
15469
15405
  }
15470
15406
  }
15471
15407
  async handleChannelHandshakeFailed(channelId, destination, reason = 'handshake_failed') {
15472
- logger$$.debug('channel_handshake_failed', {
15408
+ logger$10.debug('channel_handshake_failed', {
15473
15409
  channel_id: channelId,
15474
15410
  destination,
15475
15411
  reason,
15476
15412
  });
15477
15413
  if (this.encryptionManager?.notifyChannelFailed) {
15478
15414
  await this.encryptionManager.notifyChannelFailed(channelId, reason);
15479
- logger$$.debug('notified_encryption_manager_channel_failed', {
15415
+ logger$10.debug('notified_encryption_manager_channel_failed', {
15480
15416
  channel_id: channelId,
15481
15417
  reason,
15482
15418
  });
@@ -15523,7 +15459,7 @@ class EnvelopeSecurityHandler {
15523
15459
  checkPayload: false,
15524
15460
  });
15525
15461
  if (verified) {
15526
- logger$$.debug('envelope_verified', {
15462
+ logger$10.debug('envelope_verified', {
15527
15463
  envp_id: envelope.id,
15528
15464
  sid: envelope.sid,
15529
15465
  kid,
@@ -15534,7 +15470,7 @@ class EnvelopeSecurityHandler {
15534
15470
  }
15535
15471
  this.keyManagementHandler.queuePendingSignedEnvelope(kid, envelope, context);
15536
15472
  await this.keyManagementHandler.maybeRequestSigningKey(kid, context.originType, fromSystemId);
15537
- logger$$.debug('queued_envelope_missing_signing_key', {
15473
+ logger$10.debug('queued_envelope_missing_signing_key', {
15538
15474
  kid,
15539
15475
  envp_id: envelope.id,
15540
15476
  });
@@ -15542,7 +15478,7 @@ class EnvelopeSecurityHandler {
15542
15478
  }
15543
15479
  async handleSealedEncryption(envelope, context) {
15544
15480
  if (!envelope.to) {
15545
- logger$$.warning('sealed_encryption_requested_but_no_destination', {
15481
+ logger$10.warning('sealed_encryption_requested_but_no_destination', {
15546
15482
  envp_id: envelope.id,
15547
15483
  });
15548
15484
  return true;
@@ -15554,20 +15490,20 @@ class EnvelopeSecurityHandler {
15554
15490
  : undefined;
15555
15491
  if (options) {
15556
15492
  if (options.encryptionType === 'channel') {
15557
- logger$$.warning('policy_returned_channel_for_sealed_request', {
15493
+ logger$10.warning('policy_returned_channel_for_sealed_request', {
15558
15494
  envp_id: envelope.id,
15559
15495
  });
15560
15496
  return await this.handleToBeEncryptedEnvelopeWithOptions(envelope, context, normalizeEncryptionOptions({
15561
15497
  requestAddress: envelope.to,
15562
15498
  }));
15563
15499
  }
15564
- logger$$.debug('using_sealed_encryption_options', {
15500
+ logger$10.debug('using_sealed_encryption_options', {
15565
15501
  envp_id: envelope.id,
15566
15502
  options,
15567
15503
  });
15568
15504
  return await this.handleToBeEncryptedEnvelopeWithOptions(envelope, context, options);
15569
15505
  }
15570
- logger$$.debug('no_encryption_options_requesting_key', {
15506
+ logger$10.debug('no_encryption_options_requesting_key', {
15571
15507
  envp_id: envelope.id,
15572
15508
  });
15573
15509
  return await this.handleToBeEncryptedEnvelopeWithOptions(envelope, context, normalizeEncryptionOptions({
@@ -15575,7 +15511,7 @@ class EnvelopeSecurityHandler {
15575
15511
  }));
15576
15512
  }
15577
15513
  catch (error) {
15578
- logger$$.debug('sealed_key_lookup_failed_requesting', {
15514
+ logger$10.debug('sealed_key_lookup_failed_requesting', {
15579
15515
  envp_id: envelope.id,
15580
15516
  error: error instanceof Error ? error.message : String(error),
15581
15517
  });
@@ -15586,7 +15522,7 @@ class EnvelopeSecurityHandler {
15586
15522
  }
15587
15523
  async handleChannelEncryption(envelope, context) {
15588
15524
  if (!envelope.to) {
15589
- logger$$.warning('channel_encryption_requested_but_no_destination', {
15525
+ logger$10.warning('channel_encryption_requested_but_no_destination', {
15590
15526
  envp_id: envelope.id,
15591
15527
  });
15592
15528
  return true;
@@ -15601,13 +15537,13 @@ class EnvelopeSecurityHandler {
15601
15537
  return true;
15602
15538
  }
15603
15539
  if (context.originType !== core.DeliveryOriginType.LOCAL) {
15604
- logger$$.warning('envelope_encryption_rejected_non_local', {
15540
+ logger$10.warning('envelope_encryption_rejected_non_local', {
15605
15541
  origin: context.originType,
15606
15542
  });
15607
15543
  return true;
15608
15544
  }
15609
15545
  if (!isDataFrame$4(envelope.frame)) {
15610
- logger$$.trace('skipping_encryption_non_dataframe', {
15546
+ logger$10.trace('skipping_encryption_non_dataframe', {
15611
15547
  envp_id: envelope.id,
15612
15548
  frame_type: envelope.frame.type,
15613
15549
  });
@@ -15618,7 +15554,7 @@ class EnvelopeSecurityHandler {
15618
15554
  ? normalizeEncryptionOptions(rawOptions)
15619
15555
  : undefined;
15620
15556
  if (!options) {
15621
- logger$$.warning('no_encryption_options_provided', {
15557
+ logger$10.warning('no_encryption_options_provided', {
15622
15558
  envp_id: envelope.id,
15623
15559
  });
15624
15560
  return true;
@@ -15630,13 +15566,13 @@ class EnvelopeSecurityHandler {
15630
15566
  return true;
15631
15567
  }
15632
15568
  if (context.originType !== core.DeliveryOriginType.LOCAL) {
15633
- logger$$.warning('envelope_encryption_rejected_non_local', {
15569
+ logger$10.warning('envelope_encryption_rejected_non_local', {
15634
15570
  origin: context.originType,
15635
15571
  });
15636
15572
  return true;
15637
15573
  }
15638
15574
  if (!isDataFrame$4(envelope.frame)) {
15639
- logger$$.trace('skipping_encryption_non_dataframe', {
15575
+ logger$10.trace('skipping_encryption_non_dataframe', {
15640
15576
  envp_id: envelope.id,
15641
15577
  frame_type: envelope.frame.type,
15642
15578
  });
@@ -15653,7 +15589,7 @@ class EnvelopeSecurityHandler {
15653
15589
  // Skip encryption if envelope is already encrypted
15654
15590
  // This prevents re-queuing when replayed envelopes go through security again
15655
15591
  if (envelope.sec?.enc) {
15656
- logger$$.debug('skipping_encryption_already_encrypted', {
15592
+ logger$10.debug('skipping_encryption_already_encrypted', {
15657
15593
  envp_id: envelope.id,
15658
15594
  destination: envelope.to ? String(envelope.to) : undefined,
15659
15595
  });
@@ -15662,14 +15598,14 @@ class EnvelopeSecurityHandler {
15662
15598
  try {
15663
15599
  const result = await this.encryptionManager.encryptEnvelope(envelope, normalizedOptions);
15664
15600
  if (result.status === exports.EncryptionStatus.QUEUED) {
15665
- logger$$.debug('envelope_queued_for_encryption', {
15601
+ logger$10.debug('envelope_queued_for_encryption', {
15666
15602
  envp_id: envelope.id,
15667
15603
  });
15668
15604
  await this.handleEncryptionQueueing(envelope, context, normalizedOptions);
15669
15605
  return false;
15670
15606
  }
15671
15607
  if (result.status === exports.EncryptionStatus.OK) {
15672
- logger$$.debug('envelope_encrypted', { envp_id: envelope.id });
15608
+ logger$10.debug('envelope_encrypted', { envp_id: envelope.id });
15673
15609
  if (result.envelope) {
15674
15610
  envelope.frame = result.envelope.frame;
15675
15611
  envelope.sec = result.envelope.sec;
@@ -15677,17 +15613,17 @@ class EnvelopeSecurityHandler {
15677
15613
  return true;
15678
15614
  }
15679
15615
  if (result.status === exports.EncryptionStatus.SKIPPED) {
15680
- logger$$.debug('envelope_encryption_skipped', { envp_id: envelope.id });
15616
+ logger$10.debug('envelope_encryption_skipped', { envp_id: envelope.id });
15681
15617
  return true;
15682
15618
  }
15683
- logger$$.warning('unknown_encryption_status', {
15619
+ logger$10.warning('unknown_encryption_status', {
15684
15620
  envp_id: envelope.id,
15685
15621
  status: result.status,
15686
15622
  });
15687
15623
  return true;
15688
15624
  }
15689
15625
  catch (error) {
15690
- logger$$.error('encryption_failed', {
15626
+ logger$10.error('encryption_failed', {
15691
15627
  envp_id: envelope.id,
15692
15628
  error: error instanceof Error ? error.message : String(error),
15693
15629
  });
@@ -15726,7 +15662,7 @@ class EnvelopeSecurityHandler {
15726
15662
  return;
15727
15663
  }
15728
15664
  if (normalizedOptions.encryptionType === 'channel') {
15729
- logger$$.debug('channel_encryption_queueing_handled_internally', {
15665
+ logger$10.debug('channel_encryption_queueing_handled_internally', {
15730
15666
  envp_id: envelope.id,
15731
15667
  destination: normalizedOptions.destination
15732
15668
  ? String(normalizedOptions.destination)
@@ -15734,13 +15670,13 @@ class EnvelopeSecurityHandler {
15734
15670
  });
15735
15671
  return;
15736
15672
  }
15737
- logger$$.warning('unknown_encryption_queueing_options', {
15673
+ logger$10.warning('unknown_encryption_queueing_options', {
15738
15674
  envp_id: envelope.id,
15739
15675
  options: normalizedOptions,
15740
15676
  });
15741
15677
  }
15742
15678
  async handleFailedChannelEnvelopeCleanup(destination, reason) {
15743
- logger$$.debug('channel_handshake_failure_cleanup_attempted', {
15679
+ logger$10.debug('channel_handshake_failure_cleanup_attempted', {
15744
15680
  destination,
15745
15681
  reason,
15746
15682
  note: 'envelope_cleanup_handled_by_encryption_manager',
@@ -15751,7 +15687,7 @@ class EnvelopeSecurityHandler {
15751
15687
  }
15752
15688
  }
15753
15689
 
15754
- const logger$_ = getLogger('naylence.fame.node.secure_channel_frame_handler');
15690
+ const logger$$ = getLogger('naylence.fame.node.secure_channel_frame_handler');
15755
15691
  function isPlainRecord$1(value) {
15756
15692
  if (typeof value !== 'object' || value === null) {
15757
15693
  return false;
@@ -15841,7 +15777,7 @@ class SecureChannelFrameHandler {
15841
15777
  assertSecureChannelManager(this.secureChannelManager);
15842
15778
  const frame = envelope.frame;
15843
15779
  assertFrameType(frame, 'SecureOpen');
15844
- logger$_.debug('received_secure_open', {
15780
+ logger$$.debug('received_secure_open', {
15845
15781
  cid: frame.cid,
15846
15782
  algorithm: frame.alg,
15847
15783
  });
@@ -15864,13 +15800,13 @@ class SecureChannelFrameHandler {
15864
15800
  stickySid: envelope.sid ?? undefined,
15865
15801
  expectedResponseType: core.FameResponseType.NONE,
15866
15802
  };
15867
- logger$_.debug('stickiness_requested_for_channel_encryption', {
15803
+ logger$$.debug('stickiness_requested_for_channel_encryption', {
15868
15804
  cid: frame.cid,
15869
15805
  reason: 'secure_channel_established',
15870
15806
  });
15871
15807
  }
15872
15808
  await this.sendCallback(responseEnvelope, responseContext);
15873
- logger$_.debug('sent_secure_accept', { cid: frame.cid, ok: acceptFrame.ok });
15809
+ logger$$.debug('sent_secure_accept', { cid: frame.cid, ok: acceptFrame.ok });
15874
15810
  if (acceptFrame.ok && this.envelopeSecurityHandler) {
15875
15811
  const destination = extractDestinationFromChannelId(frame.cid);
15876
15812
  if (destination) {
@@ -15882,13 +15818,13 @@ class SecureChannelFrameHandler {
15882
15818
  assertSecureChannelManager(this.secureChannelManager);
15883
15819
  const frame = envelope.frame;
15884
15820
  assertFrameType(frame, 'SecureAccept');
15885
- logger$_.debug('received_secure_accept', { cid: frame.cid, ok: frame.ok });
15821
+ logger$$.debug('received_secure_accept', { cid: frame.cid, ok: frame.ok });
15886
15822
  const success = await this.secureChannelManager.handleAcceptFrame(frame);
15887
15823
  if (!success) {
15888
- logger$_.warning('failed_to_complete_channel', { cid: frame.cid });
15824
+ logger$$.warning('failed_to_complete_channel', { cid: frame.cid });
15889
15825
  }
15890
15826
  else {
15891
- logger$_.debug('channel_established', { cid: frame.cid });
15827
+ logger$$.debug('channel_established', { cid: frame.cid });
15892
15828
  if (this.envelopeSecurityHandler) {
15893
15829
  const destination = extractDestinationFromChannelId(frame.cid);
15894
15830
  if (destination) {
@@ -15900,7 +15836,7 @@ class SecureChannelFrameHandler {
15900
15836
  const destination = extractDestinationFromChannelId(frame.cid);
15901
15837
  if (destination) {
15902
15838
  await this.envelopeSecurityHandler.handleChannelHandshakeFailed(frame.cid, destination, 'negative_secure_accept');
15903
- logger$_.debug('notified_handshake_failure', {
15839
+ logger$$.debug('notified_handshake_failure', {
15904
15840
  cid: frame.cid,
15905
15841
  destination,
15906
15842
  });
@@ -15911,7 +15847,7 @@ class SecureChannelFrameHandler {
15911
15847
  assertSecureChannelManager(this.secureChannelManager);
15912
15848
  const frame = envelope.frame;
15913
15849
  assertFrameType(frame, 'SecureClose');
15914
- logger$_.debug('received_secure_close', {
15850
+ logger$$.debug('received_secure_close', {
15915
15851
  cid: frame.cid,
15916
15852
  reason: frame.reason,
15917
15853
  });
@@ -15969,7 +15905,7 @@ function createNodeDeliveryContext(options = {}) {
15969
15905
  class FameEnvironmentContext {
15970
15906
  }
15971
15907
 
15972
- const FACTORY_META$1a = {
15908
+ const FACTORY_META$1b = {
15973
15909
  base: NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE,
15974
15910
  key: 'DefaultNodeIdentityPolicy',
15975
15911
  };
@@ -15987,11 +15923,48 @@ class DefaultNodeIdentityPolicyFactory extends NodeIdentityPolicyFactory {
15987
15923
  var defaultNodeIdentityPolicyFactory = /*#__PURE__*/Object.freeze({
15988
15924
  __proto__: null,
15989
15925
  DefaultNodeIdentityPolicyFactory: DefaultNodeIdentityPolicyFactory,
15990
- FACTORY_META: FACTORY_META$1a,
15926
+ FACTORY_META: FACTORY_META$1b,
15991
15927
  default: DefaultNodeIdentityPolicyFactory
15992
15928
  });
15993
15929
 
15994
- const logger$Z = getLogger('naylence.fame.node.token_subject_node_identity_policy');
15930
+ const TOKEN_PROVIDER_FACTORY_BASE_TYPE = 'TokenProviderFactory';
15931
+ class TokenProviderFactory extends factory.AbstractResourceFactory {
15932
+ static async createTokenProvider(config, options = {}) {
15933
+ if (config) {
15934
+ const provider = await factory.createResource(TOKEN_PROVIDER_FACTORY_BASE_TYPE, config, options);
15935
+ if (!provider) {
15936
+ throw new Error('Failed to create token provider from configuration');
15937
+ }
15938
+ return provider;
15939
+ }
15940
+ let provider = null;
15941
+ try {
15942
+ provider = await factory.createDefaultResource(TOKEN_PROVIDER_FACTORY_BASE_TYPE, null, options);
15943
+ }
15944
+ catch (error) {
15945
+ const message = 'Failed to create default token provider' +
15946
+ (error instanceof Error && error.message ? `: ${error.message}` : '');
15947
+ throw new Error(message);
15948
+ }
15949
+ if (!provider) {
15950
+ throw new Error('Failed to create default token provider');
15951
+ }
15952
+ return provider;
15953
+ }
15954
+ }
15955
+
15956
+ function isTokenProvider(candidate) {
15957
+ return (typeof candidate === 'object' &&
15958
+ candidate !== null &&
15959
+ typeof candidate.getToken === 'function');
15960
+ }
15961
+ function isIdentityExposingTokenProvider(candidate) {
15962
+ return (isTokenProvider(candidate) &&
15963
+ typeof candidate.getIdentity ===
15964
+ 'function');
15965
+ }
15966
+
15967
+ const logger$_ = getLogger('naylence.fame.node.token_subject_node_identity_policy');
15995
15968
  class TokenSubjectNodeIdentityPolicy {
15996
15969
  async resolveInitialNodeId(context) {
15997
15970
  if (context.configuredId) {
@@ -16003,7 +15976,7 @@ class TokenSubjectNodeIdentityPolicy {
16003
15976
  return core.generateIdAsync();
16004
15977
  }
16005
15978
  async resolveAdmissionNodeId(context) {
16006
- logger$Z.debug('resolve_admission_node_id_start', {
15979
+ logger$_.debug('resolve_admission_node_id_start', {
16007
15980
  grantsCount: context.grants?.length ?? 0,
16008
15981
  currentNodeId: context.currentNodeId,
16009
15982
  });
@@ -16012,31 +15985,31 @@ class TokenSubjectNodeIdentityPolicy {
16012
15985
  try {
16013
15986
  const auth = grant.auth;
16014
15987
  if (!auth) {
16015
- logger$Z.debug('skipping_grant_no_auth', { grantType: grant.type });
15988
+ logger$_.debug('skipping_grant_no_auth', { grantType: grant.type });
16016
15989
  continue;
16017
15990
  }
16018
15991
  const tokenProviderConfig = (auth.tokenProvider ??
16019
15992
  auth.token_provider);
16020
15993
  if (!tokenProviderConfig ||
16021
15994
  typeof tokenProviderConfig.type !== 'string') {
16022
- logger$Z.debug('skipping_grant_invalid_token_provider_config', {
15995
+ logger$_.debug('skipping_grant_invalid_token_provider_config', {
16023
15996
  grantType: grant.type,
16024
15997
  config: tokenProviderConfig,
16025
15998
  });
16026
15999
  continue;
16027
16000
  }
16028
- logger$Z.debug('creating_token_provider', {
16001
+ logger$_.debug('creating_token_provider', {
16029
16002
  type: tokenProviderConfig.type,
16030
16003
  });
16031
16004
  const provider = await TokenProviderFactory.createTokenProvider(tokenProviderConfig);
16032
16005
  const isExposing = isIdentityExposingTokenProvider(provider);
16033
- logger$Z.debug('token_provider_created', {
16006
+ logger$_.debug('token_provider_created', {
16034
16007
  type: tokenProviderConfig.type,
16035
16008
  isIdentityExposing: isExposing,
16036
16009
  });
16037
16010
  if (isExposing) {
16038
16011
  const identity = await provider.getIdentity();
16039
- logger$Z.debug('retrieved_identity', { identity });
16012
+ logger$_.debug('retrieved_identity', { identity });
16040
16013
  if (identity && identity.subject) {
16041
16014
  const hashedSubject = await core.generateIdAsync({
16042
16015
  mode: 'fingerprint',
@@ -16044,7 +16017,7 @@ class TokenSubjectNodeIdentityPolicy {
16044
16017
  length: 8,
16045
16018
  });
16046
16019
  const newNodeId = `${hashedSubject}-${context.currentNodeId}`;
16047
- logger$Z.info('resolved_identity_from_token', {
16020
+ logger$_.info('resolved_identity_from_token', {
16048
16021
  subject: identity.subject,
16049
16022
  hashedSubject,
16050
16023
  newNodeId,
@@ -16052,17 +16025,17 @@ class TokenSubjectNodeIdentityPolicy {
16052
16025
  return newNodeId;
16053
16026
  }
16054
16027
  else {
16055
- logger$Z.debug('identity_missing_subject', { identity });
16028
+ logger$_.debug('identity_missing_subject', { identity });
16056
16029
  }
16057
16030
  }
16058
16031
  }
16059
16032
  catch (err) {
16060
- logger$Z.warning('failed_to_extract_identity_from_grant', { error: err });
16033
+ logger$_.warning('failed_to_extract_identity_from_grant', { error: err });
16061
16034
  }
16062
16035
  }
16063
16036
  }
16064
16037
  else {
16065
- logger$Z.debug('no_grants_available');
16038
+ logger$_.debug('no_grants_available');
16066
16039
  }
16067
16040
  return context.currentNodeId;
16068
16041
  }
@@ -16073,7 +16046,7 @@ var tokenSubjectNodeIdentityPolicy = /*#__PURE__*/Object.freeze({
16073
16046
  TokenSubjectNodeIdentityPolicy: TokenSubjectNodeIdentityPolicy
16074
16047
  });
16075
16048
 
16076
- const FACTORY_META$19 = {
16049
+ const FACTORY_META$1a = {
16077
16050
  base: NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE,
16078
16051
  key: 'TokenSubjectNodeIdentityPolicy',
16079
16052
  };
@@ -16092,27 +16065,27 @@ class TokenSubjectNodeIdentityPolicyFactory extends NodeIdentityPolicyFactory {
16092
16065
 
16093
16066
  var tokenSubjectNodeIdentityPolicyFactory = /*#__PURE__*/Object.freeze({
16094
16067
  __proto__: null,
16095
- FACTORY_META: FACTORY_META$19,
16068
+ FACTORY_META: FACTORY_META$1a,
16096
16069
  TokenSubjectNodeIdentityPolicyFactory: TokenSubjectNodeIdentityPolicyFactory,
16097
16070
  default: TokenSubjectNodeIdentityPolicyFactory
16098
16071
  });
16099
16072
 
16100
- const logger$Y = getLogger('naylence.fame.node.node_identity_policy_profile_factory');
16101
- const PROFILE_NAME_DEFAULT = 'default';
16073
+ const logger$Z = getLogger('naylence.fame.node.node_identity_policy_profile_factory');
16074
+ const PROFILE_NAME_DEFAULT$1 = 'default';
16102
16075
  const PROFILE_NAME_TOKEN_SUBJECT = 'token-subject';
16103
16076
  const PROFILE_NAME_TOKEN_SUBJECT_ALIAS = 'token_subject';
16104
- const DEFAULT_PROFILE = {
16077
+ const DEFAULT_PROFILE$1 = {
16105
16078
  type: 'DefaultNodeIdentityPolicy',
16106
16079
  };
16107
16080
  const TOKEN_SUBJECT_PROFILE = {
16108
16081
  type: 'TokenSubjectNodeIdentityPolicy',
16109
16082
  };
16110
- const PROFILE_MAP$5 = {
16111
- [PROFILE_NAME_DEFAULT]: DEFAULT_PROFILE,
16083
+ const PROFILE_MAP$6 = {
16084
+ [PROFILE_NAME_DEFAULT$1]: DEFAULT_PROFILE$1,
16112
16085
  [PROFILE_NAME_TOKEN_SUBJECT]: TOKEN_SUBJECT_PROFILE,
16113
16086
  [PROFILE_NAME_TOKEN_SUBJECT_ALIAS]: TOKEN_SUBJECT_PROFILE,
16114
16087
  };
16115
- const FACTORY_META$18 = {
16088
+ const FACTORY_META$19 = {
16116
16089
  base: NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE,
16117
16090
  key: 'NodeIdentityPolicyProfile',
16118
16091
  };
@@ -16122,17 +16095,17 @@ class NodeIdentityPolicyProfileFactory extends NodeIdentityPolicyFactory {
16122
16095
  this.type = 'NodeIdentityPolicyProfile';
16123
16096
  }
16124
16097
  async create(config) {
16125
- const normalized = normalizeConfig$w(config);
16126
- const profileConfig = resolveProfileConfig$4(normalized.profile);
16127
- logger$Y.debug('enabling_node_identity_policy_profile', {
16098
+ const normalized = normalizeConfig$x(config);
16099
+ const profileConfig = resolveProfileConfig$5(normalized.profile);
16100
+ logger$Z.debug('enabling_node_identity_policy_profile', {
16128
16101
  profile: normalized.profile,
16129
16102
  });
16130
16103
  return NodeIdentityPolicyFactory.createNodeIdentityPolicy(profileConfig);
16131
16104
  }
16132
16105
  }
16133
- function normalizeConfig$w(config) {
16106
+ function normalizeConfig$x(config) {
16134
16107
  if (!config) {
16135
- return { profile: PROFILE_NAME_DEFAULT };
16108
+ return { profile: PROFILE_NAME_DEFAULT$1 };
16136
16109
  }
16137
16110
  const candidate = config;
16138
16111
  const profileValue = typeof candidate.profile === 'string' && candidate.profile.trim().length > 0
@@ -16143,24 +16116,24 @@ function normalizeConfig$w(config) {
16143
16116
  : typeof candidate.profileName === 'string' &&
16144
16117
  candidate.profileName.trim().length > 0
16145
16118
  ? candidate.profileName
16146
- : PROFILE_NAME_DEFAULT;
16119
+ : PROFILE_NAME_DEFAULT$1;
16147
16120
  const normalizedProfile = profileValue.trim().toLowerCase();
16148
16121
  return { profile: normalizedProfile };
16149
16122
  }
16150
- function resolveProfileConfig$4(profileName) {
16151
- const profile = PROFILE_MAP$5[profileName];
16123
+ function resolveProfileConfig$5(profileName) {
16124
+ const profile = PROFILE_MAP$6[profileName];
16152
16125
  if (!profile) {
16153
16126
  throw new Error(`Unknown node identity policy profile: ${profileName}`);
16154
16127
  }
16155
- return deepClone$4(profile);
16128
+ return deepClone$5(profile);
16156
16129
  }
16157
- function deepClone$4(value) {
16130
+ function deepClone$5(value) {
16158
16131
  return JSON.parse(JSON.stringify(value));
16159
16132
  }
16160
16133
 
16161
16134
  var nodeIdentityPolicyProfileFactory = /*#__PURE__*/Object.freeze({
16162
16135
  __proto__: null,
16163
- FACTORY_META: FACTORY_META$18,
16136
+ FACTORY_META: FACTORY_META$19,
16164
16137
  NodeIdentityPolicyProfileFactory: NodeIdentityPolicyProfileFactory,
16165
16138
  default: NodeIdentityPolicyProfileFactory
16166
16139
  });
@@ -16213,8 +16186,8 @@ class DefaultConnectionRetryPolicy {
16213
16186
  }
16214
16187
  }
16215
16188
 
16216
- const logger$X = getLogger('naylence.fame.node.default-connection-retry-policy-factory');
16217
- const FACTORY_META$17 = {
16189
+ const logger$Y = getLogger('naylence.fame.node.default-connection-retry-policy-factory');
16190
+ const FACTORY_META$18 = {
16218
16191
  base: CONNECTION_RETRY_POLICY_FACTORY_BASE_TYPE,
16219
16192
  key: 'DefaultConnectionRetryPolicy',
16220
16193
  };
@@ -16235,7 +16208,7 @@ class DefaultConnectionRetryPolicyFactory extends ConnectionRetryPolicyFactory {
16235
16208
  }
16236
16209
  }
16237
16210
  const policy = new DefaultConnectionRetryPolicy(options);
16238
- logger$X.debug('connection_retry_policy_created', {
16211
+ logger$Y.debug('connection_retry_policy_created', {
16239
16212
  maxInitialAttempts: policy.maxInitialAttempts,
16240
16213
  });
16241
16214
  return policy;
@@ -16245,7 +16218,7 @@ class DefaultConnectionRetryPolicyFactory extends ConnectionRetryPolicyFactory {
16245
16218
  var defaultConnectionRetryPolicyFactory = /*#__PURE__*/Object.freeze({
16246
16219
  __proto__: null,
16247
16220
  DefaultConnectionRetryPolicyFactory: DefaultConnectionRetryPolicyFactory,
16248
- FACTORY_META: FACTORY_META$17,
16221
+ FACTORY_META: FACTORY_META$18,
16249
16222
  default: DefaultConnectionRetryPolicyFactory
16250
16223
  });
16251
16224
 
@@ -16260,7 +16233,7 @@ class LoadBalancerStickinessManagerFactory extends factory.AbstractResourceFacto
16260
16233
  }
16261
16234
  }
16262
16235
 
16263
- const logger$W = getLogger('naylence.fame.sentinel.load_balancing.composite_load_balancing_strategy');
16236
+ const logger$X = getLogger('naylence.fame.sentinel.load_balancing.composite_load_balancing_strategy');
16264
16237
  class CompositeLoadBalancingStrategy {
16265
16238
  constructor(strategies) {
16266
16239
  if (!strategies.length) {
@@ -16277,7 +16250,7 @@ class CompositeLoadBalancingStrategy {
16277
16250
  try {
16278
16251
  const result = strategy.choose(poolKey, segments, envelope);
16279
16252
  if (result !== null) {
16280
- logger$W.debug('composite_strategy_success', {
16253
+ logger$X.debug('composite_strategy_success', {
16281
16254
  envelopeId: envelope.id,
16282
16255
  poolKey,
16283
16256
  strategyIndex: index,
@@ -16288,7 +16261,7 @@ class CompositeLoadBalancingStrategy {
16288
16261
  }
16289
16262
  }
16290
16263
  catch (error) {
16291
- logger$W.warning('composite_strategy_error', {
16264
+ logger$X.warning('composite_strategy_error', {
16292
16265
  envelopeId: envelope.id,
16293
16266
  poolKey,
16294
16267
  strategyIndex: index,
@@ -16297,7 +16270,7 @@ class CompositeLoadBalancingStrategy {
16297
16270
  });
16298
16271
  }
16299
16272
  }
16300
- logger$W.debug('composite_strategy_all_failed', {
16273
+ logger$X.debug('composite_strategy_all_failed', {
16301
16274
  envelopeId: envelope.id,
16302
16275
  poolKey,
16303
16276
  strategyCount: this.strategies.length,
@@ -16306,7 +16279,7 @@ class CompositeLoadBalancingStrategy {
16306
16279
  }
16307
16280
  }
16308
16281
 
16309
- const logger$V = getLogger('naylence.fame.sentinel.load_balancing.sticky_load_balancing_strategy');
16282
+ const logger$W = getLogger('naylence.fame.sentinel.load_balancing.sticky_load_balancing_strategy');
16310
16283
  class StickyLoadBalancingStrategy {
16311
16284
  constructor(stickinessManager) {
16312
16285
  this.lastChosenReplica = null;
@@ -16321,7 +16294,7 @@ class StickyLoadBalancingStrategy {
16321
16294
  }
16322
16295
  const stickyReplica = this.stickinessManager.getStickyReplicaSegment(envelope, segments);
16323
16296
  if (stickyReplica && segments.includes(stickyReplica)) {
16324
- logger$V.debug('routing_via_stickiness', {
16297
+ logger$W.debug('routing_via_stickiness', {
16325
16298
  envelopeId: envelope.id,
16326
16299
  poolKey,
16327
16300
  replicaId: stickyReplica,
@@ -16331,7 +16304,7 @@ class StickyLoadBalancingStrategy {
16331
16304
  this.lastChosenReplica = stickyReplica;
16332
16305
  return stickyReplica;
16333
16306
  }
16334
- logger$V.debug('no_stickiness_match_fallback', {
16307
+ logger$W.debug('no_stickiness_match_fallback', {
16335
16308
  envelopeId: envelope.id,
16336
16309
  poolKey,
16337
16310
  aftPresent: Boolean(envelope.aft),
@@ -16419,7 +16392,7 @@ class RouteStoreFactory extends factory.AbstractResourceFactory {
16419
16392
  return store ?? null;
16420
16393
  }
16421
16394
  }
16422
- const FACTORY_META$16 = {
16395
+ const FACTORY_META$17 = {
16423
16396
  base: ROUTE_STORE_FACTORY_BASE_TYPE,
16424
16397
  key: 'InMemoryRouteStore',
16425
16398
  };
@@ -16437,7 +16410,7 @@ class InMemoryRouteStoreFactory extends RouteStoreFactory {
16437
16410
 
16438
16411
  var routeStoreFactory = /*#__PURE__*/Object.freeze({
16439
16412
  __proto__: null,
16440
- FACTORY_META: FACTORY_META$16,
16413
+ FACTORY_META: FACTORY_META$17,
16441
16414
  InMemoryRouteStoreFactory: InMemoryRouteStoreFactory,
16442
16415
  ROUTE_STORE_FACTORY_BASE_TYPE: ROUTE_STORE_FACTORY_BASE_TYPE,
16443
16416
  RouteStoreFactory: RouteStoreFactory,
@@ -16669,7 +16642,7 @@ function resolveRecordArray(primary, secondary) {
16669
16642
  return pickRecordArray(candidate) ?? undefined;
16670
16643
  }
16671
16644
 
16672
- const logger$U = getLogger('naylence.fame.sentinel.route_manager');
16645
+ const logger$V = getLogger('naylence.fame.sentinel.route_manager');
16673
16646
  const DEFAULT_CONNECTOR_CLEANUP_DELAY_MS$1 = 200;
16674
16647
  function normalizeRouteManagerOptions(options) {
16675
16648
  const { route_store, get_id, cleanup_delay_ms, retain_address_bindings_on_disconnect, ...rest } = options;
@@ -16753,7 +16726,7 @@ class RouteManager extends TaskSpawner {
16753
16726
  await this.safeStop(entry.connector);
16754
16727
  }
16755
16728
  catch (error) {
16756
- logger$U.debug('pending_route_stop_failed', {
16729
+ logger$V.debug('pending_route_stop_failed', {
16757
16730
  error: error instanceof Error ? error.message : String(error),
16758
16731
  });
16759
16732
  }
@@ -16776,7 +16749,7 @@ class RouteManager extends TaskSpawner {
16776
16749
  this.cancelPendingCleanup(segment);
16777
16750
  this.downstreamRoutes.set(segment, route);
16778
16751
  });
16779
- logger$U.debug('registered_downstream_route', { route: segment });
16752
+ logger$V.debug('registered_downstream_route', { route: segment });
16780
16753
  }
16781
16754
  async unregisterDownstreamRoute(segment, options) {
16782
16755
  const normalizedOptions = normalizeRouteRemovalOptions(options);
@@ -16792,7 +16765,7 @@ class RouteManager extends TaskSpawner {
16792
16765
  this.cancelPendingCleanup(segment);
16793
16766
  this._peer_routes.set(segment, route);
16794
16767
  });
16795
- logger$U.debug('registered_peer_route', { route: segment });
16768
+ logger$V.debug('registered_peer_route', { route: segment });
16796
16769
  }
16797
16770
  async unregisterPeerRoute(segment, options) {
16798
16771
  const normalizedOptions = normalizeRouteRemovalOptions(options);
@@ -16810,11 +16783,11 @@ class RouteManager extends TaskSpawner {
16810
16783
  await Promise.all(entryTuples.map(async ([segment, entry]) => {
16811
16784
  const normalized = this.normalizeEntry(entry);
16812
16785
  if (!normalized.connectorConfig) {
16813
- logger$U.warning('route_restore_missing_config', { segment });
16786
+ logger$V.warning('route_restore_missing_config', { segment });
16814
16787
  return;
16815
16788
  }
16816
16789
  if (normalized.attachExpiresAt && normalized.attachExpiresAt < now) {
16817
- logger$U.debug('skipping_expired_route', { segment });
16790
+ logger$V.debug('skipping_expired_route', { segment });
16818
16791
  return;
16819
16792
  }
16820
16793
  const authorization = this.parseAuthorization(normalized.metadata);
@@ -16847,7 +16820,7 @@ class RouteManager extends TaskSpawner {
16847
16820
  }
16848
16821
  catch (error) {
16849
16822
  if (this.isTransientError(error)) {
16850
- logger$U.warning('transient_restore_failure', {
16823
+ logger$V.warning('transient_restore_failure', {
16851
16824
  segment,
16852
16825
  attempt,
16853
16826
  error: error instanceof Error ? error.message : String(error),
@@ -16856,7 +16829,7 @@ class RouteManager extends TaskSpawner {
16856
16829
  backoff *= 2;
16857
16830
  continue;
16858
16831
  }
16859
- logger$U.error('failed_to_restore_route', {
16832
+ logger$V.error('failed_to_restore_route', {
16860
16833
  segment,
16861
16834
  error: error instanceof Error ? error.message : String(error),
16862
16835
  });
@@ -16885,13 +16858,13 @@ class RouteManager extends TaskSpawner {
16885
16858
  await this._downstream_route_store
16886
16859
  .delete(segment)
16887
16860
  .catch((error) => {
16888
- logger$U.warning('route_expiration_delete_failed', {
16861
+ logger$V.warning('route_expiration_delete_failed', {
16889
16862
  segment,
16890
16863
  error: error instanceof Error ? error.message : String(error),
16891
16864
  });
16892
16865
  });
16893
16866
  this.purgeRouteReferences(segment);
16894
- logger$U.debug('expired_route', { route: segment });
16867
+ logger$V.debug('expired_route', { route: segment });
16895
16868
  }
16896
16869
  async removeDownstreamRoute(segment, options) {
16897
16870
  const normalizedOptions = normalizeRouteRemovalOptions(options);
@@ -16949,7 +16922,7 @@ class RouteManager extends TaskSpawner {
16949
16922
  this.purgeRouteReferences(segment);
16950
16923
  }
16951
16924
  await store.delete(segment).catch((error) => {
16952
- logger$U.warning('route_delete_failed', {
16925
+ logger$V.warning('route_delete_failed', {
16953
16926
  segment,
16954
16927
  error: error instanceof Error ? error.message : String(error),
16955
16928
  });
@@ -16968,7 +16941,7 @@ class RouteManager extends TaskSpawner {
16968
16941
  caller_stack: captureStack ? captureCallerStack() : undefined,
16969
16942
  retained_addresses: retainAddresses,
16970
16943
  };
16971
- logger$U.debug('removed_route', removalMeta);
16944
+ logger$V.debug('removed_route', removalMeta);
16972
16945
  }
16973
16946
  purgeRouteReferences(segment) {
16974
16947
  for (const [address, info] of this._downstream_addresses_routes.entries()) {
@@ -17023,10 +16996,10 @@ class RouteManager extends TaskSpawner {
17023
16996
  }
17024
16997
  catch (error) {
17025
16998
  if (combined.signal.aborted) {
17026
- logger$U.debug('connector_cleanup_cancelled', { segment });
16999
+ logger$V.debug('connector_cleanup_cancelled', { segment });
17027
17000
  }
17028
17001
  else {
17029
- logger$U.debug('connector_cleanup_delay_failed', {
17002
+ logger$V.debug('connector_cleanup_delay_failed', {
17030
17003
  segment,
17031
17004
  error: error instanceof Error ? error.message : String(error),
17032
17005
  });
@@ -17049,7 +17022,7 @@ class RouteManager extends TaskSpawner {
17049
17022
  }
17050
17023
  catch (error) {
17051
17024
  if (error instanceof Error) {
17052
- logger$U.debug('connector_stop_ignored', { error: error.message });
17025
+ logger$V.debug('connector_stop_ignored', { error: error.message });
17053
17026
  }
17054
17027
  }
17055
17028
  for (const [flowId, peer] of this.flowRoutes.entries()) {
@@ -17074,12 +17047,12 @@ class RouteManager extends TaskSpawner {
17074
17047
  }
17075
17048
  }
17076
17049
  catch (error) {
17077
- logger$U.error('janitor_loop_error', {
17050
+ logger$V.error('janitor_loop_error', {
17078
17051
  error: error instanceof Error ? error.message : String(error),
17079
17052
  });
17080
17053
  }
17081
17054
  finally {
17082
- logger$U.debug('janitor_loop_exited');
17055
+ logger$V.debug('janitor_loop_exited');
17083
17056
  }
17084
17057
  }
17085
17058
  async scanStoreForExpirations(store, now, kind) {
@@ -17099,13 +17072,13 @@ class RouteManager extends TaskSpawner {
17099
17072
  }
17100
17073
  });
17101
17074
  await store.delete(segment).catch((error) => {
17102
- logger$U.warning('route_auto_expire_delete_failed', {
17075
+ logger$V.warning('route_auto_expire_delete_failed', {
17103
17076
  segment,
17104
17077
  error: error instanceof Error ? error.message : String(error),
17105
17078
  });
17106
17079
  });
17107
17080
  this.purgeRouteReferences(segment);
17108
- logger$U.debug('auto_expired_route', { segment });
17081
+ logger$V.debug('auto_expired_route', { segment });
17109
17082
  }));
17110
17083
  }
17111
17084
  parseAuthorization(metadata) {
@@ -17128,7 +17101,7 @@ class RouteManager extends TaskSpawner {
17128
17101
  return { ...base, ...extraFields };
17129
17102
  }
17130
17103
  catch (error) {
17131
- logger$U.error('corrupt_route_metadata', {
17104
+ logger$V.error('corrupt_route_metadata', {
17132
17105
  error: error instanceof Error ? error.message : String(error),
17133
17106
  });
17134
17107
  return null;
@@ -17204,12 +17177,12 @@ function captureCallerStack(skip = 3, depth = 6) {
17204
17177
  return frames.map((frame) => frame.trim()).join(' | ');
17205
17178
  }
17206
17179
 
17207
- const logger$T = getLogger('naylence.fame.sentinel.router');
17180
+ const logger$U = getLogger('naylence.fame.sentinel.router');
17208
17181
  const ZERO_EPH_PUB_BASE64 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=';
17209
17182
  class Drop {
17210
17183
  async execute(envelope, router, state, context) {
17211
17184
  await emitDeliveryNack(envelope, router, state, 'NO_ROUTE', context ?? undefined);
17212
- logger$T.debug('dropped_envelope', Object.assign(summarizeEnvelope(envelope, ''), {
17185
+ logger$U.debug('dropped_envelope', Object.assign(summarizeEnvelope(envelope, ''), {
17213
17186
  localAddresses: Array.from(state.local.values()),
17214
17187
  downstreamRoutes: Array.from(state.downstreamAddressRoutes.entries()),
17215
17188
  peerRoutes: Array.from(state.peerAddressRoutes.entries()),
@@ -17239,7 +17212,7 @@ class ForwardChild {
17239
17212
  }
17240
17213
  catch (error) {
17241
17214
  if (error instanceof FameTransportClose) {
17242
- logger$T.error('transport_closed_forward_child', {
17215
+ logger$U.error('transport_closed_forward_child', {
17243
17216
  segment: this.segment,
17244
17217
  error: error.message,
17245
17218
  });
@@ -17271,7 +17244,7 @@ class ForwardPeer {
17271
17244
  }
17272
17245
  catch (error) {
17273
17246
  if (error instanceof FameTransportClose) {
17274
- logger$T.error('transport_closed_forward_peer', {
17247
+ logger$U.error('transport_closed_forward_peer', {
17275
17248
  segment: this.segment,
17276
17249
  error: error.message,
17277
17250
  });
@@ -17306,7 +17279,7 @@ class Deny {
17306
17279
  async execute(envelope, router, state, context) {
17307
17280
  const { internalReason, deniedAction, matchedRule, context: extraContext, disclosure = 'opaque', } = this.options;
17308
17281
  // Log detailed denial internally
17309
- logger$T.warning('route_authorization_denied', {
17282
+ logger$U.warning('route_authorization_denied', {
17310
17283
  envp_id: envelope.id,
17311
17284
  frame_type: envelope.frame?.type ?? null,
17312
17285
  to: envelope.to?.toString() ?? null,
@@ -17352,7 +17325,7 @@ function mapRoutingActionToAuthorizationAction(action) {
17352
17325
  return null;
17353
17326
  }
17354
17327
  // Unknown RoutingAction: return null, caller should deny by default
17355
- logger$T.warning('unknown_routing_action_for_authorization', {
17328
+ logger$U.warning('unknown_routing_action_for_authorization', {
17356
17329
  action_type: action?.constructor?.name ?? 'unknown',
17357
17330
  });
17358
17331
  return null;
@@ -17385,7 +17358,7 @@ async function emitDeliveryNack(envelope, routingNode, state, code, context) {
17385
17358
  return;
17386
17359
  }
17387
17360
  if (!state.envelopeFactory) {
17388
- logger$T.warning('router_missing_envelope_factory', summarizeEnvelope(envelope));
17361
+ logger$U.warning('router_missing_envelope_factory', summarizeEnvelope(envelope));
17389
17362
  return;
17390
17363
  }
17391
17364
  const nackFrame = createNackFrame(envelope, code);
@@ -17416,7 +17389,7 @@ async function emitDeliveryNack(envelope, routingNode, state, code, context) {
17416
17389
  }
17417
17390
  }
17418
17391
  catch (error) {
17419
- logger$T.warning('nack_forward_failed', {
17392
+ logger$U.warning('nack_forward_failed', {
17420
17393
  error: error instanceof Error ? error.message : String(error),
17421
17394
  ...summarizeEnvelope(envelope),
17422
17395
  });
@@ -17622,7 +17595,7 @@ class HRWLoadBalancingStrategy {
17622
17595
  }
17623
17596
  }
17624
17597
 
17625
- const logger$S = getLogger('naylence.fame.sentinel.capability_aware_routing_policy');
17598
+ const logger$T = getLogger('naylence.fame.sentinel.capability_aware_routing_policy');
17626
17599
  function normalizeOptions$i(options) {
17627
17600
  if (!options || typeof options !== 'object') {
17628
17601
  return {};
@@ -17674,7 +17647,7 @@ class CapabilityAwareRoutingPolicy {
17674
17647
  if (chosenSegment) {
17675
17648
  return new ForwardChild(chosenSegment);
17676
17649
  }
17677
- logger$S.warning('capability_policy_lb_failed', {
17650
+ logger$T.warning('capability_policy_lb_failed', {
17678
17651
  segments: providerSegments,
17679
17652
  capabilities,
17680
17653
  ...summarizeEnvelope(envelope),
@@ -17703,7 +17676,7 @@ class CapabilityAwareRoutingPolicy {
17703
17676
  }
17704
17677
  }
17705
17678
  catch (error) {
17706
- logger$S.warning('capability_policy_resolve_failed', {
17679
+ logger$T.warning('capability_policy_resolve_failed', {
17707
17680
  error: error instanceof Error ? error.message : String(error),
17708
17681
  });
17709
17682
  }
@@ -17940,7 +17913,7 @@ function toFameAddress(address) {
17940
17913
  return address instanceof core.FameAddress ? address : new core.FameAddress(address);
17941
17914
  }
17942
17915
 
17943
- const logger$R = getLogger('naylence.fame.sentinel.node_attach_frame_handler');
17916
+ const logger$S = getLogger('naylence.fame.sentinel.node_attach_frame_handler');
17944
17917
  const DOWNSTREAM_ORIGINS = new Set([
17945
17918
  core.DeliveryOriginType.DOWNSTREAM,
17946
17919
  core.DeliveryOriginType.PEER,
@@ -18033,7 +18006,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18033
18006
  this.maxTtlSec = options.maxTtlSec ?? null;
18034
18007
  }
18035
18008
  async acceptNodeAttach(envelope, context) {
18036
- logger$R.debug('handling_node_attach_request');
18009
+ logger$S.debug('handling_node_attach_request');
18037
18010
  const normalizedContext = this.normalizeContext(context);
18038
18011
  const frame = this.normalizeNodeAttachFrame(envelope.frame);
18039
18012
  if (frame.type !== 'NodeAttach') {
@@ -18078,14 +18051,14 @@ class NodeAttachFrameHandler extends TaskSpawner {
18078
18051
  let isRebind = false;
18079
18052
  if (frame.originType === core.DeliveryOriginType.DOWNSTREAM) {
18080
18053
  const hasExistingRoute = this.routeManager.downstreamRoutes.has(attachedSystemId);
18081
- logger$R.debug('checking_for_existing_route', {
18054
+ logger$S.debug('checking_for_existing_route', {
18082
18055
  system_id: attachedSystemId,
18083
18056
  has_existing: hasExistingRoute,
18084
18057
  existing_routes: Array.from(this.routeManager.downstreamRoutes.keys()),
18085
18058
  });
18086
18059
  if (hasExistingRoute) {
18087
18060
  isRebind = true;
18088
- logger$R.warning('rebinding_existing_downstream_route', {
18061
+ logger$S.warning('rebinding_existing_downstream_route', {
18089
18062
  system_id: attachedSystemId,
18090
18063
  });
18091
18064
  oldAssignedPath = buildAssignedPath$1(this.routingNode.physicalPath, attachedSystemId);
@@ -18104,7 +18077,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18104
18077
  meta: { systemId: attachedSystemId },
18105
18078
  })
18106
18079
  .catch((error) => {
18107
- logger$R.warning('failed_to_unregister_downstream_route_before_rebind', {
18080
+ logger$S.warning('failed_to_unregister_downstream_route_before_rebind', {
18108
18081
  system_id: attachedSystemId,
18109
18082
  error: error instanceof Error ? error.message : String(error),
18110
18083
  });
@@ -18121,7 +18094,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18121
18094
  for (const address of orphanedAddresses) {
18122
18095
  encryptionMgr.clearChannelCacheForDestination(address);
18123
18096
  }
18124
- logger$R.debug('cleared_channel_cache_for_rebind', {
18097
+ logger$S.debug('cleared_channel_cache_for_rebind', {
18125
18098
  system_id: attachedSystemId,
18126
18099
  addresses: orphanedAddresses,
18127
18100
  });
@@ -18133,7 +18106,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18133
18106
  encryptionMgr.removeChannelsForDestination(address);
18134
18107
  }
18135
18108
  if (totalRemoved > 0) {
18136
- logger$R.debug('removed_channel_states_for_rebind', {
18109
+ logger$S.debug('removed_channel_states_for_rebind', {
18137
18110
  system_id: attachedSystemId,
18138
18111
  channels_removed: totalRemoved,
18139
18112
  });
@@ -18141,7 +18114,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18141
18114
  }
18142
18115
  }
18143
18116
  catch (error) {
18144
- logger$R.warning('failed_to_cleanup_channels_for_rebind', {
18117
+ logger$S.warning('failed_to_cleanup_channels_for_rebind', {
18145
18118
  system_id: attachedSystemId,
18146
18119
  error: error instanceof Error ? error.message : String(error),
18147
18120
  });
@@ -18164,7 +18137,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18164
18137
  meta: { systemId: attachedSystemId },
18165
18138
  })
18166
18139
  .catch((error) => {
18167
- logger$R.warning('failed_to_unregister_peer_route_before_rebind', {
18140
+ logger$S.warning('failed_to_unregister_peer_route_before_rebind', {
18168
18141
  system_id: attachedSystemId,
18169
18142
  error: error instanceof Error ? error.message : String(error),
18170
18143
  });
@@ -18202,7 +18175,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18202
18175
  ? { stickiness: negotiatedStickiness }
18203
18176
  : {}),
18204
18177
  });
18205
- logger$R.debug('sending_node_attach_ack', {
18178
+ logger$S.debug('sending_node_attach_ack', {
18206
18179
  env_id: ackEnvelope.id ?? 'unknown',
18207
18180
  });
18208
18181
  await this.sendAndNotify(connector, ackEnvelope, attachedSystemId, normalizedContext);
@@ -18249,7 +18222,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18249
18222
  return this.stickinessManager.negotiate(stickiness);
18250
18223
  }
18251
18224
  catch (error) {
18252
- logger$R.debug('stickiness_negotiate_skipped', {
18225
+ logger$S.debug('stickiness_negotiate_skipped', {
18253
18226
  error: error instanceof Error ? error.message : String(error),
18254
18227
  });
18255
18228
  return null;
@@ -18265,13 +18238,13 @@ class NodeAttachFrameHandler extends TaskSpawner {
18265
18238
  }
18266
18239
  if (!attachExpiresAt || earliestKeyExpiry < attachExpiresAt) {
18267
18240
  if (attachExpiresAt) {
18268
- logger$R.warning('attachment_ttl_limited_by_key_expiry', {
18241
+ logger$S.warning('attachment_ttl_limited_by_key_expiry', {
18269
18242
  limited_attach_expires_at: earliestKeyExpiry.toISOString(),
18270
18243
  original_attach_expires_at: attachExpiresAt.toISOString(),
18271
18244
  });
18272
18245
  }
18273
18246
  else {
18274
- logger$R.debug('attachment_ttl_set_by_key_expiry', {
18247
+ logger$S.debug('attachment_ttl_set_by_key_expiry', {
18275
18248
  attach_expires_at: earliestKeyExpiry.toISOString(),
18276
18249
  reason: 'no_max_ttl_configured',
18277
18250
  });
@@ -18282,7 +18255,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18282
18255
  }
18283
18256
  async validateAttachmentKeys(frame, envelope, connector, context, systemId) {
18284
18257
  if (!this.attachmentKeyValidator) {
18285
- logger$R.debug('child_key_validation_skipped', {
18258
+ logger$S.debug('child_key_validation_skipped', {
18286
18259
  child_id: systemId,
18287
18260
  reason: 'no_validator',
18288
18261
  });
@@ -18298,7 +18271,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18298
18271
  }
18299
18272
  }
18300
18273
  if (keyInfos.length > 0) {
18301
- logger$R.debug('node_attach_key_validation_passed', {
18274
+ logger$S.debug('node_attach_key_validation_passed', {
18302
18275
  system_id: systemId,
18303
18276
  instance_id: frame.instanceId,
18304
18277
  correlation_id: envelope.corrId,
@@ -18318,13 +18291,13 @@ class NodeAttachFrameHandler extends TaskSpawner {
18318
18291
  reason: `Certificate validation failed: ${error.message}`,
18319
18292
  });
18320
18293
  await this.sendAndNotify(connector, rejectionAck, systemId, context).catch((sendError) => {
18321
- logger$R.error('failed_sending_negative_attach_ack', {
18294
+ logger$S.error('failed_sending_negative_attach_ack', {
18322
18295
  error: sendError instanceof Error
18323
18296
  ? sendError.message
18324
18297
  : String(sendError),
18325
18298
  });
18326
18299
  });
18327
- logger$R.error('node_attach_key_validation_failed', {
18300
+ logger$S.error('node_attach_key_validation_failed', {
18328
18301
  system_id: systemId,
18329
18302
  instance_id: frame.instanceId,
18330
18303
  correlation_id: envelope.corrId,
@@ -18390,10 +18363,10 @@ class NodeAttachFrameHandler extends TaskSpawner {
18390
18363
  try {
18391
18364
  await delay(delaySeconds * 1000);
18392
18365
  await connector.close(1008, 'attach-unauthorized');
18393
- logger$R.debug('closed_unauthorized_connection');
18366
+ logger$S.debug('closed_unauthorized_connection');
18394
18367
  }
18395
18368
  catch (error) {
18396
- logger$R.error('failed_to_close_unauthorized_connection', {
18369
+ logger$S.error('failed_to_close_unauthorized_connection', {
18397
18370
  error: error instanceof Error ? error.message : String(error),
18398
18371
  });
18399
18372
  }
@@ -18506,7 +18479,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
18506
18479
  }
18507
18480
  }
18508
18481
 
18509
- const logger$Q = getLogger('naylence.fame.sentinel.address_bind_frame_handler');
18482
+ const logger$R = getLogger('naylence.fame.sentinel.address_bind_frame_handler');
18510
18483
  const RESERVED_ADDRESS_NAMES = new Set(['__sys__', '__rpc__']);
18511
18484
  function pickManagerField(manager, keys) {
18512
18485
  const record = manager;
@@ -18830,7 +18803,7 @@ class AddressBindFrameHandler {
18830
18803
  if (this.routingNode.forwardToPeers) {
18831
18804
  await this.routingNode.forwardToPeers(envelope, undefined, [sourceSystemId], context);
18832
18805
  }
18833
- logger$Q.debug('address_bound', {
18806
+ logger$R.debug('address_bound', {
18834
18807
  address: addressStr,
18835
18808
  segment: sourceSystemId,
18836
18809
  });
@@ -18928,7 +18901,7 @@ class AddressBindFrameHandler {
18928
18901
  }
18929
18902
  await this.routingNode.forwardToRoute(sourceSystemId, ackEnvelope, ackContext);
18930
18903
  }
18931
- logger$Q.debug('address_unbound', {
18904
+ logger$R.debug('address_unbound', {
18932
18905
  address: addressStr,
18933
18906
  segment: sourceSystemId,
18934
18907
  });
@@ -18946,7 +18919,7 @@ class AddressBindFrameHandler {
18946
18919
  }
18947
18920
  }
18948
18921
 
18949
- const logger$P = getLogger('naylence.fame.sentinel.node_heartbeat_frame_handler');
18922
+ const logger$Q = getLogger('naylence.fame.sentinel.node_heartbeat_frame_handler');
18950
18923
  function normalizeOptions$h(options) {
18951
18924
  if (!options || typeof options !== 'object') {
18952
18925
  throw new Error('NodeHeartbeatFrameHandler requires a routingNode option');
@@ -18983,7 +18956,7 @@ class NodeHeartbeatFrameHandler {
18983
18956
  if (!frame || frame.type !== 'NodeHeartbeat') {
18984
18957
  throw new Error(`Invalid envelope frame. Expected: NodeHeartbeatFrame, actual: ${frame?.type ?? 'unknown'}`);
18985
18958
  }
18986
- logger$P.trace('handling_heartbeat', {
18959
+ logger$Q.trace('handling_heartbeat', {
18987
18960
  hb_system_id: frame.systemId ?? 'unknown',
18988
18961
  hb_env_id: envelope.id ?? 'unknown',
18989
18962
  hb_corr_id: envelope.corrId ?? 'unknown',
@@ -19011,7 +18984,7 @@ class NodeHeartbeatFrameHandler {
19011
18984
  ...(envelope.corrId ? { corrId: envelope.corrId } : {}),
19012
18985
  ...(envelope.traceId ? { traceId: envelope.traceId } : {}),
19013
18986
  });
19014
- logger$P.debug('sending_heartbeat_ack', {
18987
+ logger$Q.debug('sending_heartbeat_ack', {
19015
18988
  hb_ack_env_id: ackEnvelope.id ?? 'unknown',
19016
18989
  hb_ack_corr_id: ackEnvelope.corrId ?? 'unknown',
19017
18990
  });
@@ -19039,7 +19012,7 @@ class NodeHeartbeatFrameHandler {
19039
19012
  }
19040
19013
  }
19041
19014
 
19042
- const logger$O = getLogger('naylence.fame.sentinel.capability_frame_handler');
19015
+ const logger$P = getLogger('naylence.fame.sentinel.capability_frame_handler');
19043
19016
  class CapabilityFrameHandler {
19044
19017
  constructor(options) {
19045
19018
  this.capabilityRoutes = new Map();
@@ -19066,7 +19039,7 @@ class CapabilityFrameHandler {
19066
19039
  const segment = this.getSourceSystemId(context);
19067
19040
  const downstreamRoutes = getDownstreamRoutes(this.routeManager);
19068
19041
  if (!segment || !hasRoute(downstreamRoutes, segment)) {
19069
- logger$O.debug('capability_advertise_unknown_segment', { segment });
19042
+ logger$P.debug('capability_advertise_unknown_segment', { segment });
19070
19043
  return;
19071
19044
  }
19072
19045
  const addressKey = this.normalizeAddress(frame.address);
@@ -19099,7 +19072,7 @@ class CapabilityFrameHandler {
19099
19072
  }
19100
19073
  const segment = this.getSourceSystemId(context);
19101
19074
  if (!segment) {
19102
- logger$O.debug('capability_withdraw_missing_segment');
19075
+ logger$P.debug('capability_withdraw_missing_segment');
19103
19076
  return;
19104
19077
  }
19105
19078
  const addressKey = this.normalizeAddress(frame.address);
@@ -19153,7 +19126,7 @@ class CapabilityFrameHandler {
19153
19126
  async forwardAckToSegment(segment, ackFrame, originalEnvelope, ackContext) {
19154
19127
  const envelopeFactory = this.routingNode.envelopeFactory;
19155
19128
  if (!envelopeFactory) {
19156
- logger$O.warning('missing_envelope_factory_for_capability_ack');
19129
+ logger$P.warning('missing_envelope_factory_for_capability_ack');
19157
19130
  return;
19158
19131
  }
19159
19132
  const ackEnvelope = envelopeFactory.createEnvelope({
@@ -19216,7 +19189,7 @@ function getStickySid(context) {
19216
19189
  return typed.stickySid ?? typed.sticky_sid ?? undefined;
19217
19190
  }
19218
19191
 
19219
- const logger$N = getLogger('naylence.fame.sentinel.credit_update_frame_handler');
19192
+ const logger$O = getLogger('naylence.fame.sentinel.credit_update_frame_handler');
19220
19193
  function normalizeOptions$g(options) {
19221
19194
  if (!options || typeof options !== 'object') {
19222
19195
  throw new Error('CreditUpdateFrameHandler requires a routeManager option');
@@ -19236,12 +19209,12 @@ class CreditUpdateFrameHandler {
19236
19209
  async acceptCreditUpdate(envelope, context) {
19237
19210
  const flowId = envelope.flowId;
19238
19211
  if (!flowId) {
19239
- logger$N.warning('credit_update_missing_flow_id');
19212
+ logger$O.warning('credit_update_missing_flow_id');
19240
19213
  return;
19241
19214
  }
19242
19215
  const targetConnector = this.routeManager.getFlowRoute(flowId);
19243
19216
  if (!targetConnector) {
19244
- logger$N.warning('credit_update_unknown_flow', { flowId });
19217
+ logger$O.warning('credit_update_unknown_flow', { flowId });
19245
19218
  return;
19246
19219
  }
19247
19220
  if (context?.fromConnector && context.fromConnector === targetConnector) {
@@ -19251,7 +19224,7 @@ class CreditUpdateFrameHandler {
19251
19224
  }
19252
19225
  }
19253
19226
 
19254
- const logger$M = getLogger('naylence.fame.sentinel.sentinel');
19227
+ const logger$N = getLogger('naylence.fame.sentinel.sentinel');
19255
19228
  const ALLOWED_BEFORE_ATTACH = new Set(['NodeAttach']);
19256
19229
  const SYSTEM_INBOX = '__sys__';
19257
19230
  const RESERVED_UPSTREAM_ADDRESS_NAMES = new Set(['__sys__', '__rpc__']);
@@ -19345,7 +19318,7 @@ class Sentinel extends FameNode {
19345
19318
  routeStore = createPersistentRouteStore(this.storageProvider);
19346
19319
  }
19347
19320
  catch (error) {
19348
- logger$M.warning('persistent_route_store_unavailable', {
19321
+ logger$N.warning('persistent_route_store_unavailable', {
19349
19322
  error: error instanceof Error ? error.message : String(error),
19350
19323
  });
19351
19324
  routeStore = getDefaultRouteStore();
@@ -19427,7 +19400,7 @@ class Sentinel extends FameNode {
19427
19400
  bumpRoutingEpoch() {
19428
19401
  const previousEpoch = this.routingEpochValue;
19429
19402
  this.routingEpochValue = core.generateId();
19430
- logger$M.debug('routing_epoch_bumped', {
19403
+ logger$N.debug('routing_epoch_bumped', {
19431
19404
  previous_epoch: previousEpoch,
19432
19405
  new_epoch: this.routingEpochValue,
19433
19406
  });
@@ -19518,7 +19491,7 @@ class Sentinel extends FameNode {
19518
19491
  }
19519
19492
  async forwardToRoute(nextSegment, envelope, context) {
19520
19493
  if (this.originMatches(context, nextSegment, core.DeliveryOriginType.DOWNSTREAM)) {
19521
- logger$M.debug('downstream_loop_detected', {
19494
+ logger$N.debug('downstream_loop_detected', {
19522
19495
  envp_id: envelope.id,
19523
19496
  segment: nextSegment,
19524
19497
  });
@@ -19531,14 +19504,14 @@ class Sentinel extends FameNode {
19531
19504
  }
19532
19505
  const connector = this.routeManager.downstreamRoutes.get(nextSegment);
19533
19506
  if (!connector) {
19534
- logger$M.warning('no_route_for_child_segment', { segment: nextSegment });
19507
+ logger$N.warning('no_route_for_child_segment', { segment: nextSegment });
19535
19508
  await this.emitDeliveryNack(processed, {
19536
19509
  code: 'CHILD_UNREACHABLE',
19537
19510
  context: context ?? null,
19538
19511
  });
19539
19512
  return;
19540
19513
  }
19541
- logger$M.debug('forwarding_downstream', {
19514
+ logger$N.debug('forwarding_downstream', {
19542
19515
  ...summarizeEnvelope(processed, ''),
19543
19516
  route: nextSegment,
19544
19517
  });
@@ -19555,7 +19528,7 @@ class Sentinel extends FameNode {
19555
19528
  }
19556
19529
  async forwardToPeer(peerSegment, envelope, context) {
19557
19530
  if (this.originMatches(context, peerSegment, core.DeliveryOriginType.PEER)) {
19558
- logger$M.debug('peer_loop_detected', {
19531
+ logger$N.debug('peer_loop_detected', {
19559
19532
  envp_id: envelope.id,
19560
19533
  segment: peerSegment,
19561
19534
  });
@@ -19566,7 +19539,7 @@ class Sentinel extends FameNode {
19566
19539
  }
19567
19540
  const connector = this.routeManager._peer_routes.get(peerSegment);
19568
19541
  if (!connector) {
19569
- logger$M.warning('no_route_for_peer_segment', {
19542
+ logger$N.warning('no_route_for_peer_segment', {
19570
19543
  peer_segment: peerSegment,
19571
19544
  });
19572
19545
  await this.emitDeliveryNack(processed, {
@@ -19609,7 +19582,7 @@ class Sentinel extends FameNode {
19609
19582
  }
19610
19583
  async forwardUpstream(envelope, context) {
19611
19584
  if (context?.originType === core.DeliveryOriginType.UPSTREAM) {
19612
- logger$M.debug('skipping_forward_upstream', {
19585
+ logger$N.debug('skipping_forward_upstream', {
19613
19586
  envp_id: envelope.id,
19614
19587
  origin_type: context.originType,
19615
19588
  });
@@ -19729,7 +19702,7 @@ class Sentinel extends FameNode {
19729
19702
  }
19730
19703
  catch (error) {
19731
19704
  if (!combined.signal.aborted) {
19732
- logger$M.debug('attach_timeout_delay_failed', {
19705
+ logger$N.debug('attach_timeout_delay_failed', {
19733
19706
  system_id: systemId,
19734
19707
  error: error instanceof Error ? error.message : String(error),
19735
19708
  });
@@ -19756,12 +19729,12 @@ class Sentinel extends FameNode {
19756
19729
  await connector.stop();
19757
19730
  }
19758
19731
  catch (error) {
19759
- logger$M.debug('attach_timeout_stop_failed', {
19732
+ logger$N.debug('attach_timeout_stop_failed', {
19760
19733
  system_id: systemId,
19761
19734
  error: error instanceof Error ? error.message : String(error),
19762
19735
  });
19763
19736
  }
19764
- logger$M.warning('attach_timeout_expired', {
19737
+ logger$N.warning('attach_timeout_expired', {
19765
19738
  system_id: systemId,
19766
19739
  timeout_ms: timeoutMs,
19767
19740
  });
@@ -19815,7 +19788,7 @@ class Sentinel extends FameNode {
19815
19788
  return new core.FameAddress(addressKey);
19816
19789
  }
19817
19790
  catch (error) {
19818
- logger$M.debug('invalid_capability_address', {
19791
+ logger$N.debug('invalid_capability_address', {
19819
19792
  capability,
19820
19793
  address: addressKey,
19821
19794
  error: error instanceof Error ? error.message : String(error),
@@ -19971,7 +19944,7 @@ class Sentinel extends FameNode {
19971
19944
  }
19972
19945
  async propagateAddressBindingsUpstream() {
19973
19946
  if (!this.hasParent) {
19974
- logger$M.warning('No upstream defined to rebind addresses');
19947
+ logger$N.warning('No upstream defined to rebind addresses');
19975
19948
  return;
19976
19949
  }
19977
19950
  const entries = Array.from(this.routeManager._downstream_addresses_routes.entries());
@@ -19994,7 +19967,7 @@ class Sentinel extends FameNode {
19994
19967
  await this.bindAddressUpstream(new core.FameAddress(address), info);
19995
19968
  }
19996
19969
  catch (error) {
19997
- logger$M.error('rebind_failed', {
19970
+ logger$N.error('rebind_failed', {
19998
19971
  address,
19999
19972
  error: error instanceof Error ? error.message : String(error),
20000
19973
  });
@@ -20092,7 +20065,7 @@ class Sentinel extends FameNode {
20092
20065
  }
20093
20066
  catch (error) {
20094
20067
  // Hook threw => treat as denial, execute Drop
20095
- logger$M.warning('routing_action_hook_error', {
20068
+ logger$N.warning('routing_action_hook_error', {
20096
20069
  envp_id: envelope.id,
20097
20070
  error: error instanceof Error ? error.message : String(error),
20098
20071
  });
@@ -20116,7 +20089,7 @@ class Sentinel extends FameNode {
20116
20089
  }
20117
20090
  const abortSignal = signal ?? null;
20118
20091
  if (abortSignal?.aborted) {
20119
- logger$M.info('shutdown_signal_received', { signal: 'abort' });
20092
+ logger$N.info('shutdown_signal_received', { signal: 'abort' });
20120
20093
  return;
20121
20094
  }
20122
20095
  // Build fabric options, preferring rootConfig if provided
@@ -20132,7 +20105,7 @@ class Sentinel extends FameNode {
20132
20105
  if (node !== null) {
20133
20106
  fabricCreateOptions.node = node;
20134
20107
  }
20135
- logger$M.debug('fabric_create_options', {
20108
+ logger$N.debug('fabric_create_options', {
20136
20109
  hasRootConfig: 'rootConfig' in fabricCreateOptions,
20137
20110
  hasNode: 'node' in fabricCreateOptions,
20138
20111
  rootConfigKeys: fabricCreateOptions.rootConfig
@@ -20165,7 +20138,7 @@ class Sentinel extends FameNode {
20165
20138
  const registerSignalListeners = () => {
20166
20139
  for (const sig of signals) {
20167
20140
  const listener = () => {
20168
- logger$M.info('shutdown_signal_received', { signal: sig });
20141
+ logger$N.info('shutdown_signal_received', { signal: sig });
20169
20142
  cleanupListeners();
20170
20143
  stopResolve();
20171
20144
  };
@@ -20174,7 +20147,7 @@ class Sentinel extends FameNode {
20174
20147
  }
20175
20148
  if (abortSignal) {
20176
20149
  abortListener = () => {
20177
- logger$M.info('shutdown_signal_received', { signal: 'abort' });
20150
+ logger$N.info('shutdown_signal_received', { signal: 'abort' });
20178
20151
  cleanupListeners();
20179
20152
  stopResolve();
20180
20153
  };
@@ -20187,12 +20160,12 @@ class Sentinel extends FameNode {
20187
20160
  await providedFabric.enter();
20188
20161
  try {
20189
20162
  registerSignalListeners();
20190
- logger$M.info('sentinel_live', {
20163
+ logger$N.info('sentinel_live', {
20191
20164
  message: 'Node is live! Press Ctrl+C to stop.',
20192
20165
  });
20193
20166
  try {
20194
20167
  await stopPromise;
20195
- logger$M.info('sentinel_shutdown_begin');
20168
+ logger$N.info('sentinel_shutdown_begin');
20196
20169
  }
20197
20170
  finally {
20198
20171
  cleanupListeners();
@@ -20206,19 +20179,19 @@ class Sentinel extends FameNode {
20206
20179
  // Use withFabric pattern for automatic lifecycle management
20207
20180
  await core.withFabric(fabricCreateOptions, async () => {
20208
20181
  registerSignalListeners();
20209
- logger$M.info('sentinel_live', {
20182
+ logger$N.info('sentinel_live', {
20210
20183
  message: 'Node is live! Press Ctrl+C to stop.',
20211
20184
  });
20212
20185
  try {
20213
20186
  await stopPromise;
20214
- logger$M.info('sentinel_shutdown_begin');
20187
+ logger$N.info('sentinel_shutdown_begin');
20215
20188
  }
20216
20189
  finally {
20217
20190
  cleanupListeners();
20218
20191
  }
20219
20192
  });
20220
20193
  }
20221
- logger$M.info('sentinel_shutdown_complete');
20194
+ logger$N.info('sentinel_shutdown_complete');
20222
20195
  }
20223
20196
  }
20224
20197
  function normalizeServeLogLevel(level) {
@@ -20363,7 +20336,7 @@ function isPlainRecord(value) {
20363
20336
  return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
20364
20337
  }
20365
20338
 
20366
- const FACTORY_META$15 = {
20339
+ const FACTORY_META$16 = {
20367
20340
  base: NODE_LIKE_FACTORY_BASE_TYPE,
20368
20341
  key: 'Sentinel',
20369
20342
  };
@@ -20547,7 +20520,7 @@ class SentinelFactory extends NodeLikeFactory {
20547
20520
 
20548
20521
  var sentinelFactory = /*#__PURE__*/Object.freeze({
20549
20522
  __proto__: null,
20550
- FACTORY_META: FACTORY_META$15,
20523
+ FACTORY_META: FACTORY_META$16,
20551
20524
  SentinelFactory: SentinelFactory,
20552
20525
  default: SentinelFactory
20553
20526
  });
@@ -20591,7 +20564,7 @@ function createConnectorConfig(config) {
20591
20564
  * A transport adapter that works with both Node.js and browser WebSocket APIs.
20592
20565
  * Supports both native WebSocket clients and server-side WebSocket connections.
20593
20566
  */
20594
- const logger$L = getLogger('naylence.fame.connector.websocket_connector');
20567
+ const logger$M = getLogger('naylence.fame.connector.websocket_connector');
20595
20568
  /**
20596
20569
  * WebSocket state constants (mirrors standard WebSocket states)
20597
20570
  */
@@ -20632,7 +20605,7 @@ class WebSocketConnector extends BaseAsyncConnector {
20632
20605
  websocket.send_bytes &&
20633
20606
  typeof websocket.receive_bytes === 'function' &&
20634
20607
  typeof websocket.send_bytes === 'function');
20635
- logger$L.debug('websocket_connector_created', {
20608
+ logger$M.debug('websocket_connector_created', {
20636
20609
  is_fastapi_like: this._isFastApiLike,
20637
20610
  ready_state: websocket.readyState,
20638
20611
  url: websocket.url,
@@ -20647,7 +20620,7 @@ class WebSocketConnector extends BaseAsyncConnector {
20647
20620
  socketAny.binaryType = 'arraybuffer';
20648
20621
  }
20649
20622
  catch (error) {
20650
- logger$L.debug('websocket_set_binary_type_failed', {
20623
+ logger$M.debug('websocket_set_binary_type_failed', {
20651
20624
  error: error instanceof Error ? error.message : String(error),
20652
20625
  current_type: socketAny.binaryType,
20653
20626
  });
@@ -20703,7 +20676,7 @@ class WebSocketConnector extends BaseAsyncConnector {
20703
20676
  else {
20704
20677
  this._receiveQueue.push(data);
20705
20678
  }
20706
- logger$L.debug('websocket_message_pushed_to_queue', {
20679
+ logger$M.debug('websocket_message_pushed_to_queue', {
20707
20680
  queueLength: this._receiveQueue.length,
20708
20681
  waitersLength: this._receiveWaiters.length,
20709
20682
  });
@@ -20756,7 +20729,7 @@ class WebSocketConnector extends BaseAsyncConnector {
20756
20729
  const result = receiveMethod.call(this._websocket);
20757
20730
  // Ensure we have a Promise
20758
20731
  if (!result || typeof result.then !== 'function') {
20759
- logger$L.error('fastapi_receive_not_awaitable', {
20732
+ logger$M.error('fastapi_receive_not_awaitable', {
20760
20733
  result_type: typeof result,
20761
20734
  result_str: String(result).substring(0, 100),
20762
20735
  });
@@ -20772,7 +20745,7 @@ class WebSocketConnector extends BaseAsyncConnector {
20772
20745
  }
20773
20746
  // Handle known WebSocket shutdown race condition
20774
20747
  if (this._isAwaitFutureError(error)) {
20775
- logger$L.debug('websocket_shutdown_race_condition_handled', {
20748
+ logger$M.debug('websocket_shutdown_race_condition_handled', {
20776
20749
  note: 'Normal WebSocket close timing - converting to cancellation',
20777
20750
  websocket_state: this._websocket.client_state || 'unknown',
20778
20751
  });
@@ -20815,7 +20788,7 @@ class WebSocketConnector extends BaseAsyncConnector {
20815
20788
  }
20816
20789
  catch (error) {
20817
20790
  if (this._isAwaitFutureError(error)) {
20818
- logger$L.debug('websocket_shutdown_race_condition_detected', {
20791
+ logger$M.debug('websocket_shutdown_race_condition_detected', {
20819
20792
  websocket_type: this._websocket.constructor.name,
20820
20793
  is_fastapi: this._isFastApiLike,
20821
20794
  note: 'Normal WebSocket close timing during shutdown',
@@ -20861,12 +20834,12 @@ class WebSocketConnector extends BaseAsyncConnector {
20861
20834
  if (socketAny.readyState !== WebSocketState.CLOSED) {
20862
20835
  try {
20863
20836
  socketAny.terminate();
20864
- logger$L.debug('websocket_force_terminated', {
20837
+ logger$M.debug('websocket_force_terminated', {
20865
20838
  ready_state: socketAny.readyState,
20866
20839
  });
20867
20840
  }
20868
20841
  catch (error) {
20869
- logger$L.debug('websocket_force_terminate_failed', {
20842
+ logger$M.debug('websocket_force_terminate_failed', {
20870
20843
  error: error instanceof Error ? error.message : String(error),
20871
20844
  });
20872
20845
  }
@@ -20877,7 +20850,7 @@ class WebSocketConnector extends BaseAsyncConnector {
20877
20850
  }
20878
20851
  }
20879
20852
  catch (error) {
20880
- logger$L.error('websocket_close_failed', {
20853
+ logger$M.error('websocket_close_failed', {
20881
20854
  error: error instanceof Error ? error.message : String(error),
20882
20855
  });
20883
20856
  // Don't re-throw - close errors are not critical during shutdown
@@ -21098,7 +21071,7 @@ class WebSocketConnector extends BaseAsyncConnector {
21098
21071
  this._removeReceiveHandlers();
21099
21072
  }
21100
21073
  catch (error) {
21101
- logger$L.debug('websocket_remove_handlers_failed', {
21074
+ logger$M.debug('websocket_remove_handlers_failed', {
21102
21075
  error: error instanceof Error ? error.message : String(error),
21103
21076
  });
21104
21077
  }
@@ -21150,7 +21123,7 @@ class WebSocketConnector extends BaseAsyncConnector {
21150
21123
  * Browser-local connector that routes binary frames between peers via an in-page EventTarget.
21151
21124
  * Relies on BaseAsyncConnector for flow control and shutdown behavior.
21152
21125
  */
21153
- const logger$K = getLogger('naylence.fame.connector.inpage_connector');
21126
+ const logger$L = getLogger('naylence.fame.connector.inpage_connector');
21154
21127
  const INPAGE_CONNECTOR_TYPE = 'inpage-connector';
21155
21128
  const DEFAULT_CHANNEL$6 = 'naylence-fabric';
21156
21129
  const DEFAULT_INBOX_CAPACITY$6 = 2048;
@@ -21248,7 +21221,7 @@ class InPageConnector extends BaseAsyncConnector {
21248
21221
  }
21249
21222
  this.localNodeId = normalizedLocalNodeId;
21250
21223
  this.targetNodeId = InPageConnector.normalizeTargetNodeId(config.initialTargetNodeId);
21251
- logger$K.debug('inpage_connector_initialized', {
21224
+ logger$L.debug('inpage_connector_initialized', {
21252
21225
  channel: this.channelName,
21253
21226
  connector_id: this.connectorId,
21254
21227
  local_node_id: this.localNodeId,
@@ -21257,7 +21230,7 @@ class InPageConnector extends BaseAsyncConnector {
21257
21230
  });
21258
21231
  this.onMsg = (event) => {
21259
21232
  if (!this.listenerRegistered) {
21260
- logger$K.warning('inpage_message_after_unregister', {
21233
+ logger$L.warning('inpage_message_after_unregister', {
21261
21234
  channel: this.channelName,
21262
21235
  connector_id: this.connectorId,
21263
21236
  timestamp: new Date().toISOString(),
@@ -21266,7 +21239,7 @@ class InPageConnector extends BaseAsyncConnector {
21266
21239
  }
21267
21240
  const messageEvent = event;
21268
21241
  const message = messageEvent.data;
21269
- logger$K.debug('inpage_raw_event', {
21242
+ logger$L.debug('inpage_raw_event', {
21270
21243
  channel: this.channelName,
21271
21244
  connector_id: this.connectorId,
21272
21245
  message_type: message && typeof message === 'object'
@@ -21286,7 +21259,7 @@ class InPageConnector extends BaseAsyncConnector {
21286
21259
  : null;
21287
21260
  const senderNodeId = InPageConnector.normalizeNodeId(busMessage.senderNodeId);
21288
21261
  if (!senderId || !senderNodeId) {
21289
- logger$K.debug('inpage_message_rejected', {
21262
+ logger$L.debug('inpage_message_rejected', {
21290
21263
  channel: this.channelName,
21291
21264
  connector_id: this.connectorId,
21292
21265
  reason: 'missing_sender_metadata',
@@ -21294,7 +21267,7 @@ class InPageConnector extends BaseAsyncConnector {
21294
21267
  return;
21295
21268
  }
21296
21269
  if (senderId === this.connectorId || senderNodeId === this.localNodeId) {
21297
- logger$K.debug('inpage_message_rejected', {
21270
+ logger$L.debug('inpage_message_rejected', {
21298
21271
  channel: this.channelName,
21299
21272
  connector_id: this.connectorId,
21300
21273
  reason: 'self_echo',
@@ -21308,14 +21281,14 @@ class InPageConnector extends BaseAsyncConnector {
21308
21281
  }
21309
21282
  const payload = InPageConnector.coercePayload(busMessage.payload);
21310
21283
  if (!payload) {
21311
- logger$K.debug('inpage_payload_rejected', {
21284
+ logger$L.debug('inpage_payload_rejected', {
21312
21285
  channel: this.channelName,
21313
21286
  connector_id: this.connectorId,
21314
21287
  reason: 'unrecognized_payload_type',
21315
21288
  });
21316
21289
  return;
21317
21290
  }
21318
- logger$K.debug('inpage_message_received', {
21291
+ logger$L.debug('inpage_message_received', {
21319
21292
  channel: this.channelName,
21320
21293
  sender_id: senderId,
21321
21294
  sender_node_id: senderNodeId,
@@ -21344,14 +21317,14 @@ class InPageConnector extends BaseAsyncConnector {
21344
21317
  }
21345
21318
  catch (error) {
21346
21319
  if (error instanceof QueueFullError) {
21347
- logger$K.warning('inpage_receive_queue_full', {
21320
+ logger$L.warning('inpage_receive_queue_full', {
21348
21321
  channel: this.channelName,
21349
21322
  inbox_capacity: this.inboxCapacity,
21350
21323
  inbox_remaining_capacity: this.inbox.remainingCapacity,
21351
21324
  });
21352
21325
  }
21353
21326
  else {
21354
- logger$K.error('inpage_receive_error', {
21327
+ logger$L.error('inpage_receive_error', {
21355
21328
  channel: this.channelName,
21356
21329
  error: error instanceof Error ? error.message : String(error),
21357
21330
  });
@@ -21363,7 +21336,7 @@ class InPageConnector extends BaseAsyncConnector {
21363
21336
  // Setup visibility change monitoring
21364
21337
  this.visibilityChangeHandler = () => {
21365
21338
  const isHidden = document.hidden;
21366
- logger$K.debug('inpage_visibility_changed', {
21339
+ logger$L.debug('inpage_visibility_changed', {
21367
21340
  channel: this.channelName,
21368
21341
  connector_id: this.connectorId,
21369
21342
  visibility: isHidden ? 'hidden' : 'visible',
@@ -21372,7 +21345,7 @@ class InPageConnector extends BaseAsyncConnector {
21372
21345
  // Pause/resume connector based on visibility
21373
21346
  if (isHidden && this.state === core.ConnectorState.STARTED) {
21374
21347
  this.pause().catch((err) => {
21375
- logger$K.warning('inpage_pause_failed', {
21348
+ logger$L.warning('inpage_pause_failed', {
21376
21349
  channel: this.channelName,
21377
21350
  connector_id: this.connectorId,
21378
21351
  error: err instanceof Error ? err.message : String(err),
@@ -21381,7 +21354,7 @@ class InPageConnector extends BaseAsyncConnector {
21381
21354
  }
21382
21355
  else if (!isHidden && this.state === core.ConnectorState.PAUSED) {
21383
21356
  this.resume().catch((err) => {
21384
- logger$K.warning('inpage_resume_failed', {
21357
+ logger$L.warning('inpage_resume_failed', {
21385
21358
  channel: this.channelName,
21386
21359
  connector_id: this.connectorId,
21387
21360
  error: err instanceof Error ? err.message : String(err),
@@ -21395,7 +21368,7 @@ class InPageConnector extends BaseAsyncConnector {
21395
21368
  // Track page lifecycle events to detect browser unload/discard
21396
21369
  if (typeof window !== 'undefined') {
21397
21370
  const lifecycleLogger = (event) => {
21398
- logger$K.info('inpage_page_lifecycle', {
21371
+ logger$L.info('inpage_page_lifecycle', {
21399
21372
  channel: this.channelName,
21400
21373
  connector_id: this.connectorId,
21401
21374
  event_type: event.type,
@@ -21411,7 +21384,7 @@ class InPageConnector extends BaseAsyncConnector {
21411
21384
  document.addEventListener('resume', lifecycleLogger);
21412
21385
  }
21413
21386
  // Log initial state with detailed visibility info
21414
- logger$K.debug('inpage_initial_visibility', {
21387
+ logger$L.debug('inpage_initial_visibility', {
21415
21388
  channel: this.channelName,
21416
21389
  connector_id: this.connectorId,
21417
21390
  visibility: document.hidden ? 'hidden' : 'visible',
@@ -21429,7 +21402,7 @@ class InPageConnector extends BaseAsyncConnector {
21429
21402
  await super.start(inboundHandler);
21430
21403
  // After transitioning to STARTED, check if tab is already hidden
21431
21404
  if (typeof document !== 'undefined' && document.hidden) {
21432
- logger$K.debug('inpage_start_in_hidden_tab', {
21405
+ logger$L.debug('inpage_start_in_hidden_tab', {
21433
21406
  channel: this.channelName,
21434
21407
  connector_id: this.connectorId,
21435
21408
  document_hidden: document.hidden,
@@ -21439,7 +21412,7 @@ class InPageConnector extends BaseAsyncConnector {
21439
21412
  });
21440
21413
  // Immediately pause if tab is hidden at start time
21441
21414
  await this.pause().catch((err) => {
21442
- logger$K.warning('inpage_initial_pause_failed', {
21415
+ logger$L.warning('inpage_initial_pause_failed', {
21443
21416
  channel: this.channelName,
21444
21417
  connector_id: this.connectorId,
21445
21418
  error: err instanceof Error ? err.message : String(err),
@@ -21469,14 +21442,14 @@ class InPageConnector extends BaseAsyncConnector {
21469
21442
  }
21470
21443
  catch (error) {
21471
21444
  if (error instanceof QueueFullError) {
21472
- logger$K.warning('inpage_push_queue_full', {
21445
+ logger$L.warning('inpage_push_queue_full', {
21473
21446
  channel: this.channelName,
21474
21447
  inbox_capacity: this.inboxCapacity,
21475
21448
  inbox_remaining_capacity: this.inbox.remainingCapacity,
21476
21449
  });
21477
21450
  throw error;
21478
21451
  }
21479
- logger$K.error('inpage_push_failed', {
21452
+ logger$L.error('inpage_push_failed', {
21480
21453
  channel: this.channelName,
21481
21454
  error: error instanceof Error ? error.message : String(error),
21482
21455
  });
@@ -21486,7 +21459,7 @@ class InPageConnector extends BaseAsyncConnector {
21486
21459
  async _transportSendBytes(data) {
21487
21460
  ensureBrowserEnvironment$2();
21488
21461
  const targetNodeId = this.targetNodeId ?? '*';
21489
- logger$K.debug('inpage_message_sending', {
21462
+ logger$L.debug('inpage_message_sending', {
21490
21463
  channel: this.channelName,
21491
21464
  sender_id: this.connectorId,
21492
21465
  sender_node_id: this.localNodeId,
@@ -21510,7 +21483,7 @@ class InPageConnector extends BaseAsyncConnector {
21510
21483
  return item;
21511
21484
  }
21512
21485
  async _transportClose(code, reason) {
21513
- logger$K.debug('inpage_transport_closing', {
21486
+ logger$L.debug('inpage_transport_closing', {
21514
21487
  channel: this.channelName,
21515
21488
  connector_id: this.connectorId,
21516
21489
  code,
@@ -21519,14 +21492,14 @@ class InPageConnector extends BaseAsyncConnector {
21519
21492
  timestamp: new Date().toISOString(),
21520
21493
  });
21521
21494
  if (this.listenerRegistered) {
21522
- logger$K.debug('inpage_removing_listener', {
21495
+ logger$L.debug('inpage_removing_listener', {
21523
21496
  channel: this.channelName,
21524
21497
  connector_id: this.connectorId,
21525
21498
  timestamp: new Date().toISOString(),
21526
21499
  });
21527
21500
  getSharedBus$1().removeEventListener(this.channelName, this.onMsg);
21528
21501
  this.listenerRegistered = false;
21529
- logger$K.debug('inpage_listener_removed', {
21502
+ logger$L.debug('inpage_listener_removed', {
21530
21503
  channel: this.channelName,
21531
21504
  connector_id: this.connectorId,
21532
21505
  timestamp: new Date().toISOString(),
@@ -21558,7 +21531,7 @@ class InPageConnector extends BaseAsyncConnector {
21558
21531
  if (targetNodeId &&
21559
21532
  targetNodeId !== '*' &&
21560
21533
  targetNodeId !== this.localNodeId) {
21561
- logger$K.debug('inpage_message_rejected', {
21534
+ logger$L.debug('inpage_message_rejected', {
21562
21535
  channel: this.channelName,
21563
21536
  connector_id: this.connectorId,
21564
21537
  reason: 'wildcard_target_mismatch',
@@ -21574,7 +21547,7 @@ class InPageConnector extends BaseAsyncConnector {
21574
21547
  if (expectedSender &&
21575
21548
  expectedSender !== '*' &&
21576
21549
  senderNodeId !== expectedSender) {
21577
- logger$K.debug('inpage_message_rejected', {
21550
+ logger$L.debug('inpage_message_rejected', {
21578
21551
  channel: this.channelName,
21579
21552
  connector_id: this.connectorId,
21580
21553
  reason: 'unexpected_sender',
@@ -21587,7 +21560,7 @@ class InPageConnector extends BaseAsyncConnector {
21587
21560
  if (targetNodeId &&
21588
21561
  targetNodeId !== '*' &&
21589
21562
  targetNodeId !== this.localNodeId) {
21590
- logger$K.debug('inpage_message_rejected', {
21563
+ logger$L.debug('inpage_message_rejected', {
21591
21564
  channel: this.channelName,
21592
21565
  connector_id: this.connectorId,
21593
21566
  reason: 'unexpected_target',
@@ -21612,7 +21585,7 @@ class InPageConnector extends BaseAsyncConnector {
21612
21585
  return 'unknown';
21613
21586
  }
21614
21587
  logInboxSnapshot(event, extra = {}) {
21615
- logger$K.debug(event, {
21588
+ logger$L.debug(event, {
21616
21589
  channel: this.channelName,
21617
21590
  connector_id: this.connectorId,
21618
21591
  connector_state: this.state,
@@ -21631,7 +21604,7 @@ class InPageConnector extends BaseAsyncConnector {
21631
21604
  return;
21632
21605
  }
21633
21606
  this.targetNodeId = normalized;
21634
- logger$K.debug('inpage_target_updated', {
21607
+ logger$L.debug('inpage_target_updated', {
21635
21608
  channel: this.channelName,
21636
21609
  connector_id: this.connectorId,
21637
21610
  local_node_id: this.localNodeId,
@@ -21641,7 +21614,7 @@ class InPageConnector extends BaseAsyncConnector {
21641
21614
  }
21642
21615
  setWildcardTarget() {
21643
21616
  this.targetNodeId = '*';
21644
- logger$K.debug('inpage_target_updated', {
21617
+ logger$L.debug('inpage_target_updated', {
21645
21618
  channel: this.channelName,
21646
21619
  connector_id: this.connectorId,
21647
21620
  local_node_id: this.localNodeId,
@@ -21835,6 +21808,185 @@ class AuthorizerFactory extends factory.AbstractResourceFactory {
21835
21808
  }
21836
21809
  }
21837
21810
 
21811
+ const logger$K = getLogger('naylence.fame.security.auth.authorization_profile_factory');
21812
+ const PROFILE_NAME_DEFAULT = 'jwt';
21813
+ const PROFILE_NAME_OAUTH2 = 'oauth2';
21814
+ const PROFILE_NAME_OAUTH2_GATED = 'oauth2-gated';
21815
+ const PROFILE_NAME_OAUTH2_CALLBACK = 'oauth2-callback';
21816
+ const PROFILE_NAME_NOOP$2 = 'noop';
21817
+ const ENV_VAR_JWT_TRUSTED_ISSUER$1 = 'FAME_JWT_TRUSTED_ISSUER';
21818
+ const ENV_VAR_JWT_ALGORITHM$1 = 'FAME_JWT_ALGORITHM';
21819
+ const ENV_VAR_JWT_AUDIENCE$2 = 'FAME_JWT_AUDIENCE';
21820
+ const ENV_VAR_JWKS_URL$1 = 'FAME_JWKS_URL';
21821
+ const ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1 = 'FAME_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY';
21822
+ const ENV_VAR_TRUSTED_CLIENT_SCOPE$1 = 'FAME_TRUSTED_CLIENT_SCOPE';
21823
+ const ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1 = 'FAME_JWT_REVERSE_AUTH_TRUSTED_ISSUER';
21824
+ const ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1 = 'FAME_JWT_REVERSE_AUTH_AUDIENCE';
21825
+ const ENV_VAR_HMAC_SECRET$1 = 'FAME_HMAC_SECRET';
21826
+ const DEFAULT_REVERSE_AUTH_ISSUER = 'reverse-auth.naylence.ai';
21827
+ const DEFAULT_REVERSE_AUTH_AUDIENCE = 'dev.naylence.ai';
21828
+ const DEFAULT_PROFILE = {
21829
+ type: 'DefaultAuthorizer',
21830
+ verifier: {
21831
+ type: 'JWKSJWTTokenVerifier',
21832
+ jwks_url: factory.Expressions.env(ENV_VAR_JWKS_URL$1),
21833
+ issuer: factory.Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER$1),
21834
+ },
21835
+ };
21836
+ const OAUTH2_PROFILE = {
21837
+ type: 'OAuth2Authorizer',
21838
+ issuer: factory.Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER$1),
21839
+ required_scopes: ['node.connect'],
21840
+ require_scope: true,
21841
+ default_ttl_sec: 3600,
21842
+ max_ttl_sec: 86400,
21843
+ algorithm: factory.Expressions.env(ENV_VAR_JWT_ALGORITHM$1, 'RS256'),
21844
+ audience: factory.Expressions.env(ENV_VAR_JWT_AUDIENCE$2),
21845
+ };
21846
+ const OAUTH2_GATED_PROFILE = {
21847
+ ...OAUTH2_PROFILE,
21848
+ enforce_token_subject_node_identity: factory.Expressions.env(ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1, 'false'),
21849
+ trusted_client_scope: factory.Expressions.env(ENV_VAR_TRUSTED_CLIENT_SCOPE$1, 'node.trusted'),
21850
+ };
21851
+ const OAUTH2_CALLBACK_PROFILE = {
21852
+ type: 'OAuth2Authorizer',
21853
+ issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1, DEFAULT_REVERSE_AUTH_ISSUER),
21854
+ audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1),
21855
+ require_scope: true,
21856
+ default_ttl_sec: 3600,
21857
+ max_ttl_sec: 86400,
21858
+ reverse_auth_ttl_sec: 86400,
21859
+ token_verifier_config: {
21860
+ type: 'JWTTokenVerifier',
21861
+ algorithm: 'HS256',
21862
+ hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET$1),
21863
+ issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1, DEFAULT_REVERSE_AUTH_ISSUER),
21864
+ ttl_sec: 86400,
21865
+ },
21866
+ token_issuer_config: {
21867
+ type: 'JWTTokenIssuer',
21868
+ algorithm: 'HS256',
21869
+ hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET$1),
21870
+ kid: 'hmac-reverse-auth-key',
21871
+ issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1, DEFAULT_REVERSE_AUTH_ISSUER),
21872
+ ttl_sec: 86400,
21873
+ audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1, DEFAULT_REVERSE_AUTH_AUDIENCE),
21874
+ },
21875
+ };
21876
+ const NOOP_PROFILE$2 = {
21877
+ type: 'NoopAuthorizer',
21878
+ };
21879
+ const PROFILE_MAP$5 = {
21880
+ [PROFILE_NAME_DEFAULT]: DEFAULT_PROFILE,
21881
+ [PROFILE_NAME_OAUTH2]: OAUTH2_PROFILE,
21882
+ [PROFILE_NAME_OAUTH2_GATED]: OAUTH2_GATED_PROFILE,
21883
+ [PROFILE_NAME_OAUTH2_CALLBACK]: OAUTH2_CALLBACK_PROFILE,
21884
+ [PROFILE_NAME_NOOP$2]: NOOP_PROFILE$2,
21885
+ };
21886
+ const PROFILE_ALIASES$1 = {
21887
+ jwt: PROFILE_NAME_DEFAULT,
21888
+ jwks: PROFILE_NAME_DEFAULT,
21889
+ default: PROFILE_NAME_DEFAULT,
21890
+ oauth2: PROFILE_NAME_OAUTH2,
21891
+ oidc: PROFILE_NAME_OAUTH2,
21892
+ 'oauth2-gated': PROFILE_NAME_OAUTH2_GATED,
21893
+ oauth2_gated: PROFILE_NAME_OAUTH2_GATED,
21894
+ 'oauth2-callback': PROFILE_NAME_OAUTH2_CALLBACK,
21895
+ oauth2_callback: PROFILE_NAME_OAUTH2_CALLBACK,
21896
+ 'reverse-auth': PROFILE_NAME_OAUTH2_CALLBACK,
21897
+ noop: PROFILE_NAME_NOOP$2,
21898
+ 'no-op': PROFILE_NAME_NOOP$2,
21899
+ no_op: PROFILE_NAME_NOOP$2,
21900
+ };
21901
+ const FACTORY_META$15 = {
21902
+ base: AUTHORIZER_FACTORY_BASE_TYPE,
21903
+ key: 'AuthorizationProfile',
21904
+ };
21905
+ class AuthorizationProfileFactory extends AuthorizerFactory {
21906
+ constructor() {
21907
+ super(...arguments);
21908
+ this.type = 'AuthorizationProfile';
21909
+ }
21910
+ async create(config, ...factoryArgs) {
21911
+ const normalized = normalizeConfig$w(config);
21912
+ const profileConfig = resolveProfileConfig$4(normalized.profile);
21913
+ logger$K.debug('enabling_authorization_profile', {
21914
+ profile: normalized.profile,
21915
+ });
21916
+ const authorizer = await AuthorizerFactory.createAuthorizer(profileConfig, { factoryArgs });
21917
+ if (!authorizer) {
21918
+ throw new Error(`Failed to create authorizer for profile: ${normalized.profile}`);
21919
+ }
21920
+ return authorizer;
21921
+ }
21922
+ }
21923
+ function normalizeConfig$w(config) {
21924
+ if (!config) {
21925
+ return { profile: PROFILE_NAME_OAUTH2 };
21926
+ }
21927
+ const candidate = config;
21928
+ const profileValue = resolveProfileName$2(candidate);
21929
+ const canonicalProfile = canonicalizeProfileName$1(profileValue);
21930
+ candidate.profile = canonicalProfile;
21931
+ return { profile: canonicalProfile };
21932
+ }
21933
+ function resolveProfileName$2(candidate) {
21934
+ const direct = coerceProfileString$2(candidate.profile);
21935
+ if (direct) {
21936
+ return direct;
21937
+ }
21938
+ const legacyKeys = ['profile_name', 'profileName'];
21939
+ for (const legacyKey of legacyKeys) {
21940
+ const legacyValue = coerceProfileString$2(candidate[legacyKey]);
21941
+ if (legacyValue) {
21942
+ return legacyValue;
21943
+ }
21944
+ }
21945
+ return PROFILE_NAME_OAUTH2;
21946
+ }
21947
+ function coerceProfileString$2(value) {
21948
+ if (typeof value !== 'string') {
21949
+ return null;
21950
+ }
21951
+ const trimmed = value.trim();
21952
+ return trimmed.length > 0 ? trimmed : null;
21953
+ }
21954
+ function canonicalizeProfileName$1(value) {
21955
+ const normalized = value.replace(/[\s_]+/g, '-').toLowerCase();
21956
+ return PROFILE_ALIASES$1[normalized] ?? normalized;
21957
+ }
21958
+ function resolveProfileConfig$4(profileName) {
21959
+ const profile = PROFILE_MAP$5[profileName];
21960
+ if (!profile) {
21961
+ throw new Error(`Unknown authorization profile: ${profileName}`);
21962
+ }
21963
+ return deepClone$4(profile);
21964
+ }
21965
+ function deepClone$4(value) {
21966
+ return JSON.parse(JSON.stringify(value));
21967
+ }
21968
+
21969
+ var authorizationProfileFactory = /*#__PURE__*/Object.freeze({
21970
+ __proto__: null,
21971
+ AuthorizationProfileFactory: AuthorizationProfileFactory,
21972
+ ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY: ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1,
21973
+ ENV_VAR_HMAC_SECRET: ENV_VAR_HMAC_SECRET$1,
21974
+ ENV_VAR_JWKS_URL: ENV_VAR_JWKS_URL$1,
21975
+ ENV_VAR_JWT_ALGORITHM: ENV_VAR_JWT_ALGORITHM$1,
21976
+ ENV_VAR_JWT_AUDIENCE: ENV_VAR_JWT_AUDIENCE$2,
21977
+ ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE: ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1,
21978
+ ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER: ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1,
21979
+ ENV_VAR_JWT_TRUSTED_ISSUER: ENV_VAR_JWT_TRUSTED_ISSUER$1,
21980
+ ENV_VAR_TRUSTED_CLIENT_SCOPE: ENV_VAR_TRUSTED_CLIENT_SCOPE$1,
21981
+ FACTORY_META: FACTORY_META$15,
21982
+ PROFILE_NAME_DEFAULT: PROFILE_NAME_DEFAULT,
21983
+ PROFILE_NAME_NOOP: PROFILE_NAME_NOOP$2,
21984
+ PROFILE_NAME_OAUTH2: PROFILE_NAME_OAUTH2,
21985
+ PROFILE_NAME_OAUTH2_CALLBACK: PROFILE_NAME_OAUTH2_CALLBACK,
21986
+ PROFILE_NAME_OAUTH2_GATED: PROFILE_NAME_OAUTH2_GATED,
21987
+ default: AuthorizationProfileFactory
21988
+ });
21989
+
21838
21990
  function isAuthInjectionStrategy(candidate) {
21839
21991
  return (typeof candidate === 'object' &&
21840
21992
  candidate !== null &&
@@ -29316,14 +29468,13 @@ const ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER = 'FAME_JWT_REVERSE_AUTH_TRUSTED_I
29316
29468
  const ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE = 'FAME_JWT_REVERSE_AUTH_AUDIENCE';
29317
29469
  const ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY = 'FAME_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY';
29318
29470
  const ENV_VAR_TRUSTED_CLIENT_SCOPE = 'FAME_TRUSTED_CLIENT_SCOPE';
29471
+ const ENV_VAR_AUTHORIZATION_PROFILE = 'FAME_AUTHORIZATION_PROFILE';
29319
29472
  const PROFILE_NAME_STRICT_OVERLAY = 'strict-overlay';
29320
29473
  const PROFILE_NAME_OVERLAY = 'overlay';
29321
29474
  const PROFILE_NAME_OVERLAY_CALLBACK = 'overlay-callback';
29322
29475
  const PROFILE_NAME_GATED = 'gated';
29323
29476
  const PROFILE_NAME_GATED_CALLBACK = 'gated-callback';
29324
29477
  const PROFILE_NAME_OPEN$1 = 'open';
29325
- const DEFAULT_REVERSE_AUTH_ISSUER = 'reverse-auth.naylence.ai';
29326
- const DEFAULT_REVERSE_AUTH_AUDIENCE = 'dev.naylence.ai';
29327
29478
  const STRICT_OVERLAY_PROFILE = {
29328
29479
  type: 'DefaultSecurityManager',
29329
29480
  security_policy: {
@@ -29369,12 +29520,8 @@ const STRICT_OVERLAY_PROFILE = {
29369
29520
  },
29370
29521
  },
29371
29522
  authorizer: {
29372
- type: 'DefaultAuthorizer',
29373
- verifier: {
29374
- type: 'JWKSJWTTokenVerifier',
29375
- jwks_url: factory.Expressions.env(ENV_VAR_JWKS_URL),
29376
- issuer: factory.Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER),
29377
- },
29523
+ type: 'AuthorizationProfile',
29524
+ profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'jwt'),
29378
29525
  },
29379
29526
  };
29380
29527
  const OVERLAY_PROFILE = {
@@ -29421,14 +29568,8 @@ const OVERLAY_PROFILE = {
29421
29568
  },
29422
29569
  },
29423
29570
  authorizer: {
29424
- type: 'OAuth2Authorizer',
29425
- issuer: factory.Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER),
29426
- required_scopes: ['node.connect'],
29427
- require_scope: true,
29428
- default_ttl_sec: 3600,
29429
- max_ttl_sec: 86400,
29430
- algorithm: factory.Expressions.env(ENV_VAR_JWT_ALGORITHM, 'RS256'),
29431
- audience: factory.Expressions.env(ENV_VAR_JWT_AUDIENCE$1),
29571
+ type: 'AuthorizationProfile',
29572
+ profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2'),
29432
29573
  },
29433
29574
  };
29434
29575
  const OVERLAY_CALLBACK_PROFILE = {
@@ -29475,29 +29616,8 @@ const OVERLAY_CALLBACK_PROFILE = {
29475
29616
  },
29476
29617
  },
29477
29618
  authorizer: {
29478
- type: 'OAuth2Authorizer',
29479
- issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
29480
- audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE),
29481
- require_scope: true,
29482
- default_ttl_sec: 3600,
29483
- max_ttl_sec: 86400,
29484
- reverse_auth_ttl_sec: 86400,
29485
- token_verifier_config: {
29486
- type: 'JWTTokenVerifier',
29487
- algorithm: 'HS256',
29488
- hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET),
29489
- issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
29490
- ttl_sec: 86400,
29491
- },
29492
- token_issuer_config: {
29493
- type: 'JWTTokenIssuer',
29494
- algorithm: 'HS256',
29495
- hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET),
29496
- kid: 'hmac-reverse-auth-key',
29497
- issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
29498
- ttl_sec: 86400,
29499
- audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, DEFAULT_REVERSE_AUTH_AUDIENCE),
29500
- },
29619
+ type: 'AuthorizationProfile',
29620
+ profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2-callback'),
29501
29621
  },
29502
29622
  };
29503
29623
  const GATED_PROFILE = {
@@ -29543,16 +29663,8 @@ const GATED_PROFILE = {
29543
29663
  },
29544
29664
  },
29545
29665
  authorizer: {
29546
- type: 'OAuth2Authorizer',
29547
- issuer: factory.Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER),
29548
- required_scopes: ['node.connect'],
29549
- require_scope: true,
29550
- default_ttl_sec: 3600,
29551
- max_ttl_sec: 86400,
29552
- algorithm: factory.Expressions.env(ENV_VAR_JWT_ALGORITHM, 'RS256'),
29553
- audience: factory.Expressions.env(ENV_VAR_JWT_AUDIENCE$1),
29554
- enforce_token_subject_node_identity: factory.Expressions.env(ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY, 'false'),
29555
- trusted_client_scope: factory.Expressions.env(ENV_VAR_TRUSTED_CLIENT_SCOPE, 'node.trusted'),
29666
+ type: 'AuthorizationProfile',
29667
+ profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2-gated'),
29556
29668
  },
29557
29669
  };
29558
29670
  const GATED_CALLBACK_PROFILE = {
@@ -29598,29 +29710,8 @@ const GATED_CALLBACK_PROFILE = {
29598
29710
  },
29599
29711
  },
29600
29712
  authorizer: {
29601
- type: 'OAuth2Authorizer',
29602
- issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
29603
- audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE),
29604
- require_scope: true,
29605
- default_ttl_sec: 3600,
29606
- max_ttl_sec: 86400,
29607
- reverse_auth_ttl_sec: 86400,
29608
- token_verifier_config: {
29609
- type: 'JWTTokenVerifier',
29610
- algorithm: 'HS256',
29611
- hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET),
29612
- issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
29613
- ttl_sec: 86400,
29614
- },
29615
- token_issuer_config: {
29616
- type: 'JWTTokenIssuer',
29617
- algorithm: 'HS256',
29618
- hmac_secret: factory.Expressions.env(ENV_VAR_HMAC_SECRET),
29619
- kid: 'hmac-reverse-auth-key',
29620
- issuer: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
29621
- ttl_sec: 86400,
29622
- audience: factory.Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, DEFAULT_REVERSE_AUTH_AUDIENCE),
29623
- },
29713
+ type: 'AuthorizationProfile',
29714
+ profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2-callback'),
29624
29715
  },
29625
29716
  };
29626
29717
  const OPEN_PROFILE$1 = {
@@ -29629,7 +29720,8 @@ const OPEN_PROFILE$1 = {
29629
29720
  type: 'NoSecurityPolicy',
29630
29721
  },
29631
29722
  authorizer: {
29632
- type: 'NoopAuthorizer',
29723
+ type: 'AuthorizationProfile',
29724
+ profile: factory.Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'noop'),
29633
29725
  },
29634
29726
  };
29635
29727
  const PROFILE_MAP$4 = {
@@ -29758,6 +29850,7 @@ function deepClone$3(value) {
29758
29850
 
29759
29851
  var nodeSecurityProfileFactory = /*#__PURE__*/Object.freeze({
29760
29852
  __proto__: null,
29853
+ ENV_VAR_AUTHORIZATION_PROFILE: ENV_VAR_AUTHORIZATION_PROFILE,
29761
29854
  ENV_VAR_DEFAULT_ENCRYPTION_LEVEL: ENV_VAR_DEFAULT_ENCRYPTION_LEVEL,
29762
29855
  ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY: ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY,
29763
29856
  ENV_VAR_HMAC_SECRET: ENV_VAR_HMAC_SECRET,
@@ -43530,11 +43623,26 @@ exports.AUTHORIZATION_POLICY_FACTORY_BASE_TYPE = AUTHORIZATION_POLICY_FACTORY_BA
43530
43623
  exports.AUTHORIZATION_POLICY_SOURCE_FACTORY_BASE_TYPE = AUTHORIZATION_POLICY_SOURCE_FACTORY_BASE_TYPE;
43531
43624
  exports.AUTHORIZER_FACTORY_BASE_TYPE = AUTHORIZER_FACTORY_BASE_TYPE;
43532
43625
  exports.AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE = AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE;
43626
+ exports.AUTH_PROFILE_ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY = ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1;
43627
+ exports.AUTH_PROFILE_ENV_VAR_HMAC_SECRET = ENV_VAR_HMAC_SECRET$1;
43628
+ exports.AUTH_PROFILE_ENV_VAR_JWKS_URL = ENV_VAR_JWKS_URL$1;
43629
+ exports.AUTH_PROFILE_ENV_VAR_JWT_ALGORITHM = ENV_VAR_JWT_ALGORITHM$1;
43630
+ exports.AUTH_PROFILE_ENV_VAR_JWT_AUDIENCE = ENV_VAR_JWT_AUDIENCE$2;
43631
+ exports.AUTH_PROFILE_ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE = ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1;
43632
+ exports.AUTH_PROFILE_ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER = ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1;
43633
+ exports.AUTH_PROFILE_ENV_VAR_JWT_TRUSTED_ISSUER = ENV_VAR_JWT_TRUSTED_ISSUER$1;
43634
+ exports.AUTH_PROFILE_ENV_VAR_TRUSTED_CLIENT_SCOPE = ENV_VAR_TRUSTED_CLIENT_SCOPE$1;
43635
+ exports.AUTH_PROFILE_NAME_DEFAULT = PROFILE_NAME_DEFAULT;
43636
+ exports.AUTH_PROFILE_NAME_NOOP = PROFILE_NAME_NOOP$2;
43637
+ exports.AUTH_PROFILE_NAME_OAUTH2 = PROFILE_NAME_OAUTH2;
43638
+ exports.AUTH_PROFILE_NAME_OAUTH2_CALLBACK = PROFILE_NAME_OAUTH2_CALLBACK;
43639
+ exports.AUTH_PROFILE_NAME_OAUTH2_GATED = PROFILE_NAME_OAUTH2_GATED;
43533
43640
  exports.AsyncLock = AsyncLock;
43534
43641
  exports.AttachmentKeyValidator = AttachmentKeyValidator;
43535
43642
  exports.AuthInjectionStrategyFactory = AuthInjectionStrategyFactory;
43536
43643
  exports.AuthorizationPolicyFactory = AuthorizationPolicyFactory;
43537
43644
  exports.AuthorizationPolicySourceFactory = AuthorizationPolicySourceFactory;
43645
+ exports.AuthorizationProfileFactory = AuthorizationProfileFactory;
43538
43646
  exports.AuthorizerFactory = AuthorizerFactory;
43539
43647
  exports.BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE = BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE;
43540
43648
  exports.BackPressureFull = BackPressureFull;
@@ -43570,6 +43678,7 @@ exports.DevFixedKeyCredentialProvider = DevFixedKeyCredentialProvider;
43570
43678
  exports.ENCRYPTION_MANAGER_FACTORY_BASE_TYPE = ENCRYPTION_MANAGER_FACTORY_BASE_TYPE;
43571
43679
  exports.ENVELOPE_SIGNER_FACTORY_BASE_TYPE = ENVELOPE_SIGNER_FACTORY_BASE_TYPE;
43572
43680
  exports.ENVELOPE_VERIFIER_FACTORY_BASE_TYPE = ENVELOPE_VERIFIER_FACTORY_BASE_TYPE;
43681
+ exports.ENV_VAR_AUTHORIZATION_PROFILE = ENV_VAR_AUTHORIZATION_PROFILE;
43573
43682
  exports.ENV_VAR_DEFAULT_ENCRYPTION_LEVEL = ENV_VAR_DEFAULT_ENCRYPTION_LEVEL;
43574
43683
  exports.ENV_VAR_HMAC_SECRET = ENV_VAR_HMAC_SECRET;
43575
43684
  exports.ENV_VAR_JWKS_URL = ENV_VAR_JWKS_URL;