@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/browser/index.cjs
CHANGED
|
@@ -30,7 +30,8 @@ function installProcessEnvShim() {
|
|
|
30
30
|
if (g.__ENV__ && typeof g.__ENV__ === 'object')
|
|
31
31
|
Object.assign(out, g.__ENV__);
|
|
32
32
|
try {
|
|
33
|
-
//
|
|
33
|
+
// import.meta is only available in ESM builds
|
|
34
|
+
// @ts-ignore
|
|
34
35
|
const ie = (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) }) !== 'undefined' && undefined) || undefined;
|
|
35
36
|
if (ie && typeof ie === 'object')
|
|
36
37
|
Object.assign(out, ie);
|
|
@@ -98,12 +99,12 @@ installProcessEnvShim();
|
|
|
98
99
|
// --- END ENV SHIM ---
|
|
99
100
|
|
|
100
101
|
// This file is auto-generated during build - do not edit manually
|
|
101
|
-
// Generated from package.json version: 0.3.
|
|
102
|
+
// Generated from package.json version: 0.3.7
|
|
102
103
|
/**
|
|
103
104
|
* The package version, injected at build time.
|
|
104
105
|
* @internal
|
|
105
106
|
*/
|
|
106
|
-
const VERSION = '0.3.
|
|
107
|
+
const VERSION = '0.3.7';
|
|
107
108
|
|
|
108
109
|
/**
|
|
109
110
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -9859,7 +9860,8 @@ const ensureBroadcastEnvironment = () => {
|
|
|
9859
9860
|
};
|
|
9860
9861
|
let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAsyncConnector {
|
|
9861
9862
|
static generateConnectorId() {
|
|
9862
|
-
const globalCrypto = globalThis
|
|
9863
|
+
const globalCrypto = globalThis
|
|
9864
|
+
.crypto;
|
|
9863
9865
|
if (globalCrypto?.randomUUID) {
|
|
9864
9866
|
return globalCrypto.randomUUID();
|
|
9865
9867
|
}
|
|
@@ -9914,7 +9916,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
9914
9916
|
this.listenerRegistered = false;
|
|
9915
9917
|
this.visibilityChangeListenerRegistered = false;
|
|
9916
9918
|
this.channelName =
|
|
9917
|
-
typeof config.channelName === 'string' &&
|
|
9919
|
+
typeof config.channelName === 'string' &&
|
|
9920
|
+
config.channelName.trim().length > 0
|
|
9918
9921
|
? config.channelName.trim()
|
|
9919
9922
|
: DEFAULT_CHANNEL$7;
|
|
9920
9923
|
const preferredCapacity = typeof config.inboxCapacity === 'number' &&
|
|
@@ -9956,7 +9959,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
9956
9959
|
channel: this.channelName,
|
|
9957
9960
|
connector_id: this.connectorId,
|
|
9958
9961
|
message_type: message && typeof message === 'object'
|
|
9959
|
-
? message.constructor
|
|
9962
|
+
? (message.constructor
|
|
9963
|
+
?.name ?? typeof message)
|
|
9960
9964
|
: typeof message,
|
|
9961
9965
|
has_sender_id: Boolean(message?.senderId),
|
|
9962
9966
|
has_sender_node_id: Boolean(message?.senderNodeId),
|
|
@@ -10186,7 +10190,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
10186
10190
|
timestamp: new Date().toISOString(),
|
|
10187
10191
|
});
|
|
10188
10192
|
}
|
|
10189
|
-
if (this.visibilityChangeListenerRegistered &&
|
|
10193
|
+
if (this.visibilityChangeListenerRegistered &&
|
|
10194
|
+
this.visibilityChangeHandler &&
|
|
10195
|
+
typeof document !== 'undefined') {
|
|
10190
10196
|
document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
|
|
10191
10197
|
this.visibilityChangeListenerRegistered = false;
|
|
10192
10198
|
this.visibilityChangeHandler = undefined;
|
|
@@ -10214,7 +10220,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
10214
10220
|
return rawOrEnvelope;
|
|
10215
10221
|
}
|
|
10216
10222
|
_isWildcardTarget() {
|
|
10217
|
-
return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
|
|
10223
|
+
return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
|
|
10218
10224
|
}
|
|
10219
10225
|
_shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
|
|
10220
10226
|
if (this._isWildcardTarget()) {
|
|
@@ -10234,7 +10240,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
10234
10240
|
return true;
|
|
10235
10241
|
}
|
|
10236
10242
|
const expectedSender = this.targetNodeId;
|
|
10237
|
-
if (expectedSender &&
|
|
10243
|
+
if (expectedSender &&
|
|
10244
|
+
expectedSender !== '*' &&
|
|
10245
|
+
senderNodeId !== expectedSender) {
|
|
10238
10246
|
logger$_.debug('broadcast_channel_message_rejected', {
|
|
10239
10247
|
channel: this.channelName,
|
|
10240
10248
|
connector_id: this.connectorId,
|
|
@@ -10453,14 +10461,16 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
|
|
|
10453
10461
|
type,
|
|
10454
10462
|
purpose,
|
|
10455
10463
|
};
|
|
10456
|
-
const channelValue = candidate.channelName ??
|
|
10464
|
+
const channelValue = candidate.channelName ??
|
|
10465
|
+
candidate['channel_name'];
|
|
10457
10466
|
if (channelValue !== undefined) {
|
|
10458
10467
|
if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
|
|
10459
10468
|
throw new TypeError('BroadcastChannelConnectionGrant "channelName" must be a non-empty string when provided');
|
|
10460
10469
|
}
|
|
10461
10470
|
result.channelName = channelValue.trim();
|
|
10462
10471
|
}
|
|
10463
|
-
const inboxValue = candidate.inboxCapacity ??
|
|
10472
|
+
const inboxValue = candidate.inboxCapacity ??
|
|
10473
|
+
candidate['inbox_capacity'];
|
|
10464
10474
|
if (inboxValue !== undefined) {
|
|
10465
10475
|
if (typeof inboxValue !== 'number' ||
|
|
10466
10476
|
!Number.isFinite(inboxValue) ||
|
|
@@ -10469,7 +10479,8 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
|
|
|
10469
10479
|
}
|
|
10470
10480
|
result.inboxCapacity = Math.floor(inboxValue);
|
|
10471
10481
|
}
|
|
10472
|
-
const windowValue = candidate.initialWindow ??
|
|
10482
|
+
const windowValue = candidate.initialWindow ??
|
|
10483
|
+
candidate['initial_window'];
|
|
10473
10484
|
if (windowValue !== undefined) {
|
|
10474
10485
|
if (typeof windowValue !== 'number' ||
|
|
10475
10486
|
!Number.isFinite(windowValue) ||
|
|
@@ -10808,7 +10819,7 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10808
10819
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
10809
10820
|
logger$Z.debug('callback_grants_before_augmentation', {
|
|
10810
10821
|
count: callbackGrants.length,
|
|
10811
|
-
types: callbackGrants.map(g => g.type),
|
|
10822
|
+
types: callbackGrants.map((g) => g.type),
|
|
10812
10823
|
});
|
|
10813
10824
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
10814
10825
|
// This prevents adding duplicate broadcast grants
|
|
@@ -10822,11 +10833,12 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10822
10833
|
});
|
|
10823
10834
|
// Include admission client's connection grants as callback grants
|
|
10824
10835
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
10825
|
-
if (welcome.frame.connectionGrants &&
|
|
10836
|
+
if (welcome.frame.connectionGrants &&
|
|
10837
|
+
Array.isArray(welcome.frame.connectionGrants)) {
|
|
10826
10838
|
for (const grant of welcome.frame.connectionGrants) {
|
|
10827
10839
|
if (grant && typeof grant === 'object') {
|
|
10828
10840
|
// Avoid duplicates by checking if grant already exists
|
|
10829
|
-
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
10841
|
+
const isDuplicate = callbackGrants.some((existing) => JSON.stringify(existing) === JSON.stringify(grant));
|
|
10830
10842
|
if (!isDuplicate) {
|
|
10831
10843
|
callbackGrants.push(grant);
|
|
10832
10844
|
logger$Z.debug('added_connection_grant_as_callback', {
|
|
@@ -10843,7 +10855,8 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10843
10855
|
}
|
|
10844
10856
|
// Add broadcast grant after connection grants to ensure we don't duplicate
|
|
10845
10857
|
// any broadcast grants that may have been in connectionGrants
|
|
10846
|
-
if (broadcastCallbackGrant &&
|
|
10858
|
+
if (broadcastCallbackGrant &&
|
|
10859
|
+
this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
10847
10860
|
callbackGrants.push(broadcastCallbackGrant);
|
|
10848
10861
|
logger$Z.debug('added_broadcast_callback_grant');
|
|
10849
10862
|
}
|
|
@@ -10852,7 +10865,7 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10852
10865
|
}
|
|
10853
10866
|
logger$Z.debug('callback_grants_after_augmentation', {
|
|
10854
10867
|
count: callbackGrants.length,
|
|
10855
|
-
types: callbackGrants.map(g => g.type),
|
|
10868
|
+
types: callbackGrants.map((g) => g.type),
|
|
10856
10869
|
});
|
|
10857
10870
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
10858
10871
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
@@ -11094,7 +11107,8 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
11094
11107
|
continue;
|
|
11095
11108
|
}
|
|
11096
11109
|
// Reset ack time if just resumed from pause (prevents immediate timeout)
|
|
11097
|
-
if (previousState === core.ConnectorState.PAUSED &&
|
|
11110
|
+
if (previousState === core.ConnectorState.PAUSED &&
|
|
11111
|
+
currentState === core.ConnectorState.STARTED) {
|
|
11098
11112
|
logger$Z.debug('connector_just_resumed_resetting_ack_time', {
|
|
11099
11113
|
previous_state: previousState,
|
|
11100
11114
|
current_state: currentState,
|
|
@@ -12662,7 +12676,8 @@ class DefaultNodeAttachClient {
|
|
|
12662
12676
|
const interimHandler = async (envelope, context) => {
|
|
12663
12677
|
if (this.inHandshake) {
|
|
12664
12678
|
// Filter: only buffer frames related to our systemId or frames without systemId info
|
|
12665
|
-
const frameSystemId = envelope.frame
|
|
12679
|
+
const frameSystemId = envelope.frame
|
|
12680
|
+
?.systemId;
|
|
12666
12681
|
if (!frameSystemId || frameSystemId === this.expectedSystemId) {
|
|
12667
12682
|
this.buffer.push(envelope);
|
|
12668
12683
|
}
|
|
@@ -12858,7 +12873,8 @@ class DefaultNodeAttachClient {
|
|
|
12858
12873
|
const deadline = Date.now() + this.timeoutMs;
|
|
12859
12874
|
while (Date.now() < deadline) {
|
|
12860
12875
|
// Allow both STARTED and PAUSED states (PAUSED = tab hidden but connection alive)
|
|
12861
|
-
if (connector.state !== core.ConnectorState.STARTED &&
|
|
12876
|
+
if (connector.state !== core.ConnectorState.STARTED &&
|
|
12877
|
+
connector.state !== core.ConnectorState.PAUSED) {
|
|
12862
12878
|
let errorMessage = 'Connector closed while waiting for NodeAttachAck';
|
|
12863
12879
|
if (connector.closeCode !== undefined) {
|
|
12864
12880
|
errorMessage += ` (code=${connector.closeCode}`;
|
|
@@ -12882,7 +12898,8 @@ class DefaultNodeAttachClient {
|
|
|
12882
12898
|
if (envelope.frame.type === 'NodeAttach') {
|
|
12883
12899
|
logger$W.debug('handshake_ignoring_concurrent_attach', {
|
|
12884
12900
|
frame_type: envelope.frame.type,
|
|
12885
|
-
frame_system_id: envelope.frame?.systemId ??
|
|
12901
|
+
frame_system_id: envelope.frame?.systemId ??
|
|
12902
|
+
'unknown',
|
|
12886
12903
|
});
|
|
12887
12904
|
}
|
|
12888
12905
|
else {
|
|
@@ -13609,7 +13626,8 @@ function createFsShim() {
|
|
|
13609
13626
|
else if (options &&
|
|
13610
13627
|
typeof options === 'object' &&
|
|
13611
13628
|
'encoding' in options &&
|
|
13612
|
-
typeof options.encoding ===
|
|
13629
|
+
typeof options.encoding ===
|
|
13630
|
+
'string') {
|
|
13613
13631
|
encoding = options.encoding;
|
|
13614
13632
|
}
|
|
13615
13633
|
const data = fsBinding.readFileUtf8(pathOrDescriptor, 0);
|
|
@@ -20542,7 +20560,8 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
20542
20560
|
this.listenerRegistered = false;
|
|
20543
20561
|
this.visibilityChangeListenerRegistered = false;
|
|
20544
20562
|
this.channelName =
|
|
20545
|
-
typeof config.channelName === 'string' &&
|
|
20563
|
+
typeof config.channelName === 'string' &&
|
|
20564
|
+
config.channelName.trim().length > 0
|
|
20546
20565
|
? config.channelName.trim()
|
|
20547
20566
|
: DEFAULT_CHANNEL$6;
|
|
20548
20567
|
const preferredCapacity = typeof config.inboxCapacity === 'number' &&
|
|
@@ -20581,7 +20600,8 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
20581
20600
|
channel: this.channelName,
|
|
20582
20601
|
connector_id: this.connectorId,
|
|
20583
20602
|
message_type: message && typeof message === 'object'
|
|
20584
|
-
? message.constructor
|
|
20603
|
+
? (message.constructor
|
|
20604
|
+
?.name ?? typeof message)
|
|
20585
20605
|
: typeof message,
|
|
20586
20606
|
has_sender_id: Boolean(message?.senderId),
|
|
20587
20607
|
has_sender_node_id: Boolean(message?.senderNodeId),
|
|
@@ -20590,7 +20610,8 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
20590
20610
|
return;
|
|
20591
20611
|
}
|
|
20592
20612
|
const busMessage = message;
|
|
20593
|
-
const senderId = typeof busMessage.senderId === 'string' &&
|
|
20613
|
+
const senderId = typeof busMessage.senderId === 'string' &&
|
|
20614
|
+
busMessage.senderId.length > 0
|
|
20594
20615
|
? busMessage.senderId
|
|
20595
20616
|
: null;
|
|
20596
20617
|
const senderNodeId = InPageConnector.normalizeNodeId(busMessage.senderNodeId);
|
|
@@ -20841,7 +20862,9 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
20841
20862
|
timestamp: new Date().toISOString(),
|
|
20842
20863
|
});
|
|
20843
20864
|
}
|
|
20844
|
-
if (this.visibilityChangeListenerRegistered &&
|
|
20865
|
+
if (this.visibilityChangeListenerRegistered &&
|
|
20866
|
+
this.visibilityChangeHandler &&
|
|
20867
|
+
typeof document !== 'undefined') {
|
|
20845
20868
|
document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
|
|
20846
20869
|
this.visibilityChangeListenerRegistered = false;
|
|
20847
20870
|
this.visibilityChangeHandler = undefined;
|
|
@@ -20858,7 +20881,7 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
20858
20881
|
return rawOrEnvelope;
|
|
20859
20882
|
}
|
|
20860
20883
|
_isWildcardTarget() {
|
|
20861
|
-
return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
|
|
20884
|
+
return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
|
|
20862
20885
|
}
|
|
20863
20886
|
_shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
|
|
20864
20887
|
if (this._isWildcardTarget()) {
|
|
@@ -20878,7 +20901,9 @@ class InPageConnector extends BaseAsyncConnector {
|
|
|
20878
20901
|
return true;
|
|
20879
20902
|
}
|
|
20880
20903
|
const expectedSender = this.targetNodeId;
|
|
20881
|
-
if (expectedSender &&
|
|
20904
|
+
if (expectedSender &&
|
|
20905
|
+
expectedSender !== '*' &&
|
|
20906
|
+
senderNodeId !== expectedSender) {
|
|
20882
20907
|
logger$G.debug('inpage_message_rejected', {
|
|
20883
20908
|
channel: this.channelName,
|
|
20884
20909
|
connector_id: this.connectorId,
|
|
@@ -21298,8 +21323,8 @@ class CertificateManagerFactory extends factory.AbstractResourceFactory {
|
|
|
21298
21323
|
}
|
|
21299
21324
|
}
|
|
21300
21325
|
|
|
21301
|
-
const DEFAULT_UNCONFIGURED_MESSAGE =
|
|
21302
|
-
const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE =
|
|
21326
|
+
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.';
|
|
21327
|
+
const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = 'TrustStoreProviderFactory';
|
|
21303
21328
|
class TrustStoreProviderFactory extends factory.AbstractResourceFactory {
|
|
21304
21329
|
createUnconfiguredProvider(reason) {
|
|
21305
21330
|
return new NoopTrustStoreProvider(reason ?? DEFAULT_UNCONFIGURED_MESSAGE);
|
|
@@ -25027,7 +25052,8 @@ class DefaultSecurityManager {
|
|
|
25027
25052
|
const hasSignature = Boolean(envelope.sec?.sig);
|
|
25028
25053
|
if (!hasSignature) {
|
|
25029
25054
|
const nodeSid = node.sid;
|
|
25030
|
-
const envelopeSid = envelope
|
|
25055
|
+
const envelopeSid = envelope
|
|
25056
|
+
.sid;
|
|
25031
25057
|
const isLocalUnsignedSelfEnvelope = localContext.originType === core.DeliveryOriginType.LOCAL &&
|
|
25032
25058
|
typeof nodeSid === 'string' &&
|
|
25033
25059
|
nodeSid.length > 0 &&
|
|
@@ -28307,14 +28333,16 @@ function normalizeInPageConnectionGrant(candidate) {
|
|
|
28307
28333
|
type,
|
|
28308
28334
|
purpose,
|
|
28309
28335
|
};
|
|
28310
|
-
const channelValue = candidate.channelName ??
|
|
28336
|
+
const channelValue = candidate.channelName ??
|
|
28337
|
+
candidate['channel_name'];
|
|
28311
28338
|
if (channelValue !== undefined) {
|
|
28312
28339
|
if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
|
|
28313
28340
|
throw new TypeError('InPageConnectionGrant "channelName" must be a non-empty string when provided');
|
|
28314
28341
|
}
|
|
28315
28342
|
result.channelName = channelValue.trim();
|
|
28316
28343
|
}
|
|
28317
|
-
const inboxValue = candidate.inboxCapacity ??
|
|
28344
|
+
const inboxValue = candidate.inboxCapacity ??
|
|
28345
|
+
candidate['inbox_capacity'];
|
|
28318
28346
|
if (inboxValue !== undefined) {
|
|
28319
28347
|
if (typeof inboxValue !== 'number' ||
|
|
28320
28348
|
!Number.isFinite(inboxValue) ||
|
|
@@ -28942,7 +28970,8 @@ class InPageConnectorFactory extends ConnectorFactory {
|
|
|
28942
28970
|
const normalized = this._normalizeConfig(config);
|
|
28943
28971
|
const options = (factoryArgs[0] ?? {});
|
|
28944
28972
|
const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
|
|
28945
|
-
const localNodeId = this._normalizeNodeId(options.localNodeId) ??
|
|
28973
|
+
const localNodeId = this._normalizeNodeId(options.localNodeId) ??
|
|
28974
|
+
normalizedLocalNodeFromConfig;
|
|
28946
28975
|
if (!localNodeId) {
|
|
28947
28976
|
throw new Error('InPageConnectorFactory requires a localNodeId from config or create() options');
|
|
28948
28977
|
}
|
|
@@ -29118,10 +29147,12 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
29118
29147
|
type: BROADCAST_CHANNEL_CONNECTOR_TYPE,
|
|
29119
29148
|
};
|
|
29120
29149
|
const channelCandidate = record.channelName ?? record['channel_name'];
|
|
29121
|
-
if (typeof channelCandidate === 'string' &&
|
|
29150
|
+
if (typeof channelCandidate === 'string' &&
|
|
29151
|
+
channelCandidate.trim().length > 0) {
|
|
29122
29152
|
config.channelName = channelCandidate.trim();
|
|
29123
29153
|
}
|
|
29124
|
-
const inboxCandidate = record.inboxCapacity ??
|
|
29154
|
+
const inboxCandidate = record.inboxCapacity ??
|
|
29155
|
+
record['inbox_capacity'];
|
|
29125
29156
|
if (typeof inboxCandidate === 'number' &&
|
|
29126
29157
|
Number.isFinite(inboxCandidate) &&
|
|
29127
29158
|
inboxCandidate > 0) {
|
|
@@ -29145,9 +29176,11 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
29145
29176
|
throw new Error('BroadcastChannelConnectorFactory requires a configuration');
|
|
29146
29177
|
}
|
|
29147
29178
|
const normalized = this._normalizeConfig(config);
|
|
29148
|
-
const options = (factoryArgs[0] ??
|
|
29179
|
+
const options = (factoryArgs[0] ??
|
|
29180
|
+
{});
|
|
29149
29181
|
const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
|
|
29150
|
-
const localNodeId = this._normalizeNodeId(options.localNodeId) ??
|
|
29182
|
+
const localNodeId = this._normalizeNodeId(options.localNodeId) ??
|
|
29183
|
+
normalizedLocalNodeFromConfig;
|
|
29151
29184
|
if (!localNodeId) {
|
|
29152
29185
|
throw new Error('BroadcastChannelConnectorFactory requires a localNodeId from config or create() options');
|
|
29153
29186
|
}
|
|
@@ -29639,7 +29672,9 @@ class InPageListener extends TransportListener {
|
|
|
29639
29672
|
typeof channelCandidate === 'string' && channelCandidate.trim().length > 0
|
|
29640
29673
|
? channelCandidate.trim()
|
|
29641
29674
|
: DEFAULT_CHANNEL$3;
|
|
29642
|
-
const normalizedCapacity = typeof inboxCandidate === 'number' &&
|
|
29675
|
+
const normalizedCapacity = typeof inboxCandidate === 'number' &&
|
|
29676
|
+
Number.isFinite(inboxCandidate) &&
|
|
29677
|
+
inboxCandidate > 0
|
|
29643
29678
|
? Math.floor(inboxCandidate)
|
|
29644
29679
|
: DEFAULT_INBOX_CAPACITY$3;
|
|
29645
29680
|
this._inboxCapacity = normalizedCapacity;
|
|
@@ -29914,7 +29949,8 @@ class InPageListener extends TransportListener {
|
|
|
29914
29949
|
if (grant.type === INPAGE_CONNECTION_GRANT_TYPE) {
|
|
29915
29950
|
return inPageGrantToConnectorConfig(grant);
|
|
29916
29951
|
}
|
|
29917
|
-
if (typeof grant
|
|
29952
|
+
if (typeof grant
|
|
29953
|
+
?.toConnectorConfig === 'function') {
|
|
29918
29954
|
return grant.toConnectorConfig();
|
|
29919
29955
|
}
|
|
29920
29956
|
throw new Error(`Unsupported grant type: ${grant.type}`);
|
|
@@ -30068,7 +30104,9 @@ function normalizeConfig$r(config) {
|
|
|
30068
30104
|
: DEFAULT_CHANNEL$2;
|
|
30069
30105
|
const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
|
|
30070
30106
|
let inboxCapacity = DEFAULT_INBOX_CAPACITY$2;
|
|
30071
|
-
if (typeof rawInbox === 'number' &&
|
|
30107
|
+
if (typeof rawInbox === 'number' &&
|
|
30108
|
+
Number.isFinite(rawInbox) &&
|
|
30109
|
+
rawInbox > 0) {
|
|
30072
30110
|
inboxCapacity = Math.floor(rawInbox);
|
|
30073
30111
|
}
|
|
30074
30112
|
else if (typeof rawInbox === 'string') {
|
|
@@ -30096,9 +30134,7 @@ class InPageListenerFactory extends TransportListenerFactory {
|
|
|
30096
30134
|
}
|
|
30097
30135
|
async create(config, ...factoryArgs) {
|
|
30098
30136
|
const normalized = normalizeConfig$r(config);
|
|
30099
|
-
const [{ InPageListener }] = await Promise.all([
|
|
30100
|
-
getInPageListenerModule(),
|
|
30101
|
-
]);
|
|
30137
|
+
const [{ InPageListener }] = await Promise.all([getInPageListenerModule()]);
|
|
30102
30138
|
return new InPageListener({
|
|
30103
30139
|
channelName: normalized.channelName,
|
|
30104
30140
|
inboxCapacity: normalized.inboxCapacity,
|
|
@@ -30116,9 +30152,7 @@ var inpageListenerFactory = /*#__PURE__*/Object.freeze({
|
|
|
30116
30152
|
const logger$o = getLogger('naylence.fame.connector.broadcast_channel_listener');
|
|
30117
30153
|
const DEFAULT_CHANNEL$1 = 'naylence-fabric';
|
|
30118
30154
|
const DEFAULT_INBOX_CAPACITY$1 = 2048;
|
|
30119
|
-
const RESPONSE_TYPE_MASK = core.FameResponseType.ACK |
|
|
30120
|
-
core.FameResponseType.REPLY |
|
|
30121
|
-
core.FameResponseType.STREAM;
|
|
30155
|
+
const RESPONSE_TYPE_MASK = core.FameResponseType.ACK | core.FameResponseType.REPLY | core.FameResponseType.STREAM;
|
|
30122
30156
|
const isBrowserEnvironment$1 = () => typeof window !== 'undefined' &&
|
|
30123
30157
|
typeof BroadcastChannel !== 'undefined' &&
|
|
30124
30158
|
typeof MessageEvent !== 'undefined';
|
|
@@ -30332,9 +30366,7 @@ class BroadcastChannelListener extends TransportListener {
|
|
|
30332
30366
|
return null;
|
|
30333
30367
|
}
|
|
30334
30368
|
})();
|
|
30335
|
-
if (error instanceof zod.ZodError &&
|
|
30336
|
-
decoded &&
|
|
30337
|
-
decoded.length > 0) {
|
|
30369
|
+
if (error instanceof zod.ZodError && decoded && decoded.length > 0) {
|
|
30338
30370
|
try {
|
|
30339
30371
|
const reparsed = JSON.parse(decoded);
|
|
30340
30372
|
const candidate = reparsed.rtype;
|
|
@@ -30682,7 +30714,9 @@ function normalizeConfig$q(config) {
|
|
|
30682
30714
|
: DEFAULT_CHANNEL;
|
|
30683
30715
|
const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
|
|
30684
30716
|
let inboxCapacity = DEFAULT_INBOX_CAPACITY;
|
|
30685
|
-
if (typeof rawInbox === 'number' &&
|
|
30717
|
+
if (typeof rawInbox === 'number' &&
|
|
30718
|
+
Number.isFinite(rawInbox) &&
|
|
30719
|
+
rawInbox > 0) {
|
|
30686
30720
|
inboxCapacity = Math.floor(rawInbox);
|
|
30687
30721
|
}
|
|
30688
30722
|
else if (typeof rawInbox === 'string') {
|
|
@@ -34172,19 +34206,23 @@ function normalizeConfig$a(config) {
|
|
|
34172
34206
|
normalized.clientSecretConfig = normalizeSecretSource(clientSecretSource);
|
|
34173
34207
|
}
|
|
34174
34208
|
const audienceCandidate = candidate.audience ?? candidate.aud;
|
|
34175
|
-
if (typeof audienceCandidate === 'string' &&
|
|
34209
|
+
if (typeof audienceCandidate === 'string' &&
|
|
34210
|
+
audienceCandidate.trim().length > 0) {
|
|
34176
34211
|
normalized.audience = audienceCandidate.trim();
|
|
34177
34212
|
}
|
|
34178
34213
|
const codeChallengeMethod = candidate.codeChallengeMethod ?? candidate.code_challenge_method;
|
|
34179
|
-
if (typeof codeChallengeMethod === 'string' &&
|
|
34214
|
+
if (typeof codeChallengeMethod === 'string' &&
|
|
34215
|
+
codeChallengeMethod.trim().length > 0) {
|
|
34180
34216
|
normalized.codeChallengeMethod = codeChallengeMethod.trim();
|
|
34181
34217
|
}
|
|
34182
34218
|
const codeVerifierLength = candidate.codeVerifierLength ?? candidate.code_verifier_length;
|
|
34183
|
-
if (typeof codeVerifierLength === 'number' &&
|
|
34219
|
+
if (typeof codeVerifierLength === 'number' &&
|
|
34220
|
+
Number.isFinite(codeVerifierLength)) {
|
|
34184
34221
|
normalized.codeVerifierLength = codeVerifierLength;
|
|
34185
34222
|
}
|
|
34186
34223
|
const clockSkewSeconds = candidate.clockSkewSeconds ?? candidate.clock_skew_seconds;
|
|
34187
|
-
if (typeof clockSkewSeconds === 'number' &&
|
|
34224
|
+
if (typeof clockSkewSeconds === 'number' &&
|
|
34225
|
+
Number.isFinite(clockSkewSeconds)) {
|
|
34188
34226
|
normalized.clockSkewSeconds = clockSkewSeconds;
|
|
34189
34227
|
}
|
|
34190
34228
|
const loginHintParam = candidate.loginHintParam ?? candidate.login_hint_param;
|
|
@@ -34229,8 +34267,8 @@ class OAuth2PkceTokenProviderFactory extends TokenProviderFactory {
|
|
|
34229
34267
|
options.audience = normalized.audience;
|
|
34230
34268
|
}
|
|
34231
34269
|
if (normalized.codeChallengeMethod) {
|
|
34232
|
-
options.codeChallengeMethod =
|
|
34233
|
-
.toUpperCase();
|
|
34270
|
+
options.codeChallengeMethod =
|
|
34271
|
+
normalized.codeChallengeMethod.toUpperCase();
|
|
34234
34272
|
}
|
|
34235
34273
|
if (normalized.codeVerifierLength) {
|
|
34236
34274
|
options.codeVerifierLength = normalized.codeVerifierLength;
|
|
@@ -35987,14 +36025,14 @@ var eddsaEnvelopeVerifierFactory = /*#__PURE__*/Object.freeze({
|
|
|
35987
36025
|
|
|
35988
36026
|
const FACTORY_META$d = {
|
|
35989
36027
|
base: TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE,
|
|
35990
|
-
key:
|
|
36028
|
+
key: 'NoopTrustStoreProvider',
|
|
35991
36029
|
isDefault: true,
|
|
35992
36030
|
priority: 10,
|
|
35993
36031
|
};
|
|
35994
36032
|
class NoopTrustStoreProviderFactory extends TrustStoreProviderFactory {
|
|
35995
36033
|
constructor() {
|
|
35996
36034
|
super(...arguments);
|
|
35997
|
-
this.type =
|
|
36035
|
+
this.type = 'NoopTrustStoreProvider';
|
|
35998
36036
|
this.isDefault = true;
|
|
35999
36037
|
this.priority = 10;
|
|
36000
36038
|
}
|
|
@@ -39388,8 +39426,7 @@ function normalizeOptions$2(raw) {
|
|
|
39388
39426
|
const scopes = normalizeScopes(camel.scopes) ??
|
|
39389
39427
|
normalizeScopes(snake.scopes ?? snake.scope) ??
|
|
39390
39428
|
DEFAULT_SCOPES.slice();
|
|
39391
|
-
const audience = coerceString(camel.audience) ??
|
|
39392
|
-
coerceString(snake.audience ?? snake.aud);
|
|
39429
|
+
const audience = coerceString(camel.audience) ?? coerceString(snake.audience ?? snake.aud);
|
|
39393
39430
|
const fetchImpl = (camel.fetchImpl ?? snake.fetch_impl);
|
|
39394
39431
|
const clockSkewSeconds = coerceNumber(camel.clockSkewSeconds) ??
|
|
39395
39432
|
coerceNumber(snake.clock_skew_seconds) ??
|