@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.
@@ -3591,7 +3591,7 @@ class WebSocketConnectionGrantImpl {
3591
3591
  this.purpose = 'connection';
3592
3592
  }
3593
3593
  }
3594
- const FACTORY_META$1f = {
3594
+ const FACTORY_META$1g = {
3595
3595
  base: CONNECTOR_FACTORY_BASE_TYPE,
3596
3596
  key: 'WebSocketConnector',
3597
3597
  };
@@ -3962,7 +3962,7 @@ class WebSocketConnectorFactory extends ConnectorFactory {
3962
3962
 
3963
3963
  var websocketConnectorFactory = /*#__PURE__*/Object.freeze({
3964
3964
  __proto__: null,
3965
- FACTORY_META: FACTORY_META$1f,
3965
+ FACTORY_META: FACTORY_META$1g,
3966
3966
  WebSocketConnectorFactory: WebSocketConnectorFactory,
3967
3967
  default: WebSocketConnectorFactory,
3968
3968
  setWebSocketConnectorSslLoader: setWebSocketConnectorSslLoader
@@ -4038,6 +4038,7 @@ const MODULES = [
4038
4038
  "./node/node-identity-policy-profile-factory.js",
4039
4039
  "./node/token-subject-node-identity-policy-factory.js",
4040
4040
  "./placement/static-node-placement-strategy-factory.js",
4041
+ "./security/auth/authorization-profile-factory.js",
4041
4042
  "./security/auth/bearer-token-header-auth-injection-strategy-factory.js",
4042
4043
  "./security/auth/default-authorizer-factory.js",
4043
4044
  "./security/auth/default-policy-authorizer-factory.js",
@@ -4120,6 +4121,7 @@ const MODULE_LOADERS = {
4120
4121
  "./node/node-identity-policy-profile-factory.js": () => Promise.resolve().then(function () { return nodeIdentityPolicyProfileFactory; }),
4121
4122
  "./node/token-subject-node-identity-policy-factory.js": () => Promise.resolve().then(function () { return tokenSubjectNodeIdentityPolicyFactory; }),
4122
4123
  "./placement/static-node-placement-strategy-factory.js": () => Promise.resolve().then(function () { return staticNodePlacementStrategyFactory; }),
4124
+ "./security/auth/authorization-profile-factory.js": () => Promise.resolve().then(function () { return authorizationProfileFactory; }),
4123
4125
  "./security/auth/bearer-token-header-auth-injection-strategy-factory.js": () => Promise.resolve().then(function () { return bearerTokenHeaderAuthInjectionStrategyFactory; }),
4124
4126
  "./security/auth/default-authorizer-factory.js": () => Promise.resolve().then(function () { return defaultAuthorizerFactory; }),
4125
4127
  "./security/auth/default-policy-authorizer-factory.js": () => Promise.resolve().then(function () { return defaultPolicyAuthorizerFactory; }),
@@ -4433,12 +4435,12 @@ async function ensureRuntimeFactoriesRegistered(registry = Registry) {
4433
4435
  }
4434
4436
 
4435
4437
  // This file is auto-generated during build - do not edit manually
4436
- // Generated from package.json version: 0.4.0
4438
+ // Generated from package.json version: 0.4.2
4437
4439
  /**
4438
4440
  * The package version, injected at build time.
4439
4441
  * @internal
4440
4442
  */
4441
- const VERSION = '0.4.0';
4443
+ const VERSION = '0.4.2';
4442
4444
 
4443
4445
  let initialized = false;
4444
4446
  const runtimePlugin = {
@@ -4553,7 +4555,7 @@ class EnvCredentialProviderFactory extends CredentialProviderFactory {
4553
4555
  return new EnvCredentialProvider(resolved.varName);
4554
4556
  }
4555
4557
  }
4556
- const FACTORY_META$1e = {
4558
+ const FACTORY_META$1f = {
4557
4559
  base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
4558
4560
  key: 'EnvCredentialProvider',
4559
4561
  };
@@ -4561,7 +4563,7 @@ const FACTORY_META$1e = {
4561
4563
  var envCredentialProviderFactory = /*#__PURE__*/Object.freeze({
4562
4564
  __proto__: null,
4563
4565
  EnvCredentialProviderFactory: EnvCredentialProviderFactory,
4564
- FACTORY_META: FACTORY_META$1e,
4566
+ FACTORY_META: FACTORY_META$1f,
4565
4567
  default: EnvCredentialProviderFactory,
4566
4568
  normalizeEnvConfig: normalizeEnvConfig
4567
4569
  });
@@ -4659,14 +4661,14 @@ class PromptCredentialProviderFactory extends CredentialProviderFactory {
4659
4661
  return new PromptCredentialProvider(resolved.credentialName);
4660
4662
  }
4661
4663
  }
4662
- const FACTORY_META$1d = {
4664
+ const FACTORY_META$1e = {
4663
4665
  base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
4664
4666
  key: 'PromptCredentialProvider',
4665
4667
  };
4666
4668
 
4667
4669
  var promptCredentialProviderFactory = /*#__PURE__*/Object.freeze({
4668
4670
  __proto__: null,
4669
- FACTORY_META: FACTORY_META$1d,
4671
+ FACTORY_META: FACTORY_META$1e,
4670
4672
  PromptCredentialProviderFactory: PromptCredentialProviderFactory,
4671
4673
  default: PromptCredentialProviderFactory,
4672
4674
  normalizePromptConfig: normalizePromptConfig
@@ -4720,14 +4722,14 @@ class SecretStoreCredentialProviderFactory extends CredentialProviderFactory {
4720
4722
  return new SecretStoreCredentialProvider(resolved.secretName);
4721
4723
  }
4722
4724
  }
4723
- const FACTORY_META$1c = {
4725
+ const FACTORY_META$1d = {
4724
4726
  base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
4725
4727
  key: 'SecretStoreCredentialProvider',
4726
4728
  };
4727
4729
 
4728
4730
  var secretStoreCredentialProviderFactory = /*#__PURE__*/Object.freeze({
4729
4731
  __proto__: null,
4730
- FACTORY_META: FACTORY_META$1c,
4732
+ FACTORY_META: FACTORY_META$1d,
4731
4733
  SecretStoreCredentialProviderFactory: SecretStoreCredentialProviderFactory,
4732
4734
  default: SecretStoreCredentialProviderFactory,
4733
4735
  normalizeSecretStoreConfig: normalizeSecretStoreConfig
@@ -4776,14 +4778,14 @@ class StaticCredentialProviderFactory extends CredentialProviderFactory {
4776
4778
  return new StaticCredentialProvider(resolved.credentialValue);
4777
4779
  }
4778
4780
  }
4779
- const FACTORY_META$1b = {
4781
+ const FACTORY_META$1c = {
4780
4782
  base: CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE,
4781
4783
  key: 'StaticCredentialProvider',
4782
4784
  };
4783
4785
 
4784
4786
  var staticCredentialProviderFactory = /*#__PURE__*/Object.freeze({
4785
4787
  __proto__: null,
4786
- FACTORY_META: FACTORY_META$1b,
4788
+ FACTORY_META: FACTORY_META$1c,
4787
4789
  StaticCredentialProviderFactory: StaticCredentialProviderFactory,
4788
4790
  default: StaticCredentialProviderFactory,
4789
4791
  normalizeStaticConfig: normalizeStaticConfig
@@ -5074,12 +5076,12 @@ const BASE_PROFILE_MAP = {
5074
5076
  [PROFILE_NAME_INDEXEDDB]: INDEXEDDB_PROFILE_CONFIG,
5075
5077
  };
5076
5078
  // Extended profile map - can be augmented by Node.js environment
5077
- const PROFILE_MAP$6 = {
5079
+ const PROFILE_MAP$7 = {
5078
5080
  ...BASE_PROFILE_MAP,
5079
5081
  };
5080
5082
  // Function to register additional profiles (used by Node.js build)
5081
5083
  function registerStorageProfile(name, config) {
5082
- PROFILE_MAP$6[name] = config;
5084
+ PROFILE_MAP$7[name] = config;
5083
5085
  }
5084
5086
  // Export the SQLite configs so they can be registered from node-index.ts
5085
5087
  const SQLITE_PROFILES = {
@@ -5098,9 +5100,9 @@ class StorageProfileFactory extends StorageProviderFactory {
5098
5100
  type: 'StorageProfile',
5099
5101
  });
5100
5102
  const profileName = (parsed.profile ?? PROFILE_NAME_MEMORY).toLowerCase();
5101
- const profileConfig = PROFILE_MAP$6[profileName];
5103
+ const profileConfig = PROFILE_MAP$7[profileName];
5102
5104
  if (!profileConfig) {
5103
- throw new Error(`Unknown storage profile '${profileName}'. Supported profiles: ${Object.keys(PROFILE_MAP$6).join(', ')}`);
5105
+ throw new Error(`Unknown storage profile '${profileName}'. Supported profiles: ${Object.keys(PROFILE_MAP$7).join(', ')}`);
5104
5106
  }
5105
5107
  const createOptions = {
5106
5108
  ...options,
@@ -14857,44 +14859,12 @@ class ConnectionRetryPolicyFactory extends AbstractResourceFactory {
14857
14859
  }
14858
14860
  }
14859
14861
 
14860
- const TOKEN_PROVIDER_FACTORY_BASE_TYPE = 'TokenProviderFactory';
14861
- class TokenProviderFactory extends AbstractResourceFactory {
14862
- static async createTokenProvider(config, options = {}) {
14863
- if (config) {
14864
- const provider = await createResource$1(TOKEN_PROVIDER_FACTORY_BASE_TYPE, config, options);
14865
- if (!provider) {
14866
- throw new Error('Failed to create token provider from configuration');
14867
- }
14868
- return provider;
14869
- }
14870
- let provider = null;
14871
- try {
14872
- provider = await createDefaultResource(TOKEN_PROVIDER_FACTORY_BASE_TYPE, null, options);
14873
- }
14874
- catch (error) {
14875
- const message = 'Failed to create default token provider' +
14876
- (error instanceof Error && error.message ? `: ${error.message}` : '');
14877
- throw new Error(message);
14878
- }
14879
- if (!provider) {
14880
- throw new Error('Failed to create default token provider');
14881
- }
14882
- return provider;
14883
- }
14884
- }
14885
-
14886
- function isTokenProvider(candidate) {
14887
- return (typeof candidate === 'object' &&
14888
- candidate !== null &&
14889
- typeof candidate.getToken === 'function');
14890
- }
14891
- function isIdentityExposingTokenProvider(candidate) {
14892
- return (isTokenProvider(candidate) &&
14893
- typeof candidate.getIdentity ===
14894
- 'function');
14895
- }
14896
-
14897
- const logger$14 = getLogger('naylence.fame.node.default_node_identity_policy');
14862
+ /**
14863
+ * Default node identity policy that preserves the current node ID.
14864
+ *
14865
+ * This policy does NOT derive identity from tokens or grants.
14866
+ * For token-subject-based identity, use TokenSubjectNodeIdentityPolicy.
14867
+ */
14898
14868
  class DefaultNodeIdentityPolicy {
14899
14869
  async resolveInitialNodeId(context) {
14900
14870
  if (context.configuredId) {
@@ -14906,44 +14876,10 @@ class DefaultNodeIdentityPolicy {
14906
14876
  return await generateIdAsync({ mode: 'fingerprint' });
14907
14877
  }
14908
14878
  async resolveAdmissionNodeId(context) {
14909
- // Try to extract identity from grants first
14910
- if (context.grants && context.grants.length > 0) {
14911
- for (const grant of context.grants) {
14912
- try {
14913
- const auth = grant.auth;
14914
- if (!auth) {
14915
- continue;
14916
- }
14917
- const tokenProviderConfig = (auth.tokenProvider ??
14918
- auth.token_provider);
14919
- if (!tokenProviderConfig ||
14920
- typeof tokenProviderConfig.type !== 'string') {
14921
- continue;
14922
- }
14923
- const provider = await TokenProviderFactory.createTokenProvider(tokenProviderConfig);
14924
- if (isIdentityExposingTokenProvider(provider)) {
14925
- const identity = await provider.getIdentity();
14926
- if (identity && identity.subject) {
14927
- logger$14.debug('identity_extracted_from_grant', {
14928
- identity_id: identity.subject,
14929
- grant_type: grant.type,
14930
- });
14931
- return identity.subject;
14932
- }
14933
- }
14934
- }
14935
- catch (error) {
14936
- logger$14.warning('identity_extraction_failed', {
14937
- error: error instanceof Error ? error.message : String(error),
14938
- grant_type: grant.type,
14939
- });
14940
- }
14941
- }
14942
- }
14943
- if (!context.currentNodeId) {
14944
- return await generateIdAsync({ mode: 'fingerprint' });
14879
+ if (context.currentNodeId) {
14880
+ return context.currentNodeId;
14945
14881
  }
14946
- return context.currentNodeId;
14882
+ return await generateIdAsync({ mode: 'fingerprint' });
14947
14883
  }
14948
14884
  }
14949
14885
 
@@ -15017,7 +14953,7 @@ class AttachmentKeyValidator {
15017
14953
  }
15018
14954
  }
15019
14955
 
15020
- const logger$13 = getLogger('naylence.fame.node.admission.default_node_attach_client');
14956
+ const logger$14 = getLogger('naylence.fame.node.admission.default_node_attach_client');
15021
14957
  const HANDSHAKE_POLL_INTERVAL_MS = 20;
15022
14958
  class DefaultNodeAttachClient {
15023
14959
  constructor(options = {}) {
@@ -15041,7 +14977,7 @@ class DefaultNodeAttachClient {
15041
14977
  }
15042
14978
  else {
15043
14979
  // Silently ignore frames from other agents during concurrent handshakes
15044
- logger$13.debug('handshake_ignoring_frame_from_different_system', {
14980
+ logger$14.debug('handshake_ignoring_frame_from_different_system', {
15045
14981
  frame_type: envelope.frame.type,
15046
14982
  frame_system_id: frameSystemId,
15047
14983
  expected_system_id: this.expectedSystemId,
@@ -15084,7 +15020,7 @@ class DefaultNodeAttachClient {
15084
15020
  }
15085
15021
  }
15086
15022
  catch (error) {
15087
- logger$13.debug('stickiness_offer_skipped', {
15023
+ logger$14.debug('stickiness_offer_skipped', {
15088
15024
  error: error instanceof Error ? error.message : String(error),
15089
15025
  });
15090
15026
  }
@@ -15105,7 +15041,7 @@ class DefaultNodeAttachClient {
15105
15041
  if (!processedEnvelope) {
15106
15042
  throw new Error('Envelope was blocked by onForwardUpstream event');
15107
15043
  }
15108
- logger$13.debug('sending_node_attach_envelope', {
15044
+ logger$14.debug('sending_node_attach_envelope', {
15109
15045
  envp_id: processedEnvelope.id ?? envelope.id ?? null,
15110
15046
  frame_type: processedEnvelope.frame?.type ?? 'unknown',
15111
15047
  trace_id: processedEnvelope.traceId ?? envelope.traceId ?? null,
@@ -15141,7 +15077,7 @@ class DefaultNodeAttachClient {
15141
15077
  try {
15142
15078
  const keyInfos = await this.attachmentKeyValidator.validateKeys(parentKeys);
15143
15079
  if (Array.isArray(keyInfos) && keyInfos.length > 0) {
15144
- logger$13.debug('parent_certificate_validation_passed', {
15080
+ logger$14.debug('parent_certificate_validation_passed', {
15145
15081
  parent_id: parentId,
15146
15082
  correlation_id: corrId,
15147
15083
  validated_keys: keyInfos.length,
@@ -15150,7 +15086,7 @@ class DefaultNodeAttachClient {
15150
15086
  }
15151
15087
  catch (error) {
15152
15088
  if (error instanceof KeyValidationError) {
15153
- logger$13.error('parent_certificate_validation_failed', {
15089
+ logger$14.error('parent_certificate_validation_failed', {
15154
15090
  parent_id: parentId,
15155
15091
  correlation_id: corrId,
15156
15092
  error_code: error.code,
@@ -15164,12 +15100,12 @@ class DefaultNodeAttachClient {
15164
15100
  }
15165
15101
  }
15166
15102
  else {
15167
- logger$13.debug('parent_certificate_validation_skipped', {
15103
+ logger$14.debug('parent_certificate_validation_skipped', {
15168
15104
  parent_id: parentId,
15169
15105
  reason: 'no_validator',
15170
15106
  });
15171
15107
  }
15172
- logger$13.debug('processing_node_attach_ack', {
15108
+ logger$14.debug('processing_node_attach_ack', {
15173
15109
  parent_id: ackFrame.targetSystemId,
15174
15110
  });
15175
15111
  this.inHandshake = false;
@@ -15200,7 +15136,7 @@ class DefaultNodeAttachClient {
15200
15136
  }
15201
15137
  }
15202
15138
  catch (error) {
15203
- logger$13.debug('stickiness_accept_skipped', {
15139
+ logger$14.debug('stickiness_accept_skipped', {
15204
15140
  error: error instanceof Error ? error.message : String(error),
15205
15141
  });
15206
15142
  }
@@ -15254,7 +15190,7 @@ class DefaultNodeAttachClient {
15254
15190
  // NodeAttach frames during handshake are expected in multi-agent scenarios
15255
15191
  // where multiple agents attach concurrently to the same channel
15256
15192
  if (envelope.frame.type === 'NodeAttach') {
15257
- logger$13.debug('handshake_ignoring_concurrent_attach', {
15193
+ logger$14.debug('handshake_ignoring_concurrent_attach', {
15258
15194
  frame_type: envelope.frame.type,
15259
15195
  frame_system_id: envelope.frame?.systemId ??
15260
15196
  'unknown',
@@ -15262,7 +15198,7 @@ class DefaultNodeAttachClient {
15262
15198
  }
15263
15199
  else {
15264
15200
  // Other unexpected frames are still logged as errors
15265
- logger$13.error('unexpected_frame_during_handshake', {
15201
+ logger$14.error('unexpected_frame_during_handshake', {
15266
15202
  frame_type: envelope.frame.type,
15267
15203
  });
15268
15204
  }
@@ -15402,7 +15338,7 @@ class TraceEmitterFactory extends AbstractResourceFactory {
15402
15338
  // void import('./trace-emitter-profile-factory.js');
15403
15339
 
15404
15340
  const BINDING_STORE_NAMESPACE = '__binding_store';
15405
- const logger$12 = getLogger('naylence.fame.node.factory_commons');
15341
+ const logger$13 = getLogger('naylence.fame.node.factory_commons');
15406
15342
  function isPlainRecord$2(value) {
15407
15343
  return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
15408
15344
  }
@@ -15596,7 +15532,7 @@ async function resolveNodeIdentityPolicy(config, options) {
15596
15532
  return await NodeIdentityPolicyFactory.createNodeIdentityPolicy(config ?? undefined, cloneCreateOptions(options));
15597
15533
  }
15598
15534
  catch (error) {
15599
- logger$12.warning('node_identity_policy_creation_failed', {
15535
+ logger$13.warning('node_identity_policy_creation_failed', {
15600
15536
  error: error instanceof Error ? error.message : String(error),
15601
15537
  });
15602
15538
  return null;
@@ -15607,7 +15543,7 @@ async function resolveConnectionRetryPolicy(config, options) {
15607
15543
  return await ConnectionRetryPolicyFactory.createConnectionRetryPolicy(config ?? undefined, cloneCreateOptions(options));
15608
15544
  }
15609
15545
  catch (error) {
15610
- logger$12.warning('connection_retry_policy_creation_failed', {
15546
+ logger$13.warning('connection_retry_policy_creation_failed', {
15611
15547
  error: error instanceof Error ? error.message : String(error),
15612
15548
  });
15613
15549
  return null;
@@ -15619,7 +15555,7 @@ async function resolveStorageProvider(config, options) {
15619
15555
  return await StorageProviderFactory.createStorageProvider(config, cloneCreateOptions(options));
15620
15556
  }
15621
15557
  catch (error) {
15622
- logger$12.warning('storage_provider_creation_failed', {
15558
+ logger$13.warning('storage_provider_creation_failed', {
15623
15559
  error: error instanceof Error ? error.message : String(error),
15624
15560
  });
15625
15561
  }
@@ -15641,7 +15577,7 @@ async function resolveAdmissionClient(config, options, identityPolicy) {
15641
15577
  return await AdmissionClientFactory.createAdmissionClient((config ?? null), createOptions);
15642
15578
  }
15643
15579
  catch (error) {
15644
- logger$12.warning('admission_client_creation_failed', {
15580
+ logger$13.warning('admission_client_creation_failed', {
15645
15581
  error: error instanceof Error ? error.message : String(error),
15646
15582
  });
15647
15583
  return null;
@@ -15668,7 +15604,7 @@ async function resolveReplicaStickinessManager(hasParent, requestedLogicals, opt
15668
15604
  return await ReplicaStickinessManagerFactory.createReplicaStickinessManager(undefined, cloneCreateOptions(options));
15669
15605
  }
15670
15606
  catch (error) {
15671
- logger$12.debug('replica_stickiness_manager_unavailable', { error });
15607
+ logger$13.debug('replica_stickiness_manager_unavailable', { error });
15672
15608
  return null;
15673
15609
  }
15674
15610
  }
@@ -15677,7 +15613,7 @@ async function resolveAttachmentKeyValidator(config, options) {
15677
15613
  return await AttachmentKeyValidatorFactory.createAttachmentKeyValidator(config ?? undefined, cloneCreateOptions(options));
15678
15614
  }
15679
15615
  catch (error) {
15680
- logger$12.warning('attachment_key_validator_creation_failed', {
15616
+ logger$13.warning('attachment_key_validator_creation_failed', {
15681
15617
  error: error instanceof Error ? error.message : String(error),
15682
15618
  });
15683
15619
  return null;
@@ -15695,7 +15631,7 @@ async function resolveDeliveryPolicy(config, options) {
15695
15631
  return await DeliveryPolicyFactory.createDeliveryPolicy(config ?? undefined, cloneCreateOptions(options));
15696
15632
  }
15697
15633
  catch (error) {
15698
- logger$12.warning('delivery_policy_creation_failed', {
15634
+ logger$13.warning('delivery_policy_creation_failed', {
15699
15635
  error: error instanceof Error ? error.message : String(error),
15700
15636
  });
15701
15637
  return null;
@@ -15709,7 +15645,7 @@ async function resolveTransportListeners(configs, eventListeners, options) {
15709
15645
  return await TransportListenerFactory.createTransportListeners(configs, eventListeners, cloneCreateOptions(options));
15710
15646
  }
15711
15647
  catch (error) {
15712
- logger$12.warning('transport_listener_creation_failed', {
15648
+ logger$13.warning('transport_listener_creation_failed', {
15713
15649
  error: error instanceof Error ? error.message : String(error),
15714
15650
  });
15715
15651
  return [];
@@ -15720,7 +15656,7 @@ async function resolveTraceEmitter(config, options) {
15720
15656
  return await TraceEmitterFactory.createTraceEmitter(config ?? undefined, cloneCreateOptions(options));
15721
15657
  }
15722
15658
  catch (error) {
15723
- logger$12.warning('trace_emitter_creation_failed', {
15659
+ logger$13.warning('trace_emitter_creation_failed', {
15724
15660
  error: error instanceof Error ? error.message : String(error),
15725
15661
  });
15726
15662
  return null;
@@ -15776,7 +15712,7 @@ async function createSecurityManagerFromConfig(config, overrides, options) {
15776
15712
  return manager ?? null;
15777
15713
  }
15778
15714
  catch (error) {
15779
- logger$12.warning('security_manager_creation_failed', {
15715
+ logger$13.warning('security_manager_creation_failed', {
15780
15716
  error: error instanceof Error ? error.message : String(error),
15781
15717
  });
15782
15718
  return null;
@@ -15805,7 +15741,7 @@ async function resolveCryptoProvider(config, options) {
15805
15741
  // This happens with overlay security profiles that need envelope signing
15806
15742
  if (requiresCryptoProvider(config)) {
15807
15743
  try {
15808
- logger$12.debug('auto_creating_crypto_provider', {
15744
+ logger$13.debug('auto_creating_crypto_provider', {
15809
15745
  reason: 'overlay_security_requires_signing',
15810
15746
  });
15811
15747
  // Dynamically import to avoid circular dependencies
@@ -15825,7 +15761,7 @@ async function resolveCryptoProvider(config, options) {
15825
15761
  });
15826
15762
  }
15827
15763
  catch (error) {
15828
- logger$12.error('failed_to_auto_create_crypto_provider', {
15764
+ logger$13.error('failed_to_auto_create_crypto_provider', {
15829
15765
  error: error instanceof Error ? error.message : String(error),
15830
15766
  });
15831
15767
  throw error;
@@ -16376,7 +16312,7 @@ class NodeLikeFactory extends AbstractResourceFactory {
16376
16312
  // registerFactory(NODE_LIKE_FACTORY_BASE_TYPE, type, factory);
16377
16313
  // }
16378
16314
 
16379
- const FACTORY_META$1a = {
16315
+ const FACTORY_META$1b = {
16380
16316
  base: NODE_LIKE_FACTORY_BASE_TYPE,
16381
16317
  key: 'Node',
16382
16318
  };
@@ -16418,7 +16354,7 @@ class NodeFactory extends NodeLikeFactory {
16418
16354
 
16419
16355
  var nodeFactory = /*#__PURE__*/Object.freeze({
16420
16356
  __proto__: null,
16421
- FACTORY_META: FACTORY_META$1a,
16357
+ FACTORY_META: FACTORY_META$1b,
16422
16358
  NodeFactory: NodeFactory,
16423
16359
  default: NodeFactory
16424
16360
  });
@@ -16995,7 +16931,7 @@ function normalizeSecurityRequirements(value) {
16995
16931
  };
16996
16932
  }
16997
16933
 
16998
- const logger$11 = getLogger('naylence.fame.node.envelope_security_handler');
16934
+ const logger$12 = getLogger('naylence.fame.node.envelope_security_handler');
16999
16935
  const ENCRYPTION_OPTION_ALIAS_PAIRS = [
17000
16936
  ['recipKid', 'recip_kid'],
17001
16937
  ['recipientKeyId', 'recipient_key_id'],
@@ -17044,7 +16980,7 @@ class EnvelopeSecurityHandler {
17044
16980
  const shouldSign = this.securityPolicy
17045
16981
  ? await this.securityPolicy.shouldSignEnvelope(envelope, context, this.node)
17046
16982
  : false;
17047
- logger$11.debug('checking_signing', {
16983
+ logger$12.debug('checking_signing', {
17048
16984
  has_signer: Boolean(this.envelopeSigner),
17049
16985
  should_sign: shouldSign,
17050
16986
  envp_id: envelope.id,
@@ -17066,7 +17002,7 @@ class EnvelopeSecurityHandler {
17066
17002
  const shouldEncrypt = this.securityPolicy
17067
17003
  ? await this.securityPolicy.shouldEncryptEnvelope(envelope, context, this.node)
17068
17004
  : false;
17069
- logger$11.debug('checking_encryption', {
17005
+ logger$12.debug('checking_encryption', {
17070
17006
  has_encryption_manager: Boolean(this.encryptionManager),
17071
17007
  should_encrypt: shouldEncrypt,
17072
17008
  envp_id: envelope.id,
@@ -17074,7 +17010,7 @@ class EnvelopeSecurityHandler {
17074
17010
  });
17075
17011
  if (this.encryptionManager && this.securityPolicy) {
17076
17012
  if (envelope.sec?.enc) {
17077
- logger$11.debug('skipping_encryption_already_encrypted', {
17013
+ logger$12.debug('skipping_encryption_already_encrypted', {
17078
17014
  envp_id: envelope.id,
17079
17015
  destination: envelope.to ? String(envelope.to) : undefined,
17080
17016
  });
@@ -17087,7 +17023,7 @@ class EnvelopeSecurityHandler {
17087
17023
  CryptoLevel.PLAINTEXT;
17088
17024
  desiredCryptoLevel =
17089
17025
  await this.securityPolicy.decideResponseCryptoLevel(requestCryptoLevel, envelope, context);
17090
- logger$11.debug('response_crypto_level_decided', {
17026
+ logger$12.debug('response_crypto_level_decided', {
17091
17027
  envp_id: envelope.id,
17092
17028
  crypto_level: desiredCryptoLevel,
17093
17029
  destination: envelope.to ? String(envelope.to) : undefined,
@@ -17098,7 +17034,7 @@ class EnvelopeSecurityHandler {
17098
17034
  else {
17099
17035
  desiredCryptoLevel =
17100
17036
  await this.securityPolicy.decideOutboundCryptoLevel(envelope, context, this.node);
17101
- logger$11.debug('outbound_crypto_level_decided', {
17037
+ logger$12.debug('outbound_crypto_level_decided', {
17102
17038
  envp_id: envelope.id,
17103
17039
  frame_type: envelope.frame.type,
17104
17040
  crypto_level: desiredCryptoLevel,
@@ -17106,11 +17042,11 @@ class EnvelopeSecurityHandler {
17106
17042
  });
17107
17043
  }
17108
17044
  if (desiredCryptoLevel === CryptoLevel.SEALED) {
17109
- logger$11.debug('applying_sealed_encryption', { envp_id: envelope.id });
17045
+ logger$12.debug('applying_sealed_encryption', { envp_id: envelope.id });
17110
17046
  return await this.handleSealedEncryption(envelope, context);
17111
17047
  }
17112
17048
  if (desiredCryptoLevel === CryptoLevel.CHANNEL) {
17113
- logger$11.debug('applying_channel_encryption', { envp_id: envelope.id });
17049
+ logger$12.debug('applying_channel_encryption', { envp_id: envelope.id });
17114
17050
  return await this.handleChannelEncryption(envelope, context);
17115
17051
  }
17116
17052
  }
@@ -17161,7 +17097,7 @@ class EnvelopeSecurityHandler {
17161
17097
  frameType === 'KeyAnnounce' ||
17162
17098
  frameType === 'SecureOpen' ||
17163
17099
  frameType === 'SecureAccept') {
17164
- logger$11.error('critical_frame_unsigned_rejected', {
17100
+ logger$12.error('critical_frame_unsigned_rejected', {
17165
17101
  envp_id: envelope.id,
17166
17102
  frame_type: frameType,
17167
17103
  reason: 'critical_frames_must_be_signed',
@@ -17169,7 +17105,7 @@ class EnvelopeSecurityHandler {
17169
17105
  return [envelope, false];
17170
17106
  }
17171
17107
  const action = this.securityPolicy.getUnsignedViolationAction(envelope, context);
17172
- logger$11.warning('unsigned_envelope_violation', {
17108
+ logger$12.warning('unsigned_envelope_violation', {
17173
17109
  envp_id: envelope.id,
17174
17110
  frame_type: frameType,
17175
17111
  action,
@@ -17181,26 +17117,26 @@ class EnvelopeSecurityHandler {
17181
17117
  return [envelope, true];
17182
17118
  }
17183
17119
  async handleChannelHandshakeComplete(channelId, destination) {
17184
- logger$11.debug('channel_handshake_completed', {
17120
+ logger$12.debug('channel_handshake_completed', {
17185
17121
  channel_id: channelId,
17186
17122
  destination,
17187
17123
  });
17188
17124
  if (this.encryptionManager?.notifyChannelEstablished) {
17189
17125
  await this.encryptionManager.notifyChannelEstablished(channelId);
17190
- logger$11.debug('notified_encryption_manager_channel_ready', {
17126
+ logger$12.debug('notified_encryption_manager_channel_ready', {
17191
17127
  channel_id: channelId,
17192
17128
  });
17193
17129
  }
17194
17130
  }
17195
17131
  async handleChannelHandshakeFailed(channelId, destination, reason = 'handshake_failed') {
17196
- logger$11.debug('channel_handshake_failed', {
17132
+ logger$12.debug('channel_handshake_failed', {
17197
17133
  channel_id: channelId,
17198
17134
  destination,
17199
17135
  reason,
17200
17136
  });
17201
17137
  if (this.encryptionManager?.notifyChannelFailed) {
17202
17138
  await this.encryptionManager.notifyChannelFailed(channelId, reason);
17203
- logger$11.debug('notified_encryption_manager_channel_failed', {
17139
+ logger$12.debug('notified_encryption_manager_channel_failed', {
17204
17140
  channel_id: channelId,
17205
17141
  reason,
17206
17142
  });
@@ -17247,7 +17183,7 @@ class EnvelopeSecurityHandler {
17247
17183
  checkPayload: false,
17248
17184
  });
17249
17185
  if (verified) {
17250
- logger$11.debug('envelope_verified', {
17186
+ logger$12.debug('envelope_verified', {
17251
17187
  envp_id: envelope.id,
17252
17188
  sid: envelope.sid,
17253
17189
  kid,
@@ -17258,7 +17194,7 @@ class EnvelopeSecurityHandler {
17258
17194
  }
17259
17195
  this.keyManagementHandler.queuePendingSignedEnvelope(kid, envelope, context);
17260
17196
  await this.keyManagementHandler.maybeRequestSigningKey(kid, context.originType, fromSystemId);
17261
- logger$11.debug('queued_envelope_missing_signing_key', {
17197
+ logger$12.debug('queued_envelope_missing_signing_key', {
17262
17198
  kid,
17263
17199
  envp_id: envelope.id,
17264
17200
  });
@@ -17266,7 +17202,7 @@ class EnvelopeSecurityHandler {
17266
17202
  }
17267
17203
  async handleSealedEncryption(envelope, context) {
17268
17204
  if (!envelope.to) {
17269
- logger$11.warning('sealed_encryption_requested_but_no_destination', {
17205
+ logger$12.warning('sealed_encryption_requested_but_no_destination', {
17270
17206
  envp_id: envelope.id,
17271
17207
  });
17272
17208
  return true;
@@ -17278,20 +17214,20 @@ class EnvelopeSecurityHandler {
17278
17214
  : undefined;
17279
17215
  if (options) {
17280
17216
  if (options.encryptionType === 'channel') {
17281
- logger$11.warning('policy_returned_channel_for_sealed_request', {
17217
+ logger$12.warning('policy_returned_channel_for_sealed_request', {
17282
17218
  envp_id: envelope.id,
17283
17219
  });
17284
17220
  return await this.handleToBeEncryptedEnvelopeWithOptions(envelope, context, normalizeEncryptionOptions({
17285
17221
  requestAddress: envelope.to,
17286
17222
  }));
17287
17223
  }
17288
- logger$11.debug('using_sealed_encryption_options', {
17224
+ logger$12.debug('using_sealed_encryption_options', {
17289
17225
  envp_id: envelope.id,
17290
17226
  options,
17291
17227
  });
17292
17228
  return await this.handleToBeEncryptedEnvelopeWithOptions(envelope, context, options);
17293
17229
  }
17294
- logger$11.debug('no_encryption_options_requesting_key', {
17230
+ logger$12.debug('no_encryption_options_requesting_key', {
17295
17231
  envp_id: envelope.id,
17296
17232
  });
17297
17233
  return await this.handleToBeEncryptedEnvelopeWithOptions(envelope, context, normalizeEncryptionOptions({
@@ -17299,7 +17235,7 @@ class EnvelopeSecurityHandler {
17299
17235
  }));
17300
17236
  }
17301
17237
  catch (error) {
17302
- logger$11.debug('sealed_key_lookup_failed_requesting', {
17238
+ logger$12.debug('sealed_key_lookup_failed_requesting', {
17303
17239
  envp_id: envelope.id,
17304
17240
  error: error instanceof Error ? error.message : String(error),
17305
17241
  });
@@ -17310,7 +17246,7 @@ class EnvelopeSecurityHandler {
17310
17246
  }
17311
17247
  async handleChannelEncryption(envelope, context) {
17312
17248
  if (!envelope.to) {
17313
- logger$11.warning('channel_encryption_requested_but_no_destination', {
17249
+ logger$12.warning('channel_encryption_requested_but_no_destination', {
17314
17250
  envp_id: envelope.id,
17315
17251
  });
17316
17252
  return true;
@@ -17325,13 +17261,13 @@ class EnvelopeSecurityHandler {
17325
17261
  return true;
17326
17262
  }
17327
17263
  if (context.originType !== DeliveryOriginType.LOCAL) {
17328
- logger$11.warning('envelope_encryption_rejected_non_local', {
17264
+ logger$12.warning('envelope_encryption_rejected_non_local', {
17329
17265
  origin: context.originType,
17330
17266
  });
17331
17267
  return true;
17332
17268
  }
17333
17269
  if (!isDataFrame$4(envelope.frame)) {
17334
- logger$11.trace('skipping_encryption_non_dataframe', {
17270
+ logger$12.trace('skipping_encryption_non_dataframe', {
17335
17271
  envp_id: envelope.id,
17336
17272
  frame_type: envelope.frame.type,
17337
17273
  });
@@ -17342,7 +17278,7 @@ class EnvelopeSecurityHandler {
17342
17278
  ? normalizeEncryptionOptions(rawOptions)
17343
17279
  : undefined;
17344
17280
  if (!options) {
17345
- logger$11.warning('no_encryption_options_provided', {
17281
+ logger$12.warning('no_encryption_options_provided', {
17346
17282
  envp_id: envelope.id,
17347
17283
  });
17348
17284
  return true;
@@ -17354,13 +17290,13 @@ class EnvelopeSecurityHandler {
17354
17290
  return true;
17355
17291
  }
17356
17292
  if (context.originType !== DeliveryOriginType.LOCAL) {
17357
- logger$11.warning('envelope_encryption_rejected_non_local', {
17293
+ logger$12.warning('envelope_encryption_rejected_non_local', {
17358
17294
  origin: context.originType,
17359
17295
  });
17360
17296
  return true;
17361
17297
  }
17362
17298
  if (!isDataFrame$4(envelope.frame)) {
17363
- logger$11.trace('skipping_encryption_non_dataframe', {
17299
+ logger$12.trace('skipping_encryption_non_dataframe', {
17364
17300
  envp_id: envelope.id,
17365
17301
  frame_type: envelope.frame.type,
17366
17302
  });
@@ -17377,7 +17313,7 @@ class EnvelopeSecurityHandler {
17377
17313
  // Skip encryption if envelope is already encrypted
17378
17314
  // This prevents re-queuing when replayed envelopes go through security again
17379
17315
  if (envelope.sec?.enc) {
17380
- logger$11.debug('skipping_encryption_already_encrypted', {
17316
+ logger$12.debug('skipping_encryption_already_encrypted', {
17381
17317
  envp_id: envelope.id,
17382
17318
  destination: envelope.to ? String(envelope.to) : undefined,
17383
17319
  });
@@ -17386,14 +17322,14 @@ class EnvelopeSecurityHandler {
17386
17322
  try {
17387
17323
  const result = await this.encryptionManager.encryptEnvelope(envelope, normalizedOptions);
17388
17324
  if (result.status === EncryptionStatus.QUEUED) {
17389
- logger$11.debug('envelope_queued_for_encryption', {
17325
+ logger$12.debug('envelope_queued_for_encryption', {
17390
17326
  envp_id: envelope.id,
17391
17327
  });
17392
17328
  await this.handleEncryptionQueueing(envelope, context, normalizedOptions);
17393
17329
  return false;
17394
17330
  }
17395
17331
  if (result.status === EncryptionStatus.OK) {
17396
- logger$11.debug('envelope_encrypted', { envp_id: envelope.id });
17332
+ logger$12.debug('envelope_encrypted', { envp_id: envelope.id });
17397
17333
  if (result.envelope) {
17398
17334
  envelope.frame = result.envelope.frame;
17399
17335
  envelope.sec = result.envelope.sec;
@@ -17401,17 +17337,17 @@ class EnvelopeSecurityHandler {
17401
17337
  return true;
17402
17338
  }
17403
17339
  if (result.status === EncryptionStatus.SKIPPED) {
17404
- logger$11.debug('envelope_encryption_skipped', { envp_id: envelope.id });
17340
+ logger$12.debug('envelope_encryption_skipped', { envp_id: envelope.id });
17405
17341
  return true;
17406
17342
  }
17407
- logger$11.warning('unknown_encryption_status', {
17343
+ logger$12.warning('unknown_encryption_status', {
17408
17344
  envp_id: envelope.id,
17409
17345
  status: result.status,
17410
17346
  });
17411
17347
  return true;
17412
17348
  }
17413
17349
  catch (error) {
17414
- logger$11.error('encryption_failed', {
17350
+ logger$12.error('encryption_failed', {
17415
17351
  envp_id: envelope.id,
17416
17352
  error: error instanceof Error ? error.message : String(error),
17417
17353
  });
@@ -17450,7 +17386,7 @@ class EnvelopeSecurityHandler {
17450
17386
  return;
17451
17387
  }
17452
17388
  if (normalizedOptions.encryptionType === 'channel') {
17453
- logger$11.debug('channel_encryption_queueing_handled_internally', {
17389
+ logger$12.debug('channel_encryption_queueing_handled_internally', {
17454
17390
  envp_id: envelope.id,
17455
17391
  destination: normalizedOptions.destination
17456
17392
  ? String(normalizedOptions.destination)
@@ -17458,13 +17394,13 @@ class EnvelopeSecurityHandler {
17458
17394
  });
17459
17395
  return;
17460
17396
  }
17461
- logger$11.warning('unknown_encryption_queueing_options', {
17397
+ logger$12.warning('unknown_encryption_queueing_options', {
17462
17398
  envp_id: envelope.id,
17463
17399
  options: normalizedOptions,
17464
17400
  });
17465
17401
  }
17466
17402
  async handleFailedChannelEnvelopeCleanup(destination, reason) {
17467
- logger$11.debug('channel_handshake_failure_cleanup_attempted', {
17403
+ logger$12.debug('channel_handshake_failure_cleanup_attempted', {
17468
17404
  destination,
17469
17405
  reason,
17470
17406
  note: 'envelope_cleanup_handled_by_encryption_manager',
@@ -17475,7 +17411,7 @@ class EnvelopeSecurityHandler {
17475
17411
  }
17476
17412
  }
17477
17413
 
17478
- const logger$10 = getLogger('naylence.fame.node.secure_channel_frame_handler');
17414
+ const logger$11 = getLogger('naylence.fame.node.secure_channel_frame_handler');
17479
17415
  function isPlainRecord$1(value) {
17480
17416
  if (typeof value !== 'object' || value === null) {
17481
17417
  return false;
@@ -17565,7 +17501,7 @@ class SecureChannelFrameHandler {
17565
17501
  assertSecureChannelManager(this.secureChannelManager);
17566
17502
  const frame = envelope.frame;
17567
17503
  assertFrameType(frame, 'SecureOpen');
17568
- logger$10.debug('received_secure_open', {
17504
+ logger$11.debug('received_secure_open', {
17569
17505
  cid: frame.cid,
17570
17506
  algorithm: frame.alg,
17571
17507
  });
@@ -17588,13 +17524,13 @@ class SecureChannelFrameHandler {
17588
17524
  stickySid: envelope.sid ?? undefined,
17589
17525
  expectedResponseType: FameResponseType.NONE,
17590
17526
  };
17591
- logger$10.debug('stickiness_requested_for_channel_encryption', {
17527
+ logger$11.debug('stickiness_requested_for_channel_encryption', {
17592
17528
  cid: frame.cid,
17593
17529
  reason: 'secure_channel_established',
17594
17530
  });
17595
17531
  }
17596
17532
  await this.sendCallback(responseEnvelope, responseContext);
17597
- logger$10.debug('sent_secure_accept', { cid: frame.cid, ok: acceptFrame.ok });
17533
+ logger$11.debug('sent_secure_accept', { cid: frame.cid, ok: acceptFrame.ok });
17598
17534
  if (acceptFrame.ok && this.envelopeSecurityHandler) {
17599
17535
  const destination = extractDestinationFromChannelId(frame.cid);
17600
17536
  if (destination) {
@@ -17606,13 +17542,13 @@ class SecureChannelFrameHandler {
17606
17542
  assertSecureChannelManager(this.secureChannelManager);
17607
17543
  const frame = envelope.frame;
17608
17544
  assertFrameType(frame, 'SecureAccept');
17609
- logger$10.debug('received_secure_accept', { cid: frame.cid, ok: frame.ok });
17545
+ logger$11.debug('received_secure_accept', { cid: frame.cid, ok: frame.ok });
17610
17546
  const success = await this.secureChannelManager.handleAcceptFrame(frame);
17611
17547
  if (!success) {
17612
- logger$10.warning('failed_to_complete_channel', { cid: frame.cid });
17548
+ logger$11.warning('failed_to_complete_channel', { cid: frame.cid });
17613
17549
  }
17614
17550
  else {
17615
- logger$10.debug('channel_established', { cid: frame.cid });
17551
+ logger$11.debug('channel_established', { cid: frame.cid });
17616
17552
  if (this.envelopeSecurityHandler) {
17617
17553
  const destination = extractDestinationFromChannelId(frame.cid);
17618
17554
  if (destination) {
@@ -17624,7 +17560,7 @@ class SecureChannelFrameHandler {
17624
17560
  const destination = extractDestinationFromChannelId(frame.cid);
17625
17561
  if (destination) {
17626
17562
  await this.envelopeSecurityHandler.handleChannelHandshakeFailed(frame.cid, destination, 'negative_secure_accept');
17627
- logger$10.debug('notified_handshake_failure', {
17563
+ logger$11.debug('notified_handshake_failure', {
17628
17564
  cid: frame.cid,
17629
17565
  destination,
17630
17566
  });
@@ -17635,7 +17571,7 @@ class SecureChannelFrameHandler {
17635
17571
  assertSecureChannelManager(this.secureChannelManager);
17636
17572
  const frame = envelope.frame;
17637
17573
  assertFrameType(frame, 'SecureClose');
17638
- logger$10.debug('received_secure_close', {
17574
+ logger$11.debug('received_secure_close', {
17639
17575
  cid: frame.cid,
17640
17576
  reason: frame.reason,
17641
17577
  });
@@ -17693,7 +17629,7 @@ function createNodeDeliveryContext(options = {}) {
17693
17629
  class FameEnvironmentContext {
17694
17630
  }
17695
17631
 
17696
- const FACTORY_META$19 = {
17632
+ const FACTORY_META$1a = {
17697
17633
  base: NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE,
17698
17634
  key: 'DefaultNodeIdentityPolicy',
17699
17635
  };
@@ -17711,11 +17647,48 @@ class DefaultNodeIdentityPolicyFactory extends NodeIdentityPolicyFactory {
17711
17647
  var defaultNodeIdentityPolicyFactory = /*#__PURE__*/Object.freeze({
17712
17648
  __proto__: null,
17713
17649
  DefaultNodeIdentityPolicyFactory: DefaultNodeIdentityPolicyFactory,
17714
- FACTORY_META: FACTORY_META$19,
17650
+ FACTORY_META: FACTORY_META$1a,
17715
17651
  default: DefaultNodeIdentityPolicyFactory
17716
17652
  });
17717
17653
 
17718
- const logger$$ = getLogger('naylence.fame.node.token_subject_node_identity_policy');
17654
+ const TOKEN_PROVIDER_FACTORY_BASE_TYPE = 'TokenProviderFactory';
17655
+ class TokenProviderFactory extends AbstractResourceFactory {
17656
+ static async createTokenProvider(config, options = {}) {
17657
+ if (config) {
17658
+ const provider = await createResource$1(TOKEN_PROVIDER_FACTORY_BASE_TYPE, config, options);
17659
+ if (!provider) {
17660
+ throw new Error('Failed to create token provider from configuration');
17661
+ }
17662
+ return provider;
17663
+ }
17664
+ let provider = null;
17665
+ try {
17666
+ provider = await createDefaultResource(TOKEN_PROVIDER_FACTORY_BASE_TYPE, null, options);
17667
+ }
17668
+ catch (error) {
17669
+ const message = 'Failed to create default token provider' +
17670
+ (error instanceof Error && error.message ? `: ${error.message}` : '');
17671
+ throw new Error(message);
17672
+ }
17673
+ if (!provider) {
17674
+ throw new Error('Failed to create default token provider');
17675
+ }
17676
+ return provider;
17677
+ }
17678
+ }
17679
+
17680
+ function isTokenProvider(candidate) {
17681
+ return (typeof candidate === 'object' &&
17682
+ candidate !== null &&
17683
+ typeof candidate.getToken === 'function');
17684
+ }
17685
+ function isIdentityExposingTokenProvider(candidate) {
17686
+ return (isTokenProvider(candidate) &&
17687
+ typeof candidate.getIdentity ===
17688
+ 'function');
17689
+ }
17690
+
17691
+ const logger$10 = getLogger('naylence.fame.node.token_subject_node_identity_policy');
17719
17692
  class TokenSubjectNodeIdentityPolicy {
17720
17693
  async resolveInitialNodeId(context) {
17721
17694
  if (context.configuredId) {
@@ -17727,7 +17700,7 @@ class TokenSubjectNodeIdentityPolicy {
17727
17700
  return generateIdAsync();
17728
17701
  }
17729
17702
  async resolveAdmissionNodeId(context) {
17730
- logger$$.debug('resolve_admission_node_id_start', {
17703
+ logger$10.debug('resolve_admission_node_id_start', {
17731
17704
  grantsCount: context.grants?.length ?? 0,
17732
17705
  currentNodeId: context.currentNodeId,
17733
17706
  });
@@ -17736,31 +17709,31 @@ class TokenSubjectNodeIdentityPolicy {
17736
17709
  try {
17737
17710
  const auth = grant.auth;
17738
17711
  if (!auth) {
17739
- logger$$.debug('skipping_grant_no_auth', { grantType: grant.type });
17712
+ logger$10.debug('skipping_grant_no_auth', { grantType: grant.type });
17740
17713
  continue;
17741
17714
  }
17742
17715
  const tokenProviderConfig = (auth.tokenProvider ??
17743
17716
  auth.token_provider);
17744
17717
  if (!tokenProviderConfig ||
17745
17718
  typeof tokenProviderConfig.type !== 'string') {
17746
- logger$$.debug('skipping_grant_invalid_token_provider_config', {
17719
+ logger$10.debug('skipping_grant_invalid_token_provider_config', {
17747
17720
  grantType: grant.type,
17748
17721
  config: tokenProviderConfig,
17749
17722
  });
17750
17723
  continue;
17751
17724
  }
17752
- logger$$.debug('creating_token_provider', {
17725
+ logger$10.debug('creating_token_provider', {
17753
17726
  type: tokenProviderConfig.type,
17754
17727
  });
17755
17728
  const provider = await TokenProviderFactory.createTokenProvider(tokenProviderConfig);
17756
17729
  const isExposing = isIdentityExposingTokenProvider(provider);
17757
- logger$$.debug('token_provider_created', {
17730
+ logger$10.debug('token_provider_created', {
17758
17731
  type: tokenProviderConfig.type,
17759
17732
  isIdentityExposing: isExposing,
17760
17733
  });
17761
17734
  if (isExposing) {
17762
17735
  const identity = await provider.getIdentity();
17763
- logger$$.debug('retrieved_identity', { identity });
17736
+ logger$10.debug('retrieved_identity', { identity });
17764
17737
  if (identity && identity.subject) {
17765
17738
  const hashedSubject = await generateIdAsync({
17766
17739
  mode: 'fingerprint',
@@ -17768,7 +17741,7 @@ class TokenSubjectNodeIdentityPolicy {
17768
17741
  length: 8,
17769
17742
  });
17770
17743
  const newNodeId = `${hashedSubject}-${context.currentNodeId}`;
17771
- logger$$.info('resolved_identity_from_token', {
17744
+ logger$10.info('resolved_identity_from_token', {
17772
17745
  subject: identity.subject,
17773
17746
  hashedSubject,
17774
17747
  newNodeId,
@@ -17776,17 +17749,17 @@ class TokenSubjectNodeIdentityPolicy {
17776
17749
  return newNodeId;
17777
17750
  }
17778
17751
  else {
17779
- logger$$.debug('identity_missing_subject', { identity });
17752
+ logger$10.debug('identity_missing_subject', { identity });
17780
17753
  }
17781
17754
  }
17782
17755
  }
17783
17756
  catch (err) {
17784
- logger$$.warning('failed_to_extract_identity_from_grant', { error: err });
17757
+ logger$10.warning('failed_to_extract_identity_from_grant', { error: err });
17785
17758
  }
17786
17759
  }
17787
17760
  }
17788
17761
  else {
17789
- logger$$.debug('no_grants_available');
17762
+ logger$10.debug('no_grants_available');
17790
17763
  }
17791
17764
  return context.currentNodeId;
17792
17765
  }
@@ -17797,7 +17770,7 @@ var tokenSubjectNodeIdentityPolicy = /*#__PURE__*/Object.freeze({
17797
17770
  TokenSubjectNodeIdentityPolicy: TokenSubjectNodeIdentityPolicy
17798
17771
  });
17799
17772
 
17800
- const FACTORY_META$18 = {
17773
+ const FACTORY_META$19 = {
17801
17774
  base: NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE,
17802
17775
  key: 'TokenSubjectNodeIdentityPolicy',
17803
17776
  };
@@ -17816,27 +17789,27 @@ class TokenSubjectNodeIdentityPolicyFactory extends NodeIdentityPolicyFactory {
17816
17789
 
17817
17790
  var tokenSubjectNodeIdentityPolicyFactory = /*#__PURE__*/Object.freeze({
17818
17791
  __proto__: null,
17819
- FACTORY_META: FACTORY_META$18,
17792
+ FACTORY_META: FACTORY_META$19,
17820
17793
  TokenSubjectNodeIdentityPolicyFactory: TokenSubjectNodeIdentityPolicyFactory,
17821
17794
  default: TokenSubjectNodeIdentityPolicyFactory
17822
17795
  });
17823
17796
 
17824
- const logger$_ = getLogger('naylence.fame.node.node_identity_policy_profile_factory');
17825
- const PROFILE_NAME_DEFAULT = 'default';
17797
+ const logger$$ = getLogger('naylence.fame.node.node_identity_policy_profile_factory');
17798
+ const PROFILE_NAME_DEFAULT$1 = 'default';
17826
17799
  const PROFILE_NAME_TOKEN_SUBJECT = 'token-subject';
17827
17800
  const PROFILE_NAME_TOKEN_SUBJECT_ALIAS = 'token_subject';
17828
- const DEFAULT_PROFILE = {
17801
+ const DEFAULT_PROFILE$1 = {
17829
17802
  type: 'DefaultNodeIdentityPolicy',
17830
17803
  };
17831
17804
  const TOKEN_SUBJECT_PROFILE = {
17832
17805
  type: 'TokenSubjectNodeIdentityPolicy',
17833
17806
  };
17834
- const PROFILE_MAP$5 = {
17835
- [PROFILE_NAME_DEFAULT]: DEFAULT_PROFILE,
17807
+ const PROFILE_MAP$6 = {
17808
+ [PROFILE_NAME_DEFAULT$1]: DEFAULT_PROFILE$1,
17836
17809
  [PROFILE_NAME_TOKEN_SUBJECT]: TOKEN_SUBJECT_PROFILE,
17837
17810
  [PROFILE_NAME_TOKEN_SUBJECT_ALIAS]: TOKEN_SUBJECT_PROFILE,
17838
17811
  };
17839
- const FACTORY_META$17 = {
17812
+ const FACTORY_META$18 = {
17840
17813
  base: NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE,
17841
17814
  key: 'NodeIdentityPolicyProfile',
17842
17815
  };
@@ -17846,17 +17819,17 @@ class NodeIdentityPolicyProfileFactory extends NodeIdentityPolicyFactory {
17846
17819
  this.type = 'NodeIdentityPolicyProfile';
17847
17820
  }
17848
17821
  async create(config) {
17849
- const normalized = normalizeConfig$w(config);
17850
- const profileConfig = resolveProfileConfig$4(normalized.profile);
17851
- logger$_.debug('enabling_node_identity_policy_profile', {
17822
+ const normalized = normalizeConfig$x(config);
17823
+ const profileConfig = resolveProfileConfig$5(normalized.profile);
17824
+ logger$$.debug('enabling_node_identity_policy_profile', {
17852
17825
  profile: normalized.profile,
17853
17826
  });
17854
17827
  return NodeIdentityPolicyFactory.createNodeIdentityPolicy(profileConfig);
17855
17828
  }
17856
17829
  }
17857
- function normalizeConfig$w(config) {
17830
+ function normalizeConfig$x(config) {
17858
17831
  if (!config) {
17859
- return { profile: PROFILE_NAME_DEFAULT };
17832
+ return { profile: PROFILE_NAME_DEFAULT$1 };
17860
17833
  }
17861
17834
  const candidate = config;
17862
17835
  const profileValue = typeof candidate.profile === 'string' && candidate.profile.trim().length > 0
@@ -17867,24 +17840,24 @@ function normalizeConfig$w(config) {
17867
17840
  : typeof candidate.profileName === 'string' &&
17868
17841
  candidate.profileName.trim().length > 0
17869
17842
  ? candidate.profileName
17870
- : PROFILE_NAME_DEFAULT;
17843
+ : PROFILE_NAME_DEFAULT$1;
17871
17844
  const normalizedProfile = profileValue.trim().toLowerCase();
17872
17845
  return { profile: normalizedProfile };
17873
17846
  }
17874
- function resolveProfileConfig$4(profileName) {
17875
- const profile = PROFILE_MAP$5[profileName];
17847
+ function resolveProfileConfig$5(profileName) {
17848
+ const profile = PROFILE_MAP$6[profileName];
17876
17849
  if (!profile) {
17877
17850
  throw new Error(`Unknown node identity policy profile: ${profileName}`);
17878
17851
  }
17879
- return deepClone$4(profile);
17852
+ return deepClone$5(profile);
17880
17853
  }
17881
- function deepClone$4(value) {
17854
+ function deepClone$5(value) {
17882
17855
  return JSON.parse(JSON.stringify(value));
17883
17856
  }
17884
17857
 
17885
17858
  var nodeIdentityPolicyProfileFactory = /*#__PURE__*/Object.freeze({
17886
17859
  __proto__: null,
17887
- FACTORY_META: FACTORY_META$17,
17860
+ FACTORY_META: FACTORY_META$18,
17888
17861
  NodeIdentityPolicyProfileFactory: NodeIdentityPolicyProfileFactory,
17889
17862
  default: NodeIdentityPolicyProfileFactory
17890
17863
  });
@@ -17937,8 +17910,8 @@ class DefaultConnectionRetryPolicy {
17937
17910
  }
17938
17911
  }
17939
17912
 
17940
- const logger$Z = getLogger('naylence.fame.node.default-connection-retry-policy-factory');
17941
- const FACTORY_META$16 = {
17913
+ const logger$_ = getLogger('naylence.fame.node.default-connection-retry-policy-factory');
17914
+ const FACTORY_META$17 = {
17942
17915
  base: CONNECTION_RETRY_POLICY_FACTORY_BASE_TYPE,
17943
17916
  key: 'DefaultConnectionRetryPolicy',
17944
17917
  };
@@ -17959,7 +17932,7 @@ class DefaultConnectionRetryPolicyFactory extends ConnectionRetryPolicyFactory {
17959
17932
  }
17960
17933
  }
17961
17934
  const policy = new DefaultConnectionRetryPolicy(options);
17962
- logger$Z.debug('connection_retry_policy_created', {
17935
+ logger$_.debug('connection_retry_policy_created', {
17963
17936
  maxInitialAttempts: policy.maxInitialAttempts,
17964
17937
  });
17965
17938
  return policy;
@@ -17969,7 +17942,7 @@ class DefaultConnectionRetryPolicyFactory extends ConnectionRetryPolicyFactory {
17969
17942
  var defaultConnectionRetryPolicyFactory = /*#__PURE__*/Object.freeze({
17970
17943
  __proto__: null,
17971
17944
  DefaultConnectionRetryPolicyFactory: DefaultConnectionRetryPolicyFactory,
17972
- FACTORY_META: FACTORY_META$16,
17945
+ FACTORY_META: FACTORY_META$17,
17973
17946
  default: DefaultConnectionRetryPolicyFactory
17974
17947
  });
17975
17948
 
@@ -17984,7 +17957,7 @@ class LoadBalancerStickinessManagerFactory extends AbstractResourceFactory {
17984
17957
  }
17985
17958
  }
17986
17959
 
17987
- const logger$Y = getLogger('naylence.fame.sentinel.load_balancing.composite_load_balancing_strategy');
17960
+ const logger$Z = getLogger('naylence.fame.sentinel.load_balancing.composite_load_balancing_strategy');
17988
17961
  class CompositeLoadBalancingStrategy {
17989
17962
  constructor(strategies) {
17990
17963
  if (!strategies.length) {
@@ -18001,7 +17974,7 @@ class CompositeLoadBalancingStrategy {
18001
17974
  try {
18002
17975
  const result = strategy.choose(poolKey, segments, envelope);
18003
17976
  if (result !== null) {
18004
- logger$Y.debug('composite_strategy_success', {
17977
+ logger$Z.debug('composite_strategy_success', {
18005
17978
  envelopeId: envelope.id,
18006
17979
  poolKey,
18007
17980
  strategyIndex: index,
@@ -18012,7 +17985,7 @@ class CompositeLoadBalancingStrategy {
18012
17985
  }
18013
17986
  }
18014
17987
  catch (error) {
18015
- logger$Y.warning('composite_strategy_error', {
17988
+ logger$Z.warning('composite_strategy_error', {
18016
17989
  envelopeId: envelope.id,
18017
17990
  poolKey,
18018
17991
  strategyIndex: index,
@@ -18021,7 +17994,7 @@ class CompositeLoadBalancingStrategy {
18021
17994
  });
18022
17995
  }
18023
17996
  }
18024
- logger$Y.debug('composite_strategy_all_failed', {
17997
+ logger$Z.debug('composite_strategy_all_failed', {
18025
17998
  envelopeId: envelope.id,
18026
17999
  poolKey,
18027
18000
  strategyCount: this.strategies.length,
@@ -18030,7 +18003,7 @@ class CompositeLoadBalancingStrategy {
18030
18003
  }
18031
18004
  }
18032
18005
 
18033
- const logger$X = getLogger('naylence.fame.sentinel.load_balancing.sticky_load_balancing_strategy');
18006
+ const logger$Y = getLogger('naylence.fame.sentinel.load_balancing.sticky_load_balancing_strategy');
18034
18007
  class StickyLoadBalancingStrategy {
18035
18008
  constructor(stickinessManager) {
18036
18009
  this.lastChosenReplica = null;
@@ -18045,7 +18018,7 @@ class StickyLoadBalancingStrategy {
18045
18018
  }
18046
18019
  const stickyReplica = this.stickinessManager.getStickyReplicaSegment(envelope, segments);
18047
18020
  if (stickyReplica && segments.includes(stickyReplica)) {
18048
- logger$X.debug('routing_via_stickiness', {
18021
+ logger$Y.debug('routing_via_stickiness', {
18049
18022
  envelopeId: envelope.id,
18050
18023
  poolKey,
18051
18024
  replicaId: stickyReplica,
@@ -18055,7 +18028,7 @@ class StickyLoadBalancingStrategy {
18055
18028
  this.lastChosenReplica = stickyReplica;
18056
18029
  return stickyReplica;
18057
18030
  }
18058
- logger$X.debug('no_stickiness_match_fallback', {
18031
+ logger$Y.debug('no_stickiness_match_fallback', {
18059
18032
  envelopeId: envelope.id,
18060
18033
  poolKey,
18061
18034
  aftPresent: Boolean(envelope.aft),
@@ -18143,7 +18116,7 @@ class RouteStoreFactory extends AbstractResourceFactory {
18143
18116
  return store ?? null;
18144
18117
  }
18145
18118
  }
18146
- const FACTORY_META$15 = {
18119
+ const FACTORY_META$16 = {
18147
18120
  base: ROUTE_STORE_FACTORY_BASE_TYPE,
18148
18121
  key: 'InMemoryRouteStore',
18149
18122
  };
@@ -18161,7 +18134,7 @@ class InMemoryRouteStoreFactory extends RouteStoreFactory {
18161
18134
 
18162
18135
  var routeStoreFactory = /*#__PURE__*/Object.freeze({
18163
18136
  __proto__: null,
18164
- FACTORY_META: FACTORY_META$15,
18137
+ FACTORY_META: FACTORY_META$16,
18165
18138
  InMemoryRouteStoreFactory: InMemoryRouteStoreFactory,
18166
18139
  ROUTE_STORE_FACTORY_BASE_TYPE: ROUTE_STORE_FACTORY_BASE_TYPE,
18167
18140
  RouteStoreFactory: RouteStoreFactory,
@@ -18393,7 +18366,7 @@ function resolveRecordArray(primary, secondary) {
18393
18366
  return pickRecordArray(candidate) ?? undefined;
18394
18367
  }
18395
18368
 
18396
- const logger$W = getLogger('naylence.fame.sentinel.route_manager');
18369
+ const logger$X = getLogger('naylence.fame.sentinel.route_manager');
18397
18370
  const DEFAULT_CONNECTOR_CLEANUP_DELAY_MS$1 = 200;
18398
18371
  function normalizeRouteManagerOptions(options) {
18399
18372
  const { route_store, get_id, cleanup_delay_ms, retain_address_bindings_on_disconnect, ...rest } = options;
@@ -18477,7 +18450,7 @@ class RouteManager extends TaskSpawner {
18477
18450
  await this.safeStop(entry.connector);
18478
18451
  }
18479
18452
  catch (error) {
18480
- logger$W.debug('pending_route_stop_failed', {
18453
+ logger$X.debug('pending_route_stop_failed', {
18481
18454
  error: error instanceof Error ? error.message : String(error),
18482
18455
  });
18483
18456
  }
@@ -18500,7 +18473,7 @@ class RouteManager extends TaskSpawner {
18500
18473
  this.cancelPendingCleanup(segment);
18501
18474
  this.downstreamRoutes.set(segment, route);
18502
18475
  });
18503
- logger$W.debug('registered_downstream_route', { route: segment });
18476
+ logger$X.debug('registered_downstream_route', { route: segment });
18504
18477
  }
18505
18478
  async unregisterDownstreamRoute(segment, options) {
18506
18479
  const normalizedOptions = normalizeRouteRemovalOptions(options);
@@ -18516,7 +18489,7 @@ class RouteManager extends TaskSpawner {
18516
18489
  this.cancelPendingCleanup(segment);
18517
18490
  this._peer_routes.set(segment, route);
18518
18491
  });
18519
- logger$W.debug('registered_peer_route', { route: segment });
18492
+ logger$X.debug('registered_peer_route', { route: segment });
18520
18493
  }
18521
18494
  async unregisterPeerRoute(segment, options) {
18522
18495
  const normalizedOptions = normalizeRouteRemovalOptions(options);
@@ -18534,11 +18507,11 @@ class RouteManager extends TaskSpawner {
18534
18507
  await Promise.all(entryTuples.map(async ([segment, entry]) => {
18535
18508
  const normalized = this.normalizeEntry(entry);
18536
18509
  if (!normalized.connectorConfig) {
18537
- logger$W.warning('route_restore_missing_config', { segment });
18510
+ logger$X.warning('route_restore_missing_config', { segment });
18538
18511
  return;
18539
18512
  }
18540
18513
  if (normalized.attachExpiresAt && normalized.attachExpiresAt < now) {
18541
- logger$W.debug('skipping_expired_route', { segment });
18514
+ logger$X.debug('skipping_expired_route', { segment });
18542
18515
  return;
18543
18516
  }
18544
18517
  const authorization = this.parseAuthorization(normalized.metadata);
@@ -18571,7 +18544,7 @@ class RouteManager extends TaskSpawner {
18571
18544
  }
18572
18545
  catch (error) {
18573
18546
  if (this.isTransientError(error)) {
18574
- logger$W.warning('transient_restore_failure', {
18547
+ logger$X.warning('transient_restore_failure', {
18575
18548
  segment,
18576
18549
  attempt,
18577
18550
  error: error instanceof Error ? error.message : String(error),
@@ -18580,7 +18553,7 @@ class RouteManager extends TaskSpawner {
18580
18553
  backoff *= 2;
18581
18554
  continue;
18582
18555
  }
18583
- logger$W.error('failed_to_restore_route', {
18556
+ logger$X.error('failed_to_restore_route', {
18584
18557
  segment,
18585
18558
  error: error instanceof Error ? error.message : String(error),
18586
18559
  });
@@ -18609,13 +18582,13 @@ class RouteManager extends TaskSpawner {
18609
18582
  await this._downstream_route_store
18610
18583
  .delete(segment)
18611
18584
  .catch((error) => {
18612
- logger$W.warning('route_expiration_delete_failed', {
18585
+ logger$X.warning('route_expiration_delete_failed', {
18613
18586
  segment,
18614
18587
  error: error instanceof Error ? error.message : String(error),
18615
18588
  });
18616
18589
  });
18617
18590
  this.purgeRouteReferences(segment);
18618
- logger$W.debug('expired_route', { route: segment });
18591
+ logger$X.debug('expired_route', { route: segment });
18619
18592
  }
18620
18593
  async removeDownstreamRoute(segment, options) {
18621
18594
  const normalizedOptions = normalizeRouteRemovalOptions(options);
@@ -18673,7 +18646,7 @@ class RouteManager extends TaskSpawner {
18673
18646
  this.purgeRouteReferences(segment);
18674
18647
  }
18675
18648
  await store.delete(segment).catch((error) => {
18676
- logger$W.warning('route_delete_failed', {
18649
+ logger$X.warning('route_delete_failed', {
18677
18650
  segment,
18678
18651
  error: error instanceof Error ? error.message : String(error),
18679
18652
  });
@@ -18692,7 +18665,7 @@ class RouteManager extends TaskSpawner {
18692
18665
  caller_stack: captureStack ? captureCallerStack() : undefined,
18693
18666
  retained_addresses: retainAddresses,
18694
18667
  };
18695
- logger$W.debug('removed_route', removalMeta);
18668
+ logger$X.debug('removed_route', removalMeta);
18696
18669
  }
18697
18670
  purgeRouteReferences(segment) {
18698
18671
  for (const [address, info] of this._downstream_addresses_routes.entries()) {
@@ -18747,10 +18720,10 @@ class RouteManager extends TaskSpawner {
18747
18720
  }
18748
18721
  catch (error) {
18749
18722
  if (combined.signal.aborted) {
18750
- logger$W.debug('connector_cleanup_cancelled', { segment });
18723
+ logger$X.debug('connector_cleanup_cancelled', { segment });
18751
18724
  }
18752
18725
  else {
18753
- logger$W.debug('connector_cleanup_delay_failed', {
18726
+ logger$X.debug('connector_cleanup_delay_failed', {
18754
18727
  segment,
18755
18728
  error: error instanceof Error ? error.message : String(error),
18756
18729
  });
@@ -18773,7 +18746,7 @@ class RouteManager extends TaskSpawner {
18773
18746
  }
18774
18747
  catch (error) {
18775
18748
  if (error instanceof Error) {
18776
- logger$W.debug('connector_stop_ignored', { error: error.message });
18749
+ logger$X.debug('connector_stop_ignored', { error: error.message });
18777
18750
  }
18778
18751
  }
18779
18752
  for (const [flowId, peer] of this.flowRoutes.entries()) {
@@ -18798,12 +18771,12 @@ class RouteManager extends TaskSpawner {
18798
18771
  }
18799
18772
  }
18800
18773
  catch (error) {
18801
- logger$W.error('janitor_loop_error', {
18774
+ logger$X.error('janitor_loop_error', {
18802
18775
  error: error instanceof Error ? error.message : String(error),
18803
18776
  });
18804
18777
  }
18805
18778
  finally {
18806
- logger$W.debug('janitor_loop_exited');
18779
+ logger$X.debug('janitor_loop_exited');
18807
18780
  }
18808
18781
  }
18809
18782
  async scanStoreForExpirations(store, now, kind) {
@@ -18823,13 +18796,13 @@ class RouteManager extends TaskSpawner {
18823
18796
  }
18824
18797
  });
18825
18798
  await store.delete(segment).catch((error) => {
18826
- logger$W.warning('route_auto_expire_delete_failed', {
18799
+ logger$X.warning('route_auto_expire_delete_failed', {
18827
18800
  segment,
18828
18801
  error: error instanceof Error ? error.message : String(error),
18829
18802
  });
18830
18803
  });
18831
18804
  this.purgeRouteReferences(segment);
18832
- logger$W.debug('auto_expired_route', { segment });
18805
+ logger$X.debug('auto_expired_route', { segment });
18833
18806
  }));
18834
18807
  }
18835
18808
  parseAuthorization(metadata) {
@@ -18852,7 +18825,7 @@ class RouteManager extends TaskSpawner {
18852
18825
  return { ...base, ...extraFields };
18853
18826
  }
18854
18827
  catch (error) {
18855
- logger$W.error('corrupt_route_metadata', {
18828
+ logger$X.error('corrupt_route_metadata', {
18856
18829
  error: error instanceof Error ? error.message : String(error),
18857
18830
  });
18858
18831
  return null;
@@ -18928,12 +18901,12 @@ function captureCallerStack(skip = 3, depth = 6) {
18928
18901
  return frames.map((frame) => frame.trim()).join(' | ');
18929
18902
  }
18930
18903
 
18931
- const logger$V = getLogger('naylence.fame.sentinel.router');
18904
+ const logger$W = getLogger('naylence.fame.sentinel.router');
18932
18905
  const ZERO_EPH_PUB_BASE64 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=';
18933
18906
  class Drop {
18934
18907
  async execute(envelope, router, state, context) {
18935
18908
  await emitDeliveryNack(envelope, router, state, 'NO_ROUTE', context ?? undefined);
18936
- logger$V.debug('dropped_envelope', Object.assign(summarizeEnvelope(envelope, ''), {
18909
+ logger$W.debug('dropped_envelope', Object.assign(summarizeEnvelope(envelope, ''), {
18937
18910
  localAddresses: Array.from(state.local.values()),
18938
18911
  downstreamRoutes: Array.from(state.downstreamAddressRoutes.entries()),
18939
18912
  peerRoutes: Array.from(state.peerAddressRoutes.entries()),
@@ -18963,7 +18936,7 @@ class ForwardChild {
18963
18936
  }
18964
18937
  catch (error) {
18965
18938
  if (error instanceof FameTransportClose) {
18966
- logger$V.error('transport_closed_forward_child', {
18939
+ logger$W.error('transport_closed_forward_child', {
18967
18940
  segment: this.segment,
18968
18941
  error: error.message,
18969
18942
  });
@@ -18995,7 +18968,7 @@ class ForwardPeer {
18995
18968
  }
18996
18969
  catch (error) {
18997
18970
  if (error instanceof FameTransportClose) {
18998
- logger$V.error('transport_closed_forward_peer', {
18971
+ logger$W.error('transport_closed_forward_peer', {
18999
18972
  segment: this.segment,
19000
18973
  error: error.message,
19001
18974
  });
@@ -19030,7 +19003,7 @@ class Deny {
19030
19003
  async execute(envelope, router, state, context) {
19031
19004
  const { internalReason, deniedAction, matchedRule, context: extraContext, disclosure = 'opaque', } = this.options;
19032
19005
  // Log detailed denial internally
19033
- logger$V.warning('route_authorization_denied', {
19006
+ logger$W.warning('route_authorization_denied', {
19034
19007
  envp_id: envelope.id,
19035
19008
  frame_type: envelope.frame?.type ?? null,
19036
19009
  to: envelope.to?.toString() ?? null,
@@ -19076,7 +19049,7 @@ function mapRoutingActionToAuthorizationAction(action) {
19076
19049
  return null;
19077
19050
  }
19078
19051
  // Unknown RoutingAction: return null, caller should deny by default
19079
- logger$V.warning('unknown_routing_action_for_authorization', {
19052
+ logger$W.warning('unknown_routing_action_for_authorization', {
19080
19053
  action_type: action?.constructor?.name ?? 'unknown',
19081
19054
  });
19082
19055
  return null;
@@ -19109,7 +19082,7 @@ async function emitDeliveryNack(envelope, routingNode, state, code, context) {
19109
19082
  return;
19110
19083
  }
19111
19084
  if (!state.envelopeFactory) {
19112
- logger$V.warning('router_missing_envelope_factory', summarizeEnvelope(envelope));
19085
+ logger$W.warning('router_missing_envelope_factory', summarizeEnvelope(envelope));
19113
19086
  return;
19114
19087
  }
19115
19088
  const nackFrame = createNackFrame(envelope, code);
@@ -19140,7 +19113,7 @@ async function emitDeliveryNack(envelope, routingNode, state, code, context) {
19140
19113
  }
19141
19114
  }
19142
19115
  catch (error) {
19143
- logger$V.warning('nack_forward_failed', {
19116
+ logger$W.warning('nack_forward_failed', {
19144
19117
  error: error instanceof Error ? error.message : String(error),
19145
19118
  ...summarizeEnvelope(envelope),
19146
19119
  });
@@ -19346,7 +19319,7 @@ class HRWLoadBalancingStrategy {
19346
19319
  }
19347
19320
  }
19348
19321
 
19349
- const logger$U = getLogger('naylence.fame.sentinel.capability_aware_routing_policy');
19322
+ const logger$V = getLogger('naylence.fame.sentinel.capability_aware_routing_policy');
19350
19323
  function normalizeOptions$i(options) {
19351
19324
  if (!options || typeof options !== 'object') {
19352
19325
  return {};
@@ -19398,7 +19371,7 @@ class CapabilityAwareRoutingPolicy {
19398
19371
  if (chosenSegment) {
19399
19372
  return new ForwardChild(chosenSegment);
19400
19373
  }
19401
- logger$U.warning('capability_policy_lb_failed', {
19374
+ logger$V.warning('capability_policy_lb_failed', {
19402
19375
  segments: providerSegments,
19403
19376
  capabilities,
19404
19377
  ...summarizeEnvelope(envelope),
@@ -19427,7 +19400,7 @@ class CapabilityAwareRoutingPolicy {
19427
19400
  }
19428
19401
  }
19429
19402
  catch (error) {
19430
- logger$U.warning('capability_policy_resolve_failed', {
19403
+ logger$V.warning('capability_policy_resolve_failed', {
19431
19404
  error: error instanceof Error ? error.message : String(error),
19432
19405
  });
19433
19406
  }
@@ -19664,7 +19637,7 @@ function toFameAddress(address) {
19664
19637
  return address instanceof FameAddress ? address : new FameAddress(address);
19665
19638
  }
19666
19639
 
19667
- const logger$T = getLogger('naylence.fame.sentinel.node_attach_frame_handler');
19640
+ const logger$U = getLogger('naylence.fame.sentinel.node_attach_frame_handler');
19668
19641
  const DOWNSTREAM_ORIGINS = new Set([
19669
19642
  DeliveryOriginType.DOWNSTREAM,
19670
19643
  DeliveryOriginType.PEER,
@@ -19757,7 +19730,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
19757
19730
  this.maxTtlSec = options.maxTtlSec ?? null;
19758
19731
  }
19759
19732
  async acceptNodeAttach(envelope, context) {
19760
- logger$T.debug('handling_node_attach_request');
19733
+ logger$U.debug('handling_node_attach_request');
19761
19734
  const normalizedContext = this.normalizeContext(context);
19762
19735
  const frame = this.normalizeNodeAttachFrame(envelope.frame);
19763
19736
  if (frame.type !== 'NodeAttach') {
@@ -19802,14 +19775,14 @@ class NodeAttachFrameHandler extends TaskSpawner {
19802
19775
  let isRebind = false;
19803
19776
  if (frame.originType === DeliveryOriginType.DOWNSTREAM) {
19804
19777
  const hasExistingRoute = this.routeManager.downstreamRoutes.has(attachedSystemId);
19805
- logger$T.debug('checking_for_existing_route', {
19778
+ logger$U.debug('checking_for_existing_route', {
19806
19779
  system_id: attachedSystemId,
19807
19780
  has_existing: hasExistingRoute,
19808
19781
  existing_routes: Array.from(this.routeManager.downstreamRoutes.keys()),
19809
19782
  });
19810
19783
  if (hasExistingRoute) {
19811
19784
  isRebind = true;
19812
- logger$T.warning('rebinding_existing_downstream_route', {
19785
+ logger$U.warning('rebinding_existing_downstream_route', {
19813
19786
  system_id: attachedSystemId,
19814
19787
  });
19815
19788
  oldAssignedPath = buildAssignedPath$1(this.routingNode.physicalPath, attachedSystemId);
@@ -19828,7 +19801,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
19828
19801
  meta: { systemId: attachedSystemId },
19829
19802
  })
19830
19803
  .catch((error) => {
19831
- logger$T.warning('failed_to_unregister_downstream_route_before_rebind', {
19804
+ logger$U.warning('failed_to_unregister_downstream_route_before_rebind', {
19832
19805
  system_id: attachedSystemId,
19833
19806
  error: error instanceof Error ? error.message : String(error),
19834
19807
  });
@@ -19845,7 +19818,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
19845
19818
  for (const address of orphanedAddresses) {
19846
19819
  encryptionMgr.clearChannelCacheForDestination(address);
19847
19820
  }
19848
- logger$T.debug('cleared_channel_cache_for_rebind', {
19821
+ logger$U.debug('cleared_channel_cache_for_rebind', {
19849
19822
  system_id: attachedSystemId,
19850
19823
  addresses: orphanedAddresses,
19851
19824
  });
@@ -19857,7 +19830,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
19857
19830
  encryptionMgr.removeChannelsForDestination(address);
19858
19831
  }
19859
19832
  if (totalRemoved > 0) {
19860
- logger$T.debug('removed_channel_states_for_rebind', {
19833
+ logger$U.debug('removed_channel_states_for_rebind', {
19861
19834
  system_id: attachedSystemId,
19862
19835
  channels_removed: totalRemoved,
19863
19836
  });
@@ -19865,7 +19838,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
19865
19838
  }
19866
19839
  }
19867
19840
  catch (error) {
19868
- logger$T.warning('failed_to_cleanup_channels_for_rebind', {
19841
+ logger$U.warning('failed_to_cleanup_channels_for_rebind', {
19869
19842
  system_id: attachedSystemId,
19870
19843
  error: error instanceof Error ? error.message : String(error),
19871
19844
  });
@@ -19888,7 +19861,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
19888
19861
  meta: { systemId: attachedSystemId },
19889
19862
  })
19890
19863
  .catch((error) => {
19891
- logger$T.warning('failed_to_unregister_peer_route_before_rebind', {
19864
+ logger$U.warning('failed_to_unregister_peer_route_before_rebind', {
19892
19865
  system_id: attachedSystemId,
19893
19866
  error: error instanceof Error ? error.message : String(error),
19894
19867
  });
@@ -19926,7 +19899,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
19926
19899
  ? { stickiness: negotiatedStickiness }
19927
19900
  : {}),
19928
19901
  });
19929
- logger$T.debug('sending_node_attach_ack', {
19902
+ logger$U.debug('sending_node_attach_ack', {
19930
19903
  env_id: ackEnvelope.id ?? 'unknown',
19931
19904
  });
19932
19905
  await this.sendAndNotify(connector, ackEnvelope, attachedSystemId, normalizedContext);
@@ -19973,7 +19946,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
19973
19946
  return this.stickinessManager.negotiate(stickiness);
19974
19947
  }
19975
19948
  catch (error) {
19976
- logger$T.debug('stickiness_negotiate_skipped', {
19949
+ logger$U.debug('stickiness_negotiate_skipped', {
19977
19950
  error: error instanceof Error ? error.message : String(error),
19978
19951
  });
19979
19952
  return null;
@@ -19989,13 +19962,13 @@ class NodeAttachFrameHandler extends TaskSpawner {
19989
19962
  }
19990
19963
  if (!attachExpiresAt || earliestKeyExpiry < attachExpiresAt) {
19991
19964
  if (attachExpiresAt) {
19992
- logger$T.warning('attachment_ttl_limited_by_key_expiry', {
19965
+ logger$U.warning('attachment_ttl_limited_by_key_expiry', {
19993
19966
  limited_attach_expires_at: earliestKeyExpiry.toISOString(),
19994
19967
  original_attach_expires_at: attachExpiresAt.toISOString(),
19995
19968
  });
19996
19969
  }
19997
19970
  else {
19998
- logger$T.debug('attachment_ttl_set_by_key_expiry', {
19971
+ logger$U.debug('attachment_ttl_set_by_key_expiry', {
19999
19972
  attach_expires_at: earliestKeyExpiry.toISOString(),
20000
19973
  reason: 'no_max_ttl_configured',
20001
19974
  });
@@ -20006,7 +19979,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
20006
19979
  }
20007
19980
  async validateAttachmentKeys(frame, envelope, connector, context, systemId) {
20008
19981
  if (!this.attachmentKeyValidator) {
20009
- logger$T.debug('child_key_validation_skipped', {
19982
+ logger$U.debug('child_key_validation_skipped', {
20010
19983
  child_id: systemId,
20011
19984
  reason: 'no_validator',
20012
19985
  });
@@ -20022,7 +19995,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
20022
19995
  }
20023
19996
  }
20024
19997
  if (keyInfos.length > 0) {
20025
- logger$T.debug('node_attach_key_validation_passed', {
19998
+ logger$U.debug('node_attach_key_validation_passed', {
20026
19999
  system_id: systemId,
20027
20000
  instance_id: frame.instanceId,
20028
20001
  correlation_id: envelope.corrId,
@@ -20042,13 +20015,13 @@ class NodeAttachFrameHandler extends TaskSpawner {
20042
20015
  reason: `Certificate validation failed: ${error.message}`,
20043
20016
  });
20044
20017
  await this.sendAndNotify(connector, rejectionAck, systemId, context).catch((sendError) => {
20045
- logger$T.error('failed_sending_negative_attach_ack', {
20018
+ logger$U.error('failed_sending_negative_attach_ack', {
20046
20019
  error: sendError instanceof Error
20047
20020
  ? sendError.message
20048
20021
  : String(sendError),
20049
20022
  });
20050
20023
  });
20051
- logger$T.error('node_attach_key_validation_failed', {
20024
+ logger$U.error('node_attach_key_validation_failed', {
20052
20025
  system_id: systemId,
20053
20026
  instance_id: frame.instanceId,
20054
20027
  correlation_id: envelope.corrId,
@@ -20114,10 +20087,10 @@ class NodeAttachFrameHandler extends TaskSpawner {
20114
20087
  try {
20115
20088
  await delay(delaySeconds * 1000);
20116
20089
  await connector.close(1008, 'attach-unauthorized');
20117
- logger$T.debug('closed_unauthorized_connection');
20090
+ logger$U.debug('closed_unauthorized_connection');
20118
20091
  }
20119
20092
  catch (error) {
20120
- logger$T.error('failed_to_close_unauthorized_connection', {
20093
+ logger$U.error('failed_to_close_unauthorized_connection', {
20121
20094
  error: error instanceof Error ? error.message : String(error),
20122
20095
  });
20123
20096
  }
@@ -20230,7 +20203,7 @@ class NodeAttachFrameHandler extends TaskSpawner {
20230
20203
  }
20231
20204
  }
20232
20205
 
20233
- const logger$S = getLogger('naylence.fame.sentinel.address_bind_frame_handler');
20206
+ const logger$T = getLogger('naylence.fame.sentinel.address_bind_frame_handler');
20234
20207
  const RESERVED_ADDRESS_NAMES = new Set(['__sys__', '__rpc__']);
20235
20208
  function pickManagerField(manager, keys) {
20236
20209
  const record = manager;
@@ -20554,7 +20527,7 @@ class AddressBindFrameHandler {
20554
20527
  if (this.routingNode.forwardToPeers) {
20555
20528
  await this.routingNode.forwardToPeers(envelope, undefined, [sourceSystemId], context);
20556
20529
  }
20557
- logger$S.debug('address_bound', {
20530
+ logger$T.debug('address_bound', {
20558
20531
  address: addressStr,
20559
20532
  segment: sourceSystemId,
20560
20533
  });
@@ -20652,7 +20625,7 @@ class AddressBindFrameHandler {
20652
20625
  }
20653
20626
  await this.routingNode.forwardToRoute(sourceSystemId, ackEnvelope, ackContext);
20654
20627
  }
20655
- logger$S.debug('address_unbound', {
20628
+ logger$T.debug('address_unbound', {
20656
20629
  address: addressStr,
20657
20630
  segment: sourceSystemId,
20658
20631
  });
@@ -20670,7 +20643,7 @@ class AddressBindFrameHandler {
20670
20643
  }
20671
20644
  }
20672
20645
 
20673
- const logger$R = getLogger('naylence.fame.sentinel.node_heartbeat_frame_handler');
20646
+ const logger$S = getLogger('naylence.fame.sentinel.node_heartbeat_frame_handler');
20674
20647
  function normalizeOptions$h(options) {
20675
20648
  if (!options || typeof options !== 'object') {
20676
20649
  throw new Error('NodeHeartbeatFrameHandler requires a routingNode option');
@@ -20707,7 +20680,7 @@ class NodeHeartbeatFrameHandler {
20707
20680
  if (!frame || frame.type !== 'NodeHeartbeat') {
20708
20681
  throw new Error(`Invalid envelope frame. Expected: NodeHeartbeatFrame, actual: ${frame?.type ?? 'unknown'}`);
20709
20682
  }
20710
- logger$R.trace('handling_heartbeat', {
20683
+ logger$S.trace('handling_heartbeat', {
20711
20684
  hb_system_id: frame.systemId ?? 'unknown',
20712
20685
  hb_env_id: envelope.id ?? 'unknown',
20713
20686
  hb_corr_id: envelope.corrId ?? 'unknown',
@@ -20735,7 +20708,7 @@ class NodeHeartbeatFrameHandler {
20735
20708
  ...(envelope.corrId ? { corrId: envelope.corrId } : {}),
20736
20709
  ...(envelope.traceId ? { traceId: envelope.traceId } : {}),
20737
20710
  });
20738
- logger$R.debug('sending_heartbeat_ack', {
20711
+ logger$S.debug('sending_heartbeat_ack', {
20739
20712
  hb_ack_env_id: ackEnvelope.id ?? 'unknown',
20740
20713
  hb_ack_corr_id: ackEnvelope.corrId ?? 'unknown',
20741
20714
  });
@@ -20763,7 +20736,7 @@ class NodeHeartbeatFrameHandler {
20763
20736
  }
20764
20737
  }
20765
20738
 
20766
- const logger$Q = getLogger('naylence.fame.sentinel.capability_frame_handler');
20739
+ const logger$R = getLogger('naylence.fame.sentinel.capability_frame_handler');
20767
20740
  class CapabilityFrameHandler {
20768
20741
  constructor(options) {
20769
20742
  this.capabilityRoutes = new Map();
@@ -20790,7 +20763,7 @@ class CapabilityFrameHandler {
20790
20763
  const segment = this.getSourceSystemId(context);
20791
20764
  const downstreamRoutes = getDownstreamRoutes(this.routeManager);
20792
20765
  if (!segment || !hasRoute(downstreamRoutes, segment)) {
20793
- logger$Q.debug('capability_advertise_unknown_segment', { segment });
20766
+ logger$R.debug('capability_advertise_unknown_segment', { segment });
20794
20767
  return;
20795
20768
  }
20796
20769
  const addressKey = this.normalizeAddress(frame.address);
@@ -20823,7 +20796,7 @@ class CapabilityFrameHandler {
20823
20796
  }
20824
20797
  const segment = this.getSourceSystemId(context);
20825
20798
  if (!segment) {
20826
- logger$Q.debug('capability_withdraw_missing_segment');
20799
+ logger$R.debug('capability_withdraw_missing_segment');
20827
20800
  return;
20828
20801
  }
20829
20802
  const addressKey = this.normalizeAddress(frame.address);
@@ -20877,7 +20850,7 @@ class CapabilityFrameHandler {
20877
20850
  async forwardAckToSegment(segment, ackFrame, originalEnvelope, ackContext) {
20878
20851
  const envelopeFactory = this.routingNode.envelopeFactory;
20879
20852
  if (!envelopeFactory) {
20880
- logger$Q.warning('missing_envelope_factory_for_capability_ack');
20853
+ logger$R.warning('missing_envelope_factory_for_capability_ack');
20881
20854
  return;
20882
20855
  }
20883
20856
  const ackEnvelope = envelopeFactory.createEnvelope({
@@ -20940,7 +20913,7 @@ function getStickySid(context) {
20940
20913
  return typed.stickySid ?? typed.sticky_sid ?? undefined;
20941
20914
  }
20942
20915
 
20943
- const logger$P = getLogger('naylence.fame.sentinel.credit_update_frame_handler');
20916
+ const logger$Q = getLogger('naylence.fame.sentinel.credit_update_frame_handler');
20944
20917
  function normalizeOptions$g(options) {
20945
20918
  if (!options || typeof options !== 'object') {
20946
20919
  throw new Error('CreditUpdateFrameHandler requires a routeManager option');
@@ -20960,12 +20933,12 @@ class CreditUpdateFrameHandler {
20960
20933
  async acceptCreditUpdate(envelope, context) {
20961
20934
  const flowId = envelope.flowId;
20962
20935
  if (!flowId) {
20963
- logger$P.warning('credit_update_missing_flow_id');
20936
+ logger$Q.warning('credit_update_missing_flow_id');
20964
20937
  return;
20965
20938
  }
20966
20939
  const targetConnector = this.routeManager.getFlowRoute(flowId);
20967
20940
  if (!targetConnector) {
20968
- logger$P.warning('credit_update_unknown_flow', { flowId });
20941
+ logger$Q.warning('credit_update_unknown_flow', { flowId });
20969
20942
  return;
20970
20943
  }
20971
20944
  if (context?.fromConnector && context.fromConnector === targetConnector) {
@@ -20975,7 +20948,7 @@ class CreditUpdateFrameHandler {
20975
20948
  }
20976
20949
  }
20977
20950
 
20978
- const logger$O = getLogger('naylence.fame.sentinel.sentinel');
20951
+ const logger$P = getLogger('naylence.fame.sentinel.sentinel');
20979
20952
  const ALLOWED_BEFORE_ATTACH = new Set(['NodeAttach']);
20980
20953
  const SYSTEM_INBOX = '__sys__';
20981
20954
  const RESERVED_UPSTREAM_ADDRESS_NAMES = new Set(['__sys__', '__rpc__']);
@@ -21069,7 +21042,7 @@ class Sentinel extends FameNode {
21069
21042
  routeStore = createPersistentRouteStore(this.storageProvider);
21070
21043
  }
21071
21044
  catch (error) {
21072
- logger$O.warning('persistent_route_store_unavailable', {
21045
+ logger$P.warning('persistent_route_store_unavailable', {
21073
21046
  error: error instanceof Error ? error.message : String(error),
21074
21047
  });
21075
21048
  routeStore = getDefaultRouteStore();
@@ -21151,7 +21124,7 @@ class Sentinel extends FameNode {
21151
21124
  bumpRoutingEpoch() {
21152
21125
  const previousEpoch = this.routingEpochValue;
21153
21126
  this.routingEpochValue = generateId();
21154
- logger$O.debug('routing_epoch_bumped', {
21127
+ logger$P.debug('routing_epoch_bumped', {
21155
21128
  previous_epoch: previousEpoch,
21156
21129
  new_epoch: this.routingEpochValue,
21157
21130
  });
@@ -21242,7 +21215,7 @@ class Sentinel extends FameNode {
21242
21215
  }
21243
21216
  async forwardToRoute(nextSegment, envelope, context) {
21244
21217
  if (this.originMatches(context, nextSegment, DeliveryOriginType.DOWNSTREAM)) {
21245
- logger$O.debug('downstream_loop_detected', {
21218
+ logger$P.debug('downstream_loop_detected', {
21246
21219
  envp_id: envelope.id,
21247
21220
  segment: nextSegment,
21248
21221
  });
@@ -21255,14 +21228,14 @@ class Sentinel extends FameNode {
21255
21228
  }
21256
21229
  const connector = this.routeManager.downstreamRoutes.get(nextSegment);
21257
21230
  if (!connector) {
21258
- logger$O.warning('no_route_for_child_segment', { segment: nextSegment });
21231
+ logger$P.warning('no_route_for_child_segment', { segment: nextSegment });
21259
21232
  await this.emitDeliveryNack(processed, {
21260
21233
  code: 'CHILD_UNREACHABLE',
21261
21234
  context: context ?? null,
21262
21235
  });
21263
21236
  return;
21264
21237
  }
21265
- logger$O.debug('forwarding_downstream', {
21238
+ logger$P.debug('forwarding_downstream', {
21266
21239
  ...summarizeEnvelope(processed, ''),
21267
21240
  route: nextSegment,
21268
21241
  });
@@ -21279,7 +21252,7 @@ class Sentinel extends FameNode {
21279
21252
  }
21280
21253
  async forwardToPeer(peerSegment, envelope, context) {
21281
21254
  if (this.originMatches(context, peerSegment, DeliveryOriginType.PEER)) {
21282
- logger$O.debug('peer_loop_detected', {
21255
+ logger$P.debug('peer_loop_detected', {
21283
21256
  envp_id: envelope.id,
21284
21257
  segment: peerSegment,
21285
21258
  });
@@ -21290,7 +21263,7 @@ class Sentinel extends FameNode {
21290
21263
  }
21291
21264
  const connector = this.routeManager._peer_routes.get(peerSegment);
21292
21265
  if (!connector) {
21293
- logger$O.warning('no_route_for_peer_segment', {
21266
+ logger$P.warning('no_route_for_peer_segment', {
21294
21267
  peer_segment: peerSegment,
21295
21268
  });
21296
21269
  await this.emitDeliveryNack(processed, {
@@ -21333,7 +21306,7 @@ class Sentinel extends FameNode {
21333
21306
  }
21334
21307
  async forwardUpstream(envelope, context) {
21335
21308
  if (context?.originType === DeliveryOriginType.UPSTREAM) {
21336
- logger$O.debug('skipping_forward_upstream', {
21309
+ logger$P.debug('skipping_forward_upstream', {
21337
21310
  envp_id: envelope.id,
21338
21311
  origin_type: context.originType,
21339
21312
  });
@@ -21453,7 +21426,7 @@ class Sentinel extends FameNode {
21453
21426
  }
21454
21427
  catch (error) {
21455
21428
  if (!combined.signal.aborted) {
21456
- logger$O.debug('attach_timeout_delay_failed', {
21429
+ logger$P.debug('attach_timeout_delay_failed', {
21457
21430
  system_id: systemId,
21458
21431
  error: error instanceof Error ? error.message : String(error),
21459
21432
  });
@@ -21480,12 +21453,12 @@ class Sentinel extends FameNode {
21480
21453
  await connector.stop();
21481
21454
  }
21482
21455
  catch (error) {
21483
- logger$O.debug('attach_timeout_stop_failed', {
21456
+ logger$P.debug('attach_timeout_stop_failed', {
21484
21457
  system_id: systemId,
21485
21458
  error: error instanceof Error ? error.message : String(error),
21486
21459
  });
21487
21460
  }
21488
- logger$O.warning('attach_timeout_expired', {
21461
+ logger$P.warning('attach_timeout_expired', {
21489
21462
  system_id: systemId,
21490
21463
  timeout_ms: timeoutMs,
21491
21464
  });
@@ -21539,7 +21512,7 @@ class Sentinel extends FameNode {
21539
21512
  return new FameAddress(addressKey);
21540
21513
  }
21541
21514
  catch (error) {
21542
- logger$O.debug('invalid_capability_address', {
21515
+ logger$P.debug('invalid_capability_address', {
21543
21516
  capability,
21544
21517
  address: addressKey,
21545
21518
  error: error instanceof Error ? error.message : String(error),
@@ -21695,7 +21668,7 @@ class Sentinel extends FameNode {
21695
21668
  }
21696
21669
  async propagateAddressBindingsUpstream() {
21697
21670
  if (!this.hasParent) {
21698
- logger$O.warning('No upstream defined to rebind addresses');
21671
+ logger$P.warning('No upstream defined to rebind addresses');
21699
21672
  return;
21700
21673
  }
21701
21674
  const entries = Array.from(this.routeManager._downstream_addresses_routes.entries());
@@ -21718,7 +21691,7 @@ class Sentinel extends FameNode {
21718
21691
  await this.bindAddressUpstream(new FameAddress(address), info);
21719
21692
  }
21720
21693
  catch (error) {
21721
- logger$O.error('rebind_failed', {
21694
+ logger$P.error('rebind_failed', {
21722
21695
  address,
21723
21696
  error: error instanceof Error ? error.message : String(error),
21724
21697
  });
@@ -21816,7 +21789,7 @@ class Sentinel extends FameNode {
21816
21789
  }
21817
21790
  catch (error) {
21818
21791
  // Hook threw => treat as denial, execute Drop
21819
- logger$O.warning('routing_action_hook_error', {
21792
+ logger$P.warning('routing_action_hook_error', {
21820
21793
  envp_id: envelope.id,
21821
21794
  error: error instanceof Error ? error.message : String(error),
21822
21795
  });
@@ -21840,7 +21813,7 @@ class Sentinel extends FameNode {
21840
21813
  }
21841
21814
  const abortSignal = signal ?? null;
21842
21815
  if (abortSignal?.aborted) {
21843
- logger$O.info('shutdown_signal_received', { signal: 'abort' });
21816
+ logger$P.info('shutdown_signal_received', { signal: 'abort' });
21844
21817
  return;
21845
21818
  }
21846
21819
  // Build fabric options, preferring rootConfig if provided
@@ -21856,7 +21829,7 @@ class Sentinel extends FameNode {
21856
21829
  if (node !== null) {
21857
21830
  fabricCreateOptions.node = node;
21858
21831
  }
21859
- logger$O.debug('fabric_create_options', {
21832
+ logger$P.debug('fabric_create_options', {
21860
21833
  hasRootConfig: 'rootConfig' in fabricCreateOptions,
21861
21834
  hasNode: 'node' in fabricCreateOptions,
21862
21835
  rootConfigKeys: fabricCreateOptions.rootConfig
@@ -21889,7 +21862,7 @@ class Sentinel extends FameNode {
21889
21862
  const registerSignalListeners = () => {
21890
21863
  for (const sig of signals) {
21891
21864
  const listener = () => {
21892
- logger$O.info('shutdown_signal_received', { signal: sig });
21865
+ logger$P.info('shutdown_signal_received', { signal: sig });
21893
21866
  cleanupListeners();
21894
21867
  stopResolve();
21895
21868
  };
@@ -21898,7 +21871,7 @@ class Sentinel extends FameNode {
21898
21871
  }
21899
21872
  if (abortSignal) {
21900
21873
  abortListener = () => {
21901
- logger$O.info('shutdown_signal_received', { signal: 'abort' });
21874
+ logger$P.info('shutdown_signal_received', { signal: 'abort' });
21902
21875
  cleanupListeners();
21903
21876
  stopResolve();
21904
21877
  };
@@ -21911,12 +21884,12 @@ class Sentinel extends FameNode {
21911
21884
  await providedFabric.enter();
21912
21885
  try {
21913
21886
  registerSignalListeners();
21914
- logger$O.info('sentinel_live', {
21887
+ logger$P.info('sentinel_live', {
21915
21888
  message: 'Node is live! Press Ctrl+C to stop.',
21916
21889
  });
21917
21890
  try {
21918
21891
  await stopPromise;
21919
- logger$O.info('sentinel_shutdown_begin');
21892
+ logger$P.info('sentinel_shutdown_begin');
21920
21893
  }
21921
21894
  finally {
21922
21895
  cleanupListeners();
@@ -21930,19 +21903,19 @@ class Sentinel extends FameNode {
21930
21903
  // Use withFabric pattern for automatic lifecycle management
21931
21904
  await withFabric(fabricCreateOptions, async () => {
21932
21905
  registerSignalListeners();
21933
- logger$O.info('sentinel_live', {
21906
+ logger$P.info('sentinel_live', {
21934
21907
  message: 'Node is live! Press Ctrl+C to stop.',
21935
21908
  });
21936
21909
  try {
21937
21910
  await stopPromise;
21938
- logger$O.info('sentinel_shutdown_begin');
21911
+ logger$P.info('sentinel_shutdown_begin');
21939
21912
  }
21940
21913
  finally {
21941
21914
  cleanupListeners();
21942
21915
  }
21943
21916
  });
21944
21917
  }
21945
- logger$O.info('sentinel_shutdown_complete');
21918
+ logger$P.info('sentinel_shutdown_complete');
21946
21919
  }
21947
21920
  }
21948
21921
  function normalizeServeLogLevel(level) {
@@ -22087,7 +22060,7 @@ function isPlainRecord(value) {
22087
22060
  return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
22088
22061
  }
22089
22062
 
22090
- const FACTORY_META$14 = {
22063
+ const FACTORY_META$15 = {
22091
22064
  base: NODE_LIKE_FACTORY_BASE_TYPE,
22092
22065
  key: 'Sentinel',
22093
22066
  };
@@ -22271,7 +22244,7 @@ class SentinelFactory extends NodeLikeFactory {
22271
22244
 
22272
22245
  var sentinelFactory = /*#__PURE__*/Object.freeze({
22273
22246
  __proto__: null,
22274
- FACTORY_META: FACTORY_META$14,
22247
+ FACTORY_META: FACTORY_META$15,
22275
22248
  SentinelFactory: SentinelFactory,
22276
22249
  default: SentinelFactory
22277
22250
  });
@@ -22354,7 +22327,7 @@ function createConnectorConfig(config) {
22354
22327
  * Browser-local connector that routes binary frames between peers via an in-page EventTarget.
22355
22328
  * Relies on BaseAsyncConnector for flow control and shutdown behavior.
22356
22329
  */
22357
- const logger$N = getLogger('naylence.fame.connector.inpage_connector');
22330
+ const logger$O = getLogger('naylence.fame.connector.inpage_connector');
22358
22331
  const INPAGE_CONNECTOR_TYPE = 'inpage-connector';
22359
22332
  const DEFAULT_CHANNEL$6 = 'naylence-fabric';
22360
22333
  const DEFAULT_INBOX_CAPACITY$6 = 2048;
@@ -22452,7 +22425,7 @@ class InPageConnector extends BaseAsyncConnector {
22452
22425
  }
22453
22426
  this.localNodeId = normalizedLocalNodeId;
22454
22427
  this.targetNodeId = InPageConnector.normalizeTargetNodeId(config.initialTargetNodeId);
22455
- logger$N.debug('inpage_connector_initialized', {
22428
+ logger$O.debug('inpage_connector_initialized', {
22456
22429
  channel: this.channelName,
22457
22430
  connector_id: this.connectorId,
22458
22431
  local_node_id: this.localNodeId,
@@ -22461,7 +22434,7 @@ class InPageConnector extends BaseAsyncConnector {
22461
22434
  });
22462
22435
  this.onMsg = (event) => {
22463
22436
  if (!this.listenerRegistered) {
22464
- logger$N.warning('inpage_message_after_unregister', {
22437
+ logger$O.warning('inpage_message_after_unregister', {
22465
22438
  channel: this.channelName,
22466
22439
  connector_id: this.connectorId,
22467
22440
  timestamp: new Date().toISOString(),
@@ -22470,7 +22443,7 @@ class InPageConnector extends BaseAsyncConnector {
22470
22443
  }
22471
22444
  const messageEvent = event;
22472
22445
  const message = messageEvent.data;
22473
- logger$N.debug('inpage_raw_event', {
22446
+ logger$O.debug('inpage_raw_event', {
22474
22447
  channel: this.channelName,
22475
22448
  connector_id: this.connectorId,
22476
22449
  message_type: message && typeof message === 'object'
@@ -22490,7 +22463,7 @@ class InPageConnector extends BaseAsyncConnector {
22490
22463
  : null;
22491
22464
  const senderNodeId = InPageConnector.normalizeNodeId(busMessage.senderNodeId);
22492
22465
  if (!senderId || !senderNodeId) {
22493
- logger$N.debug('inpage_message_rejected', {
22466
+ logger$O.debug('inpage_message_rejected', {
22494
22467
  channel: this.channelName,
22495
22468
  connector_id: this.connectorId,
22496
22469
  reason: 'missing_sender_metadata',
@@ -22498,7 +22471,7 @@ class InPageConnector extends BaseAsyncConnector {
22498
22471
  return;
22499
22472
  }
22500
22473
  if (senderId === this.connectorId || senderNodeId === this.localNodeId) {
22501
- logger$N.debug('inpage_message_rejected', {
22474
+ logger$O.debug('inpage_message_rejected', {
22502
22475
  channel: this.channelName,
22503
22476
  connector_id: this.connectorId,
22504
22477
  reason: 'self_echo',
@@ -22512,14 +22485,14 @@ class InPageConnector extends BaseAsyncConnector {
22512
22485
  }
22513
22486
  const payload = InPageConnector.coercePayload(busMessage.payload);
22514
22487
  if (!payload) {
22515
- logger$N.debug('inpage_payload_rejected', {
22488
+ logger$O.debug('inpage_payload_rejected', {
22516
22489
  channel: this.channelName,
22517
22490
  connector_id: this.connectorId,
22518
22491
  reason: 'unrecognized_payload_type',
22519
22492
  });
22520
22493
  return;
22521
22494
  }
22522
- logger$N.debug('inpage_message_received', {
22495
+ logger$O.debug('inpage_message_received', {
22523
22496
  channel: this.channelName,
22524
22497
  sender_id: senderId,
22525
22498
  sender_node_id: senderNodeId,
@@ -22548,14 +22521,14 @@ class InPageConnector extends BaseAsyncConnector {
22548
22521
  }
22549
22522
  catch (error) {
22550
22523
  if (error instanceof QueueFullError) {
22551
- logger$N.warning('inpage_receive_queue_full', {
22524
+ logger$O.warning('inpage_receive_queue_full', {
22552
22525
  channel: this.channelName,
22553
22526
  inbox_capacity: this.inboxCapacity,
22554
22527
  inbox_remaining_capacity: this.inbox.remainingCapacity,
22555
22528
  });
22556
22529
  }
22557
22530
  else {
22558
- logger$N.error('inpage_receive_error', {
22531
+ logger$O.error('inpage_receive_error', {
22559
22532
  channel: this.channelName,
22560
22533
  error: error instanceof Error ? error.message : String(error),
22561
22534
  });
@@ -22567,7 +22540,7 @@ class InPageConnector extends BaseAsyncConnector {
22567
22540
  // Setup visibility change monitoring
22568
22541
  this.visibilityChangeHandler = () => {
22569
22542
  const isHidden = document.hidden;
22570
- logger$N.debug('inpage_visibility_changed', {
22543
+ logger$O.debug('inpage_visibility_changed', {
22571
22544
  channel: this.channelName,
22572
22545
  connector_id: this.connectorId,
22573
22546
  visibility: isHidden ? 'hidden' : 'visible',
@@ -22576,7 +22549,7 @@ class InPageConnector extends BaseAsyncConnector {
22576
22549
  // Pause/resume connector based on visibility
22577
22550
  if (isHidden && this.state === ConnectorState.STARTED) {
22578
22551
  this.pause().catch((err) => {
22579
- logger$N.warning('inpage_pause_failed', {
22552
+ logger$O.warning('inpage_pause_failed', {
22580
22553
  channel: this.channelName,
22581
22554
  connector_id: this.connectorId,
22582
22555
  error: err instanceof Error ? err.message : String(err),
@@ -22585,7 +22558,7 @@ class InPageConnector extends BaseAsyncConnector {
22585
22558
  }
22586
22559
  else if (!isHidden && this.state === ConnectorState.PAUSED) {
22587
22560
  this.resume().catch((err) => {
22588
- logger$N.warning('inpage_resume_failed', {
22561
+ logger$O.warning('inpage_resume_failed', {
22589
22562
  channel: this.channelName,
22590
22563
  connector_id: this.connectorId,
22591
22564
  error: err instanceof Error ? err.message : String(err),
@@ -22599,7 +22572,7 @@ class InPageConnector extends BaseAsyncConnector {
22599
22572
  // Track page lifecycle events to detect browser unload/discard
22600
22573
  if (typeof window !== 'undefined') {
22601
22574
  const lifecycleLogger = (event) => {
22602
- logger$N.info('inpage_page_lifecycle', {
22575
+ logger$O.info('inpage_page_lifecycle', {
22603
22576
  channel: this.channelName,
22604
22577
  connector_id: this.connectorId,
22605
22578
  event_type: event.type,
@@ -22615,7 +22588,7 @@ class InPageConnector extends BaseAsyncConnector {
22615
22588
  document.addEventListener('resume', lifecycleLogger);
22616
22589
  }
22617
22590
  // Log initial state with detailed visibility info
22618
- logger$N.debug('inpage_initial_visibility', {
22591
+ logger$O.debug('inpage_initial_visibility', {
22619
22592
  channel: this.channelName,
22620
22593
  connector_id: this.connectorId,
22621
22594
  visibility: document.hidden ? 'hidden' : 'visible',
@@ -22633,7 +22606,7 @@ class InPageConnector extends BaseAsyncConnector {
22633
22606
  await super.start(inboundHandler);
22634
22607
  // After transitioning to STARTED, check if tab is already hidden
22635
22608
  if (typeof document !== 'undefined' && document.hidden) {
22636
- logger$N.debug('inpage_start_in_hidden_tab', {
22609
+ logger$O.debug('inpage_start_in_hidden_tab', {
22637
22610
  channel: this.channelName,
22638
22611
  connector_id: this.connectorId,
22639
22612
  document_hidden: document.hidden,
@@ -22643,7 +22616,7 @@ class InPageConnector extends BaseAsyncConnector {
22643
22616
  });
22644
22617
  // Immediately pause if tab is hidden at start time
22645
22618
  await this.pause().catch((err) => {
22646
- logger$N.warning('inpage_initial_pause_failed', {
22619
+ logger$O.warning('inpage_initial_pause_failed', {
22647
22620
  channel: this.channelName,
22648
22621
  connector_id: this.connectorId,
22649
22622
  error: err instanceof Error ? err.message : String(err),
@@ -22673,14 +22646,14 @@ class InPageConnector extends BaseAsyncConnector {
22673
22646
  }
22674
22647
  catch (error) {
22675
22648
  if (error instanceof QueueFullError) {
22676
- logger$N.warning('inpage_push_queue_full', {
22649
+ logger$O.warning('inpage_push_queue_full', {
22677
22650
  channel: this.channelName,
22678
22651
  inbox_capacity: this.inboxCapacity,
22679
22652
  inbox_remaining_capacity: this.inbox.remainingCapacity,
22680
22653
  });
22681
22654
  throw error;
22682
22655
  }
22683
- logger$N.error('inpage_push_failed', {
22656
+ logger$O.error('inpage_push_failed', {
22684
22657
  channel: this.channelName,
22685
22658
  error: error instanceof Error ? error.message : String(error),
22686
22659
  });
@@ -22690,7 +22663,7 @@ class InPageConnector extends BaseAsyncConnector {
22690
22663
  async _transportSendBytes(data) {
22691
22664
  ensureBrowserEnvironment$2();
22692
22665
  const targetNodeId = this.targetNodeId ?? '*';
22693
- logger$N.debug('inpage_message_sending', {
22666
+ logger$O.debug('inpage_message_sending', {
22694
22667
  channel: this.channelName,
22695
22668
  sender_id: this.connectorId,
22696
22669
  sender_node_id: this.localNodeId,
@@ -22714,7 +22687,7 @@ class InPageConnector extends BaseAsyncConnector {
22714
22687
  return item;
22715
22688
  }
22716
22689
  async _transportClose(code, reason) {
22717
- logger$N.debug('inpage_transport_closing', {
22690
+ logger$O.debug('inpage_transport_closing', {
22718
22691
  channel: this.channelName,
22719
22692
  connector_id: this.connectorId,
22720
22693
  code,
@@ -22723,14 +22696,14 @@ class InPageConnector extends BaseAsyncConnector {
22723
22696
  timestamp: new Date().toISOString(),
22724
22697
  });
22725
22698
  if (this.listenerRegistered) {
22726
- logger$N.debug('inpage_removing_listener', {
22699
+ logger$O.debug('inpage_removing_listener', {
22727
22700
  channel: this.channelName,
22728
22701
  connector_id: this.connectorId,
22729
22702
  timestamp: new Date().toISOString(),
22730
22703
  });
22731
22704
  getSharedBus$1().removeEventListener(this.channelName, this.onMsg);
22732
22705
  this.listenerRegistered = false;
22733
- logger$N.debug('inpage_listener_removed', {
22706
+ logger$O.debug('inpage_listener_removed', {
22734
22707
  channel: this.channelName,
22735
22708
  connector_id: this.connectorId,
22736
22709
  timestamp: new Date().toISOString(),
@@ -22762,7 +22735,7 @@ class InPageConnector extends BaseAsyncConnector {
22762
22735
  if (targetNodeId &&
22763
22736
  targetNodeId !== '*' &&
22764
22737
  targetNodeId !== this.localNodeId) {
22765
- logger$N.debug('inpage_message_rejected', {
22738
+ logger$O.debug('inpage_message_rejected', {
22766
22739
  channel: this.channelName,
22767
22740
  connector_id: this.connectorId,
22768
22741
  reason: 'wildcard_target_mismatch',
@@ -22778,7 +22751,7 @@ class InPageConnector extends BaseAsyncConnector {
22778
22751
  if (expectedSender &&
22779
22752
  expectedSender !== '*' &&
22780
22753
  senderNodeId !== expectedSender) {
22781
- logger$N.debug('inpage_message_rejected', {
22754
+ logger$O.debug('inpage_message_rejected', {
22782
22755
  channel: this.channelName,
22783
22756
  connector_id: this.connectorId,
22784
22757
  reason: 'unexpected_sender',
@@ -22791,7 +22764,7 @@ class InPageConnector extends BaseAsyncConnector {
22791
22764
  if (targetNodeId &&
22792
22765
  targetNodeId !== '*' &&
22793
22766
  targetNodeId !== this.localNodeId) {
22794
- logger$N.debug('inpage_message_rejected', {
22767
+ logger$O.debug('inpage_message_rejected', {
22795
22768
  channel: this.channelName,
22796
22769
  connector_id: this.connectorId,
22797
22770
  reason: 'unexpected_target',
@@ -22816,7 +22789,7 @@ class InPageConnector extends BaseAsyncConnector {
22816
22789
  return 'unknown';
22817
22790
  }
22818
22791
  logInboxSnapshot(event, extra = {}) {
22819
- logger$N.debug(event, {
22792
+ logger$O.debug(event, {
22820
22793
  channel: this.channelName,
22821
22794
  connector_id: this.connectorId,
22822
22795
  connector_state: this.state,
@@ -22835,7 +22808,7 @@ class InPageConnector extends BaseAsyncConnector {
22835
22808
  return;
22836
22809
  }
22837
22810
  this.targetNodeId = normalized;
22838
- logger$N.debug('inpage_target_updated', {
22811
+ logger$O.debug('inpage_target_updated', {
22839
22812
  channel: this.channelName,
22840
22813
  connector_id: this.connectorId,
22841
22814
  local_node_id: this.localNodeId,
@@ -22845,7 +22818,7 @@ class InPageConnector extends BaseAsyncConnector {
22845
22818
  }
22846
22819
  setWildcardTarget() {
22847
22820
  this.targetNodeId = '*';
22848
- logger$N.debug('inpage_target_updated', {
22821
+ logger$O.debug('inpage_target_updated', {
22849
22822
  channel: this.channelName,
22850
22823
  connector_id: this.connectorId,
22851
22824
  local_node_id: this.localNodeId,
@@ -23039,6 +23012,185 @@ class AuthorizerFactory extends AbstractResourceFactory {
23039
23012
  }
23040
23013
  }
23041
23014
 
23015
+ const logger$N = getLogger('naylence.fame.security.auth.authorization_profile_factory');
23016
+ const PROFILE_NAME_DEFAULT = 'jwt';
23017
+ const PROFILE_NAME_OAUTH2 = 'oauth2';
23018
+ const PROFILE_NAME_OAUTH2_GATED = 'oauth2-gated';
23019
+ const PROFILE_NAME_OAUTH2_CALLBACK = 'oauth2-callback';
23020
+ const PROFILE_NAME_NOOP$2 = 'noop';
23021
+ const ENV_VAR_JWT_TRUSTED_ISSUER$1 = 'FAME_JWT_TRUSTED_ISSUER';
23022
+ const ENV_VAR_JWT_ALGORITHM$3 = 'FAME_JWT_ALGORITHM';
23023
+ const ENV_VAR_JWT_AUDIENCE$3 = 'FAME_JWT_AUDIENCE';
23024
+ const ENV_VAR_JWKS_URL$1 = 'FAME_JWKS_URL';
23025
+ const ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1 = 'FAME_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY';
23026
+ const ENV_VAR_TRUSTED_CLIENT_SCOPE$1 = 'FAME_TRUSTED_CLIENT_SCOPE';
23027
+ const ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1 = 'FAME_JWT_REVERSE_AUTH_TRUSTED_ISSUER';
23028
+ const ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1 = 'FAME_JWT_REVERSE_AUTH_AUDIENCE';
23029
+ const ENV_VAR_HMAC_SECRET$1 = 'FAME_HMAC_SECRET';
23030
+ const DEFAULT_REVERSE_AUTH_ISSUER = 'reverse-auth.naylence.ai';
23031
+ const DEFAULT_REVERSE_AUTH_AUDIENCE = 'dev.naylence.ai';
23032
+ const DEFAULT_PROFILE = {
23033
+ type: 'DefaultAuthorizer',
23034
+ verifier: {
23035
+ type: 'JWKSJWTTokenVerifier',
23036
+ jwks_url: Expressions.env(ENV_VAR_JWKS_URL$1),
23037
+ issuer: Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER$1),
23038
+ },
23039
+ };
23040
+ const OAUTH2_PROFILE = {
23041
+ type: 'OAuth2Authorizer',
23042
+ issuer: Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER$1),
23043
+ required_scopes: ['node.connect'],
23044
+ require_scope: true,
23045
+ default_ttl_sec: 3600,
23046
+ max_ttl_sec: 86400,
23047
+ algorithm: Expressions.env(ENV_VAR_JWT_ALGORITHM$3, 'RS256'),
23048
+ audience: Expressions.env(ENV_VAR_JWT_AUDIENCE$3),
23049
+ };
23050
+ const OAUTH2_GATED_PROFILE = {
23051
+ ...OAUTH2_PROFILE,
23052
+ enforce_token_subject_node_identity: Expressions.env(ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1, 'false'),
23053
+ trusted_client_scope: Expressions.env(ENV_VAR_TRUSTED_CLIENT_SCOPE$1, 'node.trusted'),
23054
+ };
23055
+ const OAUTH2_CALLBACK_PROFILE = {
23056
+ type: 'OAuth2Authorizer',
23057
+ issuer: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1, DEFAULT_REVERSE_AUTH_ISSUER),
23058
+ audience: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1),
23059
+ require_scope: true,
23060
+ default_ttl_sec: 3600,
23061
+ max_ttl_sec: 86400,
23062
+ reverse_auth_ttl_sec: 86400,
23063
+ token_verifier_config: {
23064
+ type: 'JWTTokenVerifier',
23065
+ algorithm: 'HS256',
23066
+ hmac_secret: Expressions.env(ENV_VAR_HMAC_SECRET$1),
23067
+ issuer: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1, DEFAULT_REVERSE_AUTH_ISSUER),
23068
+ ttl_sec: 86400,
23069
+ },
23070
+ token_issuer_config: {
23071
+ type: 'JWTTokenIssuer',
23072
+ algorithm: 'HS256',
23073
+ hmac_secret: Expressions.env(ENV_VAR_HMAC_SECRET$1),
23074
+ kid: 'hmac-reverse-auth-key',
23075
+ issuer: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1, DEFAULT_REVERSE_AUTH_ISSUER),
23076
+ ttl_sec: 86400,
23077
+ audience: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1, DEFAULT_REVERSE_AUTH_AUDIENCE),
23078
+ },
23079
+ };
23080
+ const NOOP_PROFILE$2 = {
23081
+ type: 'NoopAuthorizer',
23082
+ };
23083
+ const PROFILE_MAP$5 = {
23084
+ [PROFILE_NAME_DEFAULT]: DEFAULT_PROFILE,
23085
+ [PROFILE_NAME_OAUTH2]: OAUTH2_PROFILE,
23086
+ [PROFILE_NAME_OAUTH2_GATED]: OAUTH2_GATED_PROFILE,
23087
+ [PROFILE_NAME_OAUTH2_CALLBACK]: OAUTH2_CALLBACK_PROFILE,
23088
+ [PROFILE_NAME_NOOP$2]: NOOP_PROFILE$2,
23089
+ };
23090
+ const PROFILE_ALIASES$1 = {
23091
+ jwt: PROFILE_NAME_DEFAULT,
23092
+ jwks: PROFILE_NAME_DEFAULT,
23093
+ default: PROFILE_NAME_DEFAULT,
23094
+ oauth2: PROFILE_NAME_OAUTH2,
23095
+ oidc: PROFILE_NAME_OAUTH2,
23096
+ 'oauth2-gated': PROFILE_NAME_OAUTH2_GATED,
23097
+ oauth2_gated: PROFILE_NAME_OAUTH2_GATED,
23098
+ 'oauth2-callback': PROFILE_NAME_OAUTH2_CALLBACK,
23099
+ oauth2_callback: PROFILE_NAME_OAUTH2_CALLBACK,
23100
+ 'reverse-auth': PROFILE_NAME_OAUTH2_CALLBACK,
23101
+ noop: PROFILE_NAME_NOOP$2,
23102
+ 'no-op': PROFILE_NAME_NOOP$2,
23103
+ no_op: PROFILE_NAME_NOOP$2,
23104
+ };
23105
+ const FACTORY_META$14 = {
23106
+ base: AUTHORIZER_FACTORY_BASE_TYPE,
23107
+ key: 'AuthorizationProfile',
23108
+ };
23109
+ class AuthorizationProfileFactory extends AuthorizerFactory {
23110
+ constructor() {
23111
+ super(...arguments);
23112
+ this.type = 'AuthorizationProfile';
23113
+ }
23114
+ async create(config, ...factoryArgs) {
23115
+ const normalized = normalizeConfig$w(config);
23116
+ const profileConfig = resolveProfileConfig$4(normalized.profile);
23117
+ logger$N.debug('enabling_authorization_profile', {
23118
+ profile: normalized.profile,
23119
+ });
23120
+ const authorizer = await AuthorizerFactory.createAuthorizer(profileConfig, { factoryArgs });
23121
+ if (!authorizer) {
23122
+ throw new Error(`Failed to create authorizer for profile: ${normalized.profile}`);
23123
+ }
23124
+ return authorizer;
23125
+ }
23126
+ }
23127
+ function normalizeConfig$w(config) {
23128
+ if (!config) {
23129
+ return { profile: PROFILE_NAME_OAUTH2 };
23130
+ }
23131
+ const candidate = config;
23132
+ const profileValue = resolveProfileName$2(candidate);
23133
+ const canonicalProfile = canonicalizeProfileName$1(profileValue);
23134
+ candidate.profile = canonicalProfile;
23135
+ return { profile: canonicalProfile };
23136
+ }
23137
+ function resolveProfileName$2(candidate) {
23138
+ const direct = coerceProfileString$2(candidate.profile);
23139
+ if (direct) {
23140
+ return direct;
23141
+ }
23142
+ const legacyKeys = ['profile_name', 'profileName'];
23143
+ for (const legacyKey of legacyKeys) {
23144
+ const legacyValue = coerceProfileString$2(candidate[legacyKey]);
23145
+ if (legacyValue) {
23146
+ return legacyValue;
23147
+ }
23148
+ }
23149
+ return PROFILE_NAME_OAUTH2;
23150
+ }
23151
+ function coerceProfileString$2(value) {
23152
+ if (typeof value !== 'string') {
23153
+ return null;
23154
+ }
23155
+ const trimmed = value.trim();
23156
+ return trimmed.length > 0 ? trimmed : null;
23157
+ }
23158
+ function canonicalizeProfileName$1(value) {
23159
+ const normalized = value.replace(/[\s_]+/g, '-').toLowerCase();
23160
+ return PROFILE_ALIASES$1[normalized] ?? normalized;
23161
+ }
23162
+ function resolveProfileConfig$4(profileName) {
23163
+ const profile = PROFILE_MAP$5[profileName];
23164
+ if (!profile) {
23165
+ throw new Error(`Unknown authorization profile: ${profileName}`);
23166
+ }
23167
+ return deepClone$4(profile);
23168
+ }
23169
+ function deepClone$4(value) {
23170
+ return JSON.parse(JSON.stringify(value));
23171
+ }
23172
+
23173
+ var authorizationProfileFactory = /*#__PURE__*/Object.freeze({
23174
+ __proto__: null,
23175
+ AuthorizationProfileFactory: AuthorizationProfileFactory,
23176
+ ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY: ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1,
23177
+ ENV_VAR_HMAC_SECRET: ENV_VAR_HMAC_SECRET$1,
23178
+ ENV_VAR_JWKS_URL: ENV_VAR_JWKS_URL$1,
23179
+ ENV_VAR_JWT_ALGORITHM: ENV_VAR_JWT_ALGORITHM$3,
23180
+ ENV_VAR_JWT_AUDIENCE: ENV_VAR_JWT_AUDIENCE$3,
23181
+ ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE: ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1,
23182
+ ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER: ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1,
23183
+ ENV_VAR_JWT_TRUSTED_ISSUER: ENV_VAR_JWT_TRUSTED_ISSUER$1,
23184
+ ENV_VAR_TRUSTED_CLIENT_SCOPE: ENV_VAR_TRUSTED_CLIENT_SCOPE$1,
23185
+ FACTORY_META: FACTORY_META$14,
23186
+ PROFILE_NAME_DEFAULT: PROFILE_NAME_DEFAULT,
23187
+ PROFILE_NAME_NOOP: PROFILE_NAME_NOOP$2,
23188
+ PROFILE_NAME_OAUTH2: PROFILE_NAME_OAUTH2,
23189
+ PROFILE_NAME_OAUTH2_CALLBACK: PROFILE_NAME_OAUTH2_CALLBACK,
23190
+ PROFILE_NAME_OAUTH2_GATED: PROFILE_NAME_OAUTH2_GATED,
23191
+ default: AuthorizationProfileFactory
23192
+ });
23193
+
23042
23194
  function isAuthInjectionStrategy(candidate) {
23043
23195
  return (typeof candidate === 'object' &&
23044
23196
  candidate !== null &&
@@ -30535,14 +30687,13 @@ const ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER = 'FAME_JWT_REVERSE_AUTH_TRUSTED_I
30535
30687
  const ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE = 'FAME_JWT_REVERSE_AUTH_AUDIENCE';
30536
30688
  const ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY = 'FAME_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY';
30537
30689
  const ENV_VAR_TRUSTED_CLIENT_SCOPE = 'FAME_TRUSTED_CLIENT_SCOPE';
30690
+ const ENV_VAR_AUTHORIZATION_PROFILE = 'FAME_AUTHORIZATION_PROFILE';
30538
30691
  const PROFILE_NAME_STRICT_OVERLAY = 'strict-overlay';
30539
30692
  const PROFILE_NAME_OVERLAY = 'overlay';
30540
30693
  const PROFILE_NAME_OVERLAY_CALLBACK = 'overlay-callback';
30541
30694
  const PROFILE_NAME_GATED = 'gated';
30542
30695
  const PROFILE_NAME_GATED_CALLBACK = 'gated-callback';
30543
30696
  const PROFILE_NAME_OPEN$1 = 'open';
30544
- const DEFAULT_REVERSE_AUTH_ISSUER = 'reverse-auth.naylence.ai';
30545
- const DEFAULT_REVERSE_AUTH_AUDIENCE = 'dev.naylence.ai';
30546
30697
  const STRICT_OVERLAY_PROFILE = {
30547
30698
  type: 'DefaultSecurityManager',
30548
30699
  security_policy: {
@@ -30588,12 +30739,8 @@ const STRICT_OVERLAY_PROFILE = {
30588
30739
  },
30589
30740
  },
30590
30741
  authorizer: {
30591
- type: 'DefaultAuthorizer',
30592
- verifier: {
30593
- type: 'JWKSJWTTokenVerifier',
30594
- jwks_url: Expressions.env(ENV_VAR_JWKS_URL),
30595
- issuer: Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER),
30596
- },
30742
+ type: 'AuthorizationProfile',
30743
+ profile: Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'jwt'),
30597
30744
  },
30598
30745
  };
30599
30746
  const OVERLAY_PROFILE = {
@@ -30640,14 +30787,8 @@ const OVERLAY_PROFILE = {
30640
30787
  },
30641
30788
  },
30642
30789
  authorizer: {
30643
- type: 'OAuth2Authorizer',
30644
- issuer: Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER),
30645
- required_scopes: ['node.connect'],
30646
- require_scope: true,
30647
- default_ttl_sec: 3600,
30648
- max_ttl_sec: 86400,
30649
- algorithm: Expressions.env(ENV_VAR_JWT_ALGORITHM$2, 'RS256'),
30650
- audience: Expressions.env(ENV_VAR_JWT_AUDIENCE$2),
30790
+ type: 'AuthorizationProfile',
30791
+ profile: Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2'),
30651
30792
  },
30652
30793
  };
30653
30794
  const OVERLAY_CALLBACK_PROFILE = {
@@ -30694,29 +30835,8 @@ const OVERLAY_CALLBACK_PROFILE = {
30694
30835
  },
30695
30836
  },
30696
30837
  authorizer: {
30697
- type: 'OAuth2Authorizer',
30698
- issuer: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
30699
- audience: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE),
30700
- require_scope: true,
30701
- default_ttl_sec: 3600,
30702
- max_ttl_sec: 86400,
30703
- reverse_auth_ttl_sec: 86400,
30704
- token_verifier_config: {
30705
- type: 'JWTTokenVerifier',
30706
- algorithm: 'HS256',
30707
- hmac_secret: Expressions.env(ENV_VAR_HMAC_SECRET),
30708
- issuer: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
30709
- ttl_sec: 86400,
30710
- },
30711
- token_issuer_config: {
30712
- type: 'JWTTokenIssuer',
30713
- algorithm: 'HS256',
30714
- hmac_secret: Expressions.env(ENV_VAR_HMAC_SECRET),
30715
- kid: 'hmac-reverse-auth-key',
30716
- issuer: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
30717
- ttl_sec: 86400,
30718
- audience: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, DEFAULT_REVERSE_AUTH_AUDIENCE),
30719
- },
30838
+ type: 'AuthorizationProfile',
30839
+ profile: Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2-callback'),
30720
30840
  },
30721
30841
  };
30722
30842
  const GATED_PROFILE = {
@@ -30762,16 +30882,8 @@ const GATED_PROFILE = {
30762
30882
  },
30763
30883
  },
30764
30884
  authorizer: {
30765
- type: 'OAuth2Authorizer',
30766
- issuer: Expressions.env(ENV_VAR_JWT_TRUSTED_ISSUER),
30767
- required_scopes: ['node.connect'],
30768
- require_scope: true,
30769
- default_ttl_sec: 3600,
30770
- max_ttl_sec: 86400,
30771
- algorithm: Expressions.env(ENV_VAR_JWT_ALGORITHM$2, 'RS256'),
30772
- audience: Expressions.env(ENV_VAR_JWT_AUDIENCE$2),
30773
- enforce_token_subject_node_identity: Expressions.env(ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY, 'false'),
30774
- trusted_client_scope: Expressions.env(ENV_VAR_TRUSTED_CLIENT_SCOPE, 'node.trusted'),
30885
+ type: 'AuthorizationProfile',
30886
+ profile: Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2-gated'),
30775
30887
  },
30776
30888
  };
30777
30889
  const GATED_CALLBACK_PROFILE = {
@@ -30817,29 +30929,8 @@ const GATED_CALLBACK_PROFILE = {
30817
30929
  },
30818
30930
  },
30819
30931
  authorizer: {
30820
- type: 'OAuth2Authorizer',
30821
- issuer: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
30822
- audience: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE),
30823
- require_scope: true,
30824
- default_ttl_sec: 3600,
30825
- max_ttl_sec: 86400,
30826
- reverse_auth_ttl_sec: 86400,
30827
- token_verifier_config: {
30828
- type: 'JWTTokenVerifier',
30829
- algorithm: 'HS256',
30830
- hmac_secret: Expressions.env(ENV_VAR_HMAC_SECRET),
30831
- issuer: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
30832
- ttl_sec: 86400,
30833
- },
30834
- token_issuer_config: {
30835
- type: 'JWTTokenIssuer',
30836
- algorithm: 'HS256',
30837
- hmac_secret: Expressions.env(ENV_VAR_HMAC_SECRET),
30838
- kid: 'hmac-reverse-auth-key',
30839
- issuer: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, DEFAULT_REVERSE_AUTH_ISSUER),
30840
- ttl_sec: 86400,
30841
- audience: Expressions.env(ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, DEFAULT_REVERSE_AUTH_AUDIENCE),
30842
- },
30932
+ type: 'AuthorizationProfile',
30933
+ profile: Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'oauth2-callback'),
30843
30934
  },
30844
30935
  };
30845
30936
  const OPEN_PROFILE$1 = {
@@ -30848,7 +30939,8 @@ const OPEN_PROFILE$1 = {
30848
30939
  type: 'NoSecurityPolicy',
30849
30940
  },
30850
30941
  authorizer: {
30851
- type: 'NoopAuthorizer',
30942
+ type: 'AuthorizationProfile',
30943
+ profile: Expressions.env(ENV_VAR_AUTHORIZATION_PROFILE, 'noop'),
30852
30944
  },
30853
30945
  };
30854
30946
  const PROFILE_MAP$4 = {
@@ -30977,6 +31069,7 @@ function deepClone$3(value) {
30977
31069
 
30978
31070
  var nodeSecurityProfileFactory = /*#__PURE__*/Object.freeze({
30979
31071
  __proto__: null,
31072
+ ENV_VAR_AUTHORIZATION_PROFILE: ENV_VAR_AUTHORIZATION_PROFILE,
30980
31073
  ENV_VAR_DEFAULT_ENCRYPTION_LEVEL: ENV_VAR_DEFAULT_ENCRYPTION_LEVEL,
30981
31074
  ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY: ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY,
30982
31075
  ENV_VAR_HMAC_SECRET: ENV_VAR_HMAC_SECRET,
@@ -45779,4 +45872,4 @@ var otelSetup = /*#__PURE__*/Object.freeze({
45779
45872
  setupOtel: setupOtel
45780
45873
  });
45781
45874
 
45782
- export { ADMISSION_CLIENT_FACTORY_BASE_TYPE, ATTACHMENT_KEY_VALIDATOR_FACTORY_BASE_TYPE, AUTHORIZATION_POLICY_FACTORY_BASE_TYPE, AUTHORIZATION_POLICY_SOURCE_FACTORY_BASE_TYPE, AUTHORIZER_FACTORY_BASE_TYPE, AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE, AnsiColor, AsyncLock, AttachmentKeyValidator, AuthInjectionStrategyFactory, AuthorizationPolicyFactory, AuthorizationPolicySourceFactory, AuthorizerFactory, BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE, BackPressureFull, BaseAsyncConnector, BaseNodeEventListener, BasicAuthorizationPolicy, BasicAuthorizationPolicyFactory, BindingManager, BindingStoreEntryRecord, BrowserAutoKeyCredentialProvider, BrowserWrappedKeyCredentialProvider, CERTIFICATE_MANAGER_FACTORY_BASE_TYPE, CONNECTION_RETRY_POLICY_FACTORY_BASE_TYPE, CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE, CRYPTO_LEVEL_SECURITY_ORDER, CertificateManagerFactory, ConnectionRetryPolicyFactory, ConnectorConfigDefaults, ConnectorFactory, ConsoleMetricsEmitter, CryptoLevel, FACTORY_META$10 as DEFAULT_WELCOME_FACTORY_META, DefaultConnectionRetryPolicy, DefaultConnectionRetryPolicyFactory, DefaultCryptoProvider, DefaultHttpServer, DefaultKeyManager, DefaultNodeIdentityPolicy, DefaultNodeIdentityPolicyFactory, DefaultSecurityManager, DefaultSecurityPolicy, DefaultWelcomeService, DefaultWelcomeServiceFactory, DevFixedKeyCredentialProvider, ENCRYPTION_MANAGER_FACTORY_BASE_TYPE, ENVELOPE_SIGNER_FACTORY_BASE_TYPE, ENVELOPE_VERIFIER_FACTORY_BASE_TYPE, ENV_VAR_DEFAULT_ENCRYPTION_LEVEL, ENV_VAR_HMAC_SECRET, ENV_VAR_JWKS_URL, ENV_VAR_JWT_ALGORITHM$2 as ENV_VAR_JWT_ALGORITHM, ENV_VAR_JWT_AUDIENCE$2 as ENV_VAR_JWT_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, ENV_VAR_JWT_TRUSTED_ISSUER, ENV_VAR_SESSION_MAX_INITIAL_ATTEMPTS, ENV_VAR_SHOW_ENVELOPES$1 as ENV_VAR_SHOW_ENVELOPES, EdDSAEnvelopeSigner, EncryptedKeyValueStore, EncryptedStorageProviderBase, EncryptedValue, EncryptionConfiguration, EncryptionManagerFactory, EncryptionResult, EncryptionStatus, EnvCredentialProvider, EnvelopeContext, EnvelopeListenerManager, EnvelopeSecurityHandler, EnvelopeSignerFactory, EnvelopeVerifierFactory, FACTORY_META$11 as FACTORY_META, FAME_FABRIC_FACTORY_BASE_TYPE, FIXED_PREFIX_LEN, FameAuthorizedDeliveryContextSchema, FameConnectError, FameEnvironmentContext, FameError, FameMessageTooLarge, FameNode, FameNodeAuthorizationContextSchema, FameProtocolError, FameTransportClose, FlowController, GRANT_PURPOSE_NODE_ATTACH, HTTP_CONNECTION_GRANT_TYPE, HTTP_STATELESS_CONNECTOR_TYPE, HttpListener, HttpStatelessConnector, INPAGE_CONNECTION_GRANT_TYPE, INPAGE_CONNECTOR_TYPE, InMemoryBinding, InMemoryFanoutBroker, InMemoryKeyValueStore, InMemoryReadWriteChannel, InMemoryStorageProvider, InPageConnector, InPageListener, InProcessFameFabric, InProcessFameFabricFactory, IndexedDBKeyValueStore, IndexedDBStorageProvider, InvalidPassphraseError, JWKValidationError, KEY_MANAGER_FACTORY_BASE_TYPE, KEY_STORE_FACTORY_BASE_TYPE, KNOWN_POLICY_FIELDS, KNOWN_RULE_FIELDS, KeyInfo, KeyManagementHandler, KeyManagerFactory, KeyStore, KeyStoreFactory, KeyValidationError, LOAD_BALANCER_STICKINESS_MANAGER_FACTORY_BASE_TYPE, LoadBalancerStickinessManagerFactory, LogLevel, LogLevelNames, MAX_SCOPE_NESTING_DEPTH, MemoryMetricsEmitter, NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE, NODE_LIKE_FACTORY_BASE_TYPE, NODE_PLACEMENT_STRATEGY_FACTORY_BASE_TYPE, NoOpMetricsEmitter, NoSecurityPolicy, NodeFactory, NodeIdentityPolicyFactory, NodeIdentityPolicyProfileFactory, NodePlacementStrategyFactory, NoneCredentialProvider, NoopEncryptionManager, NoopKeyValidator, NoopTrustStoreProvider, NotAuthorized, PROFILE_NAME_GATED, PROFILE_NAME_GATED_CALLBACK, PROFILE_NAME_OPEN$1 as PROFILE_NAME_OPEN, PROFILE_NAME_OVERLAY, PROFILE_NAME_OVERLAY_CALLBACK, PROFILE_NAME_STRICT_OVERLAY, PromptCredentialProvider, QueueFullError, REPLICA_STICKINESS_MANAGER_FACTORY_BASE_TYPE, REQUIRED_FIELDS_BY_KTY, ReplicaStickinessManagerFactory, RootSessionManager, RouteManager, RpcMixin, RpcProxy, SEALED_ENVELOPE_NONCE_LENGTH, SEALED_ENVELOPE_OVERHEAD, SEALED_ENVELOPE_PRIVATE_KEY_LENGTH, SEALED_ENVELOPE_PUBLIC_KEY_LENGTH, SEALED_ENVELOPE_TAG_LENGTH, SECURE_CHANNEL_MANAGER_FACTORY_BASE_TYPE, SECURITY_MANAGER_FACTORY_BASE_TYPE, SECURITY_POLICY_FACTORY_BASE_TYPE, SQLiteKeyValueStore, SQLiteStorageProvider, STORAGE_PROVIDER_FACTORY_BASE_TYPE, SecretSource, SecretStoreCredentialProvider, SecureChannelFrameHandler, SecureChannelManagerFactory, SecurityAction, SecurityRequirements, Sentinel, SentinelFactory, SessionKeyCredentialProvider, SignaturePolicy, SigningConfig as SigningConfigClass, SigningConfiguration, SimpleLoadBalancerStickinessManager, SimpleLoadBalancerStickinessManagerFactory, StaticCredentialProvider, StorageAESEncryptionManager, TOKEN_ISSUER_FACTORY_BASE_TYPE, TOKEN_PROVIDER_FACTORY_BASE_TYPE, TOKEN_VERIFIER_FACTORY_BASE_TYPE, TRANSPORT_LISTENER_FACTORY_BASE_TYPE, TRANSPORT_PROVISIONER_FACTORY_BASE_TYPE, TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE, TaskSpawner, TokenIssuerFactory, TokenProviderFactory, TokenSubjectNodeIdentityPolicy, TokenSubjectNodeIdentityPolicyFactory, TokenVerifierFactory, TransportListener, TransportListenerFactory, TransportProvisionerFactory, TrustStoreProviderFactory, TtlValidationError, UpstreamSessionManager, VALID_ACTIONS, VALID_CURVES_BY_KTY, VALID_EFFECTS, VALID_KEY_USES, VALID_ORIGIN_TYPES, VERSION, WEBSOCKET_CONNECTION_GRANT_TYPE, WELCOME_SERVICE_FACTORY_BASE_TYPE, WebSocketCloseCode, WebSocketConnector, WebSocketListener, WebSocketState, WelcomeServiceFactory, _NoopFlowController, __runtimePluginLoader, addEnvelopeFields, addLogLevel, addTimestamp, assertConnectionGrant, assertGrant, assertNotRegexPattern, basicConfig, broadcastChannelGrantToConnectorConfig, camelToSnakeCase, canonicalJson, capitalizeFirstLetter, color, compareCryptoLevels, compileGlobOnlyScopeRequirement, compileGlobPattern, compilePattern, compileScopeRequirement, compiledPathPattern, consoleTransport, convertWildcardLogicalToDnsConstraint, createConnectorConfig, createEd25519Keypair, createHostLogicalUri, createJwksRouter, createLogicalUri, createNodeDeliveryContext, createApp as createOAuth2ServerApp, createOAuth2TokenRouter, createOpenIDConfigurationRouter, createResource, createRpcProxy, createRsaKeypair, createTransportCloseError, createX25519Keypair, credentialToString, currentTraceId$1 as currentTraceId, debounce, decodeBase64Url, decodeFameDataPayload, deepMerge, defaultJsonEncoder, delay, dropEmpty, enableLogging, encodeUtf8, ensureRuntimeFactoriesRegistered, evaluateScopeRequirement, extractId, extractPoolAddressBase, extractPoolBase, filterKeysByUse, formatTimestamp, formatTimestampForConsole$1 as formatTimestampForConsole, frameDigest, getCompiledGlobPattern, getCurrentEnvelope, getFabricForNode, getFameRoot, getHttpListenerInstance, getInPageListenerInstance, getKeyProvider, getKeyStore, getLogger, getWebsocketListenerInstance, hasCryptoSupport, hostnameToLogical, hostnamesToLogicals, httpGrantToConnectorConfig, immutableHeaders, inPageGrantToConnectorConfig, isAuthInjectionStrategy, isBroadcastChannelConnectionGrant, isConnectionGrant, isConnectorConfig, isEnvelopeLoggingEnabled, isFameError, isFameErrorType, isGrant, isHttpConnectionGrant, isIdentityExposingTokenProvider, isInPageConnectionGrant, isNodeLike, isPlainObject$4 as isPlainObject, isPoolAddress, isPoolLogical, isRegexPattern, isRegisterable, isTokenExpired, isTokenProvider, isTokenValid, isWebSocketConnectionGrant, jsonDumps, logicalPatternsToDnsConstraints, logicalToHostname, logicalsToHostnames, matchPattern, matchesPoolAddress, matchesPoolLogical, maybeAwait, nodeWelcomeRouter, nodeWelcomeRouterPlugin, normalizeBroadcastChannelConnectionGrant, normalizeEncryptionConfig, normalizeEnvelopeSnapshot, normalizeExtendedFameConfig, normalizeHttpConnectionGrant, normalizeInPageConnectionGrant, normalizeInboundCryptoRules, normalizeInboundSigningRules, normalizeOutboundCryptoRules, normalizeOutboundSigningRules, normalizePath, normalizeResponseCryptoRules, normalizeResponseSigningRules, normalizeScopeRequirement, normalizeSecretSource, normalizeSecurityRequirements, normalizeSigningConfig, normalizeWebSocketConnectionGrant, objectToBytes, operation, parseSealedEnvelope, pinoTransport, prettyModel$1 as prettyModel, registerDefaultFactories, registerDefaultKeyStoreFactory, registerNodePlacementStrategyFactory, registerRuntimeFactories, requireCryptoSupport, retryWithBackoff, main as runOAuth2Server, safeColor, safeImport, sealedDecrypt, sealedEncrypt, secureDigest, setKeyStore, showEnvelopes$1 as showEnvelopes, sleep, snakeToCamelCase, stringifyNonPrimitives, supportsColor, throttle, urlsafeBase64Decode, urlsafeBase64Encode, validateCacheTtlSec, validateEncryptionKey, validateHostLogical, validateHostLogicals, validateJwkComplete, validateJwkStructure, validateJwkUseField, validateJwtTokenTtlSec, validateKeyCorrelationTtlSec, validateLogical, validateLogicalSegment, validateOAuth2TtlSec, validateSigningKey, validateTtlSec, waitForAll, waitForAllSettled, waitForAny, websocketGrantToConnectorConfig, withEnvelopeContext, withEnvelopeContextAsync, withLegacySnakeCaseKeys, withLock, withTimeout };
45875
+ export { ADMISSION_CLIENT_FACTORY_BASE_TYPE, ATTACHMENT_KEY_VALIDATOR_FACTORY_BASE_TYPE, AUTHORIZATION_POLICY_FACTORY_BASE_TYPE, AUTHORIZATION_POLICY_SOURCE_FACTORY_BASE_TYPE, AUTHORIZER_FACTORY_BASE_TYPE, AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE, ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY$1 as AUTH_PROFILE_ENV_VAR_ENFORCE_TOKEN_SUBJECT_NODE_IDENTITY, ENV_VAR_HMAC_SECRET$1 as AUTH_PROFILE_ENV_VAR_HMAC_SECRET, ENV_VAR_JWKS_URL$1 as AUTH_PROFILE_ENV_VAR_JWKS_URL, ENV_VAR_JWT_ALGORITHM$3 as AUTH_PROFILE_ENV_VAR_JWT_ALGORITHM, ENV_VAR_JWT_AUDIENCE$3 as AUTH_PROFILE_ENV_VAR_JWT_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE$1 as AUTH_PROFILE_ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER$1 as AUTH_PROFILE_ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, ENV_VAR_JWT_TRUSTED_ISSUER$1 as AUTH_PROFILE_ENV_VAR_JWT_TRUSTED_ISSUER, ENV_VAR_TRUSTED_CLIENT_SCOPE$1 as AUTH_PROFILE_ENV_VAR_TRUSTED_CLIENT_SCOPE, PROFILE_NAME_DEFAULT as AUTH_PROFILE_NAME_DEFAULT, PROFILE_NAME_NOOP$2 as AUTH_PROFILE_NAME_NOOP, PROFILE_NAME_OAUTH2 as AUTH_PROFILE_NAME_OAUTH2, PROFILE_NAME_OAUTH2_CALLBACK as AUTH_PROFILE_NAME_OAUTH2_CALLBACK, PROFILE_NAME_OAUTH2_GATED as AUTH_PROFILE_NAME_OAUTH2_GATED, AnsiColor, AsyncLock, AttachmentKeyValidator, AuthInjectionStrategyFactory, AuthorizationPolicyFactory, AuthorizationPolicySourceFactory, AuthorizationProfileFactory, AuthorizerFactory, BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE, BackPressureFull, BaseAsyncConnector, BaseNodeEventListener, BasicAuthorizationPolicy, BasicAuthorizationPolicyFactory, BindingManager, BindingStoreEntryRecord, BrowserAutoKeyCredentialProvider, BrowserWrappedKeyCredentialProvider, CERTIFICATE_MANAGER_FACTORY_BASE_TYPE, CONNECTION_RETRY_POLICY_FACTORY_BASE_TYPE, CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE, CRYPTO_LEVEL_SECURITY_ORDER, CertificateManagerFactory, ConnectionRetryPolicyFactory, ConnectorConfigDefaults, ConnectorFactory, ConsoleMetricsEmitter, CryptoLevel, FACTORY_META$10 as DEFAULT_WELCOME_FACTORY_META, DefaultConnectionRetryPolicy, DefaultConnectionRetryPolicyFactory, DefaultCryptoProvider, DefaultHttpServer, DefaultKeyManager, DefaultNodeIdentityPolicy, DefaultNodeIdentityPolicyFactory, DefaultSecurityManager, DefaultSecurityPolicy, DefaultWelcomeService, DefaultWelcomeServiceFactory, DevFixedKeyCredentialProvider, ENCRYPTION_MANAGER_FACTORY_BASE_TYPE, ENVELOPE_SIGNER_FACTORY_BASE_TYPE, ENVELOPE_VERIFIER_FACTORY_BASE_TYPE, ENV_VAR_AUTHORIZATION_PROFILE, ENV_VAR_DEFAULT_ENCRYPTION_LEVEL, ENV_VAR_HMAC_SECRET, ENV_VAR_JWKS_URL, ENV_VAR_JWT_ALGORITHM$2 as ENV_VAR_JWT_ALGORITHM, ENV_VAR_JWT_AUDIENCE$2 as ENV_VAR_JWT_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, ENV_VAR_JWT_TRUSTED_ISSUER, ENV_VAR_SESSION_MAX_INITIAL_ATTEMPTS, ENV_VAR_SHOW_ENVELOPES$1 as ENV_VAR_SHOW_ENVELOPES, EdDSAEnvelopeSigner, EncryptedKeyValueStore, EncryptedStorageProviderBase, EncryptedValue, EncryptionConfiguration, EncryptionManagerFactory, EncryptionResult, EncryptionStatus, EnvCredentialProvider, EnvelopeContext, EnvelopeListenerManager, EnvelopeSecurityHandler, EnvelopeSignerFactory, EnvelopeVerifierFactory, FACTORY_META$11 as FACTORY_META, FAME_FABRIC_FACTORY_BASE_TYPE, FIXED_PREFIX_LEN, FameAuthorizedDeliveryContextSchema, FameConnectError, FameEnvironmentContext, FameError, FameMessageTooLarge, FameNode, FameNodeAuthorizationContextSchema, FameProtocolError, FameTransportClose, FlowController, GRANT_PURPOSE_NODE_ATTACH, HTTP_CONNECTION_GRANT_TYPE, HTTP_STATELESS_CONNECTOR_TYPE, HttpListener, HttpStatelessConnector, INPAGE_CONNECTION_GRANT_TYPE, INPAGE_CONNECTOR_TYPE, InMemoryBinding, InMemoryFanoutBroker, InMemoryKeyValueStore, InMemoryReadWriteChannel, InMemoryStorageProvider, InPageConnector, InPageListener, InProcessFameFabric, InProcessFameFabricFactory, IndexedDBKeyValueStore, IndexedDBStorageProvider, InvalidPassphraseError, JWKValidationError, KEY_MANAGER_FACTORY_BASE_TYPE, KEY_STORE_FACTORY_BASE_TYPE, KNOWN_POLICY_FIELDS, KNOWN_RULE_FIELDS, KeyInfo, KeyManagementHandler, KeyManagerFactory, KeyStore, KeyStoreFactory, KeyValidationError, LOAD_BALANCER_STICKINESS_MANAGER_FACTORY_BASE_TYPE, LoadBalancerStickinessManagerFactory, LogLevel, LogLevelNames, MAX_SCOPE_NESTING_DEPTH, MemoryMetricsEmitter, NODE_IDENTITY_POLICY_FACTORY_BASE_TYPE, NODE_LIKE_FACTORY_BASE_TYPE, NODE_PLACEMENT_STRATEGY_FACTORY_BASE_TYPE, NoOpMetricsEmitter, NoSecurityPolicy, NodeFactory, NodeIdentityPolicyFactory, NodeIdentityPolicyProfileFactory, NodePlacementStrategyFactory, NoneCredentialProvider, NoopEncryptionManager, NoopKeyValidator, NoopTrustStoreProvider, NotAuthorized, PROFILE_NAME_GATED, PROFILE_NAME_GATED_CALLBACK, PROFILE_NAME_OPEN$1 as PROFILE_NAME_OPEN, PROFILE_NAME_OVERLAY, PROFILE_NAME_OVERLAY_CALLBACK, PROFILE_NAME_STRICT_OVERLAY, PromptCredentialProvider, QueueFullError, REPLICA_STICKINESS_MANAGER_FACTORY_BASE_TYPE, REQUIRED_FIELDS_BY_KTY, ReplicaStickinessManagerFactory, RootSessionManager, RouteManager, RpcMixin, RpcProxy, SEALED_ENVELOPE_NONCE_LENGTH, SEALED_ENVELOPE_OVERHEAD, SEALED_ENVELOPE_PRIVATE_KEY_LENGTH, SEALED_ENVELOPE_PUBLIC_KEY_LENGTH, SEALED_ENVELOPE_TAG_LENGTH, SECURE_CHANNEL_MANAGER_FACTORY_BASE_TYPE, SECURITY_MANAGER_FACTORY_BASE_TYPE, SECURITY_POLICY_FACTORY_BASE_TYPE, SQLiteKeyValueStore, SQLiteStorageProvider, STORAGE_PROVIDER_FACTORY_BASE_TYPE, SecretSource, SecretStoreCredentialProvider, SecureChannelFrameHandler, SecureChannelManagerFactory, SecurityAction, SecurityRequirements, Sentinel, SentinelFactory, SessionKeyCredentialProvider, SignaturePolicy, SigningConfig as SigningConfigClass, SigningConfiguration, SimpleLoadBalancerStickinessManager, SimpleLoadBalancerStickinessManagerFactory, StaticCredentialProvider, StorageAESEncryptionManager, TOKEN_ISSUER_FACTORY_BASE_TYPE, TOKEN_PROVIDER_FACTORY_BASE_TYPE, TOKEN_VERIFIER_FACTORY_BASE_TYPE, TRANSPORT_LISTENER_FACTORY_BASE_TYPE, TRANSPORT_PROVISIONER_FACTORY_BASE_TYPE, TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE, TaskSpawner, TokenIssuerFactory, TokenProviderFactory, TokenSubjectNodeIdentityPolicy, TokenSubjectNodeIdentityPolicyFactory, TokenVerifierFactory, TransportListener, TransportListenerFactory, TransportProvisionerFactory, TrustStoreProviderFactory, TtlValidationError, UpstreamSessionManager, VALID_ACTIONS, VALID_CURVES_BY_KTY, VALID_EFFECTS, VALID_KEY_USES, VALID_ORIGIN_TYPES, VERSION, WEBSOCKET_CONNECTION_GRANT_TYPE, WELCOME_SERVICE_FACTORY_BASE_TYPE, WebSocketCloseCode, WebSocketConnector, WebSocketListener, WebSocketState, WelcomeServiceFactory, _NoopFlowController, __runtimePluginLoader, addEnvelopeFields, addLogLevel, addTimestamp, assertConnectionGrant, assertGrant, assertNotRegexPattern, basicConfig, broadcastChannelGrantToConnectorConfig, camelToSnakeCase, canonicalJson, capitalizeFirstLetter, color, compareCryptoLevels, compileGlobOnlyScopeRequirement, compileGlobPattern, compilePattern, compileScopeRequirement, compiledPathPattern, consoleTransport, convertWildcardLogicalToDnsConstraint, createConnectorConfig, createEd25519Keypair, createHostLogicalUri, createJwksRouter, createLogicalUri, createNodeDeliveryContext, createApp as createOAuth2ServerApp, createOAuth2TokenRouter, createOpenIDConfigurationRouter, createResource, createRpcProxy, createRsaKeypair, createTransportCloseError, createX25519Keypair, credentialToString, currentTraceId$1 as currentTraceId, debounce, decodeBase64Url, decodeFameDataPayload, deepMerge, defaultJsonEncoder, delay, dropEmpty, enableLogging, encodeUtf8, ensureRuntimeFactoriesRegistered, evaluateScopeRequirement, extractId, extractPoolAddressBase, extractPoolBase, filterKeysByUse, formatTimestamp, formatTimestampForConsole$1 as formatTimestampForConsole, frameDigest, getCompiledGlobPattern, getCurrentEnvelope, getFabricForNode, getFameRoot, getHttpListenerInstance, getInPageListenerInstance, getKeyProvider, getKeyStore, getLogger, getWebsocketListenerInstance, hasCryptoSupport, hostnameToLogical, hostnamesToLogicals, httpGrantToConnectorConfig, immutableHeaders, inPageGrantToConnectorConfig, isAuthInjectionStrategy, isBroadcastChannelConnectionGrant, isConnectionGrant, isConnectorConfig, isEnvelopeLoggingEnabled, isFameError, isFameErrorType, isGrant, isHttpConnectionGrant, isIdentityExposingTokenProvider, isInPageConnectionGrant, isNodeLike, isPlainObject$4 as isPlainObject, isPoolAddress, isPoolLogical, isRegexPattern, isRegisterable, isTokenExpired, isTokenProvider, isTokenValid, isWebSocketConnectionGrant, jsonDumps, logicalPatternsToDnsConstraints, logicalToHostname, logicalsToHostnames, matchPattern, matchesPoolAddress, matchesPoolLogical, maybeAwait, nodeWelcomeRouter, nodeWelcomeRouterPlugin, normalizeBroadcastChannelConnectionGrant, normalizeEncryptionConfig, normalizeEnvelopeSnapshot, normalizeExtendedFameConfig, normalizeHttpConnectionGrant, normalizeInPageConnectionGrant, normalizeInboundCryptoRules, normalizeInboundSigningRules, normalizeOutboundCryptoRules, normalizeOutboundSigningRules, normalizePath, normalizeResponseCryptoRules, normalizeResponseSigningRules, normalizeScopeRequirement, normalizeSecretSource, normalizeSecurityRequirements, normalizeSigningConfig, normalizeWebSocketConnectionGrant, objectToBytes, operation, parseSealedEnvelope, pinoTransport, prettyModel$1 as prettyModel, registerDefaultFactories, registerDefaultKeyStoreFactory, registerNodePlacementStrategyFactory, registerRuntimeFactories, requireCryptoSupport, retryWithBackoff, main as runOAuth2Server, safeColor, safeImport, sealedDecrypt, sealedEncrypt, secureDigest, setKeyStore, showEnvelopes$1 as showEnvelopes, sleep, snakeToCamelCase, stringifyNonPrimitives, supportsColor, throttle, urlsafeBase64Decode, urlsafeBase64Encode, validateCacheTtlSec, validateEncryptionKey, validateHostLogical, validateHostLogicals, validateJwkComplete, validateJwkStructure, validateJwkUseField, validateJwtTokenTtlSec, validateKeyCorrelationTtlSec, validateLogical, validateLogicalSegment, validateOAuth2TtlSec, validateSigningKey, validateTtlSec, waitForAll, waitForAllSettled, waitForAny, websocketGrantToConnectorConfig, withEnvelopeContext, withEnvelopeContextAsync, withLegacySnakeCaseKeys, withLock, withTimeout };