@absolutejs/auth 0.40.0-beta.0 → 0.40.0-beta.1

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/index.js CHANGED
@@ -2672,7 +2672,7 @@ var createOAuth2Client = async (providerName, config) => {
2672
2672
  };
2673
2673
 
2674
2674
  // src/index.ts
2675
- import { Elysia as Elysia37 } from "elysia";
2675
+ import { Elysia as Elysia39 } from "elysia";
2676
2676
 
2677
2677
  // src/apikeys/routes.ts
2678
2678
  import { Elysia, t } from "elysia";
@@ -22384,6 +22384,430 @@ var vciRoutes = ({
22384
22384
  return Response.json({ c_nonce: nonce, c_nonce_expires_in: Math.floor(ttlMs / msPerSecond) }, { status: HTTP_OK3 });
22385
22385
  });
22386
22386
  };
22387
+ // src/vc/statusList.ts
22388
+ var STATUS_LIST_TYP = "statuslist+jwt";
22389
+ var STATUS_LIST_SUB_TYP = "application/statuslist+jwt";
22390
+ var DEFAULT_LIST_SIZE = 131072;
22391
+ var BITS_PER_BYTE = 8;
22392
+ var MS_PER_SECOND5 = 1000;
22393
+ var BYTE_MASK = 255;
22394
+ var createStatusList = (size = DEFAULT_LIST_SIZE) => {
22395
+ if (size % BITS_PER_BYTE !== 0) {
22396
+ throw new Error("Status list size must be a multiple of 8");
22397
+ }
22398
+ return new Uint8Array(size / BITS_PER_BYTE);
22399
+ };
22400
+ var getCredentialStatus = (bits, idx) => {
22401
+ const byteIndex = Math.floor(idx / BITS_PER_BYTE);
22402
+ const bitIndex = idx % BITS_PER_BYTE;
22403
+ if (byteIndex >= bits.length)
22404
+ return;
22405
+ const byte = bits[byteIndex] ?? 0;
22406
+ return (byte >> bitIndex & 1) === 1 ? 1 : 0;
22407
+ };
22408
+ var setCredentialStatus = (bits, idx, value) => {
22409
+ const byteIndex = Math.floor(idx / BITS_PER_BYTE);
22410
+ const bitIndex = idx % BITS_PER_BYTE;
22411
+ if (byteIndex >= bits.length) {
22412
+ throw new Error(`Status idx ${idx} out of range for this list`);
22413
+ }
22414
+ const current = bits[byteIndex] ?? 0;
22415
+ const mask = 1 << bitIndex;
22416
+ const next = value === 1 ? current | mask : current & (BYTE_MASK ^ mask);
22417
+ bits[byteIndex] = next;
22418
+ return bits;
22419
+ };
22420
+ var compress = async (bits) => {
22421
+ const blob = new Blob([new Uint8Array(bits)]);
22422
+ const stream = new Response(blob.stream().pipeThrough(new CompressionStream("deflate")));
22423
+ const compressed = new Uint8Array(await stream.arrayBuffer());
22424
+ return Buffer.from(compressed).toString("base64url");
22425
+ };
22426
+ var decompress = async (encoded) => {
22427
+ const compressed = Buffer.from(encoded, "base64url");
22428
+ const blob = new Blob([new Uint8Array(compressed)]);
22429
+ const stream = new Response(blob.stream().pipeThrough(new DecompressionStream("deflate")));
22430
+ return new Uint8Array(await stream.arrayBuffer());
22431
+ };
22432
+ var nowSeconds3 = (timeMs) => Math.floor(timeMs / MS_PER_SECOND5);
22433
+ var buildStatusClaim = (idx, uri) => ({
22434
+ status_list: { idx, uri }
22435
+ });
22436
+ var signStatusList = async ({
22437
+ bits,
22438
+ issuer,
22439
+ listUri,
22440
+ now = Date.now(),
22441
+ signingKey,
22442
+ ttlSeconds
22443
+ }) => {
22444
+ const payload = {
22445
+ iat: nowSeconds3(now),
22446
+ iss: issuer,
22447
+ status_list: {
22448
+ bits: 1,
22449
+ lst: await compress(bits)
22450
+ },
22451
+ sub: listUri,
22452
+ ttl: ttlSeconds
22453
+ };
22454
+ if (ttlSeconds !== undefined) {
22455
+ payload.exp = nowSeconds3(now) + ttlSeconds;
22456
+ }
22457
+ return signJwt(payload, signingKey);
22458
+ };
22459
+ var verifyStatusListJwt = async ({
22460
+ issuerPublicJwk,
22461
+ token
22462
+ }) => {
22463
+ const decoded = await verifyJwt(token, issuerPublicJwk);
22464
+ if (decoded === undefined)
22465
+ return;
22466
+ const rawPayload = decoded.payload;
22467
+ if (typeof rawPayload !== "object" || rawPayload === null)
22468
+ return;
22469
+ const payload = { ...rawPayload };
22470
+ const statusList = payload.status_list;
22471
+ if (typeof statusList !== "object" || statusList === null)
22472
+ return;
22473
+ const lst = Reflect.get(statusList, "lst");
22474
+ const bitsPerEntry = Reflect.get(statusList, "bits");
22475
+ if (typeof lst !== "string")
22476
+ return;
22477
+ if (bitsPerEntry !== undefined && bitsPerEntry !== 1) {
22478
+ return;
22479
+ }
22480
+ const bits = await decompress(lst);
22481
+ return { bits, sub: typeof payload.sub === "string" ? payload.sub : undefined };
22482
+ };
22483
+ // src/vc/statusListRoutes.ts
22484
+ import { Elysia as Elysia36, t as t32 } from "elysia";
22485
+ var HTTP_OK4 = 200;
22486
+ var HTTP_NOT_FOUND = 404;
22487
+ var DEFAULT_STATUS_ROUTE = "/vc/status";
22488
+ var statusListRoutes = ({
22489
+ getStatusList,
22490
+ issuerUrl,
22491
+ signingKey,
22492
+ statusRoute = DEFAULT_STATUS_ROUTE,
22493
+ ttlSeconds
22494
+ }) => {
22495
+ const listRoute = `${statusRoute}/:listId`;
22496
+ return new Elysia36().get(listRoute, async ({ params: { listId } }) => {
22497
+ const bits = await getStatusList(listId);
22498
+ if (bits === undefined) {
22499
+ return new Response("Not found", { status: HTTP_NOT_FOUND });
22500
+ }
22501
+ const jwt = await signStatusList({
22502
+ bits,
22503
+ issuer: issuerUrl,
22504
+ listUri: `${issuerUrl}${statusRoute}/${listId}`,
22505
+ signingKey,
22506
+ ttlSeconds
22507
+ });
22508
+ return new Response(jwt, {
22509
+ headers: { "content-type": STATUS_LIST_SUB_TYP },
22510
+ status: HTTP_OK4
22511
+ });
22512
+ }, { params: t32.Object({ listId: t32.String() }) });
22513
+ };
22514
+ // src/vc/openid4vp.ts
22515
+ init_crypto();
22516
+ var REQUEST_BYTES = 16;
22517
+ var DEFAULT_REQUEST_TTL_MS = 600000;
22518
+ var MS_PER_SECOND6 = 1000;
22519
+ var createPresentationRequest = async ({
22520
+ config,
22521
+ getRequestUri,
22522
+ input,
22523
+ issuer
22524
+ }) => {
22525
+ const requestId = generateSecureToken(REQUEST_BYTES);
22526
+ const nonce = generateSecureToken(REQUEST_BYTES);
22527
+ const now = input.now ?? Date.now();
22528
+ const ttlMs = config.requestTtlMs ?? DEFAULT_REQUEST_TTL_MS;
22529
+ const request = {
22530
+ clientId: input.clientId,
22531
+ createdAt: now,
22532
+ expectedIssuerPublicJwk: config.defaultExpectedIssuerPublicJwk,
22533
+ expiresAt: now + ttlMs,
22534
+ nonce,
22535
+ requestedClaims: input.requestedClaims,
22536
+ requestId,
22537
+ responseUri: config.getResponseUri(requestId),
22538
+ state: input.state
22539
+ };
22540
+ await config.requestStore.saveRequest(request);
22541
+ const requestObject = await signJwt({
22542
+ aud: "https://self-issued.me/v2",
22543
+ client_id: input.clientId,
22544
+ iat: Math.floor(now / MS_PER_SECOND6),
22545
+ iss: issuer,
22546
+ nonce,
22547
+ presentation_definition: buildSimplePresentationDefinition(requestId, input.requestedClaims),
22548
+ response_mode: "direct_post",
22549
+ response_type: "vp_token",
22550
+ response_uri: request.responseUri,
22551
+ state: input.state
22552
+ }, config.clientSigningKey);
22553
+ return {
22554
+ nonce,
22555
+ request,
22556
+ requestObject,
22557
+ requestUri: getRequestUri(requestId)
22558
+ };
22559
+ };
22560
+ var buildSimplePresentationDefinition = (requestId, requestedClaims) => ({
22561
+ id: requestId,
22562
+ input_descriptors: [
22563
+ {
22564
+ constraints: {
22565
+ fields: requestedClaims.map((claim) => ({
22566
+ path: [`$.${claim}`]
22567
+ })),
22568
+ limit_disclosure: "required"
22569
+ },
22570
+ format: { "vc+sd-jwt": { "sd-jwt_alg_values": ["ES256"] } },
22571
+ id: "sd-jwt-vc",
22572
+ name: "SD-JWT VC",
22573
+ purpose: "Verify holder claims"
22574
+ }
22575
+ ]
22576
+ });
22577
+ var verifyPresentationResponse = async ({
22578
+ config,
22579
+ input,
22580
+ now = Date.now()
22581
+ }) => {
22582
+ const failFor = (error) => {
22583
+ const failure = { error, ok: false };
22584
+ return failure;
22585
+ };
22586
+ const request = await config.requestStore.consumeRequest(input.requestId);
22587
+ if (request === undefined)
22588
+ return failFor("unknown_request");
22589
+ if (request.expiresAt < now)
22590
+ return failFor("expired_request");
22591
+ const verified = await verifySdJwtVc({
22592
+ issuerPublicJwk: request.expectedIssuerPublicJwk,
22593
+ token: input.vpToken
22594
+ });
22595
+ if (verified === undefined)
22596
+ return failFor("invalid_signature");
22597
+ if (verified.cnf !== undefined) {
22598
+ if (verified.keyBindingJwt === undefined) {
22599
+ return failFor("invalid_holder_binding");
22600
+ }
22601
+ const valid = await verifyHolderBinding({
22602
+ audience: request.clientId,
22603
+ holderJwk: verified.cnf.jwk,
22604
+ keyBindingJwt: verified.keyBindingJwt,
22605
+ nonce: request.nonce
22606
+ });
22607
+ if (!valid)
22608
+ return failFor("invalid_holder_binding");
22609
+ }
22610
+ const missingClaims = request.requestedClaims.filter((claim) => !(claim in verified.disclosedClaims));
22611
+ if (missingClaims.length > 0)
22612
+ return failFor("missing_claims");
22613
+ const statusValid = await checkStatus({
22614
+ config,
22615
+ credentialClaims: verified.protectedClaims
22616
+ });
22617
+ if (!statusValid)
22618
+ return failFor("revoked_credential");
22619
+ const success = {
22620
+ ok: true,
22621
+ verified: {
22622
+ disclosedClaims: verified.disclosedClaims,
22623
+ holderJwk: verified.cnf?.jwk,
22624
+ missingClaims,
22625
+ protectedClaims: verified.protectedClaims,
22626
+ requestId: request.requestId,
22627
+ statusValid: true
22628
+ }
22629
+ };
22630
+ return success;
22631
+ };
22632
+ var verifyHolderBinding = async ({
22633
+ audience,
22634
+ holderJwk,
22635
+ keyBindingJwt,
22636
+ nonce
22637
+ }) => {
22638
+ const decoded = await verifyJwt(keyBindingJwt, holderJwk);
22639
+ if (decoded === undefined)
22640
+ return false;
22641
+ const rawPayload = decoded.payload;
22642
+ if (typeof rawPayload !== "object" || rawPayload === null)
22643
+ return false;
22644
+ const payload = { ...rawPayload };
22645
+ if (payload.aud !== audience)
22646
+ return false;
22647
+ if (payload.nonce !== nonce)
22648
+ return false;
22649
+ if (typeof payload.iat !== "number")
22650
+ return false;
22651
+ return true;
22652
+ };
22653
+ var checkStatus = async ({
22654
+ config,
22655
+ credentialClaims
22656
+ }) => {
22657
+ if (config.statusListResolver === undefined)
22658
+ return true;
22659
+ if (config.statusListPublicJwk === undefined)
22660
+ return true;
22661
+ const { status } = credentialClaims;
22662
+ if (typeof status !== "object" || status === null)
22663
+ return true;
22664
+ const list = Reflect.get(status, "status_list");
22665
+ if (typeof list !== "object" || list === null)
22666
+ return true;
22667
+ const uri = Reflect.get(list, "uri");
22668
+ const idx = Reflect.get(list, "idx");
22669
+ if (typeof uri !== "string" || typeof idx !== "number")
22670
+ return true;
22671
+ const token = await config.statusListResolver(uri);
22672
+ if (token === undefined)
22673
+ return true;
22674
+ const verified = await verifyStatusListJwt({
22675
+ issuerPublicJwk: config.statusListPublicJwk,
22676
+ token
22677
+ });
22678
+ if (verified === undefined)
22679
+ return false;
22680
+ const bitsPerByte = 8;
22681
+ const byteIndex = Math.floor(idx / bitsPerByte);
22682
+ const bitIndex = idx % bitsPerByte;
22683
+ const byte = verified.bits[byteIndex] ?? 0;
22684
+ return (byte >> bitIndex & 1) === 0;
22685
+ };
22686
+ var buildHolderKeyBindingJwt = async ({
22687
+ audience,
22688
+ holderKey,
22689
+ nonce,
22690
+ now = Date.now(),
22691
+ sdHash
22692
+ }) => signJwt({
22693
+ aud: audience,
22694
+ iat: Math.floor(now / MS_PER_SECOND6),
22695
+ nonce,
22696
+ sd_hash: sdHash
22697
+ }, holderKey);
22698
+ var parsePresentationToken = (vpToken) => parseSdJwtVc(vpToken);
22699
+ // src/vc/inMemoryVpStores.ts
22700
+ var createInMemoryPresentationRequestStore = () => {
22701
+ const requests = new Map;
22702
+ return {
22703
+ consumeRequest: async (requestId) => {
22704
+ const request = requests.get(requestId);
22705
+ if (request === undefined)
22706
+ return;
22707
+ requests.delete(requestId);
22708
+ return request;
22709
+ },
22710
+ getRequest: async (requestId) => requests.get(requestId),
22711
+ saveRequest: async (request) => {
22712
+ requests.set(request.requestId, request);
22713
+ }
22714
+ };
22715
+ };
22716
+ // src/vc/vpRoutes.ts
22717
+ import { Elysia as Elysia37, t as t33 } from "elysia";
22718
+ var HTTP_OK5 = 200;
22719
+ var HTTP_BAD_REQUEST4 = 400;
22720
+ var HTTP_NOT_FOUND2 = 404;
22721
+ var errorBody2 = (error, status) => new Response(JSON.stringify({ error }), {
22722
+ headers: { "content-type": "application/json" },
22723
+ status
22724
+ });
22725
+ var DEFAULT_VP_ROUTE = "/vp";
22726
+ var vpRoutes = ({
22727
+ defaultClientId,
22728
+ issuerUrl,
22729
+ onVerifiedPresentation,
22730
+ vpConfig,
22731
+ vpRoute = DEFAULT_VP_ROUTE
22732
+ }) => {
22733
+ const authorizeRoute = `${vpRoute}/authorize`;
22734
+ const requestRoute = `${vpRoute}/request/:id`;
22735
+ const responseRoute = `${vpRoute}/response`;
22736
+ return new Elysia37().post(authorizeRoute, async ({ body }) => {
22737
+ const input = {
22738
+ clientId: body.client_id ?? defaultClientId,
22739
+ requestedClaims: body.requested_claims,
22740
+ state: body.state
22741
+ };
22742
+ const result = await createPresentationRequest({
22743
+ config: vpConfig,
22744
+ input,
22745
+ issuer: issuerUrl,
22746
+ getRequestUri: (id) => `${issuerUrl}${vpRoute}/request/${id}`
22747
+ });
22748
+ return Response.json({
22749
+ nonce: result.nonce,
22750
+ request_uri: result.requestUri,
22751
+ requestId: result.request.requestId
22752
+ }, { status: HTTP_OK5 });
22753
+ }, {
22754
+ body: t33.Object({
22755
+ client_id: t33.Optional(t33.String()),
22756
+ requested_claims: t33.Array(t33.String()),
22757
+ state: t33.Optional(t33.String())
22758
+ })
22759
+ }).get(requestRoute, async ({ params: { id } }) => {
22760
+ const stored = await vpConfig.requestStore.getRequest(id);
22761
+ if (stored === undefined) {
22762
+ return errorBody2("unknown_request", HTTP_NOT_FOUND2);
22763
+ }
22764
+ const rebuilt = await createPresentationRequest({
22765
+ config: { ...vpConfig, requestStore: passthroughStore(stored) },
22766
+ input: {
22767
+ clientId: stored.clientId,
22768
+ requestedClaims: stored.requestedClaims,
22769
+ state: stored.state
22770
+ },
22771
+ issuer: issuerUrl,
22772
+ getRequestUri: () => `${issuerUrl}${vpRoute}/request/${id}`
22773
+ });
22774
+ return new Response(rebuilt.requestObject, {
22775
+ headers: { "content-type": "application/oauth-authz-req+jwt" },
22776
+ status: HTTP_OK5
22777
+ });
22778
+ }, { params: t33.Object({ id: t33.String() }) }).post(responseRoute, async ({ body }) => {
22779
+ const requestId = body.state;
22780
+ if (requestId === undefined) {
22781
+ return errorBody2("missing_state", HTTP_BAD_REQUEST4);
22782
+ }
22783
+ const result = await verifyPresentationResponse({
22784
+ config: vpConfig,
22785
+ input: { requestId, vpToken: body.vp_token }
22786
+ });
22787
+ if (!result.ok)
22788
+ return errorBody2(result.error, HTTP_BAD_REQUEST4);
22789
+ if (onVerifiedPresentation !== undefined) {
22790
+ await onVerifiedPresentation({ verified: result.verified });
22791
+ }
22792
+ return Response.json({
22793
+ disclosed_claims: result.verified.disclosedClaims,
22794
+ holder_jwk: result.verified.holderJwk,
22795
+ protected_claims: result.verified.protectedClaims,
22796
+ verified: true
22797
+ }, { status: HTTP_OK5 });
22798
+ }, {
22799
+ body: t33.Object({
22800
+ presentation_submission: t33.Optional(t33.Unknown()),
22801
+ state: t33.Optional(t33.String()),
22802
+ vp_token: t33.String()
22803
+ })
22804
+ });
22805
+ };
22806
+ var passthroughStore = (request) => ({
22807
+ consumeRequest: async () => request,
22808
+ getRequest: async () => request,
22809
+ saveRequest: async () => {}
22810
+ });
22387
22811
  // src/scim/inMemoryScimTokenStore.ts
