@absolutejs/auth 0.56.19 → 0.57.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.
Files changed (52) hide show
  1. package/dist/agents/index.js +44 -37
  2. package/dist/agents/index.js.map +7 -7
  3. package/dist/audit/postgresAuditStore.d.ts +1 -1
  4. package/dist/audit/types.d.ts +2 -0
  5. package/dist/audit/wrap.d.ts +4 -2
  6. package/dist/cli/import/auth0.d.ts +1 -1
  7. package/dist/cli/import/clerk.d.ts +1 -1
  8. package/dist/cli/import/lucia.d.ts +1 -1
  9. package/dist/cli/import/nextauth.d.ts +1 -1
  10. package/dist/cli/import/types.d.ts +1 -0
  11. package/dist/cli/migrate.js +91 -47
  12. package/dist/cli/migrate.js.map +14 -13
  13. package/dist/client/react.d.ts +21 -21
  14. package/dist/client/react.js +35 -37
  15. package/dist/client/react.js.map +6 -6
  16. package/dist/client/solid.d.ts +21 -21
  17. package/dist/client/solid.js +24 -24
  18. package/dist/client/solid.js.map +3 -3
  19. package/dist/client/svelte.d.ts +21 -21
  20. package/dist/client/svelte.js +25 -25
  21. package/dist/client/svelte.js.map +3 -3
  22. package/dist/client/vue.d.ts +21 -21
  23. package/dist/client/vue.js +32 -32
  24. package/dist/client/vue.js.map +3 -3
  25. package/dist/credentials/import.d.ts +16 -1
  26. package/dist/credentials/register.d.ts +1 -1
  27. package/dist/credentials/routes.d.ts +1 -1
  28. package/dist/fingerprint-client/index.js +4 -3
  29. package/dist/fingerprint-client/index.js.map +3 -3
  30. package/dist/index.d.ts +4 -4
  31. package/dist/index.js +6416 -262
  32. package/dist/index.js.map +166 -26
  33. package/dist/manifest.js +3713 -271
  34. package/dist/manifest.js.map +30 -4
  35. package/dist/manifest.json +3 -2
  36. package/dist/oidc/clientIdMetadata.d.ts +1 -5
  37. package/dist/oidc/index.js.map +2 -2
  38. package/dist/oidc/routes.d.ts +1 -1
  39. package/dist/oidc/vci.d.ts +1 -1
  40. package/dist/routes/callback.d.ts +1 -1
  41. package/dist/server.js +6412 -261
  42. package/dist/server.js.map +166 -26
  43. package/dist/session/neonStore.d.ts +2 -2
  44. package/dist/session/redisStore.d.ts +2 -2
  45. package/dist/session/types.d.ts +2 -0
  46. package/dist/stores/postgres.d.ts +2 -2
  47. package/dist/types.d.ts +2 -1
  48. package/dist/vault/index.js.map +2 -2
  49. package/dist/webauthn.js +27 -1
  50. package/dist/webauthn.js.map +3 -3
  51. package/docs/MIGRATE-FROM-LUCIA.md +19 -2
  52. package/package.json +1 -1
@@ -1261,35 +1261,6 @@ var secureUrl3 = (value) => {
1261
1261
  return false;
1262
1262
  }
1263
1263
  };
