@sixb/server 0.1.13 → 0.1.14
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 +31 -11
- package/dist/index.js.map +4 -4
- package/dist/routes/auth.d.ts +4 -0
- package/dist/routes/auth.d.ts.map +1 -1
- package/dist/schemas/auth.d.ts +32 -0
- package/dist/schemas/auth.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/routes/auth.ts +39 -11
- package/src/schemas/auth.ts +2 -0
package/dist/routes/auth.d.ts
CHANGED
|
@@ -1298,6 +1298,7 @@ export declare function registerAuthRoutes(app: Elysia, host: SixbHostView, opti
|
|
|
1298
1298
|
reactivate: boolean;
|
|
1299
1299
|
};
|
|
1300
1300
|
groupIds: string[];
|
|
1301
|
+
managedGroupIds: string[];
|
|
1301
1302
|
}[];
|
|
1302
1303
|
};
|
|
1303
1304
|
401: {
|
|
@@ -1351,6 +1352,7 @@ export declare function registerAuthRoutes(app: Elysia, host: SixbHostView, opti
|
|
|
1351
1352
|
avatarUrl?: string | undefined;
|
|
1352
1353
|
};
|
|
1353
1354
|
groupIds: string[];
|
|
1355
|
+
managedGroupIds: string[];
|
|
1354
1356
|
};
|
|
1355
1357
|
};
|
|
1356
1358
|
404: {
|
|
@@ -1410,6 +1412,7 @@ export declare function registerAuthRoutes(app: Elysia, host: SixbHostView, opti
|
|
|
1410
1412
|
avatarUrl?: string | undefined;
|
|
1411
1413
|
};
|
|
1412
1414
|
groupIds: string[];
|
|
1415
|
+
managedGroupIds: string[];
|
|
1413
1416
|
};
|
|
1414
1417
|
};
|
|
1415
1418
|
404: {
|
|
@@ -1466,6 +1469,7 @@ export declare function registerAuthRoutes(app: Elysia, host: SixbHostView, opti
|
|
|
1466
1469
|
avatarUrl?: string | undefined;
|
|
1467
1470
|
};
|
|
1468
1471
|
groupIds: string[];
|
|
1472
|
+
managedGroupIds: string[];
|
|
1469
1473
|
};
|
|
1470
1474
|
};
|
|
1471
1475
|
404: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/routes/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/routes/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAA;AA+BnB,OAAO,EAAE,KAAK,MAAM,EAAK,MAAM,QAAQ,CAAA;AAGvC,OAAO,EACL,KAAK,gCAAgC,EACrC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAGhC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAA;AAiF3B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,kBAAkB,EAAE,yBAAyB,CAAA;IACtD,QAAQ,CAAC,0BAA0B,EAAE,0BAA0B,CAAA;IAC/D,QAAQ,CAAC,+BAA+B,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,gCAAgC,CAAA;IAChG,QAAQ,CAAC,wBAAwB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;IAC/D,QAAQ,CAAC,gCAAgC,EAAE,CACzC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,2BAA2B,KAC/B,6BAA6B,CAAA;IAClC,QAAQ,CAAC,cAAc,CAAC,EAAE,yBAAyB,CAAA;CACpD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAm7C7F"}
|
package/dist/schemas/auth.d.ts
CHANGED
|
@@ -231,6 +231,8 @@ export declare const AuthManagedMemberSchema: z.ZodObject<{
|
|
|
231
231
|
avatarUrl?: string | undefined;
|
|
232
232
|
}>;
|
|
233
233
|
groupIds: z.ZodArray<z.ZodString, "many">;
|
|
234
|
+
/** The groups among `groupIds` the identity provider manages; they sync at sign-in. */
|
|
235
|
+
managedGroupIds: z.ZodArray<z.ZodString, "many">;
|
|
234
236
|
}, "strip", z.ZodTypeAny, {
|
|
235
237
|
user: {
|
|
236
238
|
status: "active" | "suspended";
|
|
@@ -242,6 +244,7 @@ export declare const AuthManagedMemberSchema: z.ZodObject<{
|
|
|
242
244
|
avatarUrl?: string | undefined;
|
|
243
245
|
};
|
|
244
246
|
groupIds: string[];
|
|
247
|
+
managedGroupIds: string[];
|
|
245
248
|
}, {
|
|
246
249
|
user: {
|
|
247
250
|
status: "active" | "suspended";
|
|
@@ -253,6 +256,7 @@ export declare const AuthManagedMemberSchema: z.ZodObject<{
|
|
|
253
256
|
avatarUrl?: string | undefined;
|
|
254
257
|
};
|
|
255
258
|
groupIds: string[];
|
|
259
|
+
managedGroupIds: string[];
|
|
256
260
|
}>;
|
|
257
261
|
export declare const AuthMemberCapabilitiesSchema: z.ZodObject<{
|
|
258
262
|
assignGroups: z.ZodBoolean;
|
|
@@ -294,6 +298,8 @@ export declare const AuthMemberSchema: z.ZodObject<{
|
|
|
294
298
|
avatarUrl?: string | undefined;
|
|
295
299
|
}>;
|
|
296
300
|
groupIds: z.ZodArray<z.ZodString, "many">;
|
|
301
|
+
/** The groups among `groupIds` the identity provider manages; they sync at sign-in. */
|
|
302
|
+
managedGroupIds: z.ZodArray<z.ZodString, "many">;
|
|
297
303
|
} & {
|
|
298
304
|
capabilities: z.ZodObject<{
|
|
299
305
|
assignGroups: z.ZodBoolean;
|
|
@@ -324,6 +330,7 @@ export declare const AuthMemberSchema: z.ZodObject<{
|
|
|
324
330
|
reactivate: boolean;
|
|
325
331
|
};
|
|
326
332
|
groupIds: string[];
|
|
333
|
+
managedGroupIds: string[];
|
|
327
334
|
}, {
|
|
328
335
|
user: {
|
|
329
336
|
status: "active" | "suspended";
|
|
@@ -340,6 +347,7 @@ export declare const AuthMemberSchema: z.ZodObject<{
|
|
|
340
347
|
reactivate: boolean;
|
|
341
348
|
};
|
|
342
349
|
groupIds: string[];
|
|
350
|
+
managedGroupIds: string[];
|
|
343
351
|
}>;
|
|
344
352
|
export declare const GetAuthAccessManagementOptionsResponseSchema: z.ZodObject<{
|
|
345
353
|
groups: z.ZodArray<z.ZodObject<{
|
|
@@ -1386,6 +1394,8 @@ export declare const ListAuthMembersResponseSchema: z.ZodObject<{
|
|
|
1386
1394
|
avatarUrl?: string | undefined;
|
|
1387
1395
|
}>;
|
|
1388
1396
|
groupIds: z.ZodArray<z.ZodString, "many">;
|
|
1397
|
+
/** The groups among `groupIds` the identity provider manages; they sync at sign-in. */
|
|
1398
|
+
managedGroupIds: z.ZodArray<z.ZodString, "many">;
|
|
1389
1399
|
} & {
|
|
1390
1400
|
capabilities: z.ZodObject<{
|
|
1391
1401
|
assignGroups: z.ZodBoolean;
|
|
@@ -1416,6 +1426,7 @@ export declare const ListAuthMembersResponseSchema: z.ZodObject<{
|
|
|
1416
1426
|
reactivate: boolean;
|
|
1417
1427
|
};
|
|
1418
1428
|
groupIds: string[];
|
|
1429
|
+
managedGroupIds: string[];
|
|
1419
1430
|
}, {
|
|
1420
1431
|
user: {
|
|
1421
1432
|
status: "active" | "suspended";
|
|
@@ -1432,6 +1443,7 @@ export declare const ListAuthMembersResponseSchema: z.ZodObject<{
|
|
|
1432
1443
|
reactivate: boolean;
|
|
1433
1444
|
};
|
|
1434
1445
|
groupIds: string[];
|
|
1446
|
+
managedGroupIds: string[];
|
|
1435
1447
|
}>, "many">;
|
|
1436
1448
|
hasMore: z.ZodBoolean;
|
|
1437
1449
|
total: z.ZodNumber;
|
|
@@ -1454,6 +1466,7 @@ export declare const ListAuthMembersResponseSchema: z.ZodObject<{
|
|
|
1454
1466
|
reactivate: boolean;
|
|
1455
1467
|
};
|
|
1456
1468
|
groupIds: string[];
|
|
1469
|
+
managedGroupIds: string[];
|
|
1457
1470
|
}[];
|
|
1458
1471
|
}, {
|
|
1459
1472
|
hasMore: boolean;
|
|
@@ -1474,6 +1487,7 @@ export declare const ListAuthMembersResponseSchema: z.ZodObject<{
|
|
|
1474
1487
|
reactivate: boolean;
|
|
1475
1488
|
};
|
|
1476
1489
|
groupIds: string[];
|
|
1490
|
+
managedGroupIds: string[];
|
|
1477
1491
|
}[];
|
|
1478
1492
|
}>;
|
|
1479
1493
|
export declare const AuthMemberParamsSchema: z.ZodObject<{
|
|
@@ -1518,6 +1532,8 @@ export declare const UpdateAuthMemberGroupsResponseSchema: z.ZodObject<{
|
|
|
1518
1532
|
avatarUrl?: string | undefined;
|
|
1519
1533
|
}>;
|
|
1520
1534
|
groupIds: z.ZodArray<z.ZodString, "many">;
|
|
1535
|
+
/** The groups among `groupIds` the identity provider manages; they sync at sign-in. */
|
|
1536
|
+
managedGroupIds: z.ZodArray<z.ZodString, "many">;
|
|
1521
1537
|
}, "strip", z.ZodTypeAny, {
|
|
1522
1538
|
user: {
|
|
1523
1539
|
status: "active" | "suspended";
|
|
@@ -1529,6 +1545,7 @@ export declare const UpdateAuthMemberGroupsResponseSchema: z.ZodObject<{
|
|
|
1529
1545
|
avatarUrl?: string | undefined;
|
|
1530
1546
|
};
|
|
1531
1547
|
groupIds: string[];
|
|
1548
|
+
managedGroupIds: string[];
|
|
1532
1549
|
}, {
|
|
1533
1550
|
user: {
|
|
1534
1551
|
status: "active" | "suspended";
|
|
@@ -1540,6 +1557,7 @@ export declare const UpdateAuthMemberGroupsResponseSchema: z.ZodObject<{
|
|
|
1540
1557
|
avatarUrl?: string | undefined;
|
|
1541
1558
|
};
|
|
1542
1559
|
groupIds: string[];
|
|
1560
|
+
managedGroupIds: string[];
|
|
1543
1561
|
}>;
|
|
1544
1562
|
}, "strip", z.ZodTypeAny, {
|
|
1545
1563
|
member: {
|
|
@@ -1553,6 +1571,7 @@ export declare const UpdateAuthMemberGroupsResponseSchema: z.ZodObject<{
|
|
|
1553
1571
|
avatarUrl?: string | undefined;
|
|
1554
1572
|
};
|
|
1555
1573
|
groupIds: string[];
|
|
1574
|
+
managedGroupIds: string[];
|
|
1556
1575
|
};
|
|
1557
1576
|
}, {
|
|
1558
1577
|
member: {
|
|
@@ -1566,6 +1585,7 @@ export declare const UpdateAuthMemberGroupsResponseSchema: z.ZodObject<{
|
|
|
1566
1585
|
avatarUrl?: string | undefined;
|
|
1567
1586
|
};
|
|
1568
1587
|
groupIds: string[];
|
|
1588
|
+
managedGroupIds: string[];
|
|
1569
1589
|
};
|
|
1570
1590
|
}>;
|
|
1571
1591
|
export declare const SuspendAuthMemberResponseSchema: z.ZodObject<{
|
|
@@ -1596,6 +1616,8 @@ export declare const SuspendAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1596
1616
|
avatarUrl?: string | undefined;
|
|
1597
1617
|
}>;
|
|
1598
1618
|
groupIds: z.ZodArray<z.ZodString, "many">;
|
|
1619
|
+
/** The groups among `groupIds` the identity provider manages; they sync at sign-in. */
|
|
1620
|
+
managedGroupIds: z.ZodArray<z.ZodString, "many">;
|
|
1599
1621
|
}, "strip", z.ZodTypeAny, {
|
|
1600
1622
|
user: {
|
|
1601
1623
|
status: "active" | "suspended";
|
|
@@ -1607,6 +1629,7 @@ export declare const SuspendAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1607
1629
|
avatarUrl?: string | undefined;
|
|
1608
1630
|
};
|
|
1609
1631
|
groupIds: string[];
|
|
1632
|
+
managedGroupIds: string[];
|
|
1610
1633
|
}, {
|
|
1611
1634
|
user: {
|
|
1612
1635
|
status: "active" | "suspended";
|
|
@@ -1618,6 +1641,7 @@ export declare const SuspendAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1618
1641
|
avatarUrl?: string | undefined;
|
|
1619
1642
|
};
|
|
1620
1643
|
groupIds: string[];
|
|
1644
|
+
managedGroupIds: string[];
|
|
1621
1645
|
}>;
|
|
1622
1646
|
}, "strip", z.ZodTypeAny, {
|
|
1623
1647
|
member: {
|
|
@@ -1631,6 +1655,7 @@ export declare const SuspendAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1631
1655
|
avatarUrl?: string | undefined;
|
|
1632
1656
|
};
|
|
1633
1657
|
groupIds: string[];
|
|
1658
|
+
managedGroupIds: string[];
|
|
1634
1659
|
};
|
|
1635
1660
|
}, {
|
|
1636
1661
|
member: {
|
|
@@ -1644,6 +1669,7 @@ export declare const SuspendAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1644
1669
|
avatarUrl?: string | undefined;
|
|
1645
1670
|
};
|
|
1646
1671
|
groupIds: string[];
|
|
1672
|
+
managedGroupIds: string[];
|
|
1647
1673
|
};
|
|
1648
1674
|
}>;
|
|
1649
1675
|
export declare const ReactivateAuthMemberResponseSchema: z.ZodObject<{
|
|
@@ -1674,6 +1700,8 @@ export declare const ReactivateAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1674
1700
|
avatarUrl?: string | undefined;
|
|
1675
1701
|
}>;
|
|
1676
1702
|
groupIds: z.ZodArray<z.ZodString, "many">;
|
|
1703
|
+
/** The groups among `groupIds` the identity provider manages; they sync at sign-in. */
|
|
1704
|
+
managedGroupIds: z.ZodArray<z.ZodString, "many">;
|
|
1677
1705
|
}, "strip", z.ZodTypeAny, {
|
|
1678
1706
|
user: {
|
|
1679
1707
|
status: "active" | "suspended";
|
|
@@ -1685,6 +1713,7 @@ export declare const ReactivateAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1685
1713
|
avatarUrl?: string | undefined;
|
|
1686
1714
|
};
|
|
1687
1715
|
groupIds: string[];
|
|
1716
|
+
managedGroupIds: string[];
|
|
1688
1717
|
}, {
|
|
1689
1718
|
user: {
|
|
1690
1719
|
status: "active" | "suspended";
|
|
@@ -1696,6 +1725,7 @@ export declare const ReactivateAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1696
1725
|
avatarUrl?: string | undefined;
|
|
1697
1726
|
};
|
|
1698
1727
|
groupIds: string[];
|
|
1728
|
+
managedGroupIds: string[];
|
|
1699
1729
|
}>;
|
|
1700
1730
|
}, "strip", z.ZodTypeAny, {
|
|
1701
1731
|
member: {
|
|
@@ -1709,6 +1739,7 @@ export declare const ReactivateAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1709
1739
|
avatarUrl?: string | undefined;
|
|
1710
1740
|
};
|
|
1711
1741
|
groupIds: string[];
|
|
1742
|
+
managedGroupIds: string[];
|
|
1712
1743
|
};
|
|
1713
1744
|
}, {
|
|
1714
1745
|
member: {
|
|
@@ -1722,6 +1753,7 @@ export declare const ReactivateAuthMemberResponseSchema: z.ZodObject<{
|
|
|
1722
1753
|
avatarUrl?: string | undefined;
|
|
1723
1754
|
};
|
|
1724
1755
|
groupIds: string[];
|
|
1756
|
+
managedGroupIds: string[];
|
|
1725
1757
|
};
|
|
1726
1758
|
}>;
|
|
1727
1759
|
export declare const CreateAuthInvitationBodySchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/schemas/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,0BAA0B,+CAA6C,CAAA;AAEpF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU/B,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;EAQvC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;EAAwB,CAAA;AAEpE,eAAO,MAAM,yBAAyB,2CAAyC,CAAA;AAC/E,eAAO,MAAM,2BAA2B,6CAA2C,CAAA;AACnF,eAAO,MAAM,8BAA8B,oCAAkC,CAAA;AAC7E,eAAO,MAAM,oBAAoB,oCAAkC,CAAA;AAEnE,eAAO,MAAM,4BAA4B;;;;;;;;;EAGvC,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAchC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;EAQnC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;EAQ/B,CAAA;AAEF,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/schemas/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,0BAA0B,+CAA6C,CAAA;AAEpF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU/B,CAAA;AAEF,eAAO,MAAM,4BAA4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;;;;;;;;;;;;EAE/C,CAAA;AAEF,eAAO,MAAM,8BAA8B;;;QAZzC,oFAAoF;;;;;;;;QAQpF,+CAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM/C,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;;EAExC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;EAE1C,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "HTTP and WebSocket API server for Sixb",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"zod-to-json-schema": "^3.24.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@sixb/core": "0.1.
|
|
41
|
+
"@sixb/core": "0.1.14"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@sixb/auth-magic-link": "0.1.
|
|
45
|
-
"@sixb/auth-oidc": "0.1.
|
|
46
|
-
"@sixb/core": "0.1.
|
|
47
|
-
"@sixb/sqlite": "0.1.
|
|
44
|
+
"@sixb/auth-magic-link": "0.1.5",
|
|
45
|
+
"@sixb/auth-oidc": "0.1.4",
|
|
46
|
+
"@sixb/core": "0.1.14",
|
|
47
|
+
"@sixb/sqlite": "0.1.14",
|
|
48
48
|
"@types/bun": "latest",
|
|
49
49
|
"typescript": "^5.7.0"
|
|
50
50
|
},
|
package/src/routes/auth.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
isOidcAuthStrategy,
|
|
23
23
|
type MagicLinkAuthStrategy,
|
|
24
24
|
type MemberSummary,
|
|
25
|
+
SignInRefusedError,
|
|
25
26
|
shouldUseSecureCookies,
|
|
26
27
|
verifyCsrfToken,
|
|
27
28
|
verifyDoubleSubmitCsrf,
|
|
@@ -1260,7 +1261,7 @@ export function registerAuthRoutes(app: Elysia, host: SixbHostView, options: Aut
|
|
|
1260
1261
|
groupIds: parsed.groupIds,
|
|
1261
1262
|
})
|
|
1262
1263
|
|
|
1263
|
-
return jsonResponse({ member: serializeManagedMember(result
|
|
1264
|
+
return jsonResponse({ member: serializeManagedMember(result) }, 200)
|
|
1264
1265
|
} catch (error) {
|
|
1265
1266
|
return authRouteErrorResponse(error)
|
|
1266
1267
|
}
|
|
@@ -1292,7 +1293,7 @@ export function registerAuthRoutes(app: Elysia, host: SixbHostView, options: Aut
|
|
|
1292
1293
|
const parsed = AuthMemberParamsSchema.parse(params)
|
|
1293
1294
|
const result = await host.auth.suspendMember(caller, { userId: parsed.userId })
|
|
1294
1295
|
|
|
1295
|
-
return jsonResponse({ member: serializeManagedMember(result
|
|
1296
|
+
return jsonResponse({ member: serializeManagedMember(result) }, 200)
|
|
1296
1297
|
} catch (error) {
|
|
1297
1298
|
return authRouteErrorResponse(error)
|
|
1298
1299
|
}
|
|
@@ -1322,7 +1323,7 @@ export function registerAuthRoutes(app: Elysia, host: SixbHostView, options: Aut
|
|
|
1322
1323
|
const parsed = AuthMemberParamsSchema.parse(params)
|
|
1323
1324
|
const result = await host.auth.reactivateMember(caller, { userId: parsed.userId })
|
|
1324
1325
|
|
|
1325
|
-
return jsonResponse({ member: serializeManagedMember(result
|
|
1326
|
+
return jsonResponse({ member: serializeManagedMember(result) }, 200)
|
|
1326
1327
|
} catch (error) {
|
|
1327
1328
|
return authRouteErrorResponse(error)
|
|
1328
1329
|
}
|
|
@@ -1556,6 +1557,9 @@ export function registerAuthRoutes(app: Elysia, host: SixbHostView, options: Aut
|
|
|
1556
1557
|
})
|
|
1557
1558
|
} catch (error) {
|
|
1558
1559
|
logAuthCallbackError("OIDC", error)
|
|
1560
|
+
if (error instanceof SignInRefusedError) {
|
|
1561
|
+
return htmlMessageResponse(signInRefusalMessage(error), 403, "You can't sign in")
|
|
1562
|
+
}
|
|
1559
1563
|
return htmlMessageResponse("This sign-in attempt could not be completed.", 400)
|
|
1560
1564
|
}
|
|
1561
1565
|
}
|
|
@@ -2470,15 +2474,16 @@ function serializeInvitationDelivery(delivery: InviteDeliveryResult) {
|
|
|
2470
2474
|
|
|
2471
2475
|
function serializeMemberSummary(member: MemberSummary) {
|
|
2472
2476
|
return {
|
|
2473
|
-
...serializeManagedMember(member
|
|
2477
|
+
...serializeManagedMember(member),
|
|
2474
2478
|
capabilities: member.capabilities,
|
|
2475
2479
|
}
|
|
2476
2480
|
}
|
|
2477
2481
|
|
|
2478
|
-
function serializeManagedMember(
|
|
2482
|
+
function serializeManagedMember(member: Omit<MemberSummary, "capabilities">) {
|
|
2479
2483
|
return {
|
|
2480
|
-
user: serializeMemberUser(user),
|
|
2481
|
-
groupIds: [...groupIds],
|
|
2484
|
+
user: serializeMemberUser(member.user),
|
|
2485
|
+
groupIds: [...member.groupIds],
|
|
2486
|
+
managedGroupIds: [...member.managedGroupIds],
|
|
2482
2487
|
}
|
|
2483
2488
|
}
|
|
2484
2489
|
|
|
@@ -2552,17 +2557,40 @@ function authRouteErrorResponse(error: unknown): Response {
|
|
|
2552
2557
|
return jsonResponse({ error: String(error) }, 500)
|
|
2553
2558
|
}
|
|
2554
2559
|
|
|
2560
|
+
function signInRefusalMessage(error: SignInRefusedError): string {
|
|
2561
|
+
const who = error.email ?? "This account"
|
|
2562
|
+
switch (error.reason) {
|
|
2563
|
+
case "not_invited":
|
|
2564
|
+
return `${who} hasn't been invited. Ask an administrator to invite this address.`
|
|
2565
|
+
case "suspended":
|
|
2566
|
+
return `${who} has been suspended. Ask an administrator to reactivate it.`
|
|
2567
|
+
case "domain_not_allowed":
|
|
2568
|
+
return `${who} isn't on a domain that can sign in here.`
|
|
2569
|
+
case "no_trusted_address":
|
|
2570
|
+
return "Your identity provider didn't share an email address this app trusts. Ask an administrator to check the sign-in setup."
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2555
2574
|
function logAuthCallbackError(kind: string, error: unknown): void {
|
|
2556
|
-
|
|
2575
|
+
// A provider that vouches for no address is a setup mistake nobody signing in can fix, so it is
|
|
2576
|
+
// logged even without SIXB_AUTH_DEBUG.
|
|
2577
|
+
const setupMistake = error instanceof SignInRefusedError && error.reason === "no_trusted_address"
|
|
2578
|
+
if (
|
|
2579
|
+
!setupMistake &&
|
|
2580
|
+
process.env.NODE_ENV !== "development" &&
|
|
2581
|
+
process.env.SIXB_AUTH_DEBUG !== "1"
|
|
2582
|
+
) {
|
|
2557
2583
|
return
|
|
2558
2584
|
}
|
|
2559
2585
|
|
|
2560
2586
|
const detail =
|
|
2561
2587
|
error instanceof AuthStorageError
|
|
2562
2588
|
? `${error.name}(${error.code}): ${error.message}`
|
|
2563
|
-
: error instanceof
|
|
2564
|
-
? `${error.name}: ${error.message}`
|
|
2565
|
-
:
|
|
2589
|
+
: error instanceof SignInRefusedError
|
|
2590
|
+
? `${error.name}(${error.reason}): ${error.message}`
|
|
2591
|
+
: error instanceof Error
|
|
2592
|
+
? `${error.name}: ${error.message}`
|
|
2593
|
+
: String(error)
|
|
2566
2594
|
|
|
2567
2595
|
console.error(`[SixbServer] ${kind} auth callback failed: ${detail}`)
|
|
2568
2596
|
}
|
package/src/schemas/auth.ts
CHANGED
|
@@ -81,6 +81,8 @@ export const AuthMemberUserSchema = z.object({
|
|
|
81
81
|
export const AuthManagedMemberSchema = z.object({
|
|
82
82
|
user: AuthMemberUserSchema,
|
|
83
83
|
groupIds: z.array(z.string()),
|
|
84
|
+
/** The groups among `groupIds` the identity provider manages; they sync at sign-in. */
|
|
85
|
+
managedGroupIds: z.array(z.string()),
|
|
84
86
|
})
|
|
85
87
|
|
|
86
88
|
export const AuthMemberCapabilitiesSchema = z.object({
|