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