@naylence/runtime 0.3.6-test.108 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.cjs +98 -61
- package/dist/browser/index.mjs +98 -61
- package/dist/cjs/_env-shim.js +2 -1
- package/dist/cjs/naylence/fame/config/extended-fame-config.js +2 -1
- package/dist/cjs/naylence/fame/connector/broadcast-channel-connector-factory.js +8 -4
- package/dist/cjs/naylence/fame/connector/broadcast-channel-connector.browser.js +13 -6
- package/dist/cjs/naylence/fame/connector/broadcast-channel-listener-factory.js +3 -1
- package/dist/cjs/naylence/fame/connector/broadcast-channel-listener.js +2 -6
- package/dist/cjs/naylence/fame/connector/inpage-connector-factory.js +2 -1
- package/dist/cjs/naylence/fame/connector/inpage-connector.js +13 -6
- package/dist/cjs/naylence/fame/connector/inpage-listener-factory.js +4 -4
- package/dist/cjs/naylence/fame/connector/inpage-listener.js +5 -2
- package/dist/cjs/naylence/fame/grants/broadcast-channel-connection-grant.js +6 -3
- package/dist/cjs/naylence/fame/grants/inpage-connection-grant.js +4 -2
- package/dist/cjs/naylence/fame/http/oauth2-token-router.js +9 -9
- package/dist/cjs/naylence/fame/node/admission/default-node-attach-client.js +6 -3
- package/dist/cjs/naylence/fame/node/upstream-session-manager.js +9 -6
- package/dist/cjs/naylence/fame/security/auth/oauth2-pkce-token-provider-factory.js +10 -6
- package/dist/cjs/naylence/fame/security/auth/oauth2-pkce-token-provider.js +1 -2
- package/dist/cjs/naylence/fame/security/default-security-manager.js +2 -1
- package/dist/cjs/naylence/fame/security/trust-store/noop-trust-store-provider-factory.js +2 -2
- package/dist/cjs/naylence/fame/security/trust-store/trust-store-provider-factory.js +2 -2
- package/dist/cjs/version.js +2 -2
- package/dist/esm/_env-shim.js +2 -1
- package/dist/esm/browser.js +2 -2
- package/dist/esm/naylence/fame/config/extended-fame-config.js +2 -1
- package/dist/esm/naylence/fame/connector/broadcast-channel-connector-factory.js +8 -4
- package/dist/esm/naylence/fame/connector/broadcast-channel-connector.browser.js +13 -6
- package/dist/esm/naylence/fame/connector/broadcast-channel-listener-factory.js +3 -1
- package/dist/esm/naylence/fame/connector/broadcast-channel-listener.js +2 -6
- package/dist/esm/naylence/fame/connector/index.js +2 -2
- package/dist/esm/naylence/fame/connector/inpage-connector-factory.js +2 -1
- package/dist/esm/naylence/fame/connector/inpage-connector.js +13 -6
- package/dist/esm/naylence/fame/connector/inpage-listener-factory.js +4 -4
- package/dist/esm/naylence/fame/connector/inpage-listener.js +5 -2
- package/dist/esm/naylence/fame/grants/broadcast-channel-connection-grant.js +6 -3
- package/dist/esm/naylence/fame/grants/inpage-connection-grant.js +4 -2
- package/dist/esm/naylence/fame/http/oauth2-token-router.js +9 -9
- package/dist/esm/naylence/fame/node/admission/default-node-attach-client.js +6 -3
- package/dist/esm/naylence/fame/node/upstream-session-manager.js +9 -6
- package/dist/esm/naylence/fame/security/auth/oauth2-pkce-token-provider-factory.js +10 -6
- package/dist/esm/naylence/fame/security/auth/oauth2-pkce-token-provider.js +1 -2
- package/dist/esm/naylence/fame/security/default-security-manager.js +2 -1
- package/dist/esm/naylence/fame/security/index.js +1 -1
- package/dist/esm/naylence/fame/security/trust-store/noop-trust-store-provider-factory.js +3 -3
- package/dist/esm/naylence/fame/security/trust-store/trust-store-provider-factory.js +3 -3
- package/dist/esm/version.js +2 -2
- package/dist/node/index.cjs +96 -60
- package/dist/node/index.mjs +96 -60
- package/dist/node/node.cjs +105 -69
- package/dist/node/node.mjs +105 -69
- package/dist/types/browser.d.ts +2 -2
- package/dist/types/naylence/fame/connector/index.d.ts +2 -2
- package/dist/types/naylence/fame/security/index.d.ts +1 -1
- package/dist/types/naylence/fame/security/trust-store/noop-trust-store-provider-factory.d.ts +3 -3
- package/dist/types/naylence/fame/security/trust-store/trust-store-provider-factory.d.ts +4 -4
- package/dist/types/naylence/fame/security/trust-store/trust-store-provider.d.ts +5 -5
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/node/node.cjs
CHANGED
|
@@ -5563,12 +5563,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
|
|
|
5563
5563
|
}
|
|
5564
5564
|
|
|
5565
5565
|
// This file is auto-generated during build - do not edit manually
|
|
5566
|
-
// Generated from package.json version: 0.3.
|
|
5566
|
+
// Generated from package.json version: 0.3.7
|
|
5567
5567
|
/**
|
|
5568
5568
|
* The package version, injected at build time.
|
|
5569
5569
|
* @internal
|
|
5570
5570
|
*/
|
|
5571
|
-
const VERSION = '0.3.
|
|
5571
|
+
const VERSION = '0.3.7';
|
|
5572
5572
|
|
|
5573
5573
|
/**
|
|
5574
5574
|
* Fame errors module - Fame protocol specific error classes
|
|
@@ -11512,7 +11512,8 @@ const ensureBroadcastEnvironment = () => {
|
|
|
11512
11512
|
};
|
|
11513
11513
|
let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAsyncConnector {
|
|
11514
11514
|
static generateConnectorId() {
|
|
11515
|
-
const globalCrypto = globalThis
|
|
11515
|
+
const globalCrypto = globalThis
|
|
11516
|
+
.crypto;
|
|
11516
11517
|
if (globalCrypto?.randomUUID) {
|
|
11517
11518
|
return globalCrypto.randomUUID();
|
|
11518
11519
|
}
|
|
@@ -11567,7 +11568,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
11567
11568
|
this.listenerRegistered = false;
|
|
11568
11569
|
this.visibilityChangeListenerRegistered = false;
|
|
11569
11570
|
this.channelName =
|
|
11570
|
-
typeof config.channelName === 'string' &&
|
|
11571
|
+
typeof config.channelName === 'string' &&
|
|
11572
|
+
config.channelName.trim().length > 0
|
|
11571
11573
|
? config.channelName.trim()
|
|
11572
11574
|
: DEFAULT_CHANNEL$7;
|
|
11573
11575
|
const preferredCapacity = typeof config.inboxCapacity === 'number' &&
|
|
@@ -11609,7 +11611,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
11609
11611
|
channel: this.channelName,
|
|
11610
11612
|
connector_id: this.connectorId,
|
|
11611
11613
|
message_type: message && typeof message === 'object'
|
|
11612
|
-
? message.constructor
|
|
11614
|
+
? (message.constructor
|
|
11615
|
+
?.name ?? typeof message)
|
|
11613
11616
|
: typeof message,
|
|
11614
11617
|
has_sender_id: Boolean(message?.senderId),
|
|
11615
11618
|
has_sender_node_id: Boolean(message?.senderNodeId),
|
|
@@ -11839,7 +11842,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
11839
11842
|
timestamp: new Date().toISOString(),
|
|
11840
11843
|
});
|
|
11841
11844
|
}
|
|
11842
|
-
if (this.visibilityChangeListenerRegistered &&
|
|
11845
|
+
if (this.visibilityChangeListenerRegistered &&
|
|
11846
|
+
this.visibilityChangeHandler &&
|
|
11847
|
+
typeof document !== 'undefined') {
|
|
11843
11848
|
document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
|
|
11844
11849
|
this.visibilityChangeListenerRegistered = false;
|
|
11845
11850
|
this.visibilityChangeHandler = undefined;
|
|
@@ -11867,7 +11872,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
11867
11872
|
return rawOrEnvelope;
|
|
11868
11873
|
}
|
|
11869
11874
|
_isWildcardTarget() {
|
|
11870
|
-
return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
|
|
11875
|
+
return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
|
|
11871
11876
|
}
|
|
11872
11877
|
_shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
|
|
11873
11878
|
if (this._isWildcardTarget()) {
|
|
@@ -11887,7 +11892,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
11887
11892
|
return true;
|
|
11888
11893
|
}
|
|
11889
11894
|
const expectedSender = this.targetNodeId;
|
|
11890
|
-
if (expectedSender &&
|
|
11895
|
+
if (expectedSender &&
|
|
11896
|
+
expectedSender !== '*' &&
|
|
11897
|
+
senderNodeId !== expectedSender) {
|
|
11891
11898
|
logger$10.debug('broadcast_channel_message_rejected', {
|
|
11892
11899
|
channel: this.channelName,
|
|
11893
11900
|
connector_id: this.connectorId,
|
|
@@ -12061,14 +12068,16 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
|
|
|
12061
12068
|
type,
|
|
12062
12069
|
purpose,
|
|
12063
12070
|
};
|
|
12064
|
-
const channelValue = candidate.channelName ??
|
|
12071
|
+
const channelValue = candidate.channelName ??
|
|
12072
|
+
candidate['channel_name'];
|
|
12065
12073
|
if (channelValue !== undefined) {
|
|
12066
12074
|
if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
|
|
12067
12075
|
throw new TypeError('BroadcastChannelConnectionGrant "channelName" must be a non-empty string when provided');
|
|
12068
12076
|
}
|
|
12069
12077
|
result.channelName = channelValue.trim();
|
|
12070
12078
|
}
|
|
12071
|
-
const inboxValue = candidate.inboxCapacity ??
|
|
12079
|
+
const inboxValue = candidate.inboxCapacity ??
|
|
12080
|
+
candidate['inbox_capacity'];
|
|
12072
12081
|
if (inboxValue !== undefined) {
|
|
12073
12082
|
if (typeof inboxValue !== 'number' ||
|
|
12074
12083
|
!Number.isFinite(inboxValue) ||
|
|
@@ -12077,7 +12086,8 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
|
|
|
12077
12086
|
}
|
|
12078
12087
|
result.inboxCapacity = Math.floor(inboxValue);
|
|
12079
12088
|
}
|
|
12080
|
-
const windowValue = candidate.initialWindow ??
|
|
12089
|
+
const windowValue = candidate.initialWindow ??
|
|
12090
|
+
candidate['initial_window'];
|
|
12081
12091
|
if (windowValue !== undefined) {
|
|
12082
12092
|
if (typeof windowValue !== 'number' ||
|
|
12083
12093
|
!Number.isFinite(windowValue) ||
|
|
@@ -12416,7 +12426,7 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12416
12426
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
12417
12427
|
logger$$.debug('callback_grants_before_augmentation', {
|
|
12418
12428
|
count: callbackGrants.length,
|
|
12419
|
-
types: callbackGrants.map(g => g.type),
|
|
12429
|
+
types: callbackGrants.map((g) => g.type),
|
|
12420
12430
|
});
|
|
12421
12431
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
12422
12432
|
// This prevents adding duplicate broadcast grants
|
|
@@ -12430,11 +12440,12 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12430
12440
|
});
|
|
12431
12441
|
// Include admission client's connection grants as callback grants
|
|
12432
12442
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
12433
|
-
if (welcome.frame.connectionGrants &&
|
|
12443
|
+
if (welcome.frame.connectionGrants &&
|
|
12444
|
+
Array.isArray(welcome.frame.connectionGrants)) {
|
|
12434
12445
|
for (const grant of welcome.frame.connectionGrants) {
|
|
12435
12446
|
if (grant && typeof grant === 'object') {
|
|
12436
12447
|
// Avoid duplicates by checking if grant already exists
|
|
12437
|
-
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
12448
|
+
const isDuplicate = callbackGrants.some((existing) => JSON.stringify(existing) === JSON.stringify(grant));
|
|
12438
12449
|
if (!isDuplicate) {
|
|
12439
12450
|
callbackGrants.push(grant);
|
|
12440
12451
|
logger$$.debug('added_connection_grant_as_callback', {
|
|
@@ -12451,7 +12462,8 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12451
12462
|
}
|
|
12452
12463
|
// Add broadcast grant after connection grants to ensure we don't duplicate
|
|
12453
12464
|
// any broadcast grants that may have been in connectionGrants
|
|
12454
|
-
if (broadcastCallbackGrant &&
|
|
12465
|
+
if (broadcastCallbackGrant &&
|
|
12466
|
+
this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
12455
12467
|
callbackGrants.push(broadcastCallbackGrant);
|
|
12456
12468
|
logger$$.debug('added_broadcast_callback_grant');
|
|
12457
12469
|
}
|
|
@@ -12460,7 +12472,7 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12460
12472
|
}
|
|
12461
12473
|
logger$$.debug('callback_grants_after_augmentation', {
|
|
12462
12474
|
count: callbackGrants.length,
|
|
12463
|
-
types: callbackGrants.map(g => g.type),
|
|
12475
|
+
types: callbackGrants.map((g) => g.type),
|
|
12464
12476
|
});
|
|
12465
12477
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
12466
12478
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
@@ -12702,7 +12714,8 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12702
12714
|
continue;
|
|
12703
12715
|
}
|
|
12704
12716
|
// Reset ack time if just resumed from pause (prevents immediate timeout)
|
|
12705
|
-
if (previousState === core.ConnectorState.PAUSED &&
|
|
12717
|
+
if (previousState === core.ConnectorState.PAUSED &&
|
|
12718
|
+
currentState === core.ConnectorState.STARTED) {
|
|
12706
12719
|
logger$$.debug('connector_just_resumed_resetting_ack_time', {
|
|
12707
12720
|
previous_state: previousState,
|
|
12708
12721
|
current_state: currentState,
|
|
@@ -14270,7 +14283,8 @@ class DefaultNodeAttachClient {
|
|
|
14270
14283
|
const interimHandler = async (envelope, context) => {
|
|
14271
14284
|
if (this.inHandshake) {
|
|
14272
14285
|
// Filter: only buffer frames related to our systemId or frames without systemId info
|
|
14273
|
-
const frameSystemId = envelope.frame
|
|
14286
|
+
const frameSystemId = envelope.frame
|
|
14287
|
+
?.systemId;
|
|
14274
14288
|
if (!frameSystemId || frameSystemId === this.expectedSystemId) {
|
|
14275
14289
|
this.buffer.push(envelope);
|
|
14276
14290
|
}
|
|
@@ -14466,7 +14480,8 @@ class DefaultNodeAttachClient {
|
|
|
14466
14480
|
const deadline = Date.now() + this.timeoutMs;
|
|
14467
14481
|
while (Date.now() < deadline) {
|
|
14468
14482
|
// Allow both STARTED and PAUSED states (PAUSED = tab hidden but connection alive)
|
|
14469
|
-
if (connector.state !== core.ConnectorState.STARTED &&
|
|
14483
|
+
if (connector.state !== core.ConnectorState.STARTED &&
|
|
14484
|
+
connector.state !== core.ConnectorState.PAUSED) {
|
|
14470
14485
|
let errorMessage = 'Connector closed while waiting for NodeAttachAck';
|
|
14471
14486
|
if (connector.closeCode !== undefined) {
|
|
14472
14487
|
errorMessage += ` (code=${connector.closeCode}`;
|
|
@@ -14490,7 +14505,8 @@ class DefaultNodeAttachClient {
|
|
|
14490
14505
|
if (envelope.frame.type === 'NodeAttach') {
|
|
14491
14506
|
logger$Y.debug('handshake_ignoring_concurrent_attach', {
|
|
14492
14507
|
frame_type: envelope.frame.type,
|
|
14493
|
-
frame_system_id: envelope.frame?.systemId ??
|
|
14508
|
+
frame_system_id: envelope.frame?.systemId ??
|
|
14509
|
+
'unknown',
|
|
14494
14510
|
});
|
|
14495
14511
|
}
|
|
14496
14512
|
else {
|
|
@@ -15217,7 +15233,8 @@ function createFsShim() {
|
|
|
15217
15233
|
else if (options &&
|
|
15218
15234
|
typeof options === 'object' &&
|
|
15219
15235
|
'encoding' in options &&
|
|
15220
|
-
typeof options.encoding ===
|
|
15236
|
+
typeof options.encoding ===
|
|
15237
|
+
'string') {
|
|
15221
15238
|
encoding = options.encoding;
|
|
15222
15239
|
}
|
|
15223
15240
|
const data = fsBinding.readFileUtf8(pathOrDescriptor, 0);
|
|
@@ -21636,7 +21653,8 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21636
21653
|
this.listenerRegistered = false;
|
|
21637
21654
|
this.visibilityChangeListenerRegistered = false;
|
|
21638
21655
|
this.channelName =
|
|
21639
|
-
typeof config.channelName === 'string' &&
|
|
21656
|
+
typeof config.channelName === 'string' &&
|
|
21657
|
+
config.channelName.trim().length > 0
|
|
21640
21658
|
? config.channelName.trim()
|
|
21641
21659
|
: DEFAULT_CHANNEL$6;
|
|
21642
21660
|
const preferredCapacity = typeof config.inboxCapacity === 'number' &&
|
|
@@ -21675,7 +21693,8 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21675
21693
|
channel: this.channelName,
|
|
21676
21694
|
connector_id: this.connectorId,
|
|
21677
21695
|
message_type: message && typeof message === 'object'
|
|
21678
|
-
? message.constructor
|
|
21696
|
+
? (message.constructor
|
|
21697
|
+
?.name ?? typeof message)
|
|
21679
21698
|
: typeof message,
|
|
21680
21699
|
has_sender_id: Boolean(message?.senderId),
|
|
21681
21700
|
has_sender_node_id: Boolean(message?.senderNodeId),
|
|
@@ -21684,7 +21703,8 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21684
21703
|
return;
|
|
21685
21704
|
}
|
|
21686
21705
|
const busMessage = message;
|
|
21687
|
-
const senderId = typeof busMessage.senderId === 'string' &&
|
|
21706
|
+
const senderId = typeof busMessage.senderId === 'string' &&
|
|
21707
|
+
busMessage.senderId.length > 0
|
|
21688
21708
|
? busMessage.senderId
|
|
21689
21709
|
: null;
|
|
21690
21710
|
const senderNodeId = InPageConnector.normalizeNodeId(busMessage.senderNodeId);
|
|
@@ -21935,7 +21955,9 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21935
21955
|
timestamp: new Date().toISOString(),
|
|
21936
21956
|
});
|
|
21937
21957
|
}
|
|
21938
|
-
if (this.visibilityChangeListenerRegistered &&
|
|
21958
|
+
if (this.visibilityChangeListenerRegistered &&
|
|
21959
|
+
this.visibilityChangeHandler &&
|
|
21960
|
+
typeof document !== 'undefined') {
|
|
21939
21961
|
document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
|
|
21940
21962
|
this.visibilityChangeListenerRegistered = false;
|
|
21941
21963
|
this.visibilityChangeHandler = undefined;
|
|
@@ -21952,7 +21974,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21952
21974
|
return rawOrEnvelope;
|
|
21953
21975
|
}
|
|
21954
21976
|
_isWildcardTarget() {
|
|
21955
|
-
return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
|
|
21977
|
+
return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
|
|
21956
21978
|
}
|
|
21957
21979
|
_shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
|
|
21958
21980
|
if (this._isWildcardTarget()) {
|
|
@@ -21972,7 +21994,9 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
21972
21994
|
return true;
|
|
21973
21995
|
}
|
|
21974
21996
|
const expectedSender = this.targetNodeId;
|
|
21975
|
-
if (expectedSender &&
|
|
21997
|
+
if (expectedSender &&
|
|
21998
|
+
expectedSender !== '*' &&
|
|
21999
|
+
senderNodeId !== expectedSender) {
|
|
21976
22000
|
logger$J.debug('inpage_message_rejected', {
|
|
21977
22001
|
channel: this.channelName,
|
|
21978
22002
|
connector_id: this.connectorId,
|
|
@@ -22374,8 +22398,8 @@ class CertificateManagerFactory extends factory.AbstractResourceFactory {
|
|
|
22374
22398
|
}
|
|
22375
22399
|
}
|
|
22376
22400
|
|
|
22377
|
-
const DEFAULT_UNCONFIGURED_MESSAGE =
|
|
22378
|
-
const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE =
|
|
22401
|
+
const DEFAULT_UNCONFIGURED_MESSAGE = 'Trust store is not configured. Set FAME_CA_CERTS to a PEM value, a file path, a data URI, or an HTTPS bundle URL.';
|
|
22402
|
+
const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = 'TrustStoreProviderFactory';
|
|
22379
22403
|
class TrustStoreProviderFactory extends factory.AbstractResourceFactory {
|
|
22380
22404
|
createUnconfiguredProvider(reason) {
|
|
22381
22405
|
return new NoopTrustStoreProvider(reason ?? DEFAULT_UNCONFIGURED_MESSAGE);
|
|
@@ -26104,7 +26128,8 @@ class DefaultSecurityManager {
|
|
|
26104
26128
|
const hasSignature = Boolean(envelope.sec?.sig);
|
|
26105
26129
|
if (!hasSignature) {
|
|
26106
26130
|
const nodeSid = node.sid;
|
|
26107
|
-
const envelopeSid = envelope
|
|
26131
|
+
const envelopeSid = envelope
|
|
26132
|
+
.sid;
|
|
26108
26133
|
const isLocalUnsignedSelfEnvelope = localContext.originType === core.DeliveryOriginType.LOCAL &&
|
|
26109
26134
|
typeof nodeSid === 'string' &&
|
|
26110
26135
|
nodeSid.length > 0 &&
|
|
@@ -29348,14 +29373,16 @@ function normalizeInPageConnectionGrant(candidate) {
|
|
|
29348
29373
|
type,
|
|
29349
29374
|
purpose,
|
|
29350
29375
|
};
|
|
29351
|
-
const channelValue = candidate.channelName ??
|
|
29376
|
+
const channelValue = candidate.channelName ??
|
|
29377
|
+
candidate['channel_name'];
|
|
29352
29378
|
if (channelValue !== undefined) {
|
|
29353
29379
|
if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
|
|
29354
29380
|
throw new TypeError('InPageConnectionGrant "channelName" must be a non-empty string when provided');
|
|
29355
29381
|
}
|
|
29356
29382
|
result.channelName = channelValue.trim();
|
|
29357
29383
|
}
|
|
29358
|
-
const inboxValue = candidate.inboxCapacity ??
|
|
29384
|
+
const inboxValue = candidate.inboxCapacity ??
|
|
29385
|
+
candidate['inbox_capacity'];
|
|
29359
29386
|
if (inboxValue !== undefined) {
|
|
29360
29387
|
if (typeof inboxValue !== 'number' ||
|
|
29361
29388
|
!Number.isFinite(inboxValue) ||
|
|
@@ -30161,7 +30188,9 @@ function normalizeConfig$p(config) {
|
|
|
30161
30188
|
: DEFAULT_CHANNEL$5;
|
|
30162
30189
|
const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
|
|
30163
30190
|
let inboxCapacity = DEFAULT_INBOX_CAPACITY$5;
|
|
30164
|
-
if (typeof rawInbox === 'number' &&
|
|
30191
|
+
if (typeof rawInbox === 'number' &&
|
|
30192
|
+
Number.isFinite(rawInbox) &&
|
|
30193
|
+
rawInbox > 0) {
|
|
30165
30194
|
inboxCapacity = Math.floor(rawInbox);
|
|
30166
30195
|
}
|
|
30167
30196
|
else if (typeof rawInbox === 'string') {
|
|
@@ -30189,9 +30218,7 @@ class InPageListenerFactory extends TransportListenerFactory {
|
|
|
30189
30218
|
}
|
|
30190
30219
|
async create(config, ...factoryArgs) {
|
|
30191
30220
|
const normalized = normalizeConfig$p(config);
|
|
30192
|
-
const [{ InPageListener }] = await Promise.all([
|
|
30193
|
-
getInPageListenerModule(),
|
|
30194
|
-
]);
|
|
30221
|
+
const [{ InPageListener }] = await Promise.all([getInPageListenerModule()]);
|
|
30195
30222
|
void factoryArgs;
|
|
30196
30223
|
return new InPageListener({
|
|
30197
30224
|
channelName: normalized.channelName,
|
|
@@ -30224,7 +30251,9 @@ function normalizeConfig$o(config) {
|
|
|
30224
30251
|
: DEFAULT_CHANNEL$4;
|
|
30225
30252
|
const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
|
|
30226
30253
|
let inboxCapacity = DEFAULT_INBOX_CAPACITY$4;
|
|
30227
|
-
if (typeof rawInbox === 'number' &&
|
|
30254
|
+
if (typeof rawInbox === 'number' &&
|
|
30255
|
+
Number.isFinite(rawInbox) &&
|
|
30256
|
+
rawInbox > 0) {
|
|
30228
30257
|
inboxCapacity = Math.floor(rawInbox);
|
|
30229
30258
|
}
|
|
30230
30259
|
else if (typeof rawInbox === 'string') {
|
|
@@ -30629,7 +30658,8 @@ class InPageConnectorFactory extends ConnectorFactory {
|
|
|
30629
30658
|
const normalized = this._normalizeConfig(config);
|
|
30630
30659
|
const options = (factoryArgs[0] ?? {});
|
|
30631
30660
|
const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
|
|
30632
|
-
const localNodeId = this._normalizeNodeId(options.localNodeId) ??
|
|
30661
|
+
const localNodeId = this._normalizeNodeId(options.localNodeId) ??
|
|
30662
|
+
normalizedLocalNodeFromConfig;
|
|
30633
30663
|
if (!localNodeId) {
|
|
30634
30664
|
throw new Error('InPageConnectorFactory requires a localNodeId from config or create() options');
|
|
30635
30665
|
}
|
|
@@ -30805,10 +30835,12 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
30805
30835
|
type: BROADCAST_CHANNEL_CONNECTOR_TYPE$1,
|
|
30806
30836
|
};
|
|
30807
30837
|
const channelCandidate = record.channelName ?? record['channel_name'];
|
|
30808
|
-
if (typeof channelCandidate === 'string' &&
|
|
30838
|
+
if (typeof channelCandidate === 'string' &&
|
|
30839
|
+
channelCandidate.trim().length > 0) {
|
|
30809
30840
|
config.channelName = channelCandidate.trim();
|
|
30810
30841
|
}
|
|
30811
|
-
const inboxCandidate = record.inboxCapacity ??
|
|
30842
|
+
const inboxCandidate = record.inboxCapacity ??
|
|
30843
|
+
record['inbox_capacity'];
|
|
30812
30844
|
if (typeof inboxCandidate === 'number' &&
|
|
30813
30845
|
Number.isFinite(inboxCandidate) &&
|
|
30814
30846
|
inboxCandidate > 0) {
|
|
@@ -30832,9 +30864,11 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
30832
30864
|
throw new Error('BroadcastChannelConnectorFactory requires a configuration');
|
|
30833
30865
|
}
|
|
30834
30866
|
const normalized = this._normalizeConfig(config);
|
|
30835
|
-
const options = (factoryArgs[0] ??
|
|
30867
|
+
const options = (factoryArgs[0] ??
|
|
30868
|
+
{});
|
|
30836
30869
|
const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
|
|
30837
|
-
const localNodeId = this._normalizeNodeId(options.localNodeId) ??
|
|
30870
|
+
const localNodeId = this._normalizeNodeId(options.localNodeId) ??
|
|
30871
|
+
normalizedLocalNodeFromConfig;
|
|
30838
30872
|
if (!localNodeId) {
|
|
30839
30873
|
throw new Error('BroadcastChannelConnectorFactory requires a localNodeId from config or create() options');
|
|
30840
30874
|
}
|
|
@@ -32442,7 +32476,9 @@ class InPageListener extends TransportListener {
|
|
|
32442
32476
|
typeof channelCandidate === 'string' && channelCandidate.trim().length > 0
|
|
32443
32477
|
? channelCandidate.trim()
|
|
32444
32478
|
: DEFAULT_CHANNEL$1;
|
|
32445
|
-
const normalizedCapacity = typeof inboxCandidate === 'number' &&
|
|
32479
|
+
const normalizedCapacity = typeof inboxCandidate === 'number' &&
|
|
32480
|
+
Number.isFinite(inboxCandidate) &&
|
|
32481
|
+
inboxCandidate > 0
|
|
32446
32482
|
? Math.floor(inboxCandidate)
|
|
32447
32483
|
: DEFAULT_INBOX_CAPACITY$1;
|
|
32448
32484
|
this._inboxCapacity = normalizedCapacity;
|
|
@@ -32717,7 +32753,8 @@ class InPageListener extends TransportListener {
|
|
|
32717
32753
|
if (grant.type === INPAGE_CONNECTION_GRANT_TYPE) {
|
|
32718
32754
|
return inPageGrantToConnectorConfig(grant);
|
|
32719
32755
|
}
|
|
32720
|
-
if (typeof grant
|
|
32756
|
+
if (typeof grant
|
|
32757
|
+
?.toConnectorConfig === 'function') {
|
|
32721
32758
|
return grant.toConnectorConfig();
|
|
32722
32759
|
}
|
|
32723
32760
|
throw new Error(`Unsupported grant type: ${grant.type}`);
|
|
@@ -32857,9 +32894,7 @@ var inpageListener = /*#__PURE__*/Object.freeze({
|
|
|
32857
32894
|
const logger$n = getLogger('naylence.fame.connector.broadcast_channel_listener');
|
|
32858
32895
|
const DEFAULT_CHANNEL = 'naylence-fabric';
|
|
32859
32896
|
const DEFAULT_INBOX_CAPACITY = 2048;
|
|
32860
|
-
const RESPONSE_TYPE_MASK = core.FameResponseType.ACK |
|
|
32861
|
-
core.FameResponseType.REPLY |
|
|
32862
|
-
core.FameResponseType.STREAM;
|
|
32897
|
+
const RESPONSE_TYPE_MASK = core.FameResponseType.ACK | core.FameResponseType.REPLY | core.FameResponseType.STREAM;
|
|
32863
32898
|
const isBrowserEnvironment$1 = () => typeof window !== 'undefined' &&
|
|
32864
32899
|
typeof BroadcastChannel !== 'undefined' &&
|
|
32865
32900
|
typeof MessageEvent !== 'undefined';
|
|
@@ -33073,9 +33108,7 @@ class BroadcastChannelListener extends TransportListener {
|
|
|
33073
33108
|
return null;
|
|
33074
33109
|
}
|
|
33075
33110
|
})();
|
|
33076
|
-
if (error instanceof zod.ZodError &&
|
|
33077
|
-
decoded &&
|
|
33078
|
-
decoded.length > 0) {
|
|
33111
|
+
if (error instanceof zod.ZodError && decoded && decoded.length > 0) {
|
|
33079
33112
|
try {
|
|
33080
33113
|
const reparsed = JSON.parse(decoded);
|
|
33081
33114
|
const candidate = reparsed.rtype;
|
|
@@ -34180,7 +34213,9 @@ function parseCookies(cookieHeader) {
|
|
|
34180
34213
|
if (!cookieHeader) {
|
|
34181
34214
|
return {};
|
|
34182
34215
|
}
|
|
34183
|
-
return cookieHeader
|
|
34216
|
+
return cookieHeader
|
|
34217
|
+
.split(';')
|
|
34218
|
+
.reduce((acc, entry) => {
|
|
34184
34219
|
const [rawName, ...rawValueParts] = entry.split('=');
|
|
34185
34220
|
const name = rawName?.trim();
|
|
34186
34221
|
if (!name) {
|
|
@@ -34328,10 +34363,7 @@ function setNoCacheHeaders(res) {
|
|
|
34328
34363
|
res.set('Pragma', 'no-cache');
|
|
34329
34364
|
}
|
|
34330
34365
|
function respondInvalidClient(res) {
|
|
34331
|
-
res
|
|
34332
|
-
.status(401)
|
|
34333
|
-
.set('WWW-Authenticate', 'Basic')
|
|
34334
|
-
.json({
|
|
34366
|
+
res.status(401).set('WWW-Authenticate', 'Basic').json({
|
|
34335
34367
|
error: 'invalid_client',
|
|
34336
34368
|
error_description: 'Invalid client credentials',
|
|
34337
34369
|
});
|
|
@@ -34368,10 +34400,10 @@ function createOAuth2TokenRouter(options) {
|
|
|
34368
34400
|
DEFAULT_JWT_ALGORITHM$1;
|
|
34369
34401
|
const allowedScopes = getAllowedScopes$1(configAllowedScopes);
|
|
34370
34402
|
const resolvedTokenTtlSec = tokenTtlSec ?? 3600;
|
|
34371
|
-
const enablePkce = coerceBoolean(process.env[ENV_VAR_ENABLE_PKCE]) ??
|
|
34372
|
-
(configEnablePkce ?? true);
|
|
34403
|
+
const enablePkce = coerceBoolean(process.env[ENV_VAR_ENABLE_PKCE]) ?? configEnablePkce ?? true;
|
|
34373
34404
|
const allowPublicClients = coerceBoolean(process.env[ENV_VAR_ALLOW_PUBLIC_CLIENTS]) ??
|
|
34374
|
-
|
|
34405
|
+
configAllowPublicClients ??
|
|
34406
|
+
true;
|
|
34375
34407
|
const authorizationCodeTtlSec = ensurePositiveInteger(coerceNumber$1(process.env[ENV_VAR_AUTHORIZATION_CODE_TTL]) ??
|
|
34376
34408
|
configAuthorizationCodeTtlSec) ?? DEFAULT_AUTHORIZATION_CODE_TTL_SEC;
|
|
34377
34409
|
const devLoginExplicitlyEnabled = coerceBoolean(process.env[ENV_VAR_ENABLE_DEV_LOGIN]) ??
|
|
@@ -34386,7 +34418,8 @@ function createOAuth2TokenRouter(options) {
|
|
|
34386
34418
|
configDevLoginCookieName ??
|
|
34387
34419
|
DEFAULT_SESSION_COOKIE_NAME;
|
|
34388
34420
|
const devLoginSecureCookie = coerceBoolean(process.env[ENV_VAR_SESSION_SECURE_COOKIE]) ??
|
|
34389
|
-
|
|
34421
|
+
configDevLoginSecureCookie ??
|
|
34422
|
+
false;
|
|
34390
34423
|
const devLoginTitle = coerceString$2(process.env[ENV_VAR_LOGIN_TITLE]) ??
|
|
34391
34424
|
configDevLoginTitle ??
|
|
34392
34425
|
DEFAULT_LOGIN_TITLE;
|
|
@@ -37453,19 +37486,23 @@ function normalizeConfig$a(config) {
|
|
|
37453
37486
|
normalized.clientSecretConfig = normalizeSecretSource(clientSecretSource);
|
|
37454
37487
|
}
|
|
37455
37488
|
const audienceCandidate = candidate.audience ?? candidate.aud;
|
|
37456
|
-
if (typeof audienceCandidate === 'string' &&
|
|
37489
|
+
if (typeof audienceCandidate === 'string' &&
|
|
37490
|
+
audienceCandidate.trim().length > 0) {
|
|
37457
37491
|
normalized.audience = audienceCandidate.trim();
|
|
37458
37492
|
}
|
|
37459
37493
|
const codeChallengeMethod = candidate.codeChallengeMethod ?? candidate.code_challenge_method;
|
|
37460
|
-
if (typeof codeChallengeMethod === 'string' &&
|
|
37494
|
+
if (typeof codeChallengeMethod === 'string' &&
|
|
37495
|
+
codeChallengeMethod.trim().length > 0) {
|
|
37461
37496
|
normalized.codeChallengeMethod = codeChallengeMethod.trim();
|
|
37462
37497
|
}
|
|
37463
37498
|
const codeVerifierLength = candidate.codeVerifierLength ?? candidate.code_verifier_length;
|
|
37464
|
-
if (typeof codeVerifierLength === 'number' &&
|
|
37499
|
+
if (typeof codeVerifierLength === 'number' &&
|
|
37500
|
+
Number.isFinite(codeVerifierLength)) {
|
|
37465
37501
|
normalized.codeVerifierLength = codeVerifierLength;
|
|
37466
37502
|
}
|
|
37467
37503
|
const clockSkewSeconds = candidate.clockSkewSeconds ?? candidate.clock_skew_seconds;
|
|
37468
|
-
if (typeof clockSkewSeconds === 'number' &&
|
|
37504
|
+
if (typeof clockSkewSeconds === 'number' &&
|
|
37505
|
+
Number.isFinite(clockSkewSeconds)) {
|
|
37469
37506
|
normalized.clockSkewSeconds = clockSkewSeconds;
|
|
37470
37507
|
}
|
|
37471
37508
|
const loginHintParam = candidate.loginHintParam ?? candidate.login_hint_param;
|
|
@@ -37510,8 +37547,8 @@ class OAuth2PkceTokenProviderFactory extends TokenProviderFactory {
|
|
|
37510
37547
|
options.audience = normalized.audience;
|
|
37511
37548
|
}
|
|
37512
37549
|
if (normalized.codeChallengeMethod) {
|
|
37513
|
-
options.codeChallengeMethod =
|
|
37514
|
-
.toUpperCase();
|
|
37550
|
+
options.codeChallengeMethod =
|
|
37551
|
+
normalized.codeChallengeMethod.toUpperCase();
|
|
37515
37552
|
}
|
|
37516
37553
|
if (normalized.codeVerifierLength) {
|
|
37517
37554
|
options.codeVerifierLength = normalized.codeVerifierLength;
|
|
@@ -39269,14 +39306,14 @@ var eddsaEnvelopeVerifierFactory = /*#__PURE__*/Object.freeze({
|
|
|
39269
39306
|
|
|
39270
39307
|
const FACTORY_META$d = {
|
|
39271
39308
|
base: TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE,
|
|
39272
|
-
key:
|
|
39309
|
+
key: 'NoopTrustStoreProvider',
|
|
39273
39310
|
isDefault: true,
|
|
39274
39311
|
priority: 10,
|
|
39275
39312
|
};
|
|
39276
39313
|
class NoopTrustStoreProviderFactory extends TrustStoreProviderFactory {
|
|
39277
39314
|
constructor() {
|
|
39278
39315
|
super(...arguments);
|
|
39279
|
-
this.type =
|
|
39316
|
+
this.type = 'NoopTrustStoreProvider';
|
|
39280
39317
|
this.isDefault = true;
|
|
39281
39318
|
this.priority = 10;
|
|
39282
39319
|
}
|
|
@@ -41514,8 +41551,7 @@ function normalizeOptions$2(raw) {
|
|
|
41514
41551
|
const scopes = normalizeScopes(camel.scopes) ??
|
|
41515
41552
|
normalizeScopes(snake.scopes ?? snake.scope) ??
|
|
41516
41553
|
DEFAULT_SCOPES.slice();
|
|
41517
|
-
const audience = coerceString(camel.audience) ??
|
|
41518
|
-
coerceString(snake.audience ?? snake.aud);
|
|
41554
|
+
const audience = coerceString(camel.audience) ?? coerceString(snake.audience ?? snake.aud);
|
|
41519
41555
|
const fetchImpl = (camel.fetchImpl ?? snake.fetch_impl);
|
|
41520
41556
|
const clockSkewSeconds = coerceNumber(camel.clockSkewSeconds) ??
|
|
41521
41557
|
coerceNumber(snake.clock_skew_seconds) ??
|