@naylence/runtime 0.3.5-test.910 → 0.3.5-test.913
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 +1915 -1214
- package/dist/browser/index.mjs +1910 -1209
- package/dist/cjs/naylence/fame/config/extended-fame-config.js +52 -0
- package/dist/cjs/naylence/fame/factory-manifest.js +2 -0
- package/dist/cjs/naylence/fame/http/jwks-api-router.js +16 -18
- package/dist/cjs/naylence/fame/http/oauth2-server.js +28 -31
- package/dist/cjs/naylence/fame/http/oauth2-token-router.js +901 -93
- package/dist/cjs/naylence/fame/http/openid-configuration-router.js +30 -32
- package/dist/cjs/naylence/fame/node/admission/admission-profile-factory.js +79 -0
- package/dist/cjs/naylence/fame/security/auth/oauth2-pkce-token-provider-factory.js +171 -0
- package/dist/cjs/naylence/fame/security/auth/oauth2-pkce-token-provider.js +560 -0
- package/dist/cjs/naylence/fame/security/crypto/providers/default-crypto-provider.js +0 -162
- package/dist/cjs/naylence/fame/telemetry/open-telemetry-trace-emitter-factory.js +19 -2
- package/dist/cjs/naylence/fame/telemetry/open-telemetry-trace-emitter.js +19 -9
- package/dist/cjs/naylence/fame/util/register-runtime-factories.js +6 -0
- package/dist/cjs/version.js +2 -2
- package/dist/esm/naylence/fame/config/extended-fame-config.js +52 -0
- package/dist/esm/naylence/fame/factory-manifest.js +2 -0
- package/dist/esm/naylence/fame/http/jwks-api-router.js +16 -17
- package/dist/esm/naylence/fame/http/oauth2-server.js +28 -31
- package/dist/esm/naylence/fame/http/oauth2-token-router.js +901 -93
- package/dist/esm/naylence/fame/http/openid-configuration-router.js +30 -31
- package/dist/esm/naylence/fame/node/admission/admission-profile-factory.js +79 -0
- package/dist/esm/naylence/fame/security/auth/oauth2-pkce-token-provider-factory.js +134 -0
- package/dist/esm/naylence/fame/security/auth/oauth2-pkce-token-provider.js +555 -0
- package/dist/esm/naylence/fame/security/crypto/providers/default-crypto-provider.js +0 -162
- package/dist/esm/naylence/fame/telemetry/open-telemetry-trace-emitter-factory.js +19 -2
- package/dist/esm/naylence/fame/telemetry/open-telemetry-trace-emitter.js +19 -9
- package/dist/esm/naylence/fame/util/register-runtime-factories.js +6 -0
- package/dist/esm/version.js +2 -2
- package/dist/node/index.cjs +1911 -1210
- package/dist/node/index.mjs +1910 -1209
- package/dist/node/node.cjs +2945 -1439
- package/dist/node/node.mjs +2944 -1438
- package/dist/types/naylence/fame/factory-manifest.d.ts +1 -1
- package/dist/types/naylence/fame/http/jwks-api-router.d.ts +8 -8
- package/dist/types/naylence/fame/http/oauth2-server.d.ts +3 -3
- package/dist/types/naylence/fame/http/oauth2-token-router.d.ts +75 -19
- package/dist/types/naylence/fame/http/openid-configuration-router.d.ts +8 -8
- package/dist/types/naylence/fame/security/auth/oauth2-pkce-token-provider-factory.d.ts +27 -0
- package/dist/types/naylence/fame/security/auth/oauth2-pkce-token-provider.d.ts +42 -0
- package/dist/types/naylence/fame/security/crypto/providers/default-crypto-provider.d.ts +0 -1
- package/dist/types/naylence/fame/telemetry/open-telemetry-trace-emitter.d.ts +4 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +4 -4
- package/dist/esm/naylence/fame/fastapi/oauth2-server.js +0 -205
- package/dist/types/naylence/fame/fastapi/oauth2-server.d.ts +0 -22
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { AsnConvert, OctetString } from '@peculiar/asn1-schema';
|
|
2
|
-
import { AlgorithmIdentifier, Attribute, AttributeTypeAndValue, AttributeValue, Extension, Extensions, GeneralName, Name, RelativeDistinguishedName, SubjectAlternativeName, SubjectPublicKeyInfo, id_ce_subjectAltName, } from '@peculiar/asn1-x509';
|
|
3
|
-
import { Attributes, CertificationRequest, CertificationRequestInfo, } from '@peculiar/asn1-csr';
|
|
4
1
|
import { generateId } from '@naylence/core';
|
|
5
2
|
import { getLogger } from '../../../util/logging.js';
|
|
6
3
|
import { secureDigest } from '../../../util/util.js';
|
|
@@ -16,11 +13,6 @@ const DEFAULT_AUDIENCE = 'router-dev';
|
|
|
16
13
|
const DEFAULT_TTL_SEC = 3600;
|
|
17
14
|
const DEFAULT_HMAC_SECRET_BYTES = 32;
|
|
18
15
|
const ENCRYPTION_ALG = 'ECDH-ES';
|
|
19
|
-
const EXTENSION_REQUEST_OID = '1.2.840.113549.1.9.14';
|
|
20
|
-
const COMMON_NAME_OID = '2.5.4.3';
|
|
21
|
-
const ED25519_OID = '1.3.101.112';
|
|
22
|
-
const CSR_PEM_TAG = 'CERTIFICATE REQUEST';
|
|
23
|
-
const LOGICAL_URI_PREFIX = 'naylence://';
|
|
24
16
|
function normalizeDefaultCryptoProviderOptions(options) {
|
|
25
17
|
if (!options) {
|
|
26
18
|
return {};
|
|
@@ -286,76 +278,6 @@ export class DefaultCryptoProvider {
|
|
|
286
278
|
has_chain: Boolean(certificateChainPem),
|
|
287
279
|
});
|
|
288
280
|
}
|
|
289
|
-
async createCsr(nodeId, physicalPath, logicals, subjectName) {
|
|
290
|
-
const trimmedNodeId = assertNonEmptyString(nodeId, 'nodeId');
|
|
291
|
-
const trimmedPhysicalPath = assertNonEmptyString(physicalPath, 'physicalPath');
|
|
292
|
-
try {
|
|
293
|
-
if (this.artifacts.signing.algorithm !== 'EdDSA') {
|
|
294
|
-
throw new Error('CSR creation only supported for Ed25519 signing keys in the default crypto provider');
|
|
295
|
-
}
|
|
296
|
-
const cryptoImpl = await ensureWebCrypto();
|
|
297
|
-
const privateKey = await cryptoImpl.subtle.importKey('pkcs8', pemToArrayBuffer(this.signingPrivatePem), {
|
|
298
|
-
name: 'Ed25519',
|
|
299
|
-
}, false, ['sign']);
|
|
300
|
-
const publicKeyDer = pemToArrayBuffer(this.signingPublicPem);
|
|
301
|
-
const subjectPkInfo = AsnConvert.parse(publicKeyDer, SubjectPublicKeyInfo);
|
|
302
|
-
const sanitizedLogicals = Array.isArray(logicals)
|
|
303
|
-
? logicals.filter((value) => typeof value === 'string' && value.trim().length > 0)
|
|
304
|
-
: [];
|
|
305
|
-
const commonName = typeof subjectName === 'string' && subjectName.trim().length > 0
|
|
306
|
-
? subjectName.trim()
|
|
307
|
-
: trimmedNodeId;
|
|
308
|
-
const subject = buildSubjectName(commonName);
|
|
309
|
-
const attributes = new Attributes();
|
|
310
|
-
if (sanitizedLogicals.length > 0) {
|
|
311
|
-
const san = new SubjectAlternativeName(sanitizedLogicals.map((logical) => new GeneralName({
|
|
312
|
-
uniformResourceIdentifier: `${LOGICAL_URI_PREFIX}${logical}`,
|
|
313
|
-
})));
|
|
314
|
-
const extensions = new Extensions([
|
|
315
|
-
new Extension({
|
|
316
|
-
extnID: id_ce_subjectAltName,
|
|
317
|
-
critical: false,
|
|
318
|
-
extnValue: new OctetString(AsnConvert.serialize(san)),
|
|
319
|
-
}),
|
|
320
|
-
]);
|
|
321
|
-
attributes.push(new Attribute({
|
|
322
|
-
type: EXTENSION_REQUEST_OID,
|
|
323
|
-
values: [AsnConvert.serialize(extensions)],
|
|
324
|
-
}));
|
|
325
|
-
}
|
|
326
|
-
const requestInfo = new CertificationRequestInfo({
|
|
327
|
-
subject,
|
|
328
|
-
subjectPKInfo: subjectPkInfo,
|
|
329
|
-
attributes,
|
|
330
|
-
});
|
|
331
|
-
const requestInfoDer = AsnConvert.serialize(requestInfo);
|
|
332
|
-
const signature = await cryptoImpl.subtle.sign('Ed25519', privateKey, requestInfoDer);
|
|
333
|
-
const certificationRequest = new CertificationRequest({
|
|
334
|
-
certificationRequestInfo: requestInfo,
|
|
335
|
-
signatureAlgorithm: new AlgorithmIdentifier({
|
|
336
|
-
algorithm: ED25519_OID,
|
|
337
|
-
}),
|
|
338
|
-
signature: encodeBitString(signature),
|
|
339
|
-
});
|
|
340
|
-
certificationRequest.certificationRequestInfoRaw = requestInfoDer;
|
|
341
|
-
const csrDer = AsnConvert.serialize(certificationRequest);
|
|
342
|
-
const csrPem = arrayBufferToPem(csrDer, CSR_PEM_TAG);
|
|
343
|
-
logger.debug('csr_created', {
|
|
344
|
-
node_id: trimmedNodeId,
|
|
345
|
-
physical_path: trimmedPhysicalPath,
|
|
346
|
-
logical_count: sanitizedLogicals.length,
|
|
347
|
-
});
|
|
348
|
-
return csrPem;
|
|
349
|
-
}
|
|
350
|
-
catch (error) {
|
|
351
|
-
logger.error('csr_creation_failed', {
|
|
352
|
-
node_id: trimmedNodeId,
|
|
353
|
-
physical_path: trimmedPhysicalPath,
|
|
354
|
-
error: error instanceof Error ? error.message : String(error),
|
|
355
|
-
});
|
|
356
|
-
throw error;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
281
|
}
|
|
360
282
|
async function buildProviderArtifacts(options) {
|
|
361
283
|
const algorithm = normalizeAlgorithm(options.algorithm ?? readEnvAlgorithm());
|
|
@@ -591,90 +513,6 @@ function pemToDerBase64(pem) {
|
|
|
591
513
|
// Ensure the output is valid base64 without whitespace
|
|
592
514
|
return base64.replace(/\s+/g, '');
|
|
593
515
|
}
|
|
594
|
-
let cryptoPromise = null;
|
|
595
|
-
async function ensureWebCrypto() {
|
|
596
|
-
if (typeof globalThis.crypto !== 'undefined' && globalThis.crypto?.subtle) {
|
|
597
|
-
return globalThis.crypto;
|
|
598
|
-
}
|
|
599
|
-
if (!cryptoPromise) {
|
|
600
|
-
if (typeof process !== 'undefined' &&
|
|
601
|
-
typeof process.versions?.node === 'string') {
|
|
602
|
-
cryptoPromise = import('node:crypto').then((module) => {
|
|
603
|
-
const webcrypto = module.webcrypto;
|
|
604
|
-
if (!webcrypto || !webcrypto.subtle) {
|
|
605
|
-
throw new Error('WebCrypto API is not available in this Node.js runtime');
|
|
606
|
-
}
|
|
607
|
-
globalThis.crypto = webcrypto;
|
|
608
|
-
return webcrypto;
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
else {
|
|
612
|
-
cryptoPromise = Promise.reject(new Error('WebCrypto API is not available in this environment'));
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
return cryptoPromise;
|
|
616
|
-
}
|
|
617
|
-
function pemToArrayBuffer(pem) {
|
|
618
|
-
const normalized = pem
|
|
619
|
-
.replace(/-----BEGIN[^-]+-----/g, '')
|
|
620
|
-
.replace(/-----END[^-]+-----/g, '')
|
|
621
|
-
.replace(/\s+/g, '');
|
|
622
|
-
const bytes = base64ToBytes(normalized);
|
|
623
|
-
return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
|
|
624
|
-
}
|
|
625
|
-
function base64ToBytes(base64) {
|
|
626
|
-
if (typeof Buffer !== 'undefined') {
|
|
627
|
-
const buffer = Buffer.from(base64, 'base64');
|
|
628
|
-
const bytes = new Uint8Array(buffer.length);
|
|
629
|
-
for (let i = 0; i < buffer.length; i += 1) {
|
|
630
|
-
bytes[i] = buffer[i];
|
|
631
|
-
}
|
|
632
|
-
return bytes;
|
|
633
|
-
}
|
|
634
|
-
if (typeof atob === 'function') {
|
|
635
|
-
const binary = atob(base64);
|
|
636
|
-
const bytes = new Uint8Array(binary.length);
|
|
637
|
-
for (let i = 0; i < binary.length; i += 1) {
|
|
638
|
-
bytes[i] = binary.charCodeAt(i);
|
|
639
|
-
}
|
|
640
|
-
return bytes;
|
|
641
|
-
}
|
|
642
|
-
throw new Error('No base64 decoder available in this environment');
|
|
643
|
-
}
|
|
644
|
-
function arrayBufferToPem(buffer, tag) {
|
|
645
|
-
const base64 = bytesToBase64(new Uint8Array(buffer));
|
|
646
|
-
return `-----BEGIN ${tag}-----\n${formatPem(base64)}\n-----END ${tag}-----\n`;
|
|
647
|
-
}
|
|
648
|
-
function formatPem(base64) {
|
|
649
|
-
const lines = [];
|
|
650
|
-
for (let i = 0; i < base64.length; i += 64) {
|
|
651
|
-
lines.push(base64.slice(i, i + 64));
|
|
652
|
-
}
|
|
653
|
-
return lines.join('\n');
|
|
654
|
-
}
|
|
655
|
-
function encodeBitString(signature) {
|
|
656
|
-
const bytes = new Uint8Array(signature);
|
|
657
|
-
const bitString = new Uint8Array(bytes.length + 1);
|
|
658
|
-
bitString.set(bytes, 1);
|
|
659
|
-
return bitString.buffer;
|
|
660
|
-
}
|
|
661
|
-
function buildSubjectName(commonName) {
|
|
662
|
-
const attribute = new AttributeTypeAndValue({
|
|
663
|
-
type: COMMON_NAME_OID,
|
|
664
|
-
value: new AttributeValue({ utf8String: commonName }),
|
|
665
|
-
});
|
|
666
|
-
return new Name([new RelativeDistinguishedName([attribute])]);
|
|
667
|
-
}
|
|
668
|
-
function assertNonEmptyString(value, name) {
|
|
669
|
-
if (typeof value !== 'string') {
|
|
670
|
-
throw new TypeError(`${name} must be a string`);
|
|
671
|
-
}
|
|
672
|
-
const trimmed = value.trim();
|
|
673
|
-
if (trimmed.length === 0) {
|
|
674
|
-
throw new TypeError(`${name} must be a non-empty string`);
|
|
675
|
-
}
|
|
676
|
-
return trimmed;
|
|
677
|
-
}
|
|
678
516
|
function cloneJson(value) {
|
|
679
517
|
return JSON.parse(JSON.stringify(value));
|
|
680
518
|
}
|
|
@@ -4,15 +4,25 @@ import { safeImport } from '../util/lazy-import.js';
|
|
|
4
4
|
import { TRACE_EMITTER_FACTORY_BASE_TYPE, TraceEmitterFactory, } from './trace-emitter-factory.js';
|
|
5
5
|
import { getLogger } from '../util/logging.js';
|
|
6
6
|
let openTelemetryTraceEmitterModulePromise = null;
|
|
7
|
+
let otelApiModulePromise = null;
|
|
7
8
|
const logger = getLogger('naylence.fame.telemetry.open_telemetry_trace_emitter_factory');
|
|
9
|
+
const MISSING_OTEL_HELP_MESSAGE = 'Missing optional OpenTelemetry dependency. Install @opentelemetry/api (and related packages) to enable trace emission.';
|
|
8
10
|
function getOpenTelemetryTraceEmitterModule() {
|
|
9
11
|
if (!openTelemetryTraceEmitterModulePromise) {
|
|
10
12
|
openTelemetryTraceEmitterModulePromise = safeImport(() => import('./open-telemetry-trace-emitter.js'), '@opentelemetry/api', {
|
|
11
|
-
helpMessage:
|
|
13
|
+
helpMessage: MISSING_OTEL_HELP_MESSAGE,
|
|
12
14
|
});
|
|
13
15
|
}
|
|
14
16
|
return openTelemetryTraceEmitterModulePromise;
|
|
15
17
|
}
|
|
18
|
+
function getOtelApiModule() {
|
|
19
|
+
if (!otelApiModulePromise) {
|
|
20
|
+
otelApiModulePromise = safeImport(() => import('@opentelemetry/api'), '@opentelemetry/api', {
|
|
21
|
+
helpMessage: MISSING_OTEL_HELP_MESSAGE,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return otelApiModulePromise;
|
|
25
|
+
}
|
|
16
26
|
export const FACTORY_META = {
|
|
17
27
|
base: TRACE_EMITTER_FACTORY_BASE_TYPE,
|
|
18
28
|
key: 'OpenTelemetryTraceEmitter',
|
|
@@ -75,9 +85,16 @@ export class OpenTelemetryTraceEmitterFactory extends TraceEmitterFactory {
|
|
|
75
85
|
}
|
|
76
86
|
throw error;
|
|
77
87
|
}
|
|
78
|
-
const { OpenTelemetryTraceEmitter } = await
|
|
88
|
+
const [{ OpenTelemetryTraceEmitter }, otelModule] = await Promise.all([
|
|
89
|
+
getOpenTelemetryTraceEmitterModule(),
|
|
90
|
+
getOtelApiModule(),
|
|
91
|
+
]);
|
|
79
92
|
const emitterOptions = {
|
|
80
93
|
serviceName: normalized.serviceName,
|
|
94
|
+
otelApi: {
|
|
95
|
+
trace: otelModule.trace,
|
|
96
|
+
SpanStatusCode: otelModule.SpanStatusCode,
|
|
97
|
+
},
|
|
81
98
|
};
|
|
82
99
|
if (options.tracer) {
|
|
83
100
|
emitterOptions.tracer = options.tracer;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SpanStatusCode, trace } from '@opentelemetry/api';
|
|
2
1
|
import { BaseTraceEmitter } from './base-trace-emitter.js';
|
|
3
2
|
import { resetOtelSpanId, resetOtelTraceId, setOtelSpanId, setOtelTraceId, } from './otel-context.js';
|
|
4
3
|
class OpenTelemetryTraceSpan {
|
|
5
|
-
constructor(span) {
|
|
4
|
+
constructor(span, api) {
|
|
6
5
|
this.span = span;
|
|
6
|
+
this.api = api;
|
|
7
7
|
}
|
|
8
8
|
setAttribute(key, value) {
|
|
9
9
|
try {
|
|
@@ -29,7 +29,7 @@ class OpenTelemetryTraceSpan {
|
|
|
29
29
|
setStatusError(description) {
|
|
30
30
|
try {
|
|
31
31
|
const status = {
|
|
32
|
-
code: SpanStatusCode.ERROR,
|
|
32
|
+
code: this.api.SpanStatusCode.ERROR,
|
|
33
33
|
};
|
|
34
34
|
if (description !== undefined) {
|
|
35
35
|
status.message = description;
|
|
@@ -42,10 +42,10 @@ class OpenTelemetryTraceSpan {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
class OpenTelemetrySpanScope {
|
|
45
|
-
constructor(span) {
|
|
45
|
+
constructor(span, api) {
|
|
46
46
|
this.span = span;
|
|
47
47
|
this.entered = false;
|
|
48
|
-
this.wrapper = new OpenTelemetryTraceSpan(span);
|
|
48
|
+
this.wrapper = new OpenTelemetryTraceSpan(span, api);
|
|
49
49
|
}
|
|
50
50
|
enter() {
|
|
51
51
|
if (!this.entered) {
|
|
@@ -80,7 +80,9 @@ export class OpenTelemetryTraceEmitter extends BaseTraceEmitter {
|
|
|
80
80
|
super();
|
|
81
81
|
this.shutdownInvoked = false;
|
|
82
82
|
const normalized = normalizeOpenTelemetryTraceEmitterOptions(options);
|
|
83
|
-
this.
|
|
83
|
+
this.otelApi = normalized.otelApi;
|
|
84
|
+
this.tracer =
|
|
85
|
+
normalized.tracer ?? this.otelApi.trace.getTracer(normalized.serviceName);
|
|
84
86
|
this.lifecycle = normalized.lifecycle ?? null;
|
|
85
87
|
this.authStrategy = normalized.authStrategy ?? null;
|
|
86
88
|
}
|
|
@@ -98,7 +100,7 @@ export class OpenTelemetryTraceEmitter extends BaseTraceEmitter {
|
|
|
98
100
|
if (typeof envelopeTraceId === 'string') {
|
|
99
101
|
this.applyEnvelopeTraceId(span, envelopeTraceId);
|
|
100
102
|
}
|
|
101
|
-
return new OpenTelemetrySpanScope(span);
|
|
103
|
+
return new OpenTelemetrySpanScope(span, this.otelApi);
|
|
102
104
|
}
|
|
103
105
|
async flush() {
|
|
104
106
|
if (this.lifecycle?.forceFlush) {
|
|
@@ -111,7 +113,7 @@ export class OpenTelemetryTraceEmitter extends BaseTraceEmitter {
|
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
try {
|
|
114
|
-
const provider = trace.getTracerProvider();
|
|
116
|
+
const provider = this.otelApi.trace.getTracerProvider();
|
|
115
117
|
if (provider && typeof provider.forceFlush === 'function') {
|
|
116
118
|
await provider.forceFlush();
|
|
117
119
|
}
|
|
@@ -146,7 +148,7 @@ export class OpenTelemetryTraceEmitter extends BaseTraceEmitter {
|
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
try {
|
|
149
|
-
const provider = trace.getTracerProvider();
|
|
151
|
+
const provider = this.otelApi.trace.getTracerProvider();
|
|
150
152
|
if (provider && typeof provider.shutdown === 'function') {
|
|
151
153
|
await provider.shutdown();
|
|
152
154
|
}
|
|
@@ -187,6 +189,13 @@ function normalizeOpenTelemetryTraceEmitterOptions(input) {
|
|
|
187
189
|
const source = (input ?? {});
|
|
188
190
|
const serviceName = extractNonEmptyString(pickFirst(source, ['serviceName', 'service_name'])) ?? 'naylence-service';
|
|
189
191
|
const tracer = pickFirst(source, ['tracer']);
|
|
192
|
+
const otelApi = pickFirst(source, [
|
|
193
|
+
'otelApi',
|
|
194
|
+
'otel_api',
|
|
195
|
+
]);
|
|
196
|
+
if (!otelApi) {
|
|
197
|
+
throw new Error('OpenTelemetryTraceEmitter requires OpenTelemetry API bindings. Provide otelApi via options.');
|
|
198
|
+
}
|
|
190
199
|
const lifecycle = pickFirst(source, [
|
|
191
200
|
'lifecycle',
|
|
192
201
|
'lifeCycle',
|
|
@@ -199,6 +208,7 @@ function normalizeOpenTelemetryTraceEmitterOptions(input) {
|
|
|
199
208
|
return {
|
|
200
209
|
serviceName,
|
|
201
210
|
tracer,
|
|
211
|
+
otelApi,
|
|
202
212
|
lifecycle,
|
|
203
213
|
authStrategy,
|
|
204
214
|
};
|
|
@@ -8,6 +8,9 @@ const NODE_ONLY_FACTORY_MODULES = new Set([
|
|
|
8
8
|
'./telemetry/open-telemetry-trace-emitter-factory.js',
|
|
9
9
|
'./security/credential/prompt-credential-provider-factory.js',
|
|
10
10
|
]);
|
|
11
|
+
const BROWSER_ONLY_FACTORY_MODULES = new Set([
|
|
12
|
+
'./security/auth/oauth2-pkce-token-provider-factory.js',
|
|
13
|
+
]);
|
|
11
14
|
const isNodeEnvironment = typeof process !== 'undefined' && Boolean(process?.versions?.node);
|
|
12
15
|
function detectModuleUrl() {
|
|
13
16
|
// Prefer Node-friendly __filename when available.
|
|
@@ -150,6 +153,9 @@ async function performRegistration(registry) {
|
|
|
150
153
|
if (!isNodeEnvironment && NODE_ONLY_FACTORY_MODULES.has(spec)) {
|
|
151
154
|
return;
|
|
152
155
|
}
|
|
156
|
+
if (isNodeEnvironment && BROWSER_ONLY_FACTORY_MODULES.has(spec)) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
153
159
|
try {
|
|
154
160
|
let mod;
|
|
155
161
|
let lastError;
|
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.913
|
|
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.913';
|