1264
- var validateClientIdMetadataDocument = (document, expectedClientId) => {
1265
- const errors = [];
1266
- if (document.client_id !== expectedClientId)
1267
- errors.push("client_id does not match the metadata document URL");
1268
- if (!secureUrl3(document.client_id))
1269
- errors.push("client_id must use HTTPS");
1270
- if (!Array.isArray(document.redirect_uris) || document.redirect_uris.length === 0)
1271
- errors.push("redirect_uris is required");
1272
- for (const uri of document.redirect_uris ?? []) {
1273
- try {
1274
- const parsed = new URL(uri);
1275
- if (parsed.protocol !== "https:" && parsed.hostname !== "localhost")
1276
- errors.push("redirect URIs must use HTTPS or localhost");
1277
- } catch {
1278
- errors.push("redirect URI is invalid");
1279
- }
1280
- }
1281
- for (const [name, value] of [
1282
- ["client_uri", document.client_uri],
1283
- ["logo_uri", document.logo_uri],
1284
- ["policy_uri", document.policy_uri],
1285
- ["tos_uri", document.tos_uri],
1286
- ["jwks_uri", document.jwks_uri]
1287
- ]) {
1288
- if (value !== undefined && !secureUrl3(value))
1289
- errors.push(`${name} must use HTTPS`);
1290
- }
1291
- return errors;
1292
- };
1293
1264
  var clientIdMetadataToOAuthClient = (document) => ({
1294
1265
  clientId: document.client_id,
1295
1266
  grantTypes: document.grant_types ?? ["authorization_code", "refresh_token"],
@@ -1338,6 +1309,43 @@ var createClientIdMetadataResolver = ({
1338
1309
  return client;
1339
1310
  };
1340
1311
  };
1312
+ var validateRedirectUri = (uri) => {
1313
+ try {
1314
+ const parsed = new URL(uri);
1315
+ if (parsed.protocol === "https:" || parsed.hostname === "localhost")
1316
+ return;
1317
+ return "redirect URIs must use HTTPS or localhost";
1318
+ } catch {
1319
+ return "redirect URI is invalid";
1320
+ }
1321
+ };
1322
+ var validateSecureMetadataUrl = (name, value) => value !== undefined && !secureUrl3(value) ? `${name} must use HTTPS` : undefined;
1323
+ var validateClientIdMetadataDocument = (document, expectedClientId) => {
1324
+ const errors = [];
1325
+ if (document.client_id !== expectedClientId)
1326
+ errors.push("client_id does not match the metadata document URL");
1327
+ if (!secureUrl3(document.client_id))
1328
+ errors.push("client_id must use HTTPS");
1329
+ if (!Array.isArray(document.redirect_uris) || document.redirect_uris.length === 0)
1330
+ errors.push("redirect_uris is required");
1331
+ for (const uri of document.redirect_uris ?? []) {
1332
+ const error = validateRedirectUri(uri);
1333
+ if (error !== undefined)
1334
+ errors.push(error);
1335
+ }
1336
+ for (const [name, value] of [
1337
+ ["client_uri", document.client_uri],
1338
+ ["logo_uri", document.logo_uri],
1339
+ ["policy_uri", document.policy_uri],
1340
+ ["tos_uri", document.tos_uri],
1341
+ ["jwks_uri", document.jwks_uri]
1342
+ ]) {
1343
+ const error = validateSecureMetadataUrl(name, value);
1344
+ if (error !== undefined)
1345
+ errors.push(error);
1346
+ }
1347
+ return errors;
1348
+ };
1341
1349
  // src/oidc/dpop.ts
1342
1350
  init_constants();
1343
1351
  var DEFAULT_MAX_AGE_MS = 60000;
@@ -1359,7 +1367,7 @@ var extractDpopNonceClaim = (proof) => {
1359
1367
  const payload = JSON.parse(Buffer.from(payloadSegment, "base64url").toString("utf8"));
1360
1368
  if (typeof payload !== "object" || payload === null)
1361
1369
  return;
1362
- const value = payload.nonce;
1370
+ const value = Reflect.get(payload, "nonce");
1363
1371
  return typeof value === "string" ? value : undefined;
1364
1372
  } catch {
1365
1373
  return;
@@ -13449,7 +13457,6 @@ var portableJsonb = customType({
13449
13457
  fromDriver: (value) => typeof value === "string" ? JSON.parse(value) : value,
13450
13458
  toDriver: (value) => JSON.stringify(value)
13451
13459
  });
13452
- var encodedJsonb = (value) => sql`${JSON.stringify(value)}::text::jsonb`;
13453
13460
  var agentDelegationsTable = pgTable("auth_agent_delegations", {
13454
13461
  agent_id: varchar("agent_id", { length: ID_LENGTH }).notNull(),
13455
13462
  authorization_details: portableJsonb("authorization_details").$type(),
@@ -13551,7 +13558,7 @@ var toIdentityRegistration = (row) => ({
13551
13558
  });
13552
13559
  var identityRegistrationValues = (registration) => ({
13553
13560
  agent_id: registration.agentId,
13554
- claim_attempt: registration.claimAttempt === undefined ? null : encodedJsonb(registration.claimAttempt),
13561
+ claim_attempt: registration.claimAttempt === undefined ? null : registration.claimAttempt,
13555
13562
  claim_attempt_token_hash: registration.claimAttempt?.tokenHash ?? null,
13556
13563
  claim_expires_at_ms: registration.claimExpiresAt,
13557
13564
  claim_token_hash: registration.claimTokenHash,
@@ -13595,12 +13602,12 @@ var createDrizzleAgentDelegationStore = (db) => ({
13595
13602
  saveDelegation: async (delegation) => {
13596
13603
  const values = {
13597
13604
  agent_id: delegation.agentId,
13598
- authorization_details: delegation.authorizationDetails === undefined ? null : encodedJsonb(delegation.authorizationDetails),
13605
+ authorization_details: delegation.authorizationDetails === undefined ? null : delegation.authorizationDetails,
13599
13606
  created_at_ms: delegation.createdAt,
13600
13607
  delegation_id: delegation.delegationId,
13601
13608
  expires_at_ms: delegation.expiresAt ?? null,
13602
13609
  organization_id: delegation.organizationId ?? null,
13603
- scopes: encodedJsonb(delegation.scopes),
13610
+ scopes: delegation.scopes,
13604
13611
  status: delegation.status,
13605
13612
  updated_at_ms: delegation.updatedAt,
13606
13613
  user_id: delegation.userId
@@ -13663,10 +13670,10 @@ var createPostgresAgentRegistrationStore = (db) => ({
13663
13670
  saveRegistration: async (registration) => {
13664
13671
  const values = {
13665
13672
  agent_id: registration.agentId,
13666
- allowed_scopes: encodedJsonb(registration.allowedScopes),
13673
+ allowed_scopes: registration.allowedScopes,
13667
13674
  client_id: registration.clientId ?? null,
13668
13675
  created_at_ms: registration.createdAt,
13669
- metadata: registration.metadata === undefined ? null : encodedJsonb(registration.metadata),
13676
+ metadata: registration.metadata === undefined ? null : registration.metadata,
13670
13677
  name: registration.name,
13671
13678
  status: registration.status,
13672
13679
  updated_at_ms: registration.updatedAt
@@ -13725,5 +13732,5 @@ export {
13725
13732
  AGENT_CLAIM_GRANT_TYPE
13726
13733
  };
13727
13734
 
13728
- //# debugId=E730925598B6D00864756E2164756E21
13735
+ //# debugId=4DE3AC96009973EC64756E2164756E21
13729
13736
  //# sourceMappingURL=index.js.map