22388
22812
  var createInMemoryScimTokenStore = () => {
22389
22813
  const tokens = new Map;
@@ -24547,18 +24971,18 @@ var blockMigrations = {
24547
24971
  webhooks: initMigration("webhooks", [webhookDeliveriesTable])
24548
24972
  };
24549
24973
  // src/sso/samlIdpRoutes.ts
24550
- import { Elysia as Elysia36, t as t32 } from "elysia";
24551
- var HTTP_BAD_REQUEST4 = 400;
24974
+ import { Elysia as Elysia38, t as t34 } from "elysia";
24975
+ var HTTP_BAD_REQUEST5 = 400;
24552
24976
  var HTTP_UNAUTHORIZED4 = 401;
24553
24977
  var HTTP_FOUND2 = 302;
24554
- var HTTP_OK4 = 200;
24978
+ var HTTP_OK6 = 200;
24555
24979
  var xmlResponse = (body) => new Response(body, {
24556
24980
  headers: { "content-type": "application/samlmetadata+xml" },
24557
- status: HTTP_OK4
24981
+ status: HTTP_OK6
24558
24982
  });
24559
24983
  var htmlResponse = (body) => new Response(body, {
24560
24984
  headers: { "content-type": "text/html; charset=utf-8" },
24561
- status: HTTP_OK4
24985
+ status: HTTP_OK6
24562
24986
  });
24563
24987
  var redirectTo2 = (url) => new Response(null, { headers: { location: url }, status: HTTP_FOUND2 });
24564
24988
  var errorJson = (status, error) => new Response(JSON.stringify({ error }), {
@@ -24610,7 +25034,7 @@ var samlIdpRoutes = ({
24610
25034
  userSessionIdValue
24611
25035
  }) => {
24612
25036
  if (body.SAMLRequest === undefined) {
24613
- return errorJson(HTTP_BAD_REQUEST4, "missing_saml_request");
25037
+ return errorJson(HTTP_BAD_REQUEST5, "missing_saml_request");
24614
25038
  }
24615
25039
  let firstPass;
24616
25040
  try {
@@ -24619,11 +25043,11 @@ var samlIdpRoutes = ({
24619
25043
  samlRequest: body.SAMLRequest
24620
25044
  });
24621
25045
  } catch {
24622
- return errorJson(HTTP_BAD_REQUEST4, "invalid_authn_request");
25046
+ return errorJson(HTTP_BAD_REQUEST5, "invalid_authn_request");
24623
25047
  }
24624
25048
  const serviceProvider = await samlServiceProviderStore.findServiceProvider(firstPass.issuer);
24625
25049
  if (serviceProvider === undefined) {
24626
- return errorJson(HTTP_BAD_REQUEST4, "unknown_service_provider");
25050
+ return errorJson(HTTP_BAD_REQUEST5, "unknown_service_provider");
24627
25051
  }
24628
25052
  let parsed;
24629
25053
  try {
@@ -24636,7 +25060,7 @@ var samlIdpRoutes = ({
24636
25060
  signedQueryString: binding === "Redirect" ? new URL(request.url).search.slice(1) : undefined
24637
25061
  });
24638
25062
  } catch {
24639
- return errorJson(HTTP_BAD_REQUEST4, "invalid_authn_request");
25063
+ return errorJson(HTTP_BAD_REQUEST5, "invalid_authn_request");
24640
25064
  }
24641
25065
  const userSession = await loadSessionFromSource({
24642
25066
  authSessionStore,
@@ -24657,7 +25081,7 @@ var samlIdpRoutes = ({
24657
25081
  user: userSession.user
24658
25082
  });
24659
25083
  };
24660
- return new Elysia36().use(sessionStore()).post(ssoIdpRoute, async ({
25084
+ return new Elysia38().use(sessionStore()).post(ssoIdpRoute, async ({
24661
25085
  body,
24662
25086
  cookie: { user_session_id },
24663
25087
  request,
@@ -24669,12 +25093,12 @@ var samlIdpRoutes = ({
24669
25093
  request,
24670
25094
  userSessionIdValue: user_session_id.value
24671
25095
  }), {
24672
- body: t32.Object({
24673
- RelayState: t32.Optional(t32.String()),
24674
- SAMLRequest: t32.Optional(t32.String())
25096
+ body: t34.Object({
25097
+ RelayState: t34.Optional(t34.String()),
25098
+ SAMLRequest: t34.Optional(t34.String())
24675
25099
  }),
24676
- cookie: t32.Cookie({
24677
- user_session_id: t32.Optional(userSessionIdTypebox)
25100
+ cookie: t34.Cookie({
25101
+ user_session_id: t34.Optional(userSessionIdTypebox)
24678
25102
  })
24679
25103
  }).get(ssoIdpRoute, async ({
24680
25104
  cookie: { user_session_id },
@@ -24688,14 +25112,14 @@ var samlIdpRoutes = ({
24688
25112
  request,
24689
25113
  userSessionIdValue: user_session_id.value
24690
25114
  }), {
24691
- cookie: t32.Cookie({
24692
- user_session_id: t32.Optional(userSessionIdTypebox)
25115
+ cookie: t34.Cookie({
25116
+ user_session_id: t34.Optional(userSessionIdTypebox)
24693
25117
  }),
24694
- query: t32.Object({
24695
- RelayState: t32.Optional(t32.String()),
24696
- SAMLRequest: t32.Optional(t32.String()),
24697
- SigAlg: t32.Optional(t32.String()),
24698
- Signature: t32.Optional(t32.String())
25118
+ query: t34.Object({
25119
+ RelayState: t34.Optional(t34.String()),
25120
+ SAMLRequest: t34.Optional(t34.String()),
25121
+ SigAlg: t34.Optional(t34.String()),
25122
+ Signature: t34.Optional(t34.String())
24699
25123
  })
24700
25124
  }).get(idpInitiateRoute, async ({
24701
25125
  cookie: { user_session_id },
@@ -24704,11 +25128,11 @@ var samlIdpRoutes = ({
24704
25128
  store
24705
25129
  }) => {
24706
25130
  if (serviceProviderEntityId === undefined) {
24707
- return errorJson(HTTP_BAD_REQUEST4, "missing_sp");
25131
+ return errorJson(HTTP_BAD_REQUEST5, "missing_sp");
24708
25132
  }
24709
25133
  const serviceProvider = await samlServiceProviderStore.findServiceProvider(serviceProviderEntityId);
24710
25134
  if (serviceProvider === undefined) {
24711
- return errorJson(HTTP_BAD_REQUEST4, "unknown_service_provider");
25135
+ return errorJson(HTTP_BAD_REQUEST5, "unknown_service_provider");
24712
25136
  }
24713
25137
  const userSession = authSessionStore === undefined ? await loadSessionFromSource({
24714
25138
  session: store.session,
@@ -24731,12 +25155,12 @@ var samlIdpRoutes = ({
24731
25155
  user: userSession.user
24732
25156
  });
24733
25157
  }, {
24734
- cookie: t32.Cookie({
24735
- user_session_id: t32.Optional(userSessionIdTypebox)
25158
+ cookie: t34.Cookie({
25159
+ user_session_id: t34.Optional(userSessionIdTypebox)
24736
25160
  }),
24737
- query: t32.Object({
24738
- RelayState: t32.Optional(t32.String()),
24739
- sp: t32.Optional(t32.String())
25161
+ query: t34.Object({
25162
+ RelayState: t34.Optional(t34.String()),
25163
+ sp: t34.Optional(t34.String())
24740
25164
  })
24741
25165
  }).get(idpMetadataRoute, async ({ request }) => xmlResponse(await idpAdapter.getIdpMetadata({
24742
25166
  entityId: idpEntityId,
@@ -25034,7 +25458,7 @@ var auth = async ({
25034
25458
  const auditedOnCallbackSuccess = auditEmit ? composeCallbackAudit(onCallbackSuccess, auditEmit) : onCallbackSuccess;
25035
25459
  const auditedOnRevocationSuccess = auditEmit ? composeRevocationAudit(onRevocationSuccess, auditEmit) : onRevocationSuccess;
25036
25460
  const auditedOnSignOut = auditEmit ? composeSignOutAudit(onSignOut, auditEmit) : onSignOut;
25037
- return new Elysia37().use(sessionCleanup({
25461
+ return new Elysia39().use(sessionCleanup({
25038
25462
  authSessionStore,
25039
25463
  cleanupIntervalMs,
25040
25464
  maxSessions,
@@ -25082,53 +25506,53 @@ var auth = async ({
25082
25506
  authSessionStore,
25083
25507
  cookieSecure: resolvedCookieSecure,
25084
25508
  lockoutGuard
25085
- }) : new Elysia37).use(auditedMfa ? mfaRoutes({
25509
+ }) : new Elysia39).use(auditedMfa ? mfaRoutes({
25086
25510
  ...auditedMfa,
25087
25511
  authSessionStore,
25088
25512
  cookieSecure: resolvedCookieSecure
25089
- }) : new Elysia37).use(passwordless ? passwordlessRoutes({
25513
+ }) : new Elysia39).use(passwordless ? passwordlessRoutes({
25090
25514
  ...passwordless,
25091
25515
  authSessionStore,
25092
25516
  cookieSecure: resolvedCookieSecure,
25093
25517
  emit: auditEmit
25094
- }) : new Elysia37).use(sessions ? sessionRoutes({ ...sessions, authSessionStore }) : new Elysia37).use(sso ? oidcSsoRoutes({
25518
+ }) : new Elysia39).use(sessions ? sessionRoutes({ ...sessions, authSessionStore }) : new Elysia39).use(sso ? oidcSsoRoutes({
25095
25519
  ...sso,
25096
25520
  authSessionStore,
25097
25521
  cookieSecure: resolvedCookieSecure
25098
- }) : new Elysia37).use(sso && sso.samlAdapter ? samlSsoRoutes({
25522
+ }) : new Elysia39).use(sso && sso.samlAdapter ? samlSsoRoutes({
25099
25523
  ...sso,
25100
25524
  authSessionStore,
25101
25525
  cookieSecure: resolvedCookieSecure,
25102
25526
  samlAdapter: sso.samlAdapter
25103
- }) : new Elysia37).use(sso && sso.getOrganizationByEmailDomain ? ssoDiscoveryRoute({
25527
+ }) : new Elysia39).use(sso && sso.getOrganizationByEmailDomain ? ssoDiscoveryRoute({
25104
25528
  getOrganizationByEmailDomain: sso.getOrganizationByEmailDomain,
25105
25529
  ssoConnectionStore: sso.ssoConnectionStore,
25106
25530
  ssoRoute: sso.ssoRoute
25107
- }) : new Elysia37).use(scim ? scimRoutes(scim) : new Elysia37).use(apikeys ? apiKeysRoutes(apikeys) : new Elysia37).use(oidc ? oidcProviderRoutes({ ...oidc, authSessionStore }) : new Elysia37).use(organizations ? organizationRoutes({
25531
+ }) : new Elysia39).use(scim ? scimRoutes(scim) : new Elysia39).use(apikeys ? apiKeysRoutes(apikeys) : new Elysia39).use(oidc ? oidcProviderRoutes({ ...oidc, authSessionStore }) : new Elysia39).use(organizations ? organizationRoutes({
25108
25532
  ...organizations,
25109
25533
  authSessionStore,
25110
25534
  emit: auditEmit
25111
- }) : new Elysia37).use(roles ? roleRoutes({
25535
+ }) : new Elysia39).use(roles ? roleRoutes({
25112
25536
  ...roles,
25113
25537
  authSessionStore,
25114
25538
  emit: auditEmit
25115
- }) : new Elysia37).use(portal ? portalRoutes({ ...portal, emit: auditEmit }) : new Elysia37).use(webauthn ? webauthnRoutes({
25539
+ }) : new Elysia39).use(portal ? portalRoutes({ ...portal, emit: auditEmit }) : new Elysia39).use(webauthn ? webauthnRoutes({
25116
25540
  ...webauthn,
25117
25541
  authSessionStore,
25118
25542
  cookieSecure: resolvedCookieSecure,
25119
25543
  emit: auditEmit
25120
- }) : new Elysia37).use(compliance ? complianceRoutes({
25544
+ }) : new Elysia39).use(compliance ? complianceRoutes({
25121
25545
  ...compliance,
25122
25546
  authSessionStore,
25123
25547
  emit: auditEmit
25124
- }) : new Elysia37).use(protectRoutePlugin({ authSessionStore })).use(stepUpPlugin({ authSessionStore })).use(authorization ? protectPermissionPlugin({
25548
+ }) : new Elysia39).use(protectRoutePlugin({ authSessionStore })).use(stepUpPlugin({ authSessionStore })).use(authorization ? protectPermissionPlugin({
25125
25549
  ...authorization,
25126
25550
  authSessionStore,
25127
25551
  emit: auditEmit
25128
- }) : new Elysia37).use(htmx ? createAuthHtmxRoutes({
25552
+ }) : new Elysia39).use(htmx ? createAuthHtmxRoutes({
25129
25553
  ...htmx,
25130
25554
  authSessionStore
25131
- }) : new Elysia37);
25555
+ }) : new Elysia39);
25132
25556
  };
25133
25557
  export {
25134
25558
  writeWarrant,
@@ -25138,11 +25562,14 @@ export {
25138
25562
  webauthnCredentialsTable,
25139
25563
  warrantsTable,
25140
25564
  warrantKey,
25565
+ vpRoutes,
25141
25566
  verifyWebhookSignature,
25142
25567
  verifyTurnstile,
25143
25568
  verifyTotp,
25569
+ verifyStatusListJwt,
25144
25570
  verifySdJwtVc,
25145
25571
  verifyRecaptcha,
25572
+ verifyPresentationResponse,
25146
25573
  verifyPkce,
25147
25574
  verifyPassword,
25148
25575
  verifyJwtSignedByClient,
@@ -25170,13 +25597,16 @@ export {
25170
25597
  toBase64Url2 as toBase64Url,
25171
25598
  switchActiveSession,
25172
25599
  stepUpPlugin,
25600
+ statusListRoutes,
25173
25601
  startImpersonation,
25174
25602
  ssoDiscoveryRoute,
25175
25603
  ssoConnectionsTable,
25176
25604
  signWebhook,
25605
+ signStatusList,
25177
25606
  signJwt,
25178
25607
  setupSessionsTable,
25179
25608
  setMemberRoles,
25609
+ setCredentialStatus,
25180
25610
  sessionStore,
25181
25611
  sessionRoutes,
25182
25612
  sessionCleanup,
@@ -25229,6 +25659,7 @@ export {
25229
25659
  parseSignedRequestObject,
25230
25660
  parseSdJwtVc,
25231
25661
  parseSchema,
25662
+ parsePresentationToken,
25232
25663
  organizationsTable,
25233
25664
  organizationRoutes,
25234
25665
  organizationMembershipsTable,
@@ -25298,6 +25729,7 @@ export {
25298
25729
  getStatus,
25299
25730
  getRegisteredClient,
25300
25731
  getOrRefreshFederatedTokens,
25732
+ getCredentialStatus,
25301
25733
  generateTotpSecret,
25302
25734
  generateTotp,
25303
25735
  generateSigningKey,
@@ -25347,6 +25779,7 @@ export {
25347
25779
  createVault,
25348
25780
  createTotpKeyUri,
25349
25781
  createTamperEvidentSink,
25782
+ createStatusList,
25350
25783
  createSiemLogStream,
25351
25784
  createSetupSession,
25352
25785
  createSecretCipher,
@@ -25355,6 +25788,7 @@ export {
25355
25788
  createRedisLockoutStore,
25356
25789
  createRedisFgaCache,
25357
25790
  createRedisAuthSessionStore,
25791
+ createPresentationRequest,
25358
25792
  createPostgresWebhookDeliveryStore,
25359
25793
  createPostgresWebAuthnCredentialStore,
25360
25794
  createPostgresWarrantStore,
@@ -25435,6 +25869,7 @@ export {
25435
25869
  createInMemorySamlServiceProviderStore,
25436
25870
  createInMemoryRoleStore,
25437
25871
  createInMemoryPushedAuthorizationRequestStore,
25872
+ createInMemoryPresentationRequestStore,
25438
25873
  createInMemoryPasswordlessTokenStore,
25439
25874
  createInMemoryOrganizationStore,
25440
25875
  createInMemoryOidcRefreshTokenStore,
@@ -25477,7 +25912,9 @@ export {
25477
25912
  computeCertThumbprint,
25478
25913
  complianceRoutes,
25479
25914
  check,
25915
+ buildStatusClaim,
25480
25916
  buildIssuerMetadata,
25917
+ buildHolderKeyBindingJwt,
25481
25918
  buildClientProviders,
25482
25919
  blockMigrations,
25483
25920
  base32Encode,
@@ -25498,6 +25935,8 @@ export {
25498
25935
  accessTokensTable,
25499
25936
  acceptInvitation,
25500
25937
  WEBAUTHN_CHALLENGE_COOKIE,
25938
+ STATUS_LIST_TYP,
25939
+ STATUS_LIST_SUB_TYP,
25501
25940
  REQUEST_URI_PREFIX,
25502
25941
  PRE_AUTHORIZED_CODE_GRANT,
25503
25942
  DEFAULT_WEBHOOK_TIMEOUT_MS,
@@ -25505,9 +25944,11 @@ export {
25505
25944
  DEFAULT_WEBAUTHN_SESSION_TTL_MS,
25506
25945
  DEFAULT_WEBAUTHN_ROUTE,
25507
25946
  DEFAULT_WEBAUTHN_CHALLENGE_TTL_MS,
25947
+ DEFAULT_VP_ROUTE,
25508
25948
  DEFAULT_VERIFICATION_TOKEN_TTL_MS,
25509
25949
  DEFAULT_VCI_ROUTE,
25510
25950
  DEFAULT_TOKEN_ROUTE,
25951
+ DEFAULT_STATUS_ROUTE,
25511
25952
  DEFAULT_SSO_SESSION_TTL_MS,
25512
25953
  DEFAULT_SSO_ROUTE,
25513
25954
  DEFAULT_SETUP_SESSION_TTL_MS,
@@ -25534,5 +25975,5 @@ export {
25534
25975
  AuthIdentityConflictError
25535
25976
  };
25536
25977
 
25537
- //# debugId=72970D27E7C7DE2F64756E2164756E21
25978
+ //# debugId=6D61B26FBEAED15664756E2164756E21
25538
25979
  //# sourceMappingURL=index.js.map