@naylence/runtime 0.3.5-test.921 → 0.3.5-test.923
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 +255 -249
- package/dist/browser/index.mjs +250 -250
- package/dist/cjs/naylence/fame/security/index.js +10 -1
- package/dist/cjs/version.js +2 -2
- package/dist/esm/naylence/fame/security/index.js +3 -0
- package/dist/esm/version.js +2 -2
- package/dist/node/index.cjs +255 -249
- package/dist/node/index.mjs +250 -250
- package/dist/node/node.cjs +254 -248
- package/dist/node/node.mjs +249 -249
- package/dist/types/naylence/fame/security/index.d.ts +3 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/browser/index.mjs
CHANGED
|
@@ -2,15 +2,15 @@ import { parseAddressComponents, FlowFlags, FameAddress, DEFAULT_POLLING_TIMEOUT
|
|
|
2
2
|
export * from '@naylence/core';
|
|
3
3
|
import { z, ZodError } from 'zod';
|
|
4
4
|
import { AbstractResourceFactory, createResource as createResource$1, createDefaultResource, registerFactory, Expressions, ExtensionManager, ExpressionEvaluationPolicy, Registry, configValidator } from '@naylence/factory';
|
|
5
|
+
import { sign, hashes, verify } from '@noble/ed25519';
|
|
6
|
+
import { sha256, sha512 } from '@noble/hashes/sha2.js';
|
|
5
7
|
import { chacha20poly1305 } from '@noble/ciphers/chacha.js';
|
|
6
8
|
import { x25519 } from '@noble/curves/ed25519.js';
|
|
7
9
|
import { hkdf } from '@noble/hashes/hkdf.js';
|
|
8
|
-
import { sha256, sha512 } from '@noble/hashes/sha2.js';
|
|
9
10
|
import { utf8ToBytes, bytesToHex, randomBytes, concatBytes } from '@noble/hashes/utils.js';
|
|
10
11
|
import { parse } from 'yaml';
|
|
11
12
|
import fastify from 'fastify';
|
|
12
13
|
import websocketPlugin from '@fastify/websocket';
|
|
13
|
-
import { sign, hashes, verify } from '@noble/ed25519';
|
|
14
14
|
|
|
15
15
|
// --- ENV SHIM (runs once in browser) ---
|
|
16
16
|
function installProcessEnvShim() {
|
|
@@ -96,12 +96,12 @@ installProcessEnvShim();
|
|
|
96
96
|
// --- END ENV SHIM ---
|
|
97
97
|
|
|
98
98
|
// This file is auto-generated during build - do not edit manually
|
|
99
|
-
// Generated from package.json version: 0.3.5-test.
|
|
99
|
+
// Generated from package.json version: 0.3.5-test.923
|
|
100
100
|
/**
|
|
101
101
|
* The package version, injected at build time.
|
|
102
102
|
* @internal
|
|
103
103
|
*/
|
|
104
|
-
const VERSION = '0.3.5-test.
|
|
104
|
+
const VERSION = '0.3.5-test.923';
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -25243,6 +25243,251 @@ class SigningConfig {
|
|
|
25243
25243
|
}
|
|
25244
25244
|
}
|
|
25245
25245
|
|
|
25246
|
+
function hasBuffer() {
|
|
25247
|
+
return typeof Buffer !== 'undefined';
|
|
25248
|
+
}
|
|
25249
|
+
function readStringProperty(source, ...names) {
|
|
25250
|
+
if (!source || typeof source !== 'object') {
|
|
25251
|
+
return undefined;
|
|
25252
|
+
}
|
|
25253
|
+
for (const name of names) {
|
|
25254
|
+
const value = source[name];
|
|
25255
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
25256
|
+
return value;
|
|
25257
|
+
}
|
|
25258
|
+
}
|
|
25259
|
+
return undefined;
|
|
25260
|
+
}
|
|
25261
|
+
function decodePem(pem) {
|
|
25262
|
+
const base64 = pem
|
|
25263
|
+
.replace(/-----BEGIN[^-]+-----/g, '')
|
|
25264
|
+
.replace(/-----END[^-]+-----/g, '')
|
|
25265
|
+
.replace(/\s+/g, '');
|
|
25266
|
+
if (typeof atob === 'function') {
|
|
25267
|
+
const binary = atob(base64);
|
|
25268
|
+
const bytes = new Uint8Array(binary.length);
|
|
25269
|
+
for (let i = 0; i < binary.length; i += 1) {
|
|
25270
|
+
bytes[i] = binary.charCodeAt(i);
|
|
25271
|
+
}
|
|
25272
|
+
return bytes;
|
|
25273
|
+
}
|
|
25274
|
+
if (hasBuffer()) {
|
|
25275
|
+
return Uint8Array.from(Buffer.from(base64, 'base64'));
|
|
25276
|
+
}
|
|
25277
|
+
throw new Error('Base64 decoding is not available in this environment');
|
|
25278
|
+
}
|
|
25279
|
+
function readLength(data, offset) {
|
|
25280
|
+
const initial = data[offset];
|
|
25281
|
+
if (initial === undefined) {
|
|
25282
|
+
throw new Error('Unexpected end of ASN.1 data');
|
|
25283
|
+
}
|
|
25284
|
+
if ((initial & 0x80) === 0) {
|
|
25285
|
+
return { length: initial, nextOffset: offset + 1 };
|
|
25286
|
+
}
|
|
25287
|
+
const lengthOfLength = initial & 0x7f;
|
|
25288
|
+
if (lengthOfLength === 0 || lengthOfLength > 4) {
|
|
25289
|
+
throw new Error('Unsupported ASN.1 length encoding');
|
|
25290
|
+
}
|
|
25291
|
+
let length = 0;
|
|
25292
|
+
let position = offset + 1;
|
|
25293
|
+
for (let i = 0; i < lengthOfLength; i += 1) {
|
|
25294
|
+
const byte = data[position];
|
|
25295
|
+
if (byte === undefined) {
|
|
25296
|
+
throw new Error('Unexpected end of ASN.1 data');
|
|
25297
|
+
}
|
|
25298
|
+
length = (length << 8) | byte;
|
|
25299
|
+
position += 1;
|
|
25300
|
+
}
|
|
25301
|
+
return { length, nextOffset: position };
|
|
25302
|
+
}
|
|
25303
|
+
function readElement(data, offset, tag) {
|
|
25304
|
+
if (data[offset] !== tag) {
|
|
25305
|
+
throw new Error(`Unexpected ASN.1 tag: expected 0x${tag.toString(16)}, got 0x${(data[offset] ?? 0).toString(16)}`);
|
|
25306
|
+
}
|
|
25307
|
+
const { length, nextOffset } = readLength(data, offset + 1);
|
|
25308
|
+
const contentOffset = nextOffset;
|
|
25309
|
+
return {
|
|
25310
|
+
length,
|
|
25311
|
+
contentOffset,
|
|
25312
|
+
nextOffset: contentOffset + length,
|
|
25313
|
+
};
|
|
25314
|
+
}
|
|
25315
|
+
function parseEd25519PrivateKey(pem) {
|
|
25316
|
+
const raw = decodePem(pem);
|
|
25317
|
+
if (raw.length === 32) {
|
|
25318
|
+
return raw.slice();
|
|
25319
|
+
}
|
|
25320
|
+
// Handle PKCS#8 structure defined in RFC 8410
|
|
25321
|
+
const sequence = readElement(raw, 0, 0x30);
|
|
25322
|
+
const version = readElement(raw, sequence.contentOffset, 0x02);
|
|
25323
|
+
let offset = version.nextOffset;
|
|
25324
|
+
const algorithm = readElement(raw, offset, 0x30);
|
|
25325
|
+
offset = algorithm.nextOffset;
|
|
25326
|
+
const privateKey = readElement(raw, offset, 0x04);
|
|
25327
|
+
const privateContent = raw.subarray(privateKey.contentOffset, privateKey.contentOffset + privateKey.length);
|
|
25328
|
+
if (privateContent.length === 32) {
|
|
25329
|
+
return privateContent.slice();
|
|
25330
|
+
}
|
|
25331
|
+
if (privateContent.length >= 34 && privateContent[0] === 0x04) {
|
|
25332
|
+
const innerLength = privateContent[1];
|
|
25333
|
+
if (innerLength !== 32 || privateContent.length < innerLength + 2) {
|
|
25334
|
+
throw new Error('Unexpected Ed25519 private key length');
|
|
25335
|
+
}
|
|
25336
|
+
return privateContent.subarray(2, 34);
|
|
25337
|
+
}
|
|
25338
|
+
throw new Error('Unsupported Ed25519 private key structure');
|
|
25339
|
+
}
|
|
25340
|
+
const textEncoder = typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined;
|
|
25341
|
+
function encodeUtf8(value) {
|
|
25342
|
+
if (textEncoder) {
|
|
25343
|
+
return textEncoder.encode(value);
|
|
25344
|
+
}
|
|
25345
|
+
if (hasBuffer()) {
|
|
25346
|
+
return Uint8Array.from(Buffer.from(value, 'utf8'));
|
|
25347
|
+
}
|
|
25348
|
+
throw new Error('No UTF-8 encoder available in this environment');
|
|
25349
|
+
}
|
|
25350
|
+
|
|
25351
|
+
if (!hashes.sha512) {
|
|
25352
|
+
hashes.sha512 = (message) => sha512(message);
|
|
25353
|
+
}
|
|
25354
|
+
function normalizeSignerOptions(options) {
|
|
25355
|
+
if (!options || typeof options !== 'object') {
|
|
25356
|
+
return {};
|
|
25357
|
+
}
|
|
25358
|
+
const candidate = options;
|
|
25359
|
+
const result = {
|
|
25360
|
+
...options,
|
|
25361
|
+
};
|
|
25362
|
+
const cryptoProvider = resolveAlias(candidate, ['cryptoProvider', 'crypto_provider']);
|
|
25363
|
+
if (cryptoProvider !== undefined) {
|
|
25364
|
+
result.cryptoProvider = cryptoProvider ?? null;
|
|
25365
|
+
}
|
|
25366
|
+
const signingConfig = resolveAlias(candidate, ['signingConfig', 'signing_config']);
|
|
25367
|
+
if (signingConfig !== undefined) {
|
|
25368
|
+
result.signingConfig = signingConfig;
|
|
25369
|
+
}
|
|
25370
|
+
const privateKeyPem = resolveAlias(candidate, [
|
|
25371
|
+
'privateKeyPem',
|
|
25372
|
+
'private_key_pem',
|
|
25373
|
+
]);
|
|
25374
|
+
if (privateKeyPem !== undefined) {
|
|
25375
|
+
result.privateKeyPem = privateKeyPem;
|
|
25376
|
+
}
|
|
25377
|
+
const keyId = resolveAlias(candidate, [
|
|
25378
|
+
'keyId',
|
|
25379
|
+
'key_id',
|
|
25380
|
+
]);
|
|
25381
|
+
if (keyId !== undefined) {
|
|
25382
|
+
result.keyId = keyId;
|
|
25383
|
+
}
|
|
25384
|
+
return result;
|
|
25385
|
+
}
|
|
25386
|
+
class EdDSAEnvelopeSigner {
|
|
25387
|
+
constructor(options = {}) {
|
|
25388
|
+
const normalized = normalizeSignerOptions(options);
|
|
25389
|
+
const provider = normalized.cryptoProvider ?? null;
|
|
25390
|
+
if (!provider) {
|
|
25391
|
+
throw new Error('No crypto provider is configured for signing');
|
|
25392
|
+
}
|
|
25393
|
+
this.crypto = provider;
|
|
25394
|
+
const signingConfigOption = normalized.signingConfig;
|
|
25395
|
+
if (signingConfigOption instanceof SigningConfig) {
|
|
25396
|
+
this.signingConfig = signingConfigOption;
|
|
25397
|
+
}
|
|
25398
|
+
else if (signingConfigOption) {
|
|
25399
|
+
this.signingConfig = new SigningConfig(signingConfigOption);
|
|
25400
|
+
}
|
|
25401
|
+
else {
|
|
25402
|
+
this.signingConfig = new SigningConfig();
|
|
25403
|
+
}
|
|
25404
|
+
this.explicitPrivateKey = normalized.privateKeyPem;
|
|
25405
|
+
this.explicitKeyId = normalized.keyId;
|
|
25406
|
+
}
|
|
25407
|
+
signEnvelope(envelope, { physicalPath }) {
|
|
25408
|
+
if (!envelope.sid) {
|
|
25409
|
+
throw new Error('Envelope missing sid');
|
|
25410
|
+
}
|
|
25411
|
+
const frame = envelope.frame;
|
|
25412
|
+
if (frame.type === 'Data') {
|
|
25413
|
+
const dataFrame = frame;
|
|
25414
|
+
if (!dataFrame.pd) {
|
|
25415
|
+
const payload = dataFrame.payload ?? '';
|
|
25416
|
+
const payloadString = payload === '' ? '' : canonicalJson(payload);
|
|
25417
|
+
dataFrame.pd = secureDigest(payloadString);
|
|
25418
|
+
}
|
|
25419
|
+
}
|
|
25420
|
+
const digest = frameDigest(frame);
|
|
25421
|
+
const immutable = canonicalJson(immutableHeaders(envelope));
|
|
25422
|
+
const sidDigest = secureDigest(physicalPath);
|
|
25423
|
+
const tbs = new Uint8Array(encodeUtf8(sidDigest).length +
|
|
25424
|
+
1 +
|
|
25425
|
+
encodeUtf8(immutable).length +
|
|
25426
|
+
1 +
|
|
25427
|
+
encodeUtf8(digest).length);
|
|
25428
|
+
const sidBytes = encodeUtf8(sidDigest);
|
|
25429
|
+
const immBytes = encodeUtf8(immutable);
|
|
25430
|
+
const digBytes = encodeUtf8(digest);
|
|
25431
|
+
let offset = 0;
|
|
25432
|
+
tbs.set(sidBytes, offset);
|
|
25433
|
+
offset += sidBytes.length;
|
|
25434
|
+
tbs[offset] = 0x1f;
|
|
25435
|
+
offset += 1;
|
|
25436
|
+
tbs.set(immBytes, offset);
|
|
25437
|
+
offset += immBytes.length;
|
|
25438
|
+
tbs[offset] = 0x1f;
|
|
25439
|
+
offset += 1;
|
|
25440
|
+
tbs.set(digBytes, offset);
|
|
25441
|
+
const privateKey = this.loadPrivateKey();
|
|
25442
|
+
const signatureBytes = sign(tbs, privateKey);
|
|
25443
|
+
const signature = urlsafeBase64Encode(signatureBytes);
|
|
25444
|
+
const kid = this.determineKeyId();
|
|
25445
|
+
const signatureHeader = {
|
|
25446
|
+
kid,
|
|
25447
|
+
val: signature,
|
|
25448
|
+
alg: 'EdDSA',
|
|
25449
|
+
};
|
|
25450
|
+
const secHeader = envelope.sec ?? {};
|
|
25451
|
+
secHeader.sig = signatureHeader;
|
|
25452
|
+
envelope.sec = secHeader;
|
|
25453
|
+
return envelope;
|
|
25454
|
+
}
|
|
25455
|
+
loadPrivateKey() {
|
|
25456
|
+
const pem = this.explicitPrivateKey ??
|
|
25457
|
+
readStringProperty(this.crypto, 'signingPrivatePem', 'signing_private_pem');
|
|
25458
|
+
if (!pem) {
|
|
25459
|
+
throw new Error('Crypto provider does not expose a signing private key');
|
|
25460
|
+
}
|
|
25461
|
+
return parseEd25519PrivateKey(pem);
|
|
25462
|
+
}
|
|
25463
|
+
determineKeyId() {
|
|
25464
|
+
if (this.explicitKeyId) {
|
|
25465
|
+
return this.explicitKeyId;
|
|
25466
|
+
}
|
|
25467
|
+
if (this.signingConfig.signingMaterial === SigningMaterial.X509_CHAIN) {
|
|
25468
|
+
const certificateProvider = this
|
|
25469
|
+
.crypto;
|
|
25470
|
+
const jwk = certificateProvider.nodeJwk?.();
|
|
25471
|
+
if (jwk && typeof jwk === 'object' && 'kid' in jwk && 'x5c' in jwk) {
|
|
25472
|
+
const kid = jwk.kid;
|
|
25473
|
+
if (typeof kid === 'string' && kid.length > 0) {
|
|
25474
|
+
return kid;
|
|
25475
|
+
}
|
|
25476
|
+
}
|
|
25477
|
+
}
|
|
25478
|
+
const fallback = readStringProperty(this.crypto, 'signatureKeyId', 'signature_key_id');
|
|
25479
|
+
if (!fallback) {
|
|
25480
|
+
throw new Error('Crypto provider does not expose a signature key id');
|
|
25481
|
+
}
|
|
25482
|
+
return fallback;
|
|
25483
|
+
}
|
|
25484
|
+
}
|
|
25485
|
+
|
|
25486
|
+
var eddsaEnvelopeSigner = /*#__PURE__*/Object.freeze({
|
|
25487
|
+
__proto__: null,
|
|
25488
|
+
EdDSAEnvelopeSigner: EdDSAEnvelopeSigner
|
|
25489
|
+
});
|
|
25490
|
+
|
|
25246
25491
|
const logger$x = getLogger('naylence.fame.security.auth.jwt_token_issuer');
|
|
25247
25492
|
let joseModulePromise = null;
|
|
25248
25493
|
async function requireJose() {
|
|
@@ -39350,251 +39595,6 @@ var sharedSecretTokenVerifier = /*#__PURE__*/Object.freeze({
|
|
|
39350
39595
|
SharedSecretTokenVerifier: SharedSecretTokenVerifier
|
|
39351
39596
|
});
|
|
39352
39597
|
|
|
39353
|
-
function hasBuffer() {
|
|
39354
|
-
return typeof Buffer !== 'undefined';
|
|
39355
|
-
}
|
|
39356
|
-
function readStringProperty(source, ...names) {
|
|
39357
|
-
if (!source || typeof source !== 'object') {
|
|
39358
|
-
return undefined;
|
|
39359
|
-
}
|
|
39360
|
-
for (const name of names) {
|
|
39361
|
-
const value = source[name];
|
|
39362
|
-
if (typeof value === 'string' && value.length > 0) {
|
|
39363
|
-
return value;
|
|
39364
|
-
}
|
|
39365
|
-
}
|
|
39366
|
-
return undefined;
|
|
39367
|
-
}
|
|
39368
|
-
function decodePem(pem) {
|
|
39369
|
-
const base64 = pem
|
|
39370
|
-
.replace(/-----BEGIN[^-]+-----/g, '')
|
|
39371
|
-
.replace(/-----END[^-]+-----/g, '')
|
|
39372
|
-
.replace(/\s+/g, '');
|
|
39373
|
-
if (typeof atob === 'function') {
|
|
39374
|
-
const binary = atob(base64);
|
|
39375
|
-
const bytes = new Uint8Array(binary.length);
|
|
39376
|
-
for (let i = 0; i < binary.length; i += 1) {
|
|
39377
|
-
bytes[i] = binary.charCodeAt(i);
|
|
39378
|
-
}
|
|
39379
|
-
return bytes;
|
|
39380
|
-
}
|
|
39381
|
-
if (hasBuffer()) {
|
|
39382
|
-
return Uint8Array.from(Buffer.from(base64, 'base64'));
|
|
39383
|
-
}
|
|
39384
|
-
throw new Error('Base64 decoding is not available in this environment');
|
|
39385
|
-
}
|
|
39386
|
-
function readLength(data, offset) {
|
|
39387
|
-
const initial = data[offset];
|
|
39388
|
-
if (initial === undefined) {
|
|
39389
|
-
throw new Error('Unexpected end of ASN.1 data');
|
|
39390
|
-
}
|
|
39391
|
-
if ((initial & 0x80) === 0) {
|
|
39392
|
-
return { length: initial, nextOffset: offset + 1 };
|
|
39393
|
-
}
|
|
39394
|
-
const lengthOfLength = initial & 0x7f;
|
|
39395
|
-
if (lengthOfLength === 0 || lengthOfLength > 4) {
|
|
39396
|
-
throw new Error('Unsupported ASN.1 length encoding');
|
|
39397
|
-
}
|
|
39398
|
-
let length = 0;
|
|
39399
|
-
let position = offset + 1;
|
|
39400
|
-
for (let i = 0; i < lengthOfLength; i += 1) {
|
|
39401
|
-
const byte = data[position];
|
|
39402
|
-
if (byte === undefined) {
|
|
39403
|
-
throw new Error('Unexpected end of ASN.1 data');
|
|
39404
|
-
}
|
|
39405
|
-
length = (length << 8) | byte;
|
|
39406
|
-
position += 1;
|
|
39407
|
-
}
|
|
39408
|
-
return { length, nextOffset: position };
|
|
39409
|
-
}
|
|
39410
|
-
function readElement(data, offset, tag) {
|
|
39411
|
-
if (data[offset] !== tag) {
|
|
39412
|
-
throw new Error(`Unexpected ASN.1 tag: expected 0x${tag.toString(16)}, got 0x${(data[offset] ?? 0).toString(16)}`);
|
|
39413
|
-
}
|
|
39414
|
-
const { length, nextOffset } = readLength(data, offset + 1);
|
|
39415
|
-
const contentOffset = nextOffset;
|
|
39416
|
-
return {
|
|
39417
|
-
length,
|
|
39418
|
-
contentOffset,
|
|
39419
|
-
nextOffset: contentOffset + length,
|
|
39420
|
-
};
|
|
39421
|
-
}
|
|
39422
|
-
function parseEd25519PrivateKey(pem) {
|
|
39423
|
-
const raw = decodePem(pem);
|
|
39424
|
-
if (raw.length === 32) {
|
|
39425
|
-
return raw.slice();
|
|
39426
|
-
}
|
|
39427
|
-
// Handle PKCS#8 structure defined in RFC 8410
|
|
39428
|
-
const sequence = readElement(raw, 0, 0x30);
|
|
39429
|
-
const version = readElement(raw, sequence.contentOffset, 0x02);
|
|
39430
|
-
let offset = version.nextOffset;
|
|
39431
|
-
const algorithm = readElement(raw, offset, 0x30);
|
|
39432
|
-
offset = algorithm.nextOffset;
|
|
39433
|
-
const privateKey = readElement(raw, offset, 0x04);
|
|
39434
|
-
const privateContent = raw.subarray(privateKey.contentOffset, privateKey.contentOffset + privateKey.length);
|
|
39435
|
-
if (privateContent.length === 32) {
|
|
39436
|
-
return privateContent.slice();
|
|
39437
|
-
}
|
|
39438
|
-
if (privateContent.length >= 34 && privateContent[0] === 0x04) {
|
|
39439
|
-
const innerLength = privateContent[1];
|
|
39440
|
-
if (innerLength !== 32 || privateContent.length < innerLength + 2) {
|
|
39441
|
-
throw new Error('Unexpected Ed25519 private key length');
|
|
39442
|
-
}
|
|
39443
|
-
return privateContent.subarray(2, 34);
|
|
39444
|
-
}
|
|
39445
|
-
throw new Error('Unsupported Ed25519 private key structure');
|
|
39446
|
-
}
|
|
39447
|
-
const textEncoder = typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined;
|
|
39448
|
-
function encodeUtf8(value) {
|
|
39449
|
-
if (textEncoder) {
|
|
39450
|
-
return textEncoder.encode(value);
|
|
39451
|
-
}
|
|
39452
|
-
if (hasBuffer()) {
|
|
39453
|
-
return Uint8Array.from(Buffer.from(value, 'utf8'));
|
|
39454
|
-
}
|
|
39455
|
-
throw new Error('No UTF-8 encoder available in this environment');
|
|
39456
|
-
}
|
|
39457
|
-
|
|
39458
|
-
if (!hashes.sha512) {
|
|
39459
|
-
hashes.sha512 = (message) => sha512(message);
|
|
39460
|
-
}
|
|
39461
|
-
function normalizeSignerOptions(options) {
|
|
39462
|
-
if (!options || typeof options !== 'object') {
|
|
39463
|
-
return {};
|
|
39464
|
-
}
|
|
39465
|
-
const candidate = options;
|
|
39466
|
-
const result = {
|
|
39467
|
-
...options,
|
|
39468
|
-
};
|
|
39469
|
-
const cryptoProvider = resolveAlias(candidate, ['cryptoProvider', 'crypto_provider']);
|
|
39470
|
-
if (cryptoProvider !== undefined) {
|
|
39471
|
-
result.cryptoProvider = cryptoProvider ?? null;
|
|
39472
|
-
}
|
|
39473
|
-
const signingConfig = resolveAlias(candidate, ['signingConfig', 'signing_config']);
|
|
39474
|
-
if (signingConfig !== undefined) {
|
|
39475
|
-
result.signingConfig = signingConfig;
|
|
39476
|
-
}
|
|
39477
|
-
const privateKeyPem = resolveAlias(candidate, [
|
|
39478
|
-
'privateKeyPem',
|
|
39479
|
-
'private_key_pem',
|
|
39480
|
-
]);
|
|
39481
|
-
if (privateKeyPem !== undefined) {
|
|
39482
|
-
result.privateKeyPem = privateKeyPem;
|
|
39483
|
-
}
|
|
39484
|
-
const keyId = resolveAlias(candidate, [
|
|
39485
|
-
'keyId',
|
|
39486
|
-
'key_id',
|
|
39487
|
-
]);
|
|
39488
|
-
if (keyId !== undefined) {
|
|
39489
|
-
result.keyId = keyId;
|
|
39490
|
-
}
|
|
39491
|
-
return result;
|
|
39492
|
-
}
|
|
39493
|
-
class EdDSAEnvelopeSigner {
|
|
39494
|
-
constructor(options = {}) {
|
|
39495
|
-
const normalized = normalizeSignerOptions(options);
|
|
39496
|
-
const provider = normalized.cryptoProvider ?? null;
|
|
39497
|
-
if (!provider) {
|
|
39498
|
-
throw new Error('No crypto provider is configured for signing');
|
|
39499
|
-
}
|
|
39500
|
-
this.crypto = provider;
|
|
39501
|
-
const signingConfigOption = normalized.signingConfig;
|
|
39502
|
-
if (signingConfigOption instanceof SigningConfig) {
|
|
39503
|
-
this.signingConfig = signingConfigOption;
|
|
39504
|
-
}
|
|
39505
|
-
else if (signingConfigOption) {
|
|
39506
|
-
this.signingConfig = new SigningConfig(signingConfigOption);
|
|
39507
|
-
}
|
|
39508
|
-
else {
|
|
39509
|
-
this.signingConfig = new SigningConfig();
|
|
39510
|
-
}
|
|
39511
|
-
this.explicitPrivateKey = normalized.privateKeyPem;
|
|
39512
|
-
this.explicitKeyId = normalized.keyId;
|
|
39513
|
-
}
|
|
39514
|
-
signEnvelope(envelope, { physicalPath }) {
|
|
39515
|
-
if (!envelope.sid) {
|
|
39516
|
-
throw new Error('Envelope missing sid');
|
|
39517
|
-
}
|
|
39518
|
-
const frame = envelope.frame;
|
|
39519
|
-
if (frame.type === 'Data') {
|
|
39520
|
-
const dataFrame = frame;
|
|
39521
|
-
if (!dataFrame.pd) {
|
|
39522
|
-
const payload = dataFrame.payload ?? '';
|
|
39523
|
-
const payloadString = payload === '' ? '' : canonicalJson(payload);
|
|
39524
|
-
dataFrame.pd = secureDigest(payloadString);
|
|
39525
|
-
}
|
|
39526
|
-
}
|
|
39527
|
-
const digest = frameDigest(frame);
|
|
39528
|
-
const immutable = canonicalJson(immutableHeaders(envelope));
|
|
39529
|
-
const sidDigest = secureDigest(physicalPath);
|
|
39530
|
-
const tbs = new Uint8Array(encodeUtf8(sidDigest).length +
|
|
39531
|
-
1 +
|
|
39532
|
-
encodeUtf8(immutable).length +
|
|
39533
|
-
1 +
|
|
39534
|
-
encodeUtf8(digest).length);
|
|
39535
|
-
const sidBytes = encodeUtf8(sidDigest);
|
|
39536
|
-
const immBytes = encodeUtf8(immutable);
|
|
39537
|
-
const digBytes = encodeUtf8(digest);
|
|
39538
|
-
let offset = 0;
|
|
39539
|
-
tbs.set(sidBytes, offset);
|
|
39540
|
-
offset += sidBytes.length;
|
|
39541
|
-
tbs[offset] = 0x1f;
|
|
39542
|
-
offset += 1;
|
|
39543
|
-
tbs.set(immBytes, offset);
|
|
39544
|
-
offset += immBytes.length;
|
|
39545
|
-
tbs[offset] = 0x1f;
|
|
39546
|
-
offset += 1;
|
|
39547
|
-
tbs.set(digBytes, offset);
|
|
39548
|
-
const privateKey = this.loadPrivateKey();
|
|
39549
|
-
const signatureBytes = sign(tbs, privateKey);
|
|
39550
|
-
const signature = urlsafeBase64Encode(signatureBytes);
|
|
39551
|
-
const kid = this.determineKeyId();
|
|
39552
|
-
const signatureHeader = {
|
|
39553
|
-
kid,
|
|
39554
|
-
val: signature,
|
|
39555
|
-
alg: 'EdDSA',
|
|
39556
|
-
};
|
|
39557
|
-
const secHeader = envelope.sec ?? {};
|
|
39558
|
-
secHeader.sig = signatureHeader;
|
|
39559
|
-
envelope.sec = secHeader;
|
|
39560
|
-
return envelope;
|
|
39561
|
-
}
|
|
39562
|
-
loadPrivateKey() {
|
|
39563
|
-
const pem = this.explicitPrivateKey ??
|
|
39564
|
-
readStringProperty(this.crypto, 'signingPrivatePem', 'signing_private_pem');
|
|
39565
|
-
if (!pem) {
|
|
39566
|
-
throw new Error('Crypto provider does not expose a signing private key');
|
|
39567
|
-
}
|
|
39568
|
-
return parseEd25519PrivateKey(pem);
|
|
39569
|
-
}
|
|
39570
|
-
determineKeyId() {
|
|
39571
|
-
if (this.explicitKeyId) {
|
|
39572
|
-
return this.explicitKeyId;
|
|
39573
|
-
}
|
|
39574
|
-
if (this.signingConfig.signingMaterial === SigningMaterial.X509_CHAIN) {
|
|
39575
|
-
const certificateProvider = this
|
|
39576
|
-
.crypto;
|
|
39577
|
-
const jwk = certificateProvider.nodeJwk?.();
|
|
39578
|
-
if (jwk && typeof jwk === 'object' && 'kid' in jwk && 'x5c' in jwk) {
|
|
39579
|
-
const kid = jwk.kid;
|
|
39580
|
-
if (typeof kid === 'string' && kid.length > 0) {
|
|
39581
|
-
return kid;
|
|
39582
|
-
}
|
|
39583
|
-
}
|
|
39584
|
-
}
|
|
39585
|
-
const fallback = readStringProperty(this.crypto, 'signatureKeyId', 'signature_key_id');
|
|
39586
|
-
if (!fallback) {
|
|
39587
|
-
throw new Error('Crypto provider does not expose a signature key id');
|
|
39588
|
-
}
|
|
39589
|
-
return fallback;
|
|
39590
|
-
}
|
|
39591
|
-
}
|
|
39592
|
-
|
|
39593
|
-
var eddsaEnvelopeSigner = /*#__PURE__*/Object.freeze({
|
|
39594
|
-
__proto__: null,
|
|
39595
|
-
EdDSAEnvelopeSigner: EdDSAEnvelopeSigner
|
|
39596
|
-
});
|
|
39597
|
-
|
|
39598
39598
|
async function loadPublicKey(jwk, signingConfig) {
|
|
39599
39599
|
if (jwk.x5c) {
|
|
39600
39600
|
if (signingConfig.signingMaterial !== SigningMaterial.X509_CHAIN) {
|
|
@@ -39832,4 +39832,4 @@ var websocketTransportProvisioner = /*#__PURE__*/Object.freeze({
|
|
|
39832
39832
|
WebSocketTransportProvisionerFactory: WebSocketTransportProvisionerFactory
|
|
39833
39833
|
});
|
|
39834
39834
|
|
|
39835
|
-
export { ADMISSION_CLIENT_FACTORY_BASE_TYPE, ATTACHMENT_KEY_VALIDATOR_FACTORY_BASE_TYPE, AUTHORIZER_FACTORY_BASE_TYPE, AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE, AnsiColor, AsyncLock, AttachmentKeyValidator, AuthInjectionStrategyFactory, AuthorizerFactory, BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE, FACTORY_META$Y as BROADCAST_CHANNEL_CONNECTOR_FACTORY_META, BROADCAST_CHANNEL_CONNECTOR_TYPE, FACTORY_META$W as BROADCAST_CHANNEL_LISTENER_FACTORY_META, BackPressureFull, BaseAsyncConnector, BaseNodeEventListener, BindingManager, BindingStoreEntryRecord, BroadcastChannelConnector, BroadcastChannelConnectorFactory, BroadcastChannelListener, BroadcastChannelListenerFactory, BrowserAutoKeyCredentialProvider, BrowserWrappedKeyCredentialProvider, CERTIFICATE_MANAGER_FACTORY_BASE_TYPE, CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE, CRYPTO_LEVEL_SECURITY_ORDER, CertificateManagerFactory, ConnectorConfigDefaults, ConnectorFactory, ConsoleMetricsEmitter, CryptoLevel, FACTORY_META$_ as DEFAULT_WELCOME_FACTORY_META, DefaultCryptoProvider, DefaultKeyManager, DefaultSecurityManager, DefaultSecurityPolicy, DefaultWelcomeService, DefaultWelcomeServiceFactory, DevFixedKeyCredentialProvider, ENCRYPTION_MANAGER_FACTORY_BASE_TYPE, ENVELOPE_SIGNER_FACTORY_BASE_TYPE, ENVELOPE_VERIFIER_FACTORY_BASE_TYPE, ENV_VAR_DEFAULT_ENCRYPTION_LEVEL, ENV_VAR_HMAC_SECRET, ENV_VAR_JWKS_URL, ENV_VAR_JWT_ALGORITHM, ENV_VAR_JWT_AUDIENCE$1 as ENV_VAR_JWT_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, ENV_VAR_JWT_TRUSTED_ISSUER, ENV_VAR_SHOW_ENVELOPES$1 as ENV_VAR_SHOW_ENVELOPES, EncryptedKeyValueStore, EncryptedStorageProviderBase, EncryptedValue, EncryptionConfiguration, EncryptionManagerFactory, EncryptionResult, EncryptionStatus, EnvCredentialProvider, EnvelopeContext, EnvelopeListenerManager, EnvelopeSecurityHandler, EnvelopeSignerFactory, EnvelopeVerifierFactory, FACTORY_META$$ as FACTORY_META, FIXED_PREFIX_LEN, FameAuthorizedDeliveryContextSchema, FameConnectError, FameEnvironmentContext, FameError, FameMessageTooLarge, FameNode, FameNodeAuthorizationContextSchema, FameProtocolError, FameTransportClose, FlowController, GRANT_PURPOSE_NODE_ATTACH, HTTP_CONNECTION_GRANT_TYPE, HTTP_STATELESS_CONNECTOR_TYPE, INPAGE_CONNECTION_GRANT_TYPE, FACTORY_META$Z as INPAGE_CONNECTOR_FACTORY_META, INPAGE_CONNECTOR_TYPE, FACTORY_META$X as INPAGE_LISTENER_FACTORY_META, InMemoryBinding, InMemoryFanoutBroker, InMemoryKeyValueStore, InMemoryReadWriteChannel, InMemoryStorageProvider, InPageConnector, InPageConnectorFactory, InPageListener, InPageListenerFactory, IndexedDBKeyValueStore, IndexedDBStorageProvider, InvalidPassphraseError, JWKValidationError, KEY_MANAGER_FACTORY_BASE_TYPE, KEY_STORE_FACTORY_BASE_TYPE, KeyInfo, KeyManagementHandler, KeyManagerFactory, KeyStore, KeyStoreFactory, KeyValidationError, LOAD_BALANCER_STICKINESS_MANAGER_FACTORY_BASE_TYPE, LoadBalancerStickinessManagerFactory, LogLevel, LogLevelNames, MemoryMetricsEmitter, NODE_LIKE_FACTORY_BASE_TYPE, NODE_PLACEMENT_STRATEGY_FACTORY_BASE_TYPE, NoOpMetricsEmitter, NoSecurityPolicy, NodeFactory, NodePlacementStrategyFactory, NoneCredentialProvider, NoopEncryptionManager, NoopKeyValidator, NotAuthorized, PROFILE_NAME_GATED, PROFILE_NAME_GATED_CALLBACK, PROFILE_NAME_OPEN$1 as PROFILE_NAME_OPEN, PROFILE_NAME_OVERLAY, PROFILE_NAME_OVERLAY_CALLBACK, PROFILE_NAME_STRICT_OVERLAY, PromptCredentialProvider, REPLICA_STICKINESS_MANAGER_FACTORY_BASE_TYPE, REQUIRED_FIELDS_BY_KTY, ReplicaStickinessManagerFactory, RootSessionManager, RouteManager, RpcMixin, RpcProxy, SEALED_ENVELOPE_NONCE_LENGTH, SEALED_ENVELOPE_OVERHEAD, SEALED_ENVELOPE_PRIVATE_KEY_LENGTH, SEALED_ENVELOPE_PUBLIC_KEY_LENGTH, SEALED_ENVELOPE_TAG_LENGTH, SECURE_CHANNEL_MANAGER_FACTORY_BASE_TYPE, SECURITY_MANAGER_FACTORY_BASE_TYPE, SECURITY_POLICY_FACTORY_BASE_TYPE, STORAGE_PROVIDER_FACTORY_BASE_TYPE, SecretSource, SecretStoreCredentialProvider, SecureChannelFrameHandler, SecureChannelManagerFactory, SecurityAction, SecurityRequirements, Sentinel, SentinelFactory, SessionKeyCredentialProvider, SignaturePolicy, SigningConfig as SigningConfigClass, SigningConfiguration, SimpleLoadBalancerStickinessManager, SimpleLoadBalancerStickinessManagerFactory, StaticCredentialProvider, StorageAESEncryptionManager, TOKEN_ISSUER_FACTORY_BASE_TYPE, TOKEN_PROVIDER_FACTORY_BASE_TYPE, TOKEN_VERIFIER_FACTORY_BASE_TYPE, TRANSPORT_PROVISIONER_FACTORY_BASE_TYPE, TaskSpawner, TokenIssuerFactory, TokenProviderFactory, TokenVerifierFactory, TransportProvisionerFactory, TtlValidationError, UpstreamSessionManager, VALID_CURVES_BY_KTY, VALID_KEY_USES, VERSION, WEBSOCKET_CONNECTION_GRANT_TYPE, WELCOME_SERVICE_FACTORY_BASE_TYPE, WebSocketCloseCode, WebSocketConnector, WebSocketState, WelcomeServiceFactory, _NoopFlowController, __runtimePluginLoader, addEnvelopeFields, addLogLevel, addTimestamp, assertConnectionGrant, assertGrant, basicConfig, broadcastChannelGrantToConnectorConfig, camelToSnakeCase, capitalizeFirstLetter, color, compareCryptoLevels, compiledPathPattern, consoleTransport, convertWildcardLogicalToDnsConstraint, createConnectorConfig, createEd25519Keypair, createHostLogicalUri, createLogicalUri, createNodeDeliveryContext, createResource, createRpcProxy, createRsaKeypair, createTransportCloseError, createX25519Keypair, credentialToString, currentTraceId$1 as currentTraceId, debounce, decodeFameDataPayload, deepMerge, defaultJsonEncoder, delay, dropEmpty, enableLogging, ensureRuntimeFactoriesRegistered, extractId, extractPoolAddressBase, extractPoolBase, filterKeysByUse, formatTimestamp, formatTimestampForConsole$1 as formatTimestampForConsole, getCurrentEnvelope, getFameRoot, getKeyProvider, getKeyStore, getLogger, hasCryptoSupport, hostnameToLogical, hostnamesToLogicals, httpGrantToConnectorConfig, inPageGrantToConnectorConfig, isAuthInjectionStrategy, isBroadcastChannelConnectionGrant, isConnectionGrant, isConnectorConfig, isEnvelopeLoggingEnabled, isFameError, isFameErrorType, isGrant, isHttpConnectionGrant, isInPageConnectionGrant, isNodeLike, isPlainObject$3 as isPlainObject, isPoolAddress, isPoolLogical, isRegisterable, isTokenExpired, isTokenProvider, isTokenValid, isWebSocketConnectionGrant, jsonDumps, logicalPatternsToDnsConstraints, logicalToHostname, logicalsToHostnames, matchesPoolAddress, matchesPoolLogical, maybeAwait, nodeWelcomeRouter, nodeWelcomeRouterPlugin, normalizeBroadcastChannelConnectionGrant, normalizeEncryptionConfig, normalizeEnvelopeSnapshot, normalizeHttpConnectionGrant, normalizeInPageConnectionGrant, normalizeInboundCryptoRules, normalizeInboundSigningRules, normalizeOutboundCryptoRules, normalizeOutboundSigningRules, normalizePath, normalizeResponseCryptoRules, normalizeResponseSigningRules, normalizeSecretSource, normalizeSecurityRequirements, normalizeSigningConfig, normalizeWebSocketConnectionGrant, objectToBytes, operation, parseSealedEnvelope, pinoTransport, prettyModel$1 as prettyModel, registerDefaultFactories, registerDefaultKeyStoreFactory, registerNodePlacementStrategyFactory, registerRuntimeFactories, requireCryptoSupport, retryWithBackoff, safeColor, sealedDecrypt, sealedEncrypt, secureDigest, setKeyStore, showEnvelopes$1 as showEnvelopes, sleep, snakeToCamelCase, stringifyNonPrimitives, supportsColor, throttle, urlsafeBase64Decode, urlsafeBase64Encode, validateCacheTtlSec, validateEncryptionKey, validateHostLogical, validateHostLogicals, validateJwkComplete, validateJwkStructure, validateJwkUseField, validateJwtTokenTtlSec, validateKeyCorrelationTtlSec, validateLogical, validateLogicalSegment, validateOAuth2TtlSec, validateSigningKey, validateTtlSec, waitForAll, waitForAllSettled, waitForAny, websocketGrantToConnectorConfig, withEnvelopeContext, withEnvelopeContextAsync, withLegacySnakeCaseKeys, withLock, withTimeout };
|
|
39835
|
+
export { ADMISSION_CLIENT_FACTORY_BASE_TYPE, ATTACHMENT_KEY_VALIDATOR_FACTORY_BASE_TYPE, AUTHORIZER_FACTORY_BASE_TYPE, AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE, AnsiColor, AsyncLock, AttachmentKeyValidator, AuthInjectionStrategyFactory, AuthorizerFactory, BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE, FACTORY_META$Y as BROADCAST_CHANNEL_CONNECTOR_FACTORY_META, BROADCAST_CHANNEL_CONNECTOR_TYPE, FACTORY_META$W as BROADCAST_CHANNEL_LISTENER_FACTORY_META, BackPressureFull, BaseAsyncConnector, BaseNodeEventListener, BindingManager, BindingStoreEntryRecord, BroadcastChannelConnector, BroadcastChannelConnectorFactory, BroadcastChannelListener, BroadcastChannelListenerFactory, BrowserAutoKeyCredentialProvider, BrowserWrappedKeyCredentialProvider, CERTIFICATE_MANAGER_FACTORY_BASE_TYPE, CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE, CRYPTO_LEVEL_SECURITY_ORDER, CertificateManagerFactory, ConnectorConfigDefaults, ConnectorFactory, ConsoleMetricsEmitter, CryptoLevel, FACTORY_META$_ as DEFAULT_WELCOME_FACTORY_META, DefaultCryptoProvider, DefaultKeyManager, DefaultSecurityManager, DefaultSecurityPolicy, DefaultWelcomeService, DefaultWelcomeServiceFactory, DevFixedKeyCredentialProvider, ENCRYPTION_MANAGER_FACTORY_BASE_TYPE, ENVELOPE_SIGNER_FACTORY_BASE_TYPE, ENVELOPE_VERIFIER_FACTORY_BASE_TYPE, ENV_VAR_DEFAULT_ENCRYPTION_LEVEL, ENV_VAR_HMAC_SECRET, ENV_VAR_JWKS_URL, ENV_VAR_JWT_ALGORITHM, ENV_VAR_JWT_AUDIENCE$1 as ENV_VAR_JWT_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, ENV_VAR_JWT_TRUSTED_ISSUER, ENV_VAR_SHOW_ENVELOPES$1 as ENV_VAR_SHOW_ENVELOPES, EdDSAEnvelopeSigner, EncryptedKeyValueStore, EncryptedStorageProviderBase, EncryptedValue, EncryptionConfiguration, EncryptionManagerFactory, EncryptionResult, EncryptionStatus, EnvCredentialProvider, EnvelopeContext, EnvelopeListenerManager, EnvelopeSecurityHandler, EnvelopeSignerFactory, EnvelopeVerifierFactory, FACTORY_META$$ as FACTORY_META, FIXED_PREFIX_LEN, FameAuthorizedDeliveryContextSchema, FameConnectError, FameEnvironmentContext, FameError, FameMessageTooLarge, FameNode, FameNodeAuthorizationContextSchema, FameProtocolError, FameTransportClose, FlowController, GRANT_PURPOSE_NODE_ATTACH, HTTP_CONNECTION_GRANT_TYPE, HTTP_STATELESS_CONNECTOR_TYPE, INPAGE_CONNECTION_GRANT_TYPE, FACTORY_META$Z as INPAGE_CONNECTOR_FACTORY_META, INPAGE_CONNECTOR_TYPE, FACTORY_META$X as INPAGE_LISTENER_FACTORY_META, InMemoryBinding, InMemoryFanoutBroker, InMemoryKeyValueStore, InMemoryReadWriteChannel, InMemoryStorageProvider, InPageConnector, InPageConnectorFactory, InPageListener, InPageListenerFactory, IndexedDBKeyValueStore, IndexedDBStorageProvider, InvalidPassphraseError, JWKValidationError, KEY_MANAGER_FACTORY_BASE_TYPE, KEY_STORE_FACTORY_BASE_TYPE, KeyInfo, KeyManagementHandler, KeyManagerFactory, KeyStore, KeyStoreFactory, KeyValidationError, LOAD_BALANCER_STICKINESS_MANAGER_FACTORY_BASE_TYPE, LoadBalancerStickinessManagerFactory, LogLevel, LogLevelNames, MemoryMetricsEmitter, NODE_LIKE_FACTORY_BASE_TYPE, NODE_PLACEMENT_STRATEGY_FACTORY_BASE_TYPE, NoOpMetricsEmitter, NoSecurityPolicy, NodeFactory, NodePlacementStrategyFactory, NoneCredentialProvider, NoopEncryptionManager, NoopKeyValidator, NotAuthorized, PROFILE_NAME_GATED, PROFILE_NAME_GATED_CALLBACK, PROFILE_NAME_OPEN$1 as PROFILE_NAME_OPEN, PROFILE_NAME_OVERLAY, PROFILE_NAME_OVERLAY_CALLBACK, PROFILE_NAME_STRICT_OVERLAY, PromptCredentialProvider, REPLICA_STICKINESS_MANAGER_FACTORY_BASE_TYPE, REQUIRED_FIELDS_BY_KTY, ReplicaStickinessManagerFactory, RootSessionManager, RouteManager, RpcMixin, RpcProxy, SEALED_ENVELOPE_NONCE_LENGTH, SEALED_ENVELOPE_OVERHEAD, SEALED_ENVELOPE_PRIVATE_KEY_LENGTH, SEALED_ENVELOPE_PUBLIC_KEY_LENGTH, SEALED_ENVELOPE_TAG_LENGTH, SECURE_CHANNEL_MANAGER_FACTORY_BASE_TYPE, SECURITY_MANAGER_FACTORY_BASE_TYPE, SECURITY_POLICY_FACTORY_BASE_TYPE, STORAGE_PROVIDER_FACTORY_BASE_TYPE, SecretSource, SecretStoreCredentialProvider, SecureChannelFrameHandler, SecureChannelManagerFactory, SecurityAction, SecurityRequirements, Sentinel, SentinelFactory, SessionKeyCredentialProvider, SignaturePolicy, SigningConfig as SigningConfigClass, SigningConfiguration, SimpleLoadBalancerStickinessManager, SimpleLoadBalancerStickinessManagerFactory, StaticCredentialProvider, StorageAESEncryptionManager, TOKEN_ISSUER_FACTORY_BASE_TYPE, TOKEN_PROVIDER_FACTORY_BASE_TYPE, TOKEN_VERIFIER_FACTORY_BASE_TYPE, TRANSPORT_PROVISIONER_FACTORY_BASE_TYPE, TaskSpawner, TokenIssuerFactory, TokenProviderFactory, TokenVerifierFactory, TransportProvisionerFactory, TtlValidationError, UpstreamSessionManager, VALID_CURVES_BY_KTY, VALID_KEY_USES, VERSION, WEBSOCKET_CONNECTION_GRANT_TYPE, WELCOME_SERVICE_FACTORY_BASE_TYPE, WebSocketCloseCode, WebSocketConnector, WebSocketState, WelcomeServiceFactory, _NoopFlowController, __runtimePluginLoader, addEnvelopeFields, addLogLevel, addTimestamp, assertConnectionGrant, assertGrant, basicConfig, broadcastChannelGrantToConnectorConfig, camelToSnakeCase, canonicalJson, capitalizeFirstLetter, color, compareCryptoLevels, compiledPathPattern, consoleTransport, convertWildcardLogicalToDnsConstraint, createConnectorConfig, createEd25519Keypair, createHostLogicalUri, createLogicalUri, createNodeDeliveryContext, createResource, createRpcProxy, createRsaKeypair, createTransportCloseError, createX25519Keypair, credentialToString, currentTraceId$1 as currentTraceId, debounce, decodeBase64Url, decodeFameDataPayload, deepMerge, defaultJsonEncoder, delay, dropEmpty, enableLogging, encodeUtf8, ensureRuntimeFactoriesRegistered, extractId, extractPoolAddressBase, extractPoolBase, filterKeysByUse, formatTimestamp, formatTimestampForConsole$1 as formatTimestampForConsole, frameDigest, getCurrentEnvelope, getFameRoot, getKeyProvider, getKeyStore, getLogger, hasCryptoSupport, hostnameToLogical, hostnamesToLogicals, httpGrantToConnectorConfig, immutableHeaders, inPageGrantToConnectorConfig, isAuthInjectionStrategy, isBroadcastChannelConnectionGrant, isConnectionGrant, isConnectorConfig, isEnvelopeLoggingEnabled, isFameError, isFameErrorType, isGrant, isHttpConnectionGrant, isInPageConnectionGrant, isNodeLike, isPlainObject$3 as isPlainObject, isPoolAddress, isPoolLogical, isRegisterable, isTokenExpired, isTokenProvider, isTokenValid, isWebSocketConnectionGrant, jsonDumps, logicalPatternsToDnsConstraints, logicalToHostname, logicalsToHostnames, matchesPoolAddress, matchesPoolLogical, maybeAwait, nodeWelcomeRouter, nodeWelcomeRouterPlugin, normalizeBroadcastChannelConnectionGrant, normalizeEncryptionConfig, normalizeEnvelopeSnapshot, normalizeHttpConnectionGrant, normalizeInPageConnectionGrant, normalizeInboundCryptoRules, normalizeInboundSigningRules, normalizeOutboundCryptoRules, normalizeOutboundSigningRules, normalizePath, normalizeResponseCryptoRules, normalizeResponseSigningRules, normalizeSecretSource, normalizeSecurityRequirements, normalizeSigningConfig, normalizeWebSocketConnectionGrant, objectToBytes, operation, parseSealedEnvelope, pinoTransport, prettyModel$1 as prettyModel, registerDefaultFactories, registerDefaultKeyStoreFactory, registerNodePlacementStrategyFactory, registerRuntimeFactories, requireCryptoSupport, retryWithBackoff, safeColor, sealedDecrypt, sealedEncrypt, secureDigest, setKeyStore, showEnvelopes$1 as showEnvelopes, sleep, snakeToCamelCase, stringifyNonPrimitives, supportsColor, throttle, urlsafeBase64Decode, urlsafeBase64Encode, validateCacheTtlSec, validateEncryptionKey, validateHostLogical, validateHostLogicals, validateJwkComplete, validateJwkStructure, validateJwkUseField, validateJwtTokenTtlSec, validateKeyCorrelationTtlSec, validateLogical, validateLogicalSegment, validateOAuth2TtlSec, validateSigningKey, validateTtlSec, waitForAll, waitForAllSettled, waitForAny, websocketGrantToConnectorConfig, withEnvelopeContext, withEnvelopeContextAsync, withLegacySnakeCaseKeys, withLock, withTimeout };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PROFILE_NAME_OPEN = exports.PROFILE_NAME_GATED_CALLBACK = exports.PROFILE_NAME_GATED = exports.PROFILE_NAME_OVERLAY_CALLBACK = exports.PROFILE_NAME_OVERLAY = exports.PROFILE_NAME_STRICT_OVERLAY = exports.ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE = exports.ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER = exports.ENV_VAR_HMAC_SECRET = exports.ENV_VAR_DEFAULT_ENCRYPTION_LEVEL = exports.ENV_VAR_JWKS_URL = exports.ENV_VAR_JWT_AUDIENCE = exports.ENV_VAR_JWT_ALGORITHM = exports.ENV_VAR_JWT_TRUSTED_ISSUER = exports.CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE = exports.SigningConfigClass = exports.SECURITY_MANAGER_FACTORY_BASE_TYPE = exports.SECURITY_POLICY_FACTORY_BASE_TYPE = exports.KEY_STORE_FACTORY_BASE_TYPE = exports.ATTACHMENT_KEY_VALIDATOR_FACTORY_BASE_TYPE = exports.KEY_MANAGER_FACTORY_BASE_TYPE = exports.SecureChannelManagerFactory = exports.SECURE_CHANNEL_MANAGER_FACTORY_BASE_TYPE = exports.ENCRYPTION_MANAGER_FACTORY_BASE_TYPE = exports.CertificateManagerFactory = exports.CERTIFICATE_MANAGER_FACTORY_BASE_TYPE = exports.TokenProviderFactory = exports.TOKEN_PROVIDER_FACTORY_BASE_TYPE = exports.TokenVerifierFactory = exports.TOKEN_VERIFIER_FACTORY_BASE_TYPE = exports.TokenIssuerFactory = exports.TOKEN_ISSUER_FACTORY_BASE_TYPE = exports.AuthInjectionStrategyFactory = exports.AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE = exports.AuthorizerFactory = exports.AUTHORIZER_FACTORY_BASE_TYPE = void 0;
|
|
3
|
+
exports.PROFILE_NAME_OPEN = exports.PROFILE_NAME_GATED_CALLBACK = exports.PROFILE_NAME_GATED = exports.PROFILE_NAME_OVERLAY_CALLBACK = exports.PROFILE_NAME_OVERLAY = exports.PROFILE_NAME_STRICT_OVERLAY = exports.ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE = exports.ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER = exports.ENV_VAR_HMAC_SECRET = exports.ENV_VAR_DEFAULT_ENCRYPTION_LEVEL = exports.ENV_VAR_JWKS_URL = exports.ENV_VAR_JWT_AUDIENCE = exports.ENV_VAR_JWT_ALGORITHM = exports.ENV_VAR_JWT_TRUSTED_ISSUER = exports.CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE = exports.EdDSAEnvelopeSigner = exports.encodeUtf8 = exports.immutableHeaders = exports.frameDigest = exports.decodeBase64Url = exports.canonicalJson = exports.SigningConfigClass = exports.SECURITY_MANAGER_FACTORY_BASE_TYPE = exports.SECURITY_POLICY_FACTORY_BASE_TYPE = exports.KEY_STORE_FACTORY_BASE_TYPE = exports.ATTACHMENT_KEY_VALIDATOR_FACTORY_BASE_TYPE = exports.KEY_MANAGER_FACTORY_BASE_TYPE = exports.SecureChannelManagerFactory = exports.SECURE_CHANNEL_MANAGER_FACTORY_BASE_TYPE = exports.ENCRYPTION_MANAGER_FACTORY_BASE_TYPE = exports.CertificateManagerFactory = exports.CERTIFICATE_MANAGER_FACTORY_BASE_TYPE = exports.TokenProviderFactory = exports.TOKEN_PROVIDER_FACTORY_BASE_TYPE = exports.TokenVerifierFactory = exports.TOKEN_VERIFIER_FACTORY_BASE_TYPE = exports.TokenIssuerFactory = exports.TOKEN_ISSUER_FACTORY_BASE_TYPE = exports.AuthInjectionStrategyFactory = exports.AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE = exports.AuthorizerFactory = exports.AUTHORIZER_FACTORY_BASE_TYPE = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
tslib_1.__exportStar(require("./auth/authorizer.js"), exports);
|
|
6
6
|
var authorizer_factory_js_1 = require("./auth/authorizer-factory.js");
|
|
@@ -69,6 +69,15 @@ tslib_1.__exportStar(require("./signing/envelope-signer.js"), exports);
|
|
|
69
69
|
tslib_1.__exportStar(require("./signing/envelope-verifier.js"), exports);
|
|
70
70
|
var signing_config_js_1 = require("./signing/signing-config.js");
|
|
71
71
|
Object.defineProperty(exports, "SigningConfigClass", { enumerable: true, get: function () { return signing_config_js_1.SigningConfig; } });
|
|
72
|
+
var eddsa_signer_verifier_js_1 = require("./signing/eddsa-signer-verifier.js");
|
|
73
|
+
Object.defineProperty(exports, "canonicalJson", { enumerable: true, get: function () { return eddsa_signer_verifier_js_1.canonicalJson; } });
|
|
74
|
+
Object.defineProperty(exports, "decodeBase64Url", { enumerable: true, get: function () { return eddsa_signer_verifier_js_1.decodeBase64Url; } });
|
|
75
|
+
Object.defineProperty(exports, "frameDigest", { enumerable: true, get: function () { return eddsa_signer_verifier_js_1.frameDigest; } });
|
|
76
|
+
Object.defineProperty(exports, "immutableHeaders", { enumerable: true, get: function () { return eddsa_signer_verifier_js_1.immutableHeaders; } });
|
|
77
|
+
var eddsa_utils_js_1 = require("./signing/eddsa-utils.js");
|
|
78
|
+
Object.defineProperty(exports, "encodeUtf8", { enumerable: true, get: function () { return eddsa_utils_js_1.encodeUtf8; } });
|
|
79
|
+
var eddsa_envelope_signer_js_1 = require("./signing/eddsa-envelope-signer.js");
|
|
80
|
+
Object.defineProperty(exports, "EdDSAEnvelopeSigner", { enumerable: true, get: function () { return eddsa_envelope_signer_js_1.EdDSAEnvelopeSigner; } });
|
|
72
81
|
tslib_1.__exportStar(require("./crypto/providers/crypto-provider.js"), exports);
|
|
73
82
|
tslib_1.__exportStar(require("./crypto/providers/default-crypto-provider.js"), exports);
|
|
74
83
|
tslib_1.__exportStar(require("./credential/credential-provider.js"), exports);
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file is auto-generated during build - do not edit manually
|
|
3
|
-
// Generated from package.json version: 0.3.5-test.
|
|
3
|
+
// Generated from package.json version: 0.3.5-test.923
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.VERSION = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* The package version, injected at build time.
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
exports.VERSION = '0.3.5-test.
|
|
10
|
+
exports.VERSION = '0.3.5-test.923';
|
|
@@ -44,6 +44,9 @@ export { SECURITY_MANAGER_FACTORY_BASE_TYPE } from './security-manager-factory.j
|
|
|
44
44
|
export * from './signing/envelope-signer.js';
|
|
45
45
|
export * from './signing/envelope-verifier.js';
|
|
46
46
|
export { SigningConfig as SigningConfigClass, } from './signing/signing-config.js';
|
|
47
|
+
export { canonicalJson, decodeBase64Url, frameDigest, immutableHeaders, } from './signing/eddsa-signer-verifier.js';
|
|
48
|
+
export { encodeUtf8, } from './signing/eddsa-utils.js';
|
|
49
|
+
export { EdDSAEnvelopeSigner, } from './signing/eddsa-envelope-signer.js';
|
|
47
50
|
export * from './crypto/providers/crypto-provider.js';
|
|
48
51
|
export * from './crypto/providers/default-crypto-provider.js';
|
|
49
52
|
export * from './credential/credential-provider.js';
|
package/dist/esm/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is auto-generated during build - do not edit manually
|
|
2
|
-
// Generated from package.json version: 0.3.5-test.
|
|
2
|
+
// Generated from package.json version: 0.3.5-test.923
|
|
3
3
|
/**
|
|
4
4
|
* The package version, injected at build time.
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export const VERSION = '0.3.5-test.
|
|
7
|
+
export const VERSION = '0.3.5-test.923';
|