axiam-sdk 1.0.0-alpha21 → 1.0.0-alpha24
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/README.md +93 -2
- package/dist/{authzCore-DuRI1aJf.d.cts → authzCore-CA9zFm1n.d.cts} +38 -4
- package/dist/{authzCore-DtSN59if.d.ts → authzCore-a-wZL2P3.d.ts} +38 -4
- package/dist/{client-B_FqmZ0i.d.cts → client-CtT9nHQP.d.cts} +1 -1
- package/dist/{client-Dn1fs5MH.d.ts → client-utwuwc9m.d.ts} +1 -1
- package/dist/{cookieJar-Cl8Lq9dL.d.ts → cookieJar-C9fqLqbh.d.ts} +29 -6
- package/dist/{cookieJar-BTDnjjbL.d.cts → cookieJar-DeJKczxD.d.cts} +29 -6
- package/dist/grpc/index.d.cts +5 -5
- package/dist/grpc/index.d.ts +5 -5
- package/dist/grpc/index.js +81 -14
- package/dist/grpc/index.js.map +1 -1
- package/dist/grpc/index.mjs +81 -14
- package/dist/grpc/index.mjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +32 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -7
- package/dist/index.mjs.map +1 -1
- package/dist/{jwks-BgojMGC5.d.cts → jwks-DEiwxlku.d.cts} +84 -3
- package/dist/{jwks-BgojMGC5.d.ts → jwks-DEiwxlku.d.ts} +84 -3
- package/dist/middleware/index.d.cts +6 -6
- package/dist/middleware/index.d.ts +6 -6
- package/dist/middleware/index.js +177 -138
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware/index.mjs +176 -139
- package/dist/middleware/index.mjs.map +1 -1
- package/dist/nestjs/index.d.cts +2 -2
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/node/index.d.cts +94 -6
- package/dist/node/index.d.ts +94 -6
- package/dist/node/index.js +183 -16
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +179 -18
- package/dist/node/index.mjs.map +1 -1
- package/dist/{oidcState-CkFuCjpM.d.ts → oidcState-CfebuJ0n.d.ts} +2 -2
- package/dist/{oidcState-BGxqWUun.d.cts → oidcState-tHRAg5bu.d.cts} +2 -2
- package/dist/rest/index.d.cts +2 -2
- package/dist/rest/index.d.ts +2 -2
- package/dist/rest/index.js +32 -7
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/index.mjs +32 -7
- package/dist/rest/index.mjs.map +1 -1
- package/dist/{session-BWUWhhyB.d.cts → session-ti3C9ZJU.d.cts} +28 -1
- package/dist/{session-BWUWhhyB.d.ts → session-ti3C9ZJU.d.ts} +28 -1
- package/package.json +2 -2
|
@@ -400,24 +400,190 @@ async function completeOidcLogin(options, query) {
|
|
|
400
400
|
}
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
|
+
var MAX_CLOCK_SKEW_SEC = 60;
|
|
404
|
+
function idTokenAuthError(reason, message) {
|
|
405
|
+
return new AuthError(`id_token validation failed (${reason}): ${message}`, reason);
|
|
406
|
+
}
|
|
407
|
+
function resolveClockSkewSec(clockSkewSec) {
|
|
408
|
+
if (clockSkewSec === void 0) {
|
|
409
|
+
return MAX_CLOCK_SKEW_SEC;
|
|
410
|
+
}
|
|
411
|
+
return Math.min(Math.max(clockSkewSec, 0), MAX_CLOCK_SKEW_SEC);
|
|
412
|
+
}
|
|
413
|
+
function constantTimeEquals(a, b) {
|
|
414
|
+
const left = Buffer.from(a, "utf8");
|
|
415
|
+
const right = Buffer.from(b, "utf8");
|
|
416
|
+
if (left.length !== right.length) {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
return timingSafeEqual(left, right);
|
|
420
|
+
}
|
|
421
|
+
var ID_TOKEN_ALG = "EdDSA";
|
|
422
|
+
function assertIdTokenAlg(alg) {
|
|
423
|
+
if (alg !== ID_TOKEN_ALG) {
|
|
424
|
+
throw idTokenAuthError(
|
|
425
|
+
"invalid_alg",
|
|
426
|
+
`expected alg "${ID_TOKEN_ALG}", got ${typeof alg === "string" ? `"${alg}"` : "no alg header"}`
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function checkIdTokenClaims(claims, expectations, nowSec = Math.floor(Date.now() / 1e3)) {
|
|
431
|
+
const skew = resolveClockSkewSec(expectations.clockSkewSec);
|
|
432
|
+
if (claims.iss !== expectations.issuer) {
|
|
433
|
+
throw idTokenAuthError("invalid_issuer", "iss does not equal the discovery document issuer");
|
|
434
|
+
}
|
|
435
|
+
const audiences = Array.isArray(claims.aud) ? claims.aud : [claims.aud];
|
|
436
|
+
if (!audiences.includes(expectations.clientId)) {
|
|
437
|
+
throw idTokenAuthError("invalid_audience", "aud does not contain this client_id");
|
|
438
|
+
}
|
|
439
|
+
if (audiences.length > 1 && claims.azp !== expectations.clientId) {
|
|
440
|
+
throw idTokenAuthError(
|
|
441
|
+
"invalid_audience",
|
|
442
|
+
"aud holds multiple audiences and azp is absent or does not equal this client_id"
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
if (typeof claims.exp !== "number") {
|
|
446
|
+
throw idTokenAuthError("token_expired", "exp claim is missing or not a number");
|
|
447
|
+
}
|
|
448
|
+
if (claims.exp + skew <= nowSec) {
|
|
449
|
+
throw idTokenAuthError("token_expired", "exp is in the past");
|
|
450
|
+
}
|
|
451
|
+
if (typeof claims.iat !== "number") {
|
|
452
|
+
throw idTokenAuthError("token_expired", "iat claim is missing or not a number");
|
|
453
|
+
}
|
|
454
|
+
if (claims.iat - skew > nowSec) {
|
|
455
|
+
throw idTokenAuthError("token_expired", "iat is in the future");
|
|
456
|
+
}
|
|
457
|
+
if (typeof claims.nbf === "number" && claims.nbf - skew > nowSec) {
|
|
458
|
+
throw idTokenAuthError("token_expired", "nbf is in the future");
|
|
459
|
+
}
|
|
460
|
+
if (expectations.nonce !== void 0) {
|
|
461
|
+
if (typeof claims.nonce !== "string" || !constantTimeEquals(claims.nonce, expectations.nonce)) {
|
|
462
|
+
throw idTokenAuthError("nonce_mismatch", "nonce claim is absent or does not match the request nonce");
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return claims;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// src/node/jwks.ts
|
|
469
|
+
var COOLDOWN_DURATION_MS = 6e4;
|
|
470
|
+
var TIMEOUT_DURATION_MS = 5e3;
|
|
471
|
+
var CLOCK_SKEW_LEEWAY_SEC = 60;
|
|
472
|
+
function createJwksVerifier(jwksUri) {
|
|
473
|
+
let jwksPromise = null;
|
|
474
|
+
async function getJwks() {
|
|
475
|
+
if (!jwksPromise) {
|
|
476
|
+
jwksPromise = import('jose').then(
|
|
477
|
+
({ createRemoteJWKSet }) => createRemoteJWKSet(new URL(jwksUri), {
|
|
478
|
+
cooldownDuration: COOLDOWN_DURATION_MS,
|
|
479
|
+
timeoutDuration: TIMEOUT_DURATION_MS
|
|
480
|
+
})
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
return jwksPromise;
|
|
484
|
+
}
|
|
485
|
+
return {
|
|
486
|
+
async verifyAccessToken(token, expectations) {
|
|
487
|
+
const { jwtVerify } = await import('jose');
|
|
488
|
+
const jwks = await getJwks();
|
|
489
|
+
const { payload } = await jwtVerify(token, jwks, {
|
|
490
|
+
algorithms: ["EdDSA"],
|
|
491
|
+
requiredClaims: ["exp"],
|
|
492
|
+
clockTolerance: CLOCK_SKEW_LEEWAY_SEC,
|
|
493
|
+
...expectations.expectedIssuer !== void 0 ? { issuer: expectations.expectedIssuer } : {},
|
|
494
|
+
...expectations.expectedAudience !== void 0 ? { audience: expectations.expectedAudience } : {}
|
|
495
|
+
});
|
|
496
|
+
assertTenantClaim(payload.tenant_id, expectations.expectedTenantId);
|
|
497
|
+
return payload;
|
|
498
|
+
},
|
|
499
|
+
async verifySignatureOnlyUnchecked(token) {
|
|
500
|
+
const { jwtVerify } = await import('jose');
|
|
501
|
+
const jwks = await getJwks();
|
|
502
|
+
const { payload } = await jwtVerify(token, jwks, { algorithms: ["EdDSA"] });
|
|
503
|
+
return payload;
|
|
504
|
+
},
|
|
505
|
+
async verifyIdToken(token, expectations) {
|
|
506
|
+
const { decodeProtectedHeader, jwtVerify } = await import('jose');
|
|
507
|
+
let header;
|
|
508
|
+
try {
|
|
509
|
+
header = decodeProtectedHeader(token);
|
|
510
|
+
} catch {
|
|
511
|
+
throw idTokenAuthError("invalid_alg", "token is not a well-formed JWS");
|
|
512
|
+
}
|
|
513
|
+
assertIdTokenAlg(header.alg);
|
|
514
|
+
if (!header.kid) {
|
|
515
|
+
throw idTokenAuthError("unknown_kid", "token carries no kid header");
|
|
516
|
+
}
|
|
517
|
+
const jwks = await getJwks();
|
|
518
|
+
const skew = resolveClockSkewSec(expectations.clockSkewSec);
|
|
519
|
+
let claims;
|
|
520
|
+
try {
|
|
521
|
+
const { payload } = await jwtVerify(token, jwks, {
|
|
522
|
+
algorithms: [ID_TOKEN_ALG],
|
|
523
|
+
clockTolerance: skew
|
|
524
|
+
});
|
|
525
|
+
claims = payload;
|
|
526
|
+
} catch (err) {
|
|
527
|
+
throw mapJoseVerifyError(err);
|
|
528
|
+
}
|
|
529
|
+
return checkIdTokenClaims(claims, { ...expectations, clockSkewSec: skew });
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
function assertTenantClaim(claim, expected) {
|
|
534
|
+
if (typeof expected !== "string" || expected === "") {
|
|
535
|
+
throw new AuthError(
|
|
536
|
+
"no configured tenant to verify the token against; refusing the request (CONTRACT.md \xA710.1 rule 4 fails closed)"
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
if (typeof claim !== "string" || claim === "") {
|
|
540
|
+
throw new AuthError("invalid tenant_id claim");
|
|
541
|
+
}
|
|
542
|
+
if (claim !== expected) {
|
|
543
|
+
warnOnceIfComparandLooksLikeASlug(claim, expected);
|
|
544
|
+
throw new AuthError("token tenant_id does not match configured tenant");
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
548
|
+
var slugComparandWarned = false;
|
|
549
|
+
function warnOnceIfComparandLooksLikeASlug(claim, expected) {
|
|
550
|
+
if (slugComparandWarned) return;
|
|
551
|
+
if (!UUID_RE.test(claim) || UUID_RE.test(expected)) return;
|
|
552
|
+
slugComparandWarned = true;
|
|
553
|
+
console.warn(
|
|
554
|
+
`AXIAM: the tenant this guard was configured with ("${expected}") is not a UUID, but access tokens carry the tenant UUID in their \`tenant_id\` claim, so this guard will reject every request. Configure it with the tenant UUID, not the slug. (CONTRACT.md \xA710.1 rule 4; logged once per process, and it does not affect the rejection itself.)`
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
function mapJoseVerifyError(err) {
|
|
558
|
+
const code = typeof err === "object" && err !== null && "code" in err ? String(err.code) : "";
|
|
559
|
+
switch (code) {
|
|
560
|
+
case "ERR_JWKS_NO_MATCHING_KEY":
|
|
561
|
+
return idTokenAuthError("unknown_kid", "no JWKS key matches the token kid");
|
|
562
|
+
case "ERR_JWT_EXPIRED":
|
|
563
|
+
return idTokenAuthError("token_expired", "exp is in the past");
|
|
564
|
+
case "ERR_JWT_CLAIM_VALIDATION_FAILED":
|
|
565
|
+
return idTokenAuthError("token_expired", "a time-based claim (nbf/iat) is not yet valid");
|
|
566
|
+
default:
|
|
567
|
+
return idTokenAuthError("invalid_signature", "signature verification failed");
|
|
568
|
+
}
|
|
569
|
+
}
|
|
403
570
|
|
|
404
571
|
// src/middleware/verifyCore.ts
|
|
405
572
|
async function authenticateRequest(session, token) {
|
|
406
573
|
let claims;
|
|
407
574
|
try {
|
|
408
|
-
claims = await session.jwksVerifier.verifyAccessToken(token
|
|
575
|
+
claims = await session.jwksVerifier.verifyAccessToken(token, {
|
|
576
|
+
expectedTenantId: session.tenantHeaderValue,
|
|
577
|
+
expectedIssuer: session.expectedIssuer,
|
|
578
|
+
expectedAudience: session.expectedAudience
|
|
579
|
+
});
|
|
409
580
|
} catch (err) {
|
|
410
581
|
throw new AuthError(err instanceof Error ? err.message : "invalid or expired token");
|
|
411
582
|
}
|
|
412
583
|
if (!claims.sub) {
|
|
413
584
|
throw new AuthError("invalid sub claim");
|
|
414
585
|
}
|
|
415
|
-
|
|
416
|
-
throw new AuthError("invalid tenant_id claim");
|
|
417
|
-
}
|
|
418
|
-
if (claims.tenant_id !== session.tenantHeaderValue) {
|
|
419
|
-
throw new AuthError("token tenant_id does not match configured tenant");
|
|
420
|
-
}
|
|
586
|
+
assertTenantClaim(claims.tenant_id, session.tenantHeaderValue);
|
|
421
587
|
const roles = (claims.scope ?? "").split(" ").filter(Boolean);
|
|
422
588
|
return {
|
|
423
589
|
userId: claims.sub,
|
|
@@ -686,135 +852,6 @@ var oidcLoginPlugin = (options) => {
|
|
|
686
852
|
plugin[/* @__PURE__ */ Symbol.for("fastify.display-name")] = "axiam-oidc-login";
|
|
687
853
|
return plugin;
|
|
688
854
|
};
|
|
689
|
-
var MAX_CLOCK_SKEW_SEC = 60;
|
|
690
|
-
function idTokenAuthError(reason, message) {
|
|
691
|
-
return new AuthError(`id_token validation failed (${reason}): ${message}`, reason);
|
|
692
|
-
}
|
|
693
|
-
function resolveClockSkewSec(clockSkewSec) {
|
|
694
|
-
if (clockSkewSec === void 0) {
|
|
695
|
-
return MAX_CLOCK_SKEW_SEC;
|
|
696
|
-
}
|
|
697
|
-
return Math.min(Math.max(clockSkewSec, 0), MAX_CLOCK_SKEW_SEC);
|
|
698
|
-
}
|
|
699
|
-
function constantTimeEquals(a, b) {
|
|
700
|
-
const left = Buffer.from(a, "utf8");
|
|
701
|
-
const right = Buffer.from(b, "utf8");
|
|
702
|
-
if (left.length !== right.length) {
|
|
703
|
-
return false;
|
|
704
|
-
}
|
|
705
|
-
return timingSafeEqual(left, right);
|
|
706
|
-
}
|
|
707
|
-
var ID_TOKEN_ALG = "EdDSA";
|
|
708
|
-
function assertIdTokenAlg(alg) {
|
|
709
|
-
if (alg !== ID_TOKEN_ALG) {
|
|
710
|
-
throw idTokenAuthError(
|
|
711
|
-
"invalid_alg",
|
|
712
|
-
`expected alg "${ID_TOKEN_ALG}", got ${typeof alg === "string" ? `"${alg}"` : "no alg header"}`
|
|
713
|
-
);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
function checkIdTokenClaims(claims, expectations, nowSec = Math.floor(Date.now() / 1e3)) {
|
|
717
|
-
const skew = resolveClockSkewSec(expectations.clockSkewSec);
|
|
718
|
-
if (claims.iss !== expectations.issuer) {
|
|
719
|
-
throw idTokenAuthError("invalid_issuer", "iss does not equal the discovery document issuer");
|
|
720
|
-
}
|
|
721
|
-
const audiences = Array.isArray(claims.aud) ? claims.aud : [claims.aud];
|
|
722
|
-
if (!audiences.includes(expectations.clientId)) {
|
|
723
|
-
throw idTokenAuthError("invalid_audience", "aud does not contain this client_id");
|
|
724
|
-
}
|
|
725
|
-
if (audiences.length > 1 && claims.azp !== expectations.clientId) {
|
|
726
|
-
throw idTokenAuthError(
|
|
727
|
-
"invalid_audience",
|
|
728
|
-
"aud holds multiple audiences and azp is absent or does not equal this client_id"
|
|
729
|
-
);
|
|
730
|
-
}
|
|
731
|
-
if (typeof claims.exp !== "number") {
|
|
732
|
-
throw idTokenAuthError("token_expired", "exp claim is missing or not a number");
|
|
733
|
-
}
|
|
734
|
-
if (claims.exp + skew <= nowSec) {
|
|
735
|
-
throw idTokenAuthError("token_expired", "exp is in the past");
|
|
736
|
-
}
|
|
737
|
-
if (typeof claims.iat !== "number") {
|
|
738
|
-
throw idTokenAuthError("token_expired", "iat claim is missing or not a number");
|
|
739
|
-
}
|
|
740
|
-
if (claims.iat - skew > nowSec) {
|
|
741
|
-
throw idTokenAuthError("token_expired", "iat is in the future");
|
|
742
|
-
}
|
|
743
|
-
if (typeof claims.nbf === "number" && claims.nbf - skew > nowSec) {
|
|
744
|
-
throw idTokenAuthError("token_expired", "nbf is in the future");
|
|
745
|
-
}
|
|
746
|
-
if (expectations.nonce !== void 0) {
|
|
747
|
-
if (typeof claims.nonce !== "string" || !constantTimeEquals(claims.nonce, expectations.nonce)) {
|
|
748
|
-
throw idTokenAuthError("nonce_mismatch", "nonce claim is absent or does not match the request nonce");
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
return claims;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
// src/node/jwks.ts
|
|
755
|
-
var COOLDOWN_DURATION_MS = 6e4;
|
|
756
|
-
var TIMEOUT_DURATION_MS = 5e3;
|
|
757
|
-
function createJwksVerifier(jwksUri) {
|
|
758
|
-
let jwksPromise = null;
|
|
759
|
-
async function getJwks() {
|
|
760
|
-
if (!jwksPromise) {
|
|
761
|
-
jwksPromise = import('jose').then(
|
|
762
|
-
({ createRemoteJWKSet }) => createRemoteJWKSet(new URL(jwksUri), {
|
|
763
|
-
cooldownDuration: COOLDOWN_DURATION_MS,
|
|
764
|
-
timeoutDuration: TIMEOUT_DURATION_MS
|
|
765
|
-
})
|
|
766
|
-
);
|
|
767
|
-
}
|
|
768
|
-
return jwksPromise;
|
|
769
|
-
}
|
|
770
|
-
return {
|
|
771
|
-
async verifyAccessToken(token) {
|
|
772
|
-
const { jwtVerify } = await import('jose');
|
|
773
|
-
const jwks = await getJwks();
|
|
774
|
-
const { payload } = await jwtVerify(token, jwks, { algorithms: ["EdDSA"] });
|
|
775
|
-
return payload;
|
|
776
|
-
},
|
|
777
|
-
async verifyIdToken(token, expectations) {
|
|
778
|
-
const { decodeProtectedHeader, jwtVerify } = await import('jose');
|
|
779
|
-
let header;
|
|
780
|
-
try {
|
|
781
|
-
header = decodeProtectedHeader(token);
|
|
782
|
-
} catch {
|
|
783
|
-
throw idTokenAuthError("invalid_alg", "token is not a well-formed JWS");
|
|
784
|
-
}
|
|
785
|
-
assertIdTokenAlg(header.alg);
|
|
786
|
-
if (!header.kid) {
|
|
787
|
-
throw idTokenAuthError("unknown_kid", "token carries no kid header");
|
|
788
|
-
}
|
|
789
|
-
const jwks = await getJwks();
|
|
790
|
-
const skew = resolveClockSkewSec(expectations.clockSkewSec);
|
|
791
|
-
let claims;
|
|
792
|
-
try {
|
|
793
|
-
const { payload } = await jwtVerify(token, jwks, {
|
|
794
|
-
algorithms: [ID_TOKEN_ALG],
|
|
795
|
-
clockTolerance: skew
|
|
796
|
-
});
|
|
797
|
-
claims = payload;
|
|
798
|
-
} catch (err) {
|
|
799
|
-
throw mapJoseVerifyError(err);
|
|
800
|
-
}
|
|
801
|
-
return checkIdTokenClaims(claims, { ...expectations, clockSkewSec: skew });
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
}
|
|
805
|
-
function mapJoseVerifyError(err) {
|
|
806
|
-
const code = typeof err === "object" && err !== null && "code" in err ? String(err.code) : "";
|
|
807
|
-
switch (code) {
|
|
808
|
-
case "ERR_JWKS_NO_MATCHING_KEY":
|
|
809
|
-
return idTokenAuthError("unknown_kid", "no JWKS key matches the token kid");
|
|
810
|
-
case "ERR_JWT_EXPIRED":
|
|
811
|
-
return idTokenAuthError("token_expired", "exp is in the past");
|
|
812
|
-
case "ERR_JWT_CLAIM_VALIDATION_FAILED":
|
|
813
|
-
return idTokenAuthError("token_expired", "a time-based claim (nbf/iat) is not yet valid");
|
|
814
|
-
default:
|
|
815
|
-
return idTokenAuthError("invalid_signature", "signature verification failed");
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
855
|
var CODE_CHALLENGE_METHOD_S256 = "S256";
|
|
819
856
|
var CSPRNG_BYTES = 32;
|
|
820
857
|
function randomUrlSafeToken(bytes = CSPRNG_BYTES) {
|
|
@@ -843,7 +880,7 @@ var RESERVED_AUTHORIZE_PARAMS = /* @__PURE__ */ new Set([
|
|
|
843
880
|
"code_challenge",
|
|
844
881
|
"code_challenge_method"
|
|
845
882
|
]);
|
|
846
|
-
var
|
|
883
|
+
var UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
847
884
|
var DiscoveryCache = class {
|
|
848
885
|
#documents = /* @__PURE__ */ new Map();
|
|
849
886
|
#inFlight = /* @__PURE__ */ new Map();
|
|
@@ -1346,7 +1383,7 @@ var OidcClient = class {
|
|
|
1346
1383
|
"this operation requires a tenant_id UUID for the /oauth2 query parameter: pass tenantId explicitly, or construct the client with the tenantId (UUID) form (CONTRACT.md \xA712.3 rule 4)."
|
|
1347
1384
|
);
|
|
1348
1385
|
}
|
|
1349
|
-
if (!
|
|
1386
|
+
if (!UUID_RE2.test(candidate)) {
|
|
1350
1387
|
throw new AuthError(
|
|
1351
1388
|
"tenant_id must be a UUID for the /oauth2 query parameter; a tenant slug cannot be substituted (CONTRACT.md \xA712.3 rule 4)."
|
|
1352
1389
|
);
|
|
@@ -1494,6 +1531,6 @@ var MemoryOidcStateStore = class {
|
|
|
1494
1531
|
}
|
|
1495
1532
|
};
|
|
1496
1533
|
|
|
1497
|
-
export { ACCESS_COOKIE_NAME, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, MIN_DISCOVERY_TTL_MS, MemoryOidcStateStore, OIDC_STATE_TTL_MS, OidcClient, ResourceResolutionError, assertAuthzClient, authenticateRequest, axiamMiddleware, axiamPlugin, beginOidcLogin, completeOidcLogin, createOidcClient, evaluateAccess, extractCredential, extractToken, fromParam, hasAnyRole, isCsrfValid, isSafeMethod, oidcLoginHandlers, oidcLoginPlugin, parseCookieHeader, requireAccess, requireAccessHook, requireAuth, requireAuthHook, requireRole, requireRoleHook, resolveResourceId };
|
|
1534
|
+
export { ACCESS_COOKIE_NAME, CLOCK_SKEW_LEEWAY_SEC, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, MIN_DISCOVERY_TTL_MS, MemoryOidcStateStore, OIDC_STATE_TTL_MS, OidcClient, ResourceResolutionError, assertAuthzClient, assertTenantClaim, authenticateRequest, axiamMiddleware, axiamPlugin, beginOidcLogin, completeOidcLogin, createOidcClient, evaluateAccess, extractCredential, extractToken, fromParam, hasAnyRole, isCsrfValid, isSafeMethod, oidcLoginHandlers, oidcLoginPlugin, parseCookieHeader, requireAccess, requireAccessHook, requireAuth, requireAuthHook, requireRole, requireRoleHook, resolveResourceId };
|
|
1498
1535
|
//# sourceMappingURL=index.mjs.map
|
|
1499
1536
|
//# sourceMappingURL=index.mjs.map
|