@happyvertical/smrt-users 0.57.16 → 0.57.18
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/AGENTS.md +21 -0
- package/README.md +134 -4
- package/agents/retention.md +3 -2
- package/dist/chunks/{PasswordCredentialService-CyB9FmYp.js → PasswordCredentialService-DezdsV_v.js} +40 -3
- package/dist/chunks/PasswordCredentialService-DezdsV_v.js.map +1 -0
- package/dist/chunks/TerminalAuthService-Dn2BIzRM.js +4012 -0
- package/dist/chunks/TerminalAuthService-Dn2BIzRM.js.map +1 -0
- package/dist/collections/PasskeyChallengeCollection.d.ts +37 -0
- package/dist/collections/PasskeyChallengeCollection.d.ts.map +1 -0
- package/dist/collections/PasskeyCredentialCollection.d.ts +66 -0
- package/dist/collections/PasskeyCredentialCollection.d.ts.map +1 -0
- package/dist/collections/SessionCollection.d.ts.map +1 -1
- package/dist/collections/index.d.ts +2 -0
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1302 -428
- package/dist/models/PasskeyChallenge.d.ts +32 -0
- package/dist/models/PasskeyChallenge.d.ts.map +1 -0
- package/dist/models/PasskeyCredential.d.ts +50 -0
- package/dist/models/PasskeyCredential.d.ts.map +1 -0
- package/dist/models/Session.d.ts +23 -0
- package/dist/models/Session.d.ts.map +1 -1
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/operator.js +1 -1
- package/dist/retention.d.ts +3 -1
- package/dist/retention.d.ts.map +1 -1
- package/dist/services/PasskeyCredentialService.d.ts +382 -0
- package/dist/services/PasskeyCredentialService.d.ts.map +1 -0
- package/dist/services/SessionService.d.ts.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +407 -9
- package/dist/svelte/auth.d.ts +9 -3
- package/dist/svelte/auth.d.ts.map +1 -1
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +1 -0
- package/dist/svelte/passkey.d.ts +58 -0
- package/dist/svelte/passkey.d.ts.map +1 -0
- package/dist/svelte/passkey.js +97 -0
- package/dist/sveltekit/index.d.ts +1 -0
- package/dist/sveltekit/index.d.ts.map +1 -1
- package/dist/sveltekit/passkey-handlers.d.ts +117 -0
- package/dist/sveltekit/passkey-handlers.d.ts.map +1 -0
- package/dist/sveltekit.js +259 -69
- package/dist/sveltekit.js.map +1 -1
- package/package.json +12 -10
- package/dist/chunks/PasswordCredentialService-CyB9FmYp.js.map +0 -1
- package/dist/chunks/TerminalAuthService-BSHq7edu.js +0 -3012
- package/dist/chunks/TerminalAuthService-BSHq7edu.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,EACtC,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,+BAA+B,EAC/B,+BAA+B,EAC/B,sBAAsB,EACtB,KAAK,4BAA4B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Ac,EACd,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,kBAAkB,EACvB,aAAa,EACb,KAAK,yBAAyB,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,+CAA+C,EAC/C,qCAAqC,EACrC,sCAAsC,EACtC,oCAAoC,EACpC,+BAA+B,EAC/B,2BAA2B,EAC3B,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,KAAK,0BAA0B,GAChC,MAAM,0BAA0B,CAAC"}
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-users",
|
|
6
|
-
"packageVersion": "0.57.
|
|
6
|
+
"packageVersion": "0.57.18",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
12
|
-
"agents": "
|
|
10
|
+
"manifest": "323750c5fe82078671d187df04b7cf958e50f0eacd3c721727ae40c231959a9c",
|
|
11
|
+
"packageJson": "0c4e42e91f4dd0a00c723cceb2304ec15c3bfec1825365deb22882c60db0d20a",
|
|
12
|
+
"agents": "a78e98bccfdde674b905ee03295dcbb2f70a0532881ab88ecd18855da0feaa8f",
|
|
13
13
|
"moduleDoc:agents/permissions.md": "02b2f03f0e057721369d9c693a624a6fdb3df4935401531a4373ff18229a64be",
|
|
14
14
|
"moduleDoc:agents/oidc-provisioning.md": "b73f3fdaf61136720132a614c7e14237b7bd35f7bf5d43eabb29f565485803b9",
|
|
15
15
|
"moduleDoc:agents/mobile-auth.md": "25e85e83f43e3a46383a92fa809f3a003b4545c3026e78dbe1bccbbc35161e18",
|
|
16
16
|
"moduleDoc:agents/terminal-auth-testing.md": "8a84c16a19e381427aed81d3b1882344c427fe22a70e87f5ac2db836b1a6822d",
|
|
17
|
-
"moduleDoc:agents/retention.md": "
|
|
17
|
+
"moduleDoc:agents/retention.md": "fc6ed5443b154641bfe890a4de1213366d4b330ea1bb18ea9e0edfe605f45b02"
|
|
18
18
|
},
|
|
19
19
|
"exports": [
|
|
20
20
|
".",
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
"@happyvertical/smrt-types": "workspace:*",
|
|
38
38
|
"@happyvertical/smrt-ui": "workspace:*",
|
|
39
39
|
"@happyvertical/sql": "catalog:",
|
|
40
|
+
"@simplewebauthn/browser": "^14.0.0",
|
|
41
|
+
"@simplewebauthn/server": "^14.0.3",
|
|
40
42
|
"jose": "^6.2.12",
|
|
41
43
|
"@happyvertical/smrt-vitest": "workspace:*",
|
|
42
44
|
"@sveltejs/package": "^2.5.8",
|
|
@@ -1412,6 +1414,237 @@
|
|
|
1412
1414
|
"tags": [],
|
|
1413
1415
|
"risks": []
|
|
1414
1416
|
},
|
|
1417
|
+
{
|
|
1418
|
+
"name": "UsersPasskeyChallengeCollection",
|
|
1419
|
+
"qualifiedName": "@happyvertical/smrt-users:UsersPasskeyChallengeCollection",
|
|
1420
|
+
"collection": "userspasskeychallenges",
|
|
1421
|
+
"tableName": "users_passkey_challenges",
|
|
1422
|
+
"packageName": "@happyvertical/smrt-users",
|
|
1423
|
+
"extends": "SmrtCollection",
|
|
1424
|
+
"fields": [],
|
|
1425
|
+
"relationships": [],
|
|
1426
|
+
"methods": [
|
|
1427
|
+
"consume",
|
|
1428
|
+
"deleteExpired"
|
|
1429
|
+
],
|
|
1430
|
+
"methodSignatures": [
|
|
1431
|
+
{
|
|
1432
|
+
"name": "consume",
|
|
1433
|
+
"async": true,
|
|
1434
|
+
"params": [
|
|
1435
|
+
"challengeHash: string",
|
|
1436
|
+
"purpose: PasskeyChallengePurpose",
|
|
1437
|
+
"expiresAt: Date"
|
|
1438
|
+
],
|
|
1439
|
+
"returns": "Promise<boolean>"
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
"name": "deleteExpired",
|
|
1443
|
+
"async": true,
|
|
1444
|
+
"params": [
|
|
1445
|
+
"options?: object"
|
|
1446
|
+
],
|
|
1447
|
+
"returns": "Promise<number>"
|
|
1448
|
+
}
|
|
1449
|
+
],
|
|
1450
|
+
"surfaces": [],
|
|
1451
|
+
"withheldSurfaces": [
|
|
1452
|
+
{
|
|
1453
|
+
"kind": "api",
|
|
1454
|
+
"operation": "consume",
|
|
1455
|
+
"code": "api-disabled",
|
|
1456
|
+
"reason": "api is disabled",
|
|
1457
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyChallengeCollection"
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
"kind": "api",
|
|
1461
|
+
"operation": "deleteExpired",
|
|
1462
|
+
"code": "api-disabled",
|
|
1463
|
+
"reason": "api is disabled",
|
|
1464
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyChallengeCollection"
|
|
1465
|
+
}
|
|
1466
|
+
],
|
|
1467
|
+
"relationshipFeatures": [
|
|
1468
|
+
"uuidColumns"
|
|
1469
|
+
],
|
|
1470
|
+
"tags": [],
|
|
1471
|
+
"risks": []
|
|
1472
|
+
},
|
|
1473
|
+
{
|
|
1474
|
+
"name": "UsersPasskeyCredentialCollection",
|
|
1475
|
+
"qualifiedName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection",
|
|
1476
|
+
"collection": "userspasskeycredentials",
|
|
1477
|
+
"tableName": "users_passkey_credentials",
|
|
1478
|
+
"packageName": "@happyvertical/smrt-users",
|
|
1479
|
+
"extends": "SmrtCollection",
|
|
1480
|
+
"fields": [],
|
|
1481
|
+
"relationships": [],
|
|
1482
|
+
"methods": [
|
|
1483
|
+
"countByUserId",
|
|
1484
|
+
"deleteAllForUser",
|
|
1485
|
+
"deleteOwned",
|
|
1486
|
+
"findByCredentialId",
|
|
1487
|
+
"findOwned",
|
|
1488
|
+
"insertIfAbsent",
|
|
1489
|
+
"listByUserId",
|
|
1490
|
+
"recordUseIfCurrent",
|
|
1491
|
+
"renameOwned"
|
|
1492
|
+
],
|
|
1493
|
+
"methodSignatures": [
|
|
1494
|
+
{
|
|
1495
|
+
"name": "countByUserId",
|
|
1496
|
+
"async": true,
|
|
1497
|
+
"params": [
|
|
1498
|
+
"userId: string"
|
|
1499
|
+
],
|
|
1500
|
+
"returns": "Promise<number>"
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
"name": "deleteAllForUser",
|
|
1504
|
+
"async": true,
|
|
1505
|
+
"params": [
|
|
1506
|
+
"userId: string"
|
|
1507
|
+
],
|
|
1508
|
+
"returns": "Promise<number>"
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
"name": "deleteOwned",
|
|
1512
|
+
"async": true,
|
|
1513
|
+
"params": [
|
|
1514
|
+
"id: string",
|
|
1515
|
+
"userId: string"
|
|
1516
|
+
],
|
|
1517
|
+
"returns": "Promise<boolean>"
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
"name": "findByCredentialId",
|
|
1521
|
+
"async": true,
|
|
1522
|
+
"params": [
|
|
1523
|
+
"credentialId: string"
|
|
1524
|
+
],
|
|
1525
|
+
"returns": "Promise<UsersPasskeyCredential | null>"
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
"name": "findOwned",
|
|
1529
|
+
"async": true,
|
|
1530
|
+
"params": [
|
|
1531
|
+
"id: string",
|
|
1532
|
+
"userId: string"
|
|
1533
|
+
],
|
|
1534
|
+
"returns": "Promise<UsersPasskeyCredential | null>"
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
"name": "insertIfAbsent",
|
|
1538
|
+
"async": true,
|
|
1539
|
+
"params": [
|
|
1540
|
+
"write: PasskeyCredentialWrite"
|
|
1541
|
+
],
|
|
1542
|
+
"returns": "Promise<UsersPasskeyCredential | null>"
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
"name": "listByUserId",
|
|
1546
|
+
"async": true,
|
|
1547
|
+
"params": [
|
|
1548
|
+
"userId: string"
|
|
1549
|
+
],
|
|
1550
|
+
"returns": "Promise<UsersPasskeyCredential[]>"
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
"name": "recordUseIfCurrent",
|
|
1554
|
+
"async": true,
|
|
1555
|
+
"params": [
|
|
1556
|
+
"id: string",
|
|
1557
|
+
"userId: string",
|
|
1558
|
+
"expectedSignCount: number",
|
|
1559
|
+
"newSignCount: number",
|
|
1560
|
+
"backedUp: boolean",
|
|
1561
|
+
"now?: Date"
|
|
1562
|
+
],
|
|
1563
|
+
"returns": "Promise<boolean>"
|
|
1564
|
+
},
|
|
1565
|
+
{
|
|
1566
|
+
"name": "renameOwned",
|
|
1567
|
+
"async": true,
|
|
1568
|
+
"params": [
|
|
1569
|
+
"id: string",
|
|
1570
|
+
"userId: string",
|
|
1571
|
+
"name: string"
|
|
1572
|
+
],
|
|
1573
|
+
"returns": "Promise<boolean>"
|
|
1574
|
+
}
|
|
1575
|
+
],
|
|
1576
|
+
"surfaces": [],
|
|
1577
|
+
"withheldSurfaces": [
|
|
1578
|
+
{
|
|
1579
|
+
"kind": "api",
|
|
1580
|
+
"operation": "countByUserId",
|
|
1581
|
+
"code": "api-disabled",
|
|
1582
|
+
"reason": "api is disabled",
|
|
1583
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection"
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
"kind": "api",
|
|
1587
|
+
"operation": "deleteAllForUser",
|
|
1588
|
+
"code": "api-disabled",
|
|
1589
|
+
"reason": "api is disabled",
|
|
1590
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection"
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
"kind": "api",
|
|
1594
|
+
"operation": "deleteOwned",
|
|
1595
|
+
"code": "api-disabled",
|
|
1596
|
+
"reason": "api is disabled",
|
|
1597
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection"
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
"kind": "api",
|
|
1601
|
+
"operation": "findByCredentialId",
|
|
1602
|
+
"code": "api-disabled",
|
|
1603
|
+
"reason": "api is disabled",
|
|
1604
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection"
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
"kind": "api",
|
|
1608
|
+
"operation": "findOwned",
|
|
1609
|
+
"code": "api-disabled",
|
|
1610
|
+
"reason": "api is disabled",
|
|
1611
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection"
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
"kind": "api",
|
|
1615
|
+
"operation": "insertIfAbsent",
|
|
1616
|
+
"code": "api-disabled",
|
|
1617
|
+
"reason": "api is disabled",
|
|
1618
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection"
|
|
1619
|
+
},
|
|
1620
|
+
{
|
|
1621
|
+
"kind": "api",
|
|
1622
|
+
"operation": "listByUserId",
|
|
1623
|
+
"code": "api-disabled",
|
|
1624
|
+
"reason": "api is disabled",
|
|
1625
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection"
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
"kind": "api",
|
|
1629
|
+
"operation": "recordUseIfCurrent",
|
|
1630
|
+
"code": "api-disabled",
|
|
1631
|
+
"reason": "api is disabled",
|
|
1632
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection"
|
|
1633
|
+
},
|
|
1634
|
+
{
|
|
1635
|
+
"kind": "api",
|
|
1636
|
+
"operation": "renameOwned",
|
|
1637
|
+
"code": "api-disabled",
|
|
1638
|
+
"reason": "api is disabled",
|
|
1639
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredentialCollection"
|
|
1640
|
+
}
|
|
1641
|
+
],
|
|
1642
|
+
"relationshipFeatures": [
|
|
1643
|
+
"uuidColumns"
|
|
1644
|
+
],
|
|
1645
|
+
"tags": [],
|
|
1646
|
+
"risks": []
|
|
1647
|
+
},
|
|
1415
1648
|
{
|
|
1416
1649
|
"name": "UsersPasswordCredentialCollection",
|
|
1417
1650
|
"qualifiedName": "@happyvertical/smrt-users:UsersPasswordCredentialCollection",
|
|
@@ -5481,6 +5714,159 @@
|
|
|
5481
5714
|
"tags": [],
|
|
5482
5715
|
"risks": []
|
|
5483
5716
|
},
|
|
5717
|
+
{
|
|
5718
|
+
"name": "UsersPasskeyChallenge",
|
|
5719
|
+
"qualifiedName": "@happyvertical/smrt-users:UsersPasskeyChallenge",
|
|
5720
|
+
"collection": "userspasskeychallenges",
|
|
5721
|
+
"tableName": "users_passkey_challenges",
|
|
5722
|
+
"packageName": "@happyvertical/smrt-users",
|
|
5723
|
+
"extends": "SmrtObject",
|
|
5724
|
+
"fields": [
|
|
5725
|
+
{
|
|
5726
|
+
"name": "challengeHash",
|
|
5727
|
+
"type": "text",
|
|
5728
|
+
"required": true,
|
|
5729
|
+
"columnType": "TEXT"
|
|
5730
|
+
},
|
|
5731
|
+
{
|
|
5732
|
+
"name": "purpose",
|
|
5733
|
+
"type": "text",
|
|
5734
|
+
"required": true,
|
|
5735
|
+
"columnType": "TEXT"
|
|
5736
|
+
},
|
|
5737
|
+
{
|
|
5738
|
+
"name": "expiresAt",
|
|
5739
|
+
"type": "datetime",
|
|
5740
|
+
"required": true,
|
|
5741
|
+
"columnType": "TIMESTAMP"
|
|
5742
|
+
}
|
|
5743
|
+
],
|
|
5744
|
+
"relationships": [],
|
|
5745
|
+
"methods": [],
|
|
5746
|
+
"surfaces": [],
|
|
5747
|
+
"relationshipFeatures": [
|
|
5748
|
+
"uuidColumns"
|
|
5749
|
+
],
|
|
5750
|
+
"tags": [],
|
|
5751
|
+
"risks": []
|
|
5752
|
+
},
|
|
5753
|
+
{
|
|
5754
|
+
"name": "UsersPasskeyCredential",
|
|
5755
|
+
"qualifiedName": "@happyvertical/smrt-users:UsersPasskeyCredential",
|
|
5756
|
+
"displayLabelField": "name",
|
|
5757
|
+
"collection": "userspasskeycredentials",
|
|
5758
|
+
"tableName": "users_passkey_credentials",
|
|
5759
|
+
"packageName": "@happyvertical/smrt-users",
|
|
5760
|
+
"extends": "SmrtObject",
|
|
5761
|
+
"fields": [
|
|
5762
|
+
{
|
|
5763
|
+
"name": "userId",
|
|
5764
|
+
"type": "foreignKey",
|
|
5765
|
+
"required": true,
|
|
5766
|
+
"related": "User",
|
|
5767
|
+
"columnType": "UUID"
|
|
5768
|
+
},
|
|
5769
|
+
{
|
|
5770
|
+
"name": "signCount",
|
|
5771
|
+
"type": "integer",
|
|
5772
|
+
"required": true,
|
|
5773
|
+
"columnType": "INTEGER",
|
|
5774
|
+
"default": 0
|
|
5775
|
+
},
|
|
5776
|
+
{
|
|
5777
|
+
"name": "transports",
|
|
5778
|
+
"type": "text",
|
|
5779
|
+
"required": false,
|
|
5780
|
+
"columnType": "TEXT"
|
|
5781
|
+
},
|
|
5782
|
+
{
|
|
5783
|
+
"name": "name",
|
|
5784
|
+
"type": "text",
|
|
5785
|
+
"required": true,
|
|
5786
|
+
"columnType": "TEXT"
|
|
5787
|
+
},
|
|
5788
|
+
{
|
|
5789
|
+
"name": "aaguid",
|
|
5790
|
+
"type": "text",
|
|
5791
|
+
"required": false,
|
|
5792
|
+
"columnType": "TEXT"
|
|
5793
|
+
},
|
|
5794
|
+
{
|
|
5795
|
+
"name": "backedUp",
|
|
5796
|
+
"type": "boolean",
|
|
5797
|
+
"required": true,
|
|
5798
|
+
"columnType": "BOOLEAN",
|
|
5799
|
+
"default": false
|
|
5800
|
+
},
|
|
5801
|
+
{
|
|
5802
|
+
"name": "deviceType",
|
|
5803
|
+
"type": "text",
|
|
5804
|
+
"required": false,
|
|
5805
|
+
"columnType": "TEXT"
|
|
5806
|
+
},
|
|
5807
|
+
{
|
|
5808
|
+
"name": "lastUsedAt",
|
|
5809
|
+
"type": "datetime",
|
|
5810
|
+
"required": false,
|
|
5811
|
+
"columnType": "TIMESTAMP"
|
|
5812
|
+
},
|
|
5813
|
+
{
|
|
5814
|
+
"name": "createdBy",
|
|
5815
|
+
"type": "text",
|
|
5816
|
+
"required": false,
|
|
5817
|
+
"columnType": "TEXT"
|
|
5818
|
+
}
|
|
5819
|
+
],
|
|
5820
|
+
"relationships": [
|
|
5821
|
+
{
|
|
5822
|
+
"name": "userId",
|
|
5823
|
+
"type": "foreignKey",
|
|
5824
|
+
"required": true,
|
|
5825
|
+
"related": "User",
|
|
5826
|
+
"columnType": "UUID"
|
|
5827
|
+
}
|
|
5828
|
+
],
|
|
5829
|
+
"methods": [
|
|
5830
|
+
"getTransports",
|
|
5831
|
+
"setTransports"
|
|
5832
|
+
],
|
|
5833
|
+
"methodSignatures": [
|
|
5834
|
+
{
|
|
5835
|
+
"name": "getTransports",
|
|
5836
|
+
"returns": "string[]"
|
|
5837
|
+
},
|
|
5838
|
+
{
|
|
5839
|
+
"name": "setTransports",
|
|
5840
|
+
"params": [
|
|
5841
|
+
"value: any"
|
|
5842
|
+
],
|
|
5843
|
+
"returns": "void"
|
|
5844
|
+
}
|
|
5845
|
+
],
|
|
5846
|
+
"surfaces": [],
|
|
5847
|
+
"withheldSurfaces": [
|
|
5848
|
+
{
|
|
5849
|
+
"kind": "api",
|
|
5850
|
+
"operation": "getTransports",
|
|
5851
|
+
"code": "api-disabled",
|
|
5852
|
+
"reason": "api is disabled",
|
|
5853
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredential"
|
|
5854
|
+
},
|
|
5855
|
+
{
|
|
5856
|
+
"kind": "api",
|
|
5857
|
+
"operation": "setTransports",
|
|
5858
|
+
"code": "api-disabled",
|
|
5859
|
+
"reason": "api is disabled",
|
|
5860
|
+
"objectName": "@happyvertical/smrt-users:UsersPasskeyCredential"
|
|
5861
|
+
}
|
|
5862
|
+
],
|
|
5863
|
+
"relationshipFeatures": [
|
|
5864
|
+
"foreignKey",
|
|
5865
|
+
"uuidColumns"
|
|
5866
|
+
],
|
|
5867
|
+
"tags": [],
|
|
5868
|
+
"risks": []
|
|
5869
|
+
},
|
|
5484
5870
|
{
|
|
5485
5871
|
"name": "UsersPasswordCredential",
|
|
5486
5872
|
"qualifiedName": "@happyvertical/smrt-users:UsersPasswordCredential",
|
|
@@ -6225,6 +6611,7 @@
|
|
|
6225
6611
|
"methods": [
|
|
6226
6612
|
"extend",
|
|
6227
6613
|
"getAbsoluteExpiry",
|
|
6614
|
+
"getAuthenticatedAt",
|
|
6228
6615
|
"getData",
|
|
6229
6616
|
"getIdleSeconds",
|
|
6230
6617
|
"getPermissionCeiling",
|
|
@@ -6251,6 +6638,10 @@
|
|
|
6251
6638
|
"name": "getAbsoluteExpiry",
|
|
6252
6639
|
"returns": "Date | null"
|
|
6253
6640
|
},
|
|
6641
|
+
{
|
|
6642
|
+
"name": "getAuthenticatedAt",
|
|
6643
|
+
"returns": "Date | null"
|
|
6644
|
+
},
|
|
6254
6645
|
{
|
|
6255
6646
|
"name": "getData",
|
|
6256
6647
|
"params": [
|
|
@@ -6360,6 +6751,13 @@
|
|
|
6360
6751
|
"reason": "not listed in api.include",
|
|
6361
6752
|
"objectName": "@happyvertical/smrt-users:Session"
|
|
6362
6753
|
},
|
|
6754
|
+
{
|
|
6755
|
+
"kind": "api",
|
|
6756
|
+
"operation": "getAuthenticatedAt",
|
|
6757
|
+
"code": "not-included",
|
|
6758
|
+
"reason": "not listed in api.include",
|
|
6759
|
+
"objectName": "@happyvertical/smrt-users:Session"
|
|
6760
|
+
},
|
|
6363
6761
|
{
|
|
6364
6762
|
"kind": "api",
|
|
6365
6763
|
"operation": "getData",
|
|
@@ -7774,14 +8172,14 @@
|
|
|
7774
8172
|
],
|
|
7775
8173
|
"prompts": [],
|
|
7776
8174
|
"relationshipsV2": {
|
|
7777
|
-
"foreignKeyFields":
|
|
8175
|
+
"foreignKeyFields": 35,
|
|
7778
8176
|
"crossPackageRefFields": 2,
|
|
7779
8177
|
"junctionCollections": 0,
|
|
7780
8178
|
"hierarchicalObjects": 0,
|
|
7781
8179
|
"polymorphicAssociations": 0,
|
|
7782
|
-
"uuidColumns":
|
|
8180
|
+
"uuidColumns": 162
|
|
7783
8181
|
},
|
|
7784
|
-
"agentDoc": "# @happyvertical/smrt-users\n\nMulti-tenant identity, RBAC, hierarchical tenants, sessions, and SvelteKit auth.\n\n## Modules\n\nRead only the module relevant to the change; protocol and provisioning details\nare not prerequisites for unrelated user-package work.\n\n| Module | Scope | Module doc |\n|---|---|---|\n| `src/services/PermissionResolver.ts` | permission precedence, inherited memberships, guards, RLS, role seeding | [agents/permissions.md](agents/permissions.md) |\n| `src/services/OidcLoginService.ts`, collections and OIDC handlers | identity reconciliation, transaction boundaries, migration readiness | [agents/oidc-provisioning.md](agents/oidc-provisioning.md) |\n| `src/services/MobileAuthService.ts` | mobile handshake, bearer sessions, bootstrap extension boundary | [agents/mobile-auth.md](agents/mobile-auth.md) |\n| `src/services/TerminalAuthService.ts`, `src/services/LoginAttemptLimiter.ts`, `src/collections/LoginAttemptCollection.ts` | terminal approval concurrency, shared login budget and lockout (#3273), retry-safe database fixtures | [agents/terminal-auth-testing.md](agents/terminal-auth-testing.md) |\n| `src/services/DeviceCredentialService.ts` | per-person PIN layered on a device session (#3276), verifier seam for other credential kinds | this file, \"Security boundaries\" |\n| `src/services/PasswordCredentialService.ts`, `src/sveltekit/password-handlers.ts` | email + password sign-in and password lifecycle (#3274); shared scrypt in `credential-hash.ts` | this file, \"Security boundaries\"; README \"Password sign-in\" |\n| `src/retention.ts` | expired session/token/CLI-auth reaping and retention sweep wiring | [agents/retention.md](agents/retention.md) |\n\n## Models and authority\n\n- Users are global; tenant access comes through Membership (unique user/tenant).\n User email is normalized and globally unique through readonly nullable\n `emailKey`. `profileId` is a unique cross-package reference: at most one User\n owns each non-null Profile.\n- Tenant uses STI and a materialized hierarchy, maximum depth 10.\n `hierarchyPath`/`hierarchyLevel` are derived from `parentTenantId` by\n `Tenant.save()` on every save (any caller-supplied value is recomputed) and\n descendants are re-materialized when they change; never hand-maintain them.\n Legacy rows are backfilled with `smrt db:materialize-tenant-hierarchy`\n (`materializeTenantHierarchy()`). Tests that need a corrupt path must write it\n with raw SQL (#3036).\n- Role with `tenantId = null` is available to all tenants; `isSystem` prevents\n deletion. `inheritsToDescendants` is opt-in. Seed owner/admin/member/viewer\n through `RoleCollection.seedSystemRoles()` at application initialization.\n- Group roles apply only in their own tenant. Use `getGroupIdsForTenant()`,\n never cross-tenant `getGroupIds()`, for authorization.\n- Upward visibility is opt-in and read-only: `permissions.ancestorRead`\n ({ roles, collections, maxDepth? }) lets a DESCENDANT membership contribute\n declared `<collection>.read` at an ancestor, only when no membership resolved\n there, intersected with BOTH the role's own catalog grants and the\n principal's effective permissions in that descendant, and only for SYSTEM\n roles (a tenant-scoped role sharing a declared slug is ignored). Off by default, never\n write, never lateral, and never row visibility — sibling rows stay scoped by\n tenancy/RLS. Read the permissions module before changing it.\n- Membership DENY always wins. Direct inactive membership blocks inherited\n authority; a direct active membership pins resolution instead of unioning it\n with ancestors. Read the permissions module before changing these rules.\n- AccessRequest has no generated API/MCP/CLI operations; access it through\n `AccessRequestService`. Its JSON field is `requestContext`, not reserved\n slug-scoping `context`.\n\n## Security boundaries\n\n- Generated REST/MCP operations on identity/RBAC models are list/get only.\n Route authentication does not authorize authority mutations, and these models\n are not tenant-scoped. Use permission-gated services or explicitly checked\n consumer handlers. Generated CLI is list/get or closed (`cli: false` for\n credential/grant models) because agents shell out to it; a `cli` without\n `include` is full CRUD (#3742). Their catalog slugs stay full via\n `USERS_AUTHORITY_CATALOG_MODELS`. Preserve the registry assertions in\n `security-audit-1400.test.ts` and `issue-3742-cli-surface-lockdown.test.ts`.\n- Resource guards take the resource tenant, not the session tenant. Omit a\n session membership when targeting a different tenant; mismatches fail closed.\n `loadSessionContext().tenantAuthorization` must be checked by required-tenant\n consumers: null membership can represent inherited authority.\n- Sessions use secure UUIDs; TTL is seconds (default seven days). Access marks\n expired sessions EXPIRED. Magic-link tokens are single use.\n- `Session.authMethod` is server-set at mint time and never read from the\n client; every mint site in this package sets it. A session with\n `parentSessionId` is valid only while its parent validates\n (`loadSessionContext` enforces this; there is no FK cascade by design), may\n not switch to a tenant other than the parent's, and is revoked with its\n parent by `destroySession`.\n- Credential sign-ins reserve through `LoginAttemptLimiter` BEFORE credential\n work and key the subject on the submitted identifier, never a resolved user,\n so unknown and wrong take the same path. Reservations are fail-closed: keep\n them on failure, release on success or abort, never skip the reserve.\n Limiter writes are raw SQL and bypass the change feed; the audit sink is the\n observability seam, and it must never throw into the sign-in path.\n Subject and source budgets are sized independently (#3531); `source: false`\n ignores the source key, so a reservation then needs a subject (fail closed).\n The `source-locked` audit entry never carries a subject or caller metadata.\n- `DeviceCredentialService` accepts a person credential only from a\n first-class session whose `authMethod` is a device-enrollment method\n (`terminal` by default) and that the host's `assertEnrolledDevice` confirms.\n A layered or PIN session can never administer PINs regardless of\n permissions. PIN hashes carry a per-row salt and the configured pepper;\n treat an unset pepper as a production misconfiguration.\n- A person session carries the PERSON's authority (resolved from their own\n membership on every load), never the device account's. `Session.data` keys\n in `SESSION_DATA_KEYS` are server-set controls enforced by the model:\n `permissionCeiling` only ever intersects (malformed fails closed to none)\n and suppresses `superAdminBypass`/`systemContext`; `absoluteExpiresAt`\n bounds `extend()` and `isValid()`; `idleSeconds` overrides the resolving\n service's TTL policy. Never write them from client input. The ceiling is a\n sign-in snapshot; `singleOccupant` revokes other children only AFTER a\n successful mint. A `mustReset` sign-in mints with an empty ceiling and\n `setPin` ends that session; do not grant it authority another way.\n- `UsersPasswordCredential` is one row per person, sensitive, with no\n generated surface; `PasswordCredentialService` and its handlers are its only\n session-authorized read/write paths. The separate Node `./operator` entrypoint\n provisions new PostgreSQL owners from trusted database custody, atomically;\n never mount it in a browser/REST/MCP handler. Exact retries verify existing\n credentials without writes; partial/conflicting identities fail closed.\n See README \"Trusted deployment owner provisioning\".\n Sign-in normalizes the email like `emailKey`, reserves\n before work, always runs one scrypt verify (dummy hash when absent), never\n creates a user, and maps every non-rate-limit refusal to one\n `PasswordCredentialError`. It re-checks the credential after the mint (a\n rehash that keeps row and version is confirmed by re-verifying); the\n parameter-upgrade write is a guarded UPDATE that must never replace a\n rotated password, and verification against a weaker stored hash is padded\n to the policy's scrypt cost. Self-service writes are guarded on the proven\n credential (first set insert-only); session sweeps run before and after\n each write. Self-service needs the current password except for a first\n set; `users.password.manage` follows the PIN's single-tenant target\n rule and never resets the actor's own. Layered sessions never manage\n passwords; a `mustChange` sign-in mints an empty ceiling.\n `replaceForgottenPassword` (#3905, opt-in `recovery`) is the only\n self-service write without the current password: it decides on the stored\n session row (owner, first-class, no ceiling, listed non-password/pin\n `authMethod`, fresh `outOfBandProofAt` stamp) and ends every session,\n its own included. Never set that stamp from client input.\n- A layered session whose tenant differs from its parent's never loads (null\n is allowed: narrower). Limiter rows carry `retain_until`; retention must\n not fall back to a process-wide horizon.\n- `Session.parentSessionId` is the parent's bearer: sensitive, never a\n `list()` filter (raw-SQL id reads, which also keep revocation sweeps free of\n caller list bounds), never serialized to clients. `users.pin.manage` reaches\n only people whose every active membership is in the actor's tenant (the PIN\n is global per person). A sign-in re-checks the verified\n credential generation AFTER the mint (`stillValid`); keep that ordering.\n Operation guards deny outside a session's ceiling; `loadPersonSession`\n re-checks device enrollment.\n- Tenant switching verifies active membership before writing and rotates the\n session ID for non-null targets, revoking the old session. Persist the returned\n `SwitchTenantResult.sessionId`; `switchSessionTenant()` updates the cookie and\n preserves its security settings. Failed switches mutate nothing; null clears\n do not rotate, and layered sessions never rotate (a replacement would escape\n the revocation sweeps they depend on). Layers do not nest. `SessionCollection.setSessionTenant()` is unguarded and must\n never receive an untrusted tenant ID.\n- OIDC provisioning is atomic and fail-closed. Preserve exact issuer/subject\n identifiers, claim-source email verification, unique global Person ownership,\n and transaction-bound reconciliation. Read the OIDC module and canonical\n scenario matrix before changing any provisioning path.\n\n## Entry points and validation\n\n`src/sveltekit/` owns `createSessionHandler`, `createSessionCookie`,\n`destroySessionCookie`, and `switchSessionTenant`. Use README integration examples\nrather than copying application setup into these instructions.\n\nFrom the repository root:\n\n```bash\npnpm --filter @happyvertical/smrt-users test\npnpm --filter @happyvertical/smrt-users typecheck\npnpm --filter @happyvertical/smrt-users test:postgres\n```\n\nStart with the relevant test file via `test -- src/__tests__/<file>.test.ts`.\nRun `test:postgres` for RLS, principal context, OIDC, or terminal-auth database\nchanges. `typecheck` includes Svelte accessibility checks; plain `tsc` is\ninsufficient. Follow root knowledge freshness checks before shipping.\n",
|
|
8182
|
+
"agentDoc": "# @happyvertical/smrt-users\n\nMulti-tenant identity, RBAC, hierarchical tenants, sessions, and SvelteKit auth.\n\n## Modules\n\nRead only the module relevant to the change; protocol and provisioning details\nare not prerequisites for unrelated user-package work.\n\n| Module | Scope | Module doc |\n|---|---|---|\n| `src/services/PermissionResolver.ts` | permission precedence, inherited memberships, guards, RLS, role seeding | [agents/permissions.md](agents/permissions.md) |\n| `src/services/OidcLoginService.ts`, collections and OIDC handlers | identity reconciliation, transaction boundaries, migration readiness | [agents/oidc-provisioning.md](agents/oidc-provisioning.md) |\n| `src/services/MobileAuthService.ts` | mobile handshake, bearer sessions, bootstrap extension boundary | [agents/mobile-auth.md](agents/mobile-auth.md) |\n| `src/services/TerminalAuthService.ts`, `src/services/LoginAttemptLimiter.ts`, `src/collections/LoginAttemptCollection.ts` | terminal approval concurrency, shared login budget and lockout (#3273), retry-safe database fixtures | [agents/terminal-auth-testing.md](agents/terminal-auth-testing.md) |\n| `src/services/DeviceCredentialService.ts` | per-person PIN layered on a device session (#3276), verifier seam for other credential kinds | this file, \"Security boundaries\" |\n| `src/services/PasswordCredentialService.ts`, `src/sveltekit/password-handlers.ts` | email + password sign-in and password lifecycle (#3274); shared scrypt in `credential-hash.ts` | this file, \"Security boundaries\"; README \"Password sign-in\" |\n| `src/services/PasskeyCredentialService.ts`, `src/sveltekit/passkey-handlers.ts`, `src/svelte/passkey.ts` | passkey (WebAuthn) sign-in and passkey lifecycle (#3275); library does all verification | this file, \"Security boundaries\"; README \"Passkey sign-in\" |\n| `src/retention.ts` | expired session/token/CLI-auth reaping and retention sweep wiring | [agents/retention.md](agents/retention.md) |\n\n## Models and authority\n\n- Users are global; tenant access comes through Membership (unique user/tenant).\n User email is normalized and globally unique through readonly nullable\n `emailKey`. `profileId` is a unique cross-package reference: at most one User\n owns each non-null Profile.\n- Tenant uses STI and a materialized hierarchy, maximum depth 10.\n `hierarchyPath`/`hierarchyLevel` are derived from `parentTenantId` by\n `Tenant.save()` on every save (any caller-supplied value is recomputed) and\n descendants are re-materialized when they change; never hand-maintain them.\n Legacy rows are backfilled with `smrt db:materialize-tenant-hierarchy`\n (`materializeTenantHierarchy()`). Tests that need a corrupt path must write it\n with raw SQL (#3036).\n- Role with `tenantId = null` is available to all tenants; `isSystem` prevents\n deletion. `inheritsToDescendants` is opt-in. Seed owner/admin/member/viewer\n through `RoleCollection.seedSystemRoles()` at application initialization.\n- Group roles apply only in their own tenant. Use `getGroupIdsForTenant()`,\n never cross-tenant `getGroupIds()`, for authorization.\n- Upward visibility is opt-in and read-only: `permissions.ancestorRead`\n ({ roles, collections, maxDepth? }) lets a DESCENDANT membership contribute\n declared `<collection>.read` at an ancestor, only when no membership resolved\n there, intersected with BOTH the role's own catalog grants and the\n principal's effective permissions in that descendant, and only for SYSTEM\n roles (a tenant-scoped role sharing a declared slug is ignored). Off by default, never\n write, never lateral, and never row visibility — sibling rows stay scoped by\n tenancy/RLS. Read the permissions module before changing it.\n- Membership DENY always wins. Direct inactive membership blocks inherited\n authority; a direct active membership pins resolution instead of unioning it\n with ancestors. Read the permissions module before changing these rules.\n- AccessRequest has no generated API/MCP/CLI operations; access it through\n `AccessRequestService`. Its JSON field is `requestContext`, not reserved\n slug-scoping `context`.\n\n## Security boundaries\n\n- Generated REST/MCP operations on identity/RBAC models are list/get only.\n Route authentication does not authorize authority mutations, and these models\n are not tenant-scoped. Use permission-gated services or explicitly checked\n consumer handlers. Generated CLI is list/get or closed (`cli: false` for\n credential/grant models) because agents shell out to it; a `cli` without\n `include` is full CRUD (#3742). Their catalog slugs stay full via\n `USERS_AUTHORITY_CATALOG_MODELS`. Preserve the registry assertions in\n `security-audit-1400.test.ts` and `issue-3742-cli-surface-lockdown.test.ts`.\n- Resource guards take the resource tenant, not the session tenant. Omit a\n session membership when targeting a different tenant; mismatches fail closed.\n `loadSessionContext().tenantAuthorization` must be checked by required-tenant\n consumers: null membership can represent inherited authority.\n- Sessions use secure UUIDs; TTL is seconds (default seven days). Access marks\n expired sessions EXPIRED. Magic-link tokens are single use.\n- `Session.authMethod` is server-set at mint time and never read from the\n client; every mint site in this package sets it. A session with\n `parentSessionId` is valid only while its parent validates\n (`loadSessionContext` enforces this; there is no FK cascade by design), may\n not switch to a tenant other than the parent's, and is revoked with its\n parent by `destroySession`.\n- Credential sign-ins reserve through `LoginAttemptLimiter` BEFORE credential\n work and key the subject on the submitted identifier, never a resolved user,\n so unknown and wrong take the same path. Reservations are fail-closed: keep\n them on failure, release on success or abort, never skip the reserve.\n Limiter writes are raw SQL and bypass the change feed; the audit sink is the\n observability seam, and it must never throw into the sign-in path.\n Subject and source budgets are sized independently (#3531); `source: false`\n ignores the source key, so a reservation then needs a subject (fail closed).\n The `source-locked` audit entry never carries a subject or caller metadata.\n- `DeviceCredentialService` accepts a person credential only from a\n first-class session whose `authMethod` is a device-enrollment method\n (`terminal` by default) and that the host's `assertEnrolledDevice` confirms.\n A layered or PIN session can never administer PINs regardless of\n permissions. PIN hashes carry a per-row salt and the configured pepper;\n treat an unset pepper as a production misconfiguration.\n- A person session carries the PERSON's authority (resolved from their own\n membership on every load), never the device account's. `Session.data` keys\n in `SESSION_DATA_KEYS` are server-set controls enforced by the model:\n `permissionCeiling` only ever intersects (malformed fails closed to none)\n and suppresses `superAdminBypass`/`systemContext`; `absoluteExpiresAt`\n bounds `extend()` and `isValid()`; `idleSeconds` overrides the resolving\n service's TTL policy. Never write them from client input. The ceiling is a\n sign-in snapshot; `singleOccupant` revokes other children only AFTER a\n successful mint. A `mustReset` sign-in mints with an empty ceiling and\n `setPin` ends that session; do not grant it authority another way.\n- `UsersPasswordCredential` is one row per person, sensitive, with no\n generated surface; `PasswordCredentialService` and its handlers are its only\n session-authorized read/write paths. The separate Node `./operator` entrypoint\n provisions new PostgreSQL owners from trusted database custody, atomically;\n never mount it in a browser/REST/MCP handler. Exact retries verify existing\n credentials without writes; partial/conflicting identities fail closed.\n See README \"Trusted deployment owner provisioning\".\n Sign-in normalizes the email like `emailKey`, reserves\n before work, always runs one scrypt verify (dummy hash when absent), never\n creates a user, and maps every non-rate-limit refusal to one\n `PasswordCredentialError`. It re-checks the credential after the mint (a\n rehash that keeps row and version is confirmed by re-verifying); the\n parameter-upgrade write is a guarded UPDATE that must never replace a\n rotated password, and verification against a weaker stored hash is padded\n to the policy's scrypt cost. Self-service writes are guarded on the proven\n credential (first set insert-only); session sweeps run before and after\n each write. Self-service needs the current password except for a first\n set; `users.password.manage` follows the PIN's single-tenant target\n rule and never resets the actor's own. Layered sessions never manage\n passwords; a `mustChange` sign-in mints an empty ceiling.\n `replaceForgottenPassword` (#3905, opt-in `recovery`) is the only\n self-service write without the current password: it decides on the stored\n session row (owner, first-class, no ceiling, listed non-password/pin\n `authMethod`, fresh `outOfBandProofAt` stamp) and ends every session,\n its own included. Never set that stamp from client input.\n- `UsersPasskeyCredential` (many per person) and `UsersPasskeyChallenge` (consumed\n challenge ledger) are sensitive with no generated surface;\n `PasskeyCredentialService` and its handlers are the only paths. Verification is\n `@simplewebauthn/server`, loaded on first use (its `reflect-metadata` polyfill is process-wide) and external in the build; never hand-roll COSE/CBOR. Sign-in reserves on\n the submitted credential id before any work, requires user verification, checks\n user handle and a strictly advancing counter (`reason: 'counter'`), mints, then\n re-checks with a guarded counter UPDATE; a ceremony is an HMAC-signed\n `ceremonyId` consumed into the unique ledger (replay = refuse; set\n `challengeSecret` for multi-process). Unique arbiters are\n `INSERT … ON CONFLICT DO NOTHING`, never a caught constraint error. Register and\n self-remove need a session authenticated within `freshSessionSeconds`, decided\n on the stored row (`Session.getAuthenticatedAt()`: server-set\n `data.authenticatedAt`, which tenant-switch rotation carries forward, else\n `created_at`; malformed fails closed; `setSessionData` refuses the key),\n first-class, no ceiling, and its STORED `authMethod` in `freshAuthMethods` (default password/passkey/oidc/magic-link; never `terminal`, whose approval mints a fresh session for any holder of a stale one, nor `pin`); self list/rename also refuse a ceiling; `users.passkey.manage` follows the PIN's\n single-tenant rule, and `removeAllPasskeys` is admin-only, never self. Sessions\n end before and after every removal; `SESSION_DATA_KEYS.passkeyCredentialId` is\n server-set (`setSessionData` refuses it). State-changing handlers require\n `application/json` (415). Challenge rows are reaped only 10 minutes past expiry\n (clock skew).\n- A layered session whose tenant differs from its parent's never loads (null\n is allowed: narrower). Limiter rows carry `retain_until`; retention must\n not fall back to a process-wide horizon.\n- `Session.parentSessionId` is the parent's bearer: sensitive, never a\n `list()` filter (raw-SQL id reads, which also keep revocation sweeps free of\n caller list bounds), never serialized to clients. `users.pin.manage` reaches\n only people whose every active membership is in the actor's tenant (the PIN\n is global per person). A sign-in re-checks the verified\n credential generation AFTER the mint (`stillValid`); keep that ordering.\n Operation guards deny outside a session's ceiling; `loadPersonSession`\n re-checks device enrollment.\n- Tenant switching verifies active membership before writing and rotates the\n session ID for non-null targets, revoking the old session. Persist the returned\n `SwitchTenantResult.sessionId`; `switchSessionTenant()` updates the cookie and\n preserves its security settings. Failed switches mutate nothing; null clears\n do not rotate, and layered sessions never rotate (a replacement would escape\n the revocation sweeps they depend on). Layers do not nest. `SessionCollection.setSessionTenant()` is unguarded and must\n never receive an untrusted tenant ID.\n- OIDC provisioning is atomic and fail-closed. Preserve exact issuer/subject\n identifiers, claim-source email verification, unique global Person ownership,\n and transaction-bound reconciliation. Read the OIDC module and canonical\n scenario matrix before changing any provisioning path.\n\n## Entry points and validation\n\n`src/sveltekit/` owns `createSessionHandler`, `createSessionCookie`,\n`destroySessionCookie`, and `switchSessionTenant`. Use README integration examples\nrather than copying application setup into these instructions.\n\nFrom the repository root:\n\n```bash\npnpm --filter @happyvertical/smrt-users test\npnpm --filter @happyvertical/smrt-users typecheck\npnpm --filter @happyvertical/smrt-users test:postgres\n```\n\nStart with the relevant test file via `test -- src/__tests__/<file>.test.ts`.\nRun `test:postgres` for RLS, principal context, OIDC, or terminal-auth database\nchanges. `typecheck` includes Svelte accessibility checks; plain `tsc` is\ninsufficient. Follow root knowledge freshness checks before shipping.\n",
|
|
7785
8183
|
"moduleDocs": [
|
|
7786
8184
|
{
|
|
7787
8185
|
"path": "agents/permissions.md",
|
|
@@ -7806,7 +8204,7 @@
|
|
|
7806
8204
|
{
|
|
7807
8205
|
"path": "agents/retention.md",
|
|
7808
8206
|
"module": "retention",
|
|
7809
|
-
"content": "# smrt-users/credential retention\n\nModule semantics for `src/retention.ts` and the three `deleteExpired()` paths\nit drives. Package orientation, the permission model, and the security rules\nthat apply before editing anything live in [../AGENTS.md](../AGENTS.md) — read\nthat first.\n\n## Credential retention (#2375)\n\n`SessionCollection.deleteExpired()`,\n`UsersMagicLinkTokenCollection.deleteExpired()` and\n`UsersCliAuthRequestCollection.deleteExpired()` all existed, and all waited for\nan application to remember to call them. Expired credential rows are the worst\nkind of unbounded growth: worthless the moment they expire, and exactly the\nrows an attacker would like to still find in the table.\n\n`src/retention.ts` contributes the three to the framework retention sweep in\n`@happyvertical/smrt-core`, so `smrt db:prune` and a running jobs `TaskRunner`\nreap them.\n\n- **The entry point registers on import.** `src/index.ts` calls\n `registerUserRetentionTasks()`, so any process that loaded this package\n contributes the tasks — including `smrt db:prune`, which imports the package\n optionally for exactly that reason. Registering is not scheduling: nothing is\n deleted until something runs a sweep.\n- **Task names** are `users-sessions`, `users-magic-link-tokens`,\n `users-cli-auth-requests`, `users-login-attempts`, `users-login-audit-events
|
|
8207
|
+
"content": "# smrt-users/credential retention\n\nModule semantics for `src/retention.ts` and the three `deleteExpired()` paths\nit drives. Package orientation, the permission model, and the security rules\nthat apply before editing anything live in [../AGENTS.md](../AGENTS.md) — read\nthat first.\n\n## Credential retention (#2375)\n\n`SessionCollection.deleteExpired()`,\n`UsersMagicLinkTokenCollection.deleteExpired()` and\n`UsersCliAuthRequestCollection.deleteExpired()` all existed, and all waited for\nan application to remember to call them. Expired credential rows are the worst\nkind of unbounded growth: worthless the moment they expire, and exactly the\nrows an attacker would like to still find in the table.\n\n`src/retention.ts` contributes the three to the framework retention sweep in\n`@happyvertical/smrt-core`, so `smrt db:prune` and a running jobs `TaskRunner`\nreap them.\n\n- **The entry point registers on import.** `src/index.ts` calls\n `registerUserRetentionTasks()`, so any process that loaded this package\n contributes the tasks — including `smrt db:prune`, which imports the package\n optionally for exactly that reason. Registering is not scheduling: nothing is\n deleted until something runs a sweep.\n- **Task names** are `users-sessions`, `users-magic-link-tokens`,\n `users-cli-auth-requests`, `users-login-attempts`, `users-login-audit-events`,\n `users-passkey-challenges` (consumed passkey ceremony challenges past their\n expiry, #3275) — prefixed with the package's short name because the retention registry is\n one process-global namespace. Opt one out with\n `runRetentionSweep(db, { tasks: { 'users-sessions': false } })` or\n `smrt db:prune --skip users-sessions`; `unregisterUserRetentionTasks()`\n removes all of them.\n- **The credential tasks have no retention window to configure.** An expired\n credential has nothing worth retaining, so each deletes only already-expired\n rows. An application that keeps expired sessions for audit should opt the\n task out and archive them itself. The two #3273 tasks differ: limiter rows\n are pruned once past their own `retain_until` — written by the limiter from\n its configured window and streak-forgiveness horizon, so a custom-configured\n limiter is never swept early — and never while a lockout is live; audit\n events are pruned after\n `DEFAULT_LOGIN_AUDIT_RETENTION_DAYS` (90). A host that needs longer audit\n retention opts `users-login-audit-events` out and archives.\n- **All three are a single counted DELETE**, not a hydrate-and-delete loop.\n They now run unattended on a timer, and a per-row delete that throws part-way\n leaves the rest of the expired rows un-reaped — the #1400 reasoning that\n already applied to sessions, now applied to the other two. Counting first\n also gives a usable figure where `rowCount` is not populated, and is what\n makes `{ dryRun }` preview the same predicate rather than an estimate. The\n count and the delete are not one transaction, so the figure is approximate\n under concurrent writers.\n- **`expiresAt` is `@field({ indexed: true })`** on `Session`,\n `UsersMagicLinkToken` and `UsersCliAuthRequest`: the prune predicate scans\n that column on every pass.\n- **CLI bearer handoff is single-use.** An approved request becomes `consumed`\n and clears its `sessionId` when one poller wins the exchange. The CLI\n retention task deletes pending requests past their TTL, requests already\n marked `expired` by lazy expiry, and consumed history; it retains approved\n requests until exchange so a near-expiry approval cannot orphan its bearer\n session.\n\n## OAuth credential retention\n\n`users-oauth-credentials` prunes expired authorization codes and access-token\nrevocations. Refresh grants (including consumed or revoked hashes) remain until\n30 days after their own expiry, so replay within their validity period and this\ngrace period still revokes the family. Later replay fails as an unknown token.\nThis bounds retained rotation history even for continuously active families.\nThe sweep locks each candidate family using the same row as token rotation,\nrechecks its descendants, and deletes the family only when none remain. Live\ngrants and revocations are never swept. Each family is a separate transaction;\nrolled-back contention retries follow the OAuth transaction policy. If the SQL\nadapter invalidates a connection (for example SQLite SQLITE_BUSY), the sweep\nreports failure; the host must acquire a fresh connection before retrying. It\nnever continues on an invalidated connection. Dry runs write nothing and\nreport approximate counts under concurrent writes. Clients and consent records\nremain for application-managed lifecycle/audit. Opt-out and unregister work as\nfor the other retention tasks. No raw bearer or credential hash is logged.\n"
|
|
7810
8208
|
}
|
|
7811
8209
|
],
|
|
7812
8210
|
"recipes": [
|
package/dist/svelte/auth.d.ts
CHANGED
|
@@ -26,7 +26,12 @@ export interface UsersAuthAdapter {
|
|
|
26
26
|
signInWithOidc?(input: {
|
|
27
27
|
providerId: string;
|
|
28
28
|
}): Promise<void>;
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Provided only when the host supplies a `passkeyCeremony`. Build one with
|
|
31
|
+
* `createPasskeySignInCeremony()` against the routes of
|
|
32
|
+
* `createPasskeyCredentialHandlers()` (#3275): endpoint configuration alone
|
|
33
|
+
* cannot perform the browser ceremony.
|
|
34
|
+
*/
|
|
30
35
|
signInWithPasskey?(): Promise<void>;
|
|
31
36
|
revokeSession?(sessionId: string): Promise<void>;
|
|
32
37
|
revokeApiKey?(apiKeyId: string): Promise<void>;
|
|
@@ -54,8 +59,9 @@ export interface UsersAuthEndpointOptions {
|
|
|
54
59
|
fetch?: typeof fetch;
|
|
55
60
|
endpoints?: Partial<Record<Exclude<keyof UsersAuthAdapter, 'signInWithPasskey'>, string>>;
|
|
56
61
|
/**
|
|
57
|
-
* A host-owned WebAuthn ceremony
|
|
58
|
-
*
|
|
62
|
+
* A host-owned WebAuthn ceremony, normally `createPasskeySignInCeremony()`.
|
|
63
|
+
* Endpoint configuration alone cannot enable passkeys because it cannot
|
|
64
|
+
* perform the browser ceremony (#3275).
|
|
59
65
|
*/
|
|
60
66
|
passkeyCeremony?: NonNullable<UsersAuthAdapter['signInWithPasskey']>;
|
|
61
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/svelte/auth.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,iFAAiF;AACjF;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,CAAC,CAAC,KAAK,EAAE;QACzB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,MAAM,CAAC,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,gBAAgB,CAAC,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,C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AAI,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,uFAAuF;AACvF,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CACjB,MAAM,CAAC,OAAO,CAAC,MAAM,gBAAgB,EAAE,mBAAmB,CAAC,EAAE,MAAM,CAAC,CACrE,CAAC;IACF;;;;OAIG;IACH,eAAe,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACtE;AAeD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,wBAA6B,GACrC,gBAAgB,CAuBlB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpE"}
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ import UserList from './components/UserList.svelte';
|
|
|
21
21
|
import UserMenu from './components/UserMenu.svelte';
|
|
22
22
|
export type { AccountApiKey, AccountSession, OidcProviderButton, UsersAuthAdapter, UsersAuthEndpointOptions, } from './auth.js';
|
|
23
23
|
export { createUsersAuthAdapter } from './auth.js';
|
|
24
|
+
export type { CreatePasskeySignInCeremonyOptions, RegisterPasskeyOptions, } from './passkey.js';
|
|
25
|
+
export { browserSupportsPasskeys, createPasskeySignInCeremony, PasskeyRequestError, registerPasskey, } from './passkey.js';
|
|
24
26
|
export { AccountSecurityPanel, InviteUserModal, MagicLinkForm, OidcProviderButtons, PasskeySignInButton, SignInForm, SignUpForm, UserAvatar, UserCard, UserForm, UserList, UserMenu, };
|
|
25
27
|
export type InviteUserModalProps = ComponentProps<typeof InviteUserModal>;
|
|
26
28
|
export type UserAvatarProps = ComponentProps<typeof UserAvatar>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAE5E,OAAO,eAAe,MAAM,qCAAqC,CAAC;AAClE,OAAO,aAAa,MAAM,mCAAmC,CAAC;AAC9D,OAAO,mBAAmB,MAAM,yCAAyC,CAAC;AAC1E,OAAO,mBAAmB,MAAM,yCAAyC,CAAC;AAC1E,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AAEpD,YAAY,EACV,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAO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AAM,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5D,MAAM,MAAM,yBAAyB,GAAG,cAAc,CACpD,OAAO,oBAAoB,CAC5B,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,cAAc,CACnD,OAAO,mBAAmB,CAC3B,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CACnD,OAAO,mBAAmB,CAC3B,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
package/dist/svelte/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import UserForm from './components/UserForm.svelte';
|
|
|
22
22
|
import UserList from './components/UserList.svelte';
|
|
23
23
|
import UserMenu from './components/UserMenu.svelte';
|
|
24
24
|
export { createUsersAuthAdapter } from './auth.js';
|
|
25
|
+
export { browserSupportsPasskeys, createPasskeySignInCeremony, PasskeyRequestError, registerPasskey, } from './passkey.js';
|
|
25
26
|
// Export components
|
|
26
27
|
export { AccountSecurityPanel, InviteUserModal, MagicLinkForm, OidcProviderButtons, PasskeySignInButton, SignInForm, SignUpForm, UserAvatar, UserCard, UserForm, UserList, UserMenu, };
|
|
27
28
|
// Auto-register with ModuleUIRegistry
|