@sixb/core 0.1.19 → 0.1.20

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 (211) hide show
  1. package/dist/actions/index.js +24 -24
  2. package/dist/agents/index.js +25 -25
  3. package/dist/agents/index.js.map +1 -1
  4. package/dist/auth/cookies.d.ts +2 -4
  5. package/dist/auth/cookies.d.ts.map +1 -1
  6. package/dist/auth/index.d.ts +0 -2
  7. package/dist/auth/index.d.ts.map +1 -1
  8. package/dist/auth/index.js +8 -14
  9. package/dist/auth/index.js.map +1 -1
  10. package/dist/auth/runtime.d.ts +8 -10
  11. package/dist/auth/runtime.d.ts.map +1 -1
  12. package/dist/auth/session-cache.d.ts +1 -5
  13. package/dist/auth/session-cache.d.ts.map +1 -1
  14. package/dist/auth/strategy.js +1 -1
  15. package/dist/auth/types.d.ts +4 -8
  16. package/dist/auth/types.d.ts.map +1 -1
  17. package/dist/auth/validation.d.ts +0 -1
  18. package/dist/auth/validation.d.ts.map +1 -1
  19. package/dist/authorization/decision.d.ts +0 -4
  20. package/dist/authorization/decision.d.ts.map +1 -1
  21. package/dist/authorization/grant-kinds.d.ts +6 -8
  22. package/dist/authorization/grant-kinds.d.ts.map +1 -1
  23. package/dist/authorization/index.d.ts +0 -1
  24. package/dist/authorization/index.d.ts.map +1 -1
  25. package/dist/authorization/index.js +3 -7
  26. package/dist/authorization/index.js.map +1 -1
  27. package/dist/authorization/resolve.d.ts +1 -1
  28. package/dist/authorization/resolve.d.ts.map +1 -1
  29. package/dist/bootstrap/index.js +26 -26
  30. package/dist/{chunk-aff7cyea.js → chunk-0rbyz4qy.js} +21 -21
  31. package/dist/{chunk-aff7cyea.js.map → chunk-0rbyz4qy.js.map} +1 -1
  32. package/dist/{chunk-rz53yb4v.js → chunk-0yh890a4.js} +1 -1
  33. package/dist/{chunk-7mbzgd9m.js → chunk-1zq2p6g0.js} +1 -1
  34. package/dist/{chunk-dnmadg9k.js → chunk-3t2hgbgd.js} +2 -2
  35. package/dist/{chunk-wwdfe68s.js → chunk-4vyr1j8f.js} +2 -2
  36. package/dist/{chunk-kyzq4wy9.js → chunk-5j58wjct.js} +15 -15
  37. package/dist/chunk-5j58wjct.js.map +18 -0
  38. package/dist/{chunk-ey3pyej1.js → chunk-6c6sn0bh.js} +29 -24
  39. package/dist/{chunk-ey3pyej1.js.map → chunk-6c6sn0bh.js.map} +3 -3
  40. package/dist/{chunk-q1vkr2ys.js → chunk-6p49a5cq.js} +2 -2
  41. package/dist/{chunk-nre82s12.js → chunk-9dmt152s.js} +1 -1
  42. package/dist/{chunk-7kg3k1m9.js → chunk-9w055r5b.js} +1 -1
  43. package/dist/{chunk-4tcx876c.js → chunk-bx9q3cwv.js} +15 -15
  44. package/dist/{chunk-4tcx876c.js.map → chunk-bx9q3cwv.js.map} +1 -1
  45. package/dist/{chunk-bpgy64fw.js → chunk-d09tj99x.js} +1 -1
  46. package/dist/{chunk-y7rqfrgg.js → chunk-d0bqz29d.js} +23 -36
  47. package/dist/chunk-d0bqz29d.js.map +23 -0
  48. package/dist/{chunk-rhg02hxq.js → chunk-dk8tkk5f.js} +3 -3
  49. package/dist/{chunk-xt1zt7gv.js → chunk-es1gxsbf.js} +24 -15
  50. package/dist/chunk-es1gxsbf.js.map +13 -0
  51. package/dist/{chunk-52bk93x8.js → chunk-fkgc1wt8.js} +1 -1
  52. package/dist/{chunk-enpsx8k5.js → chunk-gsjm1wms.js} +16 -20
  53. package/dist/chunk-gsjm1wms.js.map +10 -0
  54. package/dist/{chunk-2jntasmh.js → chunk-hcbyfxbe.js} +25 -49
  55. package/dist/chunk-hcbyfxbe.js.map +12 -0
  56. package/dist/{chunk-zrmy8zvw.js → chunk-hjzdd750.js} +3 -3
  57. package/dist/chunk-hkc3jct7.js.map +1 -1
  58. package/dist/{chunk-85yvv5n0.js → chunk-k6q3n2sc.js} +3 -3
  59. package/dist/{chunk-j2bp5ryw.js → chunk-n33z5bjw.js} +11 -10
  60. package/dist/{chunk-j2bp5ryw.js.map → chunk-n33z5bjw.js.map} +3 -3
  61. package/dist/{chunk-80mc0971.js → chunk-ren4kg2j.js} +8 -8
  62. package/dist/{chunk-1f7wpmyp.js → chunk-rrzt8jdy.js} +2 -2
  63. package/dist/{chunk-6gmfggss.js → chunk-t7x8dmn0.js} +2 -2
  64. package/dist/{chunk-wz0xs816.js → chunk-tg2cw67r.js} +1 -1
  65. package/dist/{chunk-3gnrh4ve.js → chunk-vpq4shxz.js} +46 -106
  66. package/dist/chunk-vpq4shxz.js.map +39 -0
  67. package/dist/{chunk-bwjcehza.js → chunk-way52z4h.js} +1 -1
  68. package/dist/{chunk-tjb1mk5t.js → chunk-x6m907x7.js} +2 -2
  69. package/dist/{chunk-t6vq7bff.js → chunk-xfs8x8m9.js} +3 -3
  70. package/dist/{chunk-d2ync1v3.js → chunk-yevzdx4y.js} +3 -3
  71. package/dist/{chunk-kg5j6fct.js → chunk-z4m0yz8c.js} +1 -1
  72. package/dist/datasets/write.js +5 -5
  73. package/dist/deploy/internal.js +4 -3
  74. package/dist/deploy/internal.js.map +4 -4
  75. package/dist/deploy/services.d.ts.map +1 -1
  76. package/dist/deploy/types.d.ts +1 -2
  77. package/dist/deploy/types.d.ts.map +1 -1
  78. package/dist/execution/agent.js +24 -24
  79. package/dist/execution/authorization.d.ts.map +1 -1
  80. package/dist/execution/primitive.js +24 -24
  81. package/dist/execution/request.js +23 -23
  82. package/dist/index.d.ts +5 -5
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +33 -46
  85. package/dist/index.js.map +1 -1
  86. package/dist/lake-storage/index.js +5 -5
  87. package/dist/materializer/index.js +13 -13
  88. package/dist/models/execution/index.js +10 -10
  89. package/dist/objects/index.js +24 -24
  90. package/dist/objects/query/index.js +12 -12
  91. package/dist/objects/vectors/handle.d.ts.map +1 -1
  92. package/dist/objects/vectors/profile.d.ts +5 -0
  93. package/dist/objects/vectors/profile.d.ts.map +1 -1
  94. package/dist/ontology/index.js +3 -3
  95. package/dist/pipelines/index.js +15 -15
  96. package/dist/projections/internal.js +13 -13
  97. package/dist/runtime/internal.js +13 -13
  98. package/dist/security/builders.d.ts.map +1 -1
  99. package/dist/security/every.d.ts +1 -4
  100. package/dist/security/every.d.ts.map +1 -1
  101. package/dist/security/grants.d.ts +2 -4
  102. package/dist/security/grants.d.ts.map +1 -1
  103. package/dist/security/index.d.ts +1 -2
  104. package/dist/security/index.d.ts.map +1 -1
  105. package/dist/security/membership-policies.d.ts.map +1 -1
  106. package/dist/security/public.d.ts +10 -0
  107. package/dist/security/public.d.ts.map +1 -0
  108. package/dist/security/public.js +10 -0
  109. package/dist/security/public.js.map +9 -0
  110. package/dist/security/registry.d.ts +0 -1
  111. package/dist/security/registry.d.ts.map +1 -1
  112. package/dist/security/types.d.ts +13 -18
  113. package/dist/security/types.d.ts.map +1 -1
  114. package/dist/security/validation.d.ts +0 -6
  115. package/dist/security/validation.d.ts.map +1 -1
  116. package/dist/shares/internal.js +10 -10
  117. package/dist/storage/agents/types.d.ts +1 -1
  118. package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
  119. package/dist/storage/auth/in-memory/magic-links.d.ts.map +1 -1
  120. package/dist/storage/auth/in-memory/oidc-attempts.d.ts.map +1 -1
  121. package/dist/storage/auth/in-memory/sessions.d.ts +0 -10
  122. package/dist/storage/auth/in-memory/sessions.d.ts.map +1 -1
  123. package/dist/storage/auth/in-memory/shared.d.ts +1 -2
  124. package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
  125. package/dist/storage/auth/types.d.ts +1 -17
  126. package/dist/storage/auth/types.d.ts.map +1 -1
  127. package/dist/storage/file-upload-sessions/provider.js +6 -6
  128. package/dist/storage/index.js +21 -21
  129. package/dist/storage/index.js.map +1 -1
  130. package/dist/storage/workflow-runs/provider.js +6 -6
  131. package/dist/syncs/index.js +16 -16
  132. package/dist/testing/auth-storage-contract.d.ts.map +1 -1
  133. package/dist/testing/index.js +41 -124
  134. package/dist/testing/index.js.map +4 -4
  135. package/dist/webhooks/internal.js +11 -11
  136. package/dist/workflows/index.js +25 -25
  137. package/package.json +8 -2
  138. package/src/auth/cookies.ts +3 -20
  139. package/src/auth/index.ts +0 -6
  140. package/src/auth/runtime.ts +59 -76
  141. package/src/auth/session-cache.ts +2 -9
  142. package/src/auth/types.ts +4 -8
  143. package/src/auth/validation.ts +0 -2
  144. package/src/authorization/decision.ts +8 -23
  145. package/src/authorization/grant-kinds.ts +20 -27
  146. package/src/authorization/index.ts +0 -1
  147. package/src/authorization/resolve.ts +10 -6
  148. package/src/deploy/services.ts +0 -1
  149. package/src/deploy/types.ts +1 -2
  150. package/src/deploy/validation.ts +3 -1
  151. package/src/execution/authorization.ts +11 -5
  152. package/src/index.ts +1 -14
  153. package/src/models/execution/embedding.ts +6 -6
  154. package/src/objects/vectors/README.md +4 -0
  155. package/src/objects/vectors/handle.ts +11 -2
  156. package/src/objects/vectors/indexing-generate.ts +2 -2
  157. package/src/objects/vectors/profile.ts +5 -0
  158. package/src/security/builders.ts +7 -2
  159. package/src/security/every.ts +0 -4
  160. package/src/security/grants.ts +5 -25
  161. package/src/security/index.ts +0 -3
  162. package/src/security/membership-policies.ts +3 -1
  163. package/src/security/public.ts +10 -0
  164. package/src/security/registry.ts +0 -8
  165. package/src/security/types.ts +19 -25
  166. package/src/security/validation.ts +19 -17
  167. package/src/storage/agents/types.ts +1 -1
  168. package/src/storage/auth/in-memory/auth-storage.ts +0 -18
  169. package/src/storage/auth/in-memory/magic-links.ts +0 -3
  170. package/src/storage/auth/in-memory/oidc-attempts.ts +0 -3
  171. package/src/storage/auth/in-memory/sessions.ts +1 -25
  172. package/src/storage/auth/in-memory/shared.ts +1 -10
  173. package/src/storage/auth/types.ts +2 -18
  174. package/src/testing/auth-storage-contract.ts +14 -107
  175. package/src/testing/execution-storage-contract.ts +0 -2
  176. package/dist/auth/audience.d.ts +0 -8
  177. package/dist/auth/audience.d.ts.map +0 -1
  178. package/dist/authorization/application-access.d.ts +0 -18
  179. package/dist/authorization/application-access.d.ts.map +0 -1
  180. package/dist/chunk-2jntasmh.js.map +0 -13
  181. package/dist/chunk-3gnrh4ve.js.map +0 -40
  182. package/dist/chunk-enpsx8k5.js.map +0 -10
  183. package/dist/chunk-kyzq4wy9.js.map +0 -18
  184. package/dist/chunk-xt1zt7gv.js.map +0 -13
  185. package/dist/chunk-y7rqfrgg.js.map +0 -24
  186. package/dist/security/applications.d.ts +0 -15
  187. package/dist/security/applications.d.ts.map +0 -1
  188. package/src/auth/audience.ts +0 -28
  189. package/src/authorization/application-access.ts +0 -34
  190. package/src/security/applications.ts +0 -11
  191. /package/dist/{chunk-rz53yb4v.js.map → chunk-0yh890a4.js.map} +0 -0
  192. /package/dist/{chunk-7mbzgd9m.js.map → chunk-1zq2p6g0.js.map} +0 -0
  193. /package/dist/{chunk-dnmadg9k.js.map → chunk-3t2hgbgd.js.map} +0 -0
  194. /package/dist/{chunk-wwdfe68s.js.map → chunk-4vyr1j8f.js.map} +0 -0
  195. /package/dist/{chunk-q1vkr2ys.js.map → chunk-6p49a5cq.js.map} +0 -0
  196. /package/dist/{chunk-nre82s12.js.map → chunk-9dmt152s.js.map} +0 -0
  197. /package/dist/{chunk-7kg3k1m9.js.map → chunk-9w055r5b.js.map} +0 -0
  198. /package/dist/{chunk-bpgy64fw.js.map → chunk-d09tj99x.js.map} +0 -0
  199. /package/dist/{chunk-rhg02hxq.js.map → chunk-dk8tkk5f.js.map} +0 -0
  200. /package/dist/{chunk-52bk93x8.js.map → chunk-fkgc1wt8.js.map} +0 -0
  201. /package/dist/{chunk-zrmy8zvw.js.map → chunk-hjzdd750.js.map} +0 -0
  202. /package/dist/{chunk-85yvv5n0.js.map → chunk-k6q3n2sc.js.map} +0 -0
  203. /package/dist/{chunk-80mc0971.js.map → chunk-ren4kg2j.js.map} +0 -0
  204. /package/dist/{chunk-1f7wpmyp.js.map → chunk-rrzt8jdy.js.map} +0 -0
  205. /package/dist/{chunk-6gmfggss.js.map → chunk-t7x8dmn0.js.map} +0 -0
  206. /package/dist/{chunk-wz0xs816.js.map → chunk-tg2cw67r.js.map} +0 -0
  207. /package/dist/{chunk-bwjcehza.js.map → chunk-way52z4h.js.map} +0 -0
  208. /package/dist/{chunk-tjb1mk5t.js.map → chunk-x6m907x7.js.map} +0 -0
  209. /package/dist/{chunk-t6vq7bff.js.map → chunk-xfs8x8m9.js.map} +0 -0
  210. /package/dist/{chunk-d2ync1v3.js.map → chunk-yevzdx4y.js.map} +0 -0
  211. /package/dist/{chunk-kg5j6fct.js.map → chunk-z4m0yz8c.js.map} +0 -0
@@ -1,21 +1,21 @@
1
1
  // @bun
2
2
  import"../chunk-8mx7qw3y.js";
3
3
  import"../chunk-z3y5kg1x.js";
4
- import"../chunk-enpsx8k5.js";
5
- import"../chunk-y7rqfrgg.js";
4
+ import"../chunk-gsjm1wms.js";
5
+ import"../chunk-d0bqz29d.js";
6
6
  import"../chunk-v4jbb3rs.js";
7
7
  import"../chunk-jhm3zsa7.js";
8
8
  import"../chunk-hvsb78a1.js";
9
9
  import {
10
10
  createConnectorCodedError,
11
11
  getConnectorExecutionSourceResolver
12
- } from "../chunk-wz0xs816.js";
12
+ } from "../chunk-tg2cw67r.js";
13
13
  import"../chunk-a40ad1ft.js";
14
14
  import"../chunk-b38szspf.js";
15
- import"../chunk-3gnrh4ve.js";
16
- import"../chunk-xt1zt7gv.js";
15
+ import"../chunk-vpq4shxz.js";
16
+ import"../chunk-es1gxsbf.js";
17
17
  import"../chunk-v9xd5wzd.js";
18
- import"../chunk-2jntasmh.js";
18
+ import"../chunk-hcbyfxbe.js";
19
19
  import"../chunk-pqajwytd.js";
20
20
  import"../chunk-29yx306f.js";
21
21
  import"../chunk-gfdh9kqa.js";
@@ -24,15 +24,15 @@ import"../chunk-s54c868q.js";
24
24
  import"../chunk-ere85b8y.js";
25
25
  import"../chunk-4as3wt1c.js";
26
26
  import"../chunk-h89wz928.js";
27
- import"../chunk-7kg3k1m9.js";
27
+ import"../chunk-9w055r5b.js";
28
28
  import {
29
29
  ExecutionStorageError2
30
30
  } from "../chunk-tw03bsmb.js";
31
- import"../chunk-bpgy64fw.js";
31
+ import"../chunk-d09tj99x.js";
32
32
  import"../chunk-7n440zgt.js";
33
33
  import {
34
34
  canRetryWebhookRun2
35
- } from "../chunk-j2bp5ryw.js";
35
+ } from "../chunk-n33z5bjw.js";
36
36
  import"../chunk-pbcbn83d.js";
37
37
  import"../chunk-qczk96d9.js";
38
38
  import"../chunk-mmagke4x.js";
@@ -42,10 +42,10 @@ import"../chunk-jmfet9r4.js";
42
42
  import {
43
43
  WebhookRunError2
44
44
  } from "../chunk-qf954wje.js";
45
- import"../chunk-1f7wpmyp.js";
45
+ import"../chunk-rrzt8jdy.js";
46
46
  import {
47
47
  createPrimitiveExecutionRecord
48
- } from "../chunk-nre82s12.js";
48
+ } from "../chunk-9dmt152s.js";
49
49
  import"../chunk-br3k6qbf.js";
50
50
  import {
51
51
  isStorageSerializationFailure2
@@ -8,7 +8,7 @@ import {
8
8
  defineWorkflow2,
9
9
  createWorkflowNodeFailure2,
10
10
  unwrapWorkflowNodeFailure2
11
- } from "../chunk-85yvv5n0.js";
11
+ } from "../chunk-k6q3n2sc.js";
12
12
  import"../chunk-nq6gpjt7.js";
13
13
  import"../chunk-fb3feg1e.js";
14
14
  import"../chunk-yxd3nnqt.js";
@@ -45,33 +45,33 @@ import {
45
45
  snapshotWorkflowActionInput2,
46
46
  WorkflowRunDispatcher2,
47
47
  requestWorkflowRun2
48
- } from "../chunk-ey3pyej1.js";
49
- import"../chunk-t6vq7bff.js";
50
- import"../chunk-wz0xs816.js";
51
- import"../chunk-52bk93x8.js";
52
- import"../chunk-wwdfe68s.js";
53
- import"../chunk-zrmy8zvw.js";
48
+ } from "../chunk-6c6sn0bh.js";
49
+ import"../chunk-xfs8x8m9.js";
50
+ import"../chunk-tg2cw67r.js";
51
+ import"../chunk-fkgc1wt8.js";
52
+ import"../chunk-4vyr1j8f.js";
53
+ import"../chunk-hjzdd750.js";
54
54
  import"../chunk-mfs23znk.js";
55
- import"../chunk-7mbzgd9m.js";
55
+ import"../chunk-1zq2p6g0.js";
56
56
  import"../chunk-99nd4rc1.js";
57
57
  import"../chunk-vyf9kfqf.js";
58
- import"../chunk-4tcx876c.js";
59
- import"../chunk-d2ync1v3.js";
60
- import"../chunk-nre82s12.js";
61
- import"../chunk-j2bp5ryw.js";
58
+ import"../chunk-bx9q3cwv.js";
59
+ import"../chunk-yevzdx4y.js";
60
+ import"../chunk-9dmt152s.js";
61
+ import"../chunk-n33z5bjw.js";
62
+ import"../chunk-9ybhtmg4.js";
62
63
  import"../chunk-br3k6qbf.js";
63
64
  import"../chunk-jmfet9r4.js";
64
65
  import"../chunk-qf954wje.js";
65
- import"../chunk-1f7wpmyp.js";
66
+ import"../chunk-rrzt8jdy.js";
66
67
  import"../chunk-tw03bsmb.js";
67
- import"../chunk-7kg3k1m9.js";
68
+ import"../chunk-9w055r5b.js";
68
69
  import"../chunk-s16apyk9.js";
70
+ import"../chunk-hn2r7z41.js";
69
71
  import"../chunk-h89wz928.js";
70
72
  import"../chunk-pbcbn83d.js";
71
73
  import"../chunk-qczk96d9.js";
72
74
  import"../chunk-mmagke4x.js";
73
- import"../chunk-9ybhtmg4.js";
74
- import"../chunk-hn2r7z41.js";
75
75
  import"../chunk-b38szspf.js";
76
76
  import"../chunk-a40ad1ft.js";
77
77
  import"../chunk-s54c868q.js";
@@ -80,7 +80,7 @@ import"../chunk-rj69qcrd.js";
80
80
  import"../chunk-4as3wt1c.js";
81
81
  import"../chunk-29yx306f.js";
82
82
  import"../chunk-pqajwytd.js";
83
- import"../chunk-bpgy64fw.js";
83
+ import"../chunk-d09tj99x.js";
84
84
  import"../chunk-3qms4nax.js";
85
85
  import"../chunk-7n440zgt.js";
86
86
  import"../chunk-m427qgq0.js";
@@ -88,22 +88,22 @@ import"../chunk-fa02jy15.js";
88
88
  import"../chunk-7t429e3f.js";
89
89
  import"../chunk-3zxk45er.js";
90
90
  import"../chunk-5a4a52tq.js";
91
- import"../chunk-6gmfggss.js";
92
- import"../chunk-bwjcehza.js";
93
- import"../chunk-rz53yb4v.js";
91
+ import"../chunk-t7x8dmn0.js";
92
+ import"../chunk-way52z4h.js";
93
+ import"../chunk-0yh890a4.js";
94
94
  import"../chunk-gc4ntf7d.js";
95
95
  import"../chunk-gfdh9kqa.js";
96
96
  import"../chunk-pfp1txq2.js";
97
97
  import"../chunk-5e43w60z.js";
98
- import"../chunk-3gnrh4ve.js";
98
+ import"../chunk-vpq4shxz.js";
99
99
  import"../chunk-c85m1hyj.js";
100
100
  import"../chunk-v9xd5wzd.js";
101
- import"../chunk-xt1zt7gv.js";
102
- import"../chunk-2jntasmh.js";
103
- import"../chunk-y7rqfrgg.js";
101
+ import"../chunk-es1gxsbf.js";
102
+ import"../chunk-hcbyfxbe.js";
103
+ import"../chunk-d0bqz29d.js";
104
104
  import"../chunk-v4jbb3rs.js";
105
105
  import"../chunk-hvsb78a1.js";
106
- import"../chunk-enpsx8k5.js";
106
+ import"../chunk-gsjm1wms.js";
107
107
  import"../chunk-jhm3zsa7.js";
108
108
  import"../chunk-8mx7qw3y.js";
109
109
  import"../chunk-z3y5kg1x.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixb/core",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "The ontology-first runtime for Sixb — objects, links, telemetry, actions, and provider contracts",
5
5
  "keywords": [
6
6
  "sixb",
@@ -455,6 +455,12 @@
455
455
  "import": "./dist/sandboxes/index.js",
456
456
  "default": "./dist/sandboxes/index.js"
457
457
  },
458
+ "./security": {
459
+ "types": "./dist/security/public.d.ts",
460
+ "bun": "./src/security/public.ts",
461
+ "import": "./dist/security/public.js",
462
+ "default": "./dist/security/public.js"
463
+ },
458
464
  "./storage": {
459
465
  "types": "./dist/storage/index.d.ts",
460
466
  "bun": "./src/storage/index.ts",
@@ -472,7 +478,7 @@
472
478
  "build": "bun ../../scripts/build-package.ts",
473
479
  "typecheck": "tsc --noEmit",
474
480
  "test": "bun test",
475
- "test:e2e": "bun ../../scripts/ci-guard.ts --stall 120 --max 600 bun test ./tests/published-artifacts.e2e.ts",
481
+ "test:e2e": "bun ../../scripts/ci-guard.ts --stall 120 --max 600 bun test ./tests/published-artifacts.e2e.ts ./tests/browser-entries.e2e.ts",
476
482
  "prepack": "bun run build"
477
483
  },
478
484
  "devDependencies": {
@@ -1,9 +1,8 @@
1
- import type { AuthSessionAudience } from "./audience"
2
- import { DEFAULT_AUTH_SESSION_AUDIENCE, resolveAuthSessionAudience } from "./audience"
3
1
  import type { AuthCookieOptions } from "./types"
4
2
 
5
- export const DEFAULT_SESSION_COOKIE_NAME = "sixb_session"
6
- export const DEFAULT_CSRF_COOKIE_NAME = "sixb_csrf"
3
+ // The names the app's cookies had beside Atlas's, so its sessions survived Atlas leaving.
4
+ export const DEFAULT_SESSION_COOKIE_NAME = "sixb_session_app"
5
+ export const DEFAULT_CSRF_COOKIE_NAME = "sixb_csrf_app"
7
6
 
8
7
  export interface ResolvedAuthCookieOptions {
9
8
  readonly sessionCookieName: string
@@ -41,22 +40,6 @@ export function resolveAuthCookieOptions(
41
40
  return resolved
42
41
  }
43
42
 
44
- export function resolveAuthCookieOptionsForAudience(
45
- options: ResolvedAuthCookieOptions,
46
- audience: AuthSessionAudience | undefined
47
- ): ResolvedAuthCookieOptions {
48
- const resolvedAudience = resolveAuthSessionAudience(audience)
49
- if (resolvedAudience === DEFAULT_AUTH_SESSION_AUDIENCE) {
50
- return options
51
- }
52
-
53
- return {
54
- ...options,
55
- sessionCookieName: `${options.sessionCookieName}_${resolvedAudience}`,
56
- csrfCookieName: `${options.csrfCookieName}_${resolvedAudience}`,
57
- }
58
- }
59
-
60
43
  export function parseCookieHeader(header: string | null): ReadonlyMap<string, string> {
61
44
  const cookies = new Map<string, string>()
62
45
  if (!header) {
package/src/auth/index.ts CHANGED
@@ -9,12 +9,6 @@ export {
9
9
  parseAccessTokenValue,
10
10
  SERVICE_ACCOUNT_ACCESS_TOKEN_PREFIX,
11
11
  } from "./access-tokens"
12
- export type { AuthSessionAudience, AuthSessionAudienceOptions } from "./audience"
13
- export {
14
- DEFAULT_AUTH_SESSION_AUDIENCE,
15
- isValidAuthSessionAudience,
16
- resolveAuthSessionAudience,
17
- } from "./audience"
18
12
  export { getRequestClientAddress, setRequestClientAddress } from "./client-address"
19
13
  export {
20
14
  clearCsrfCookieHeader,
@@ -1,9 +1,5 @@
1
1
  import { randomUUID } from "node:crypto"
2
- import {
3
- type AuthorizationContext,
4
- canAccessApplication,
5
- resolveAuthorizationContext,
6
- } from "../authorization"
2
+ import { type AuthorizationContext, resolveAuthorizationContext } from "../authorization"
7
3
  import {
8
4
  canPerformMembershipOperation,
9
5
  type GroupReference,
@@ -33,13 +29,8 @@ import {
33
29
  hashAccessTokenSecret,
34
30
  parseAccessTokenValue,
35
31
  } from "./access-tokens"
36
- import { type AuthSessionAudience, DEFAULT_AUTH_SESSION_AUDIENCE } from "./audience"
37
32
  import { getRequestClientAddress } from "./client-address"
38
- import {
39
- getCookie,
40
- type ResolvedAuthCookieOptions,
41
- resolveAuthCookieOptionsForAudience,
42
- } from "./cookies"
33
+ import { getCookie, type ResolvedAuthCookieOptions } from "./cookies"
43
34
  import { AuthRuntimeError } from "./errors"
44
35
  import { SessionCache } from "./session-cache"
45
36
  import {
@@ -108,7 +99,6 @@ import {
108
99
  isInvitationDeliveryAuthStrategy,
109
100
  normalizePagination,
110
101
  resolveAuthConfig,
111
- resolveAuthSessionAudience,
112
102
  resolveInvitationExpiresAt,
113
103
  } from "./validation"
114
104
 
@@ -184,8 +174,8 @@ export class AuthRuntime {
184
174
  }
185
175
  }
186
176
 
187
- getCookieOptions(options: AuthSessionResolutionOptions = {}): ResolvedAuthCookieOptions {
188
- return resolveAuthCookieOptionsForAudience(this.config.cookies, options.audience)
177
+ getCookieOptions(): ResolvedAuthCookieOptions {
178
+ return this.config.cookies
189
179
  }
190
180
 
191
181
  assertCanServeHttp(params: { readonly production: boolean }): void {
@@ -240,8 +230,6 @@ export class AuthRuntime {
240
230
  return { authenticated: false, reason: "auth_disabled" }
241
231
  }
242
232
 
243
- const audience = resolveAuthSessionAudience(options.audience)
244
-
245
233
  if (options.credentialSource === "any") {
246
234
  const tokenValue = getBearerAccessTokenValue(request)
247
235
  if (tokenValue?.startsWith(SESSION_ACCESS_TOKEN_PREFIX)) {
@@ -257,15 +245,14 @@ export class AuthRuntime {
257
245
  }
258
246
  }
259
247
 
260
- return this.resolveCookieSession(request, audience, options.sessionActivity)
248
+ return this.resolveCookieSession(request, options.sessionActivity)
261
249
  }
262
250
 
263
251
  private async resolveCookieSession(
264
252
  request: Request,
265
- audience: ReturnType<typeof resolveAuthSessionAudience>,
266
253
  activity: AuthSessionResolutionOptions["sessionActivity"]
267
254
  ): Promise<AuthSessionResult> {
268
- const cookieOptions = this.getCookieOptions({ audience })
255
+ const cookieOptions = this.getCookieOptions()
269
256
  const cookieValue = getCookie(request, cookieOptions.sessionCookieName)
270
257
  if (!cookieValue) {
271
258
  return { authenticated: false, reason: "missing_cookie" }
@@ -283,7 +270,6 @@ export class AuthRuntime {
283
270
  sessionId: parts.sessionId,
284
271
  tokenHash,
285
272
  transport: "cookie",
286
- audience,
287
273
  nowMs,
288
274
  })
289
275
  if (cached) {
@@ -298,7 +284,6 @@ export class AuthRuntime {
298
284
  let session = await storage.sessions.findValidByTokenHash({
299
285
  projectId: this.projectId,
300
286
  id: parts.sessionId,
301
- audience,
302
287
  tokenHash,
303
288
  now,
304
289
  })
@@ -312,7 +297,6 @@ export class AuthRuntime {
312
297
  const renewed = await storage.sessions.renewIfValid({
313
298
  projectId: this.projectId,
314
299
  id: parts.sessionId,
315
- audience,
316
300
  tokenHash,
317
301
  now,
318
302
  expiresAt: this.getRenewedSessionExpiresAt(session, nowMs),
@@ -388,7 +372,6 @@ export class AuthRuntime {
388
372
  this.sessionCache?.set({
389
373
  sessionId: session.id,
390
374
  tokenHash,
391
- audience: session.audience,
392
375
  session: result,
393
376
  nowMs: now.getTime(),
394
377
  sessionExpiresAtMs: session.expiresAt.getTime(),
@@ -418,8 +401,6 @@ export class AuthRuntime {
418
401
  projectId: this.projectId,
419
402
  userId: input.userId,
420
403
  strategyId: "device",
421
- // A native session belongs to no web app. The column needs a value; nothing reads it.
422
- audience: DEFAULT_AUTH_SESSION_AUDIENCE,
423
404
  tokenHash: tokens.tokenHash,
424
405
  createdAt: input.now,
425
406
  ...this.createSessionDeadlines(input.now),
@@ -712,6 +693,11 @@ export class AuthRuntime {
712
693
  caller: AuthenticatedUserRequestSession
713
694
  ): Promise<ListServiceAccountsResult> {
714
695
  const storage = this.requireAuthStorage()
696
+ const scope = this.resolveMembershipPolicyScopeForUser(caller.groupIds)
697
+ if (scope.operations.serviceAccounts.policyIds.length === 0) {
698
+ return { serviceAccounts: [] }
699
+ }
700
+
715
701
  const result = await storage.serviceAccounts.list({
716
702
  projectId: this.projectId,
717
703
  order: "desc",
@@ -724,11 +710,11 @@ export class AuthRuntime {
724
710
  }))
725
711
  )
726
712
 
727
- // A caller only sees the service accounts it is allowed to manage, so
728
- // listing never leaks the groups of more-privileged accounts.
713
+ // A caller only sees the service accounts its membership policies cover, so
714
+ // listing never leaks the groups of accounts outside its scope.
729
715
  return {
730
716
  serviceAccounts: withGroups.filter(({ groupIds }) =>
731
- callerCanManageServiceAccount(caller.groupIds, groupIds)
717
+ canPerformMembershipOperation(scope, "serviceAccounts", groupIds)
732
718
  ),
733
719
  }
734
720
  }
@@ -738,11 +724,9 @@ export class AuthRuntime {
738
724
  input: CreateServiceAccountInput
739
725
  ): Promise<CreateServiceAccountResult> {
740
726
  const storage = this.requireAuthStorage()
741
- // A caller can only place a service account in groups it itself belongs to.
742
- const groupIds =
743
- constrainRequestedGroupIds(input.groupIds, caller.groupIds, {
744
- subject: "service account",
745
- }) ?? []
727
+ // A caller can only place a service account in groups its `serviceAccounts` policies cover.
728
+ const groupIds = normalizeRequestedGroupIds(input.groupIds) ?? []
729
+ this.assertCanManageServiceAccountGroups(caller.groupIds, groupIds)
746
730
  const now = new Date()
747
731
  const serviceAccount = await storage.serviceAccounts.create({
748
732
  id: input.id ?? `svc_${randomUUID()}`,
@@ -829,8 +813,8 @@ export class AuthRuntime {
829
813
  }
830
814
 
831
815
  // The token can only carry groups the service account already holds; the
832
- // manageability check above guarantees those are a subset of the caller's
833
- // own groups, so the caller can never mint privileges it lacks.
816
+ // manageability check above guarantees those are within the caller's
817
+ // `serviceAccounts` scope, so the token never reaches past that scope.
834
818
  const groupIds = constrainRequestedGroupIds(input.groupIds, serviceAccountGroupIds, {
835
819
  subject: "service account token",
836
820
  })
@@ -888,12 +872,10 @@ export class AuthRuntime {
888
872
  /**
889
873
  * Resolve a service account the caller is allowed to manage.
890
874
  *
891
- * A caller may manage a service account only when it belongs to every group
892
- * the account is in ("you can manage what you could have created"). This
893
- * confines token minting, disabling, and revocation to privileges the caller
894
- * already holds and prevents a service-account token from outliving the
895
- * caller's own access. Missing and non-manageable accounts raise the same
896
- * error so callers cannot probe which privileged accounts exist.
875
+ * A caller needs a membership policy with the `serviceAccounts` operation whose scope covers every
876
+ * group the account is in ("you can manage what you could have created"). This confines token
877
+ * minting, disabling, and revocation to the groups the project's policies hand out. Missing and
878
+ * out-of-scope accounts raise the same error so callers cannot probe which accounts exist.
897
879
  */
898
880
  private async requireManageableServiceAccount(
899
881
  storage: AuthStorage,
@@ -903,6 +885,11 @@ export class AuthRuntime {
903
885
  readonly serviceAccount: ServiceAccountRecord
904
886
  readonly groupIds: readonly string[]
905
887
  }> {
888
+ const scope = this.resolveMembershipPolicyScopeForUser(callerGroupIds)
889
+ if (scope.operations.serviceAccounts.policyIds.length === 0) {
890
+ throw missingServiceAccountsPolicyError()
891
+ }
892
+
906
893
  const serviceAccount = await storage.serviceAccounts.getById({
907
894
  projectId: this.projectId,
908
895
  id: serviceAccountId,
@@ -911,7 +898,7 @@ export class AuthRuntime {
911
898
  ? await this.listServiceAccountGroupIds(storage, serviceAccountId)
912
899
  : []
913
900
 
914
- if (!serviceAccount || !callerCanManageServiceAccount(callerGroupIds, groupIds)) {
901
+ if (!serviceAccount || !canPerformMembershipOperation(scope, "serviceAccounts", groupIds)) {
915
902
  throw new AuthStorageError(
916
903
  "missing_service_account",
917
904
  `[Sixb] Service account '${serviceAccountId}' not found for project '${this.projectId}'.`
@@ -975,6 +962,7 @@ export class AuthRuntime {
975
962
  return {
976
963
  // The member-admin edit-groups dialog assigns from the `assignGroups` scope.
977
964
  groups: this.scopedGroupOptions(scope.operations.assignGroups.groupIds),
965
+ serviceAccountGroups: this.scopedGroupOptions(scope.operations.serviceAccounts.groupIds),
978
966
  capabilities: membershipCapabilities(scope).holds,
979
967
  }
980
968
  }
@@ -1163,7 +1151,7 @@ export class AuthRuntime {
1163
1151
  return { user: reactivated, groupIds, managedGroupIds }
1164
1152
  }
1165
1153
 
1166
- /** The caller's active sessions across every audience, most recently active first. */
1154
+ /** The caller's active sessions, most recently active first. */
1167
1155
  async listSessions(caller: AuthenticatedUserRequestSession): Promise<readonly SessionRecord[]> {
1168
1156
  return this.requireAuthStorage().sessions.listActiveByUserId({
1169
1157
  projectId: this.projectId,
@@ -1195,7 +1183,7 @@ export class AuthRuntime {
1195
1183
  return true
1196
1184
  }
1197
1185
 
1198
- /** End every active session of the caller, across audiences. Returns how many ended. */
1186
+ /** End every active session of the caller. Returns how many ended. */
1199
1187
  async revokeAllSessions(caller: AuthenticatedUserRequestSession): Promise<number> {
1200
1188
  const revoked = await this.requireAuthStorage().sessions.revokeActiveForUser({
1201
1189
  projectId: this.projectId,
@@ -1284,7 +1272,6 @@ export class AuthRuntime {
1284
1272
  }
1285
1273
 
1286
1274
  await this.assertCanInviteRecipient(strategy, authStorage, input.email, now)
1287
- this.assertInvitationApplicationAccess(groupIds, destination.audience)
1288
1275
 
1289
1276
  const invitation = await authStorage.invitations.createOrUpdateActive({
1290
1277
  id: `inv_${randomUUID()}`,
@@ -1304,7 +1291,6 @@ export class AuthRuntime {
1304
1291
  projectId: this.projectId,
1305
1292
  authStorage,
1306
1293
  invitation,
1307
- audience: destination.audience,
1308
1294
  returnTo: destination.returnTo,
1309
1295
  requestOrigin: destination.requestOrigin,
1310
1296
  revealLink: input.revealLink,
@@ -1451,27 +1437,6 @@ export class AuthRuntime {
1451
1437
  return { state: "enabled" }
1452
1438
  }
1453
1439
 
1454
- private assertInvitationApplicationAccess(
1455
- groupIds: readonly string[],
1456
- audience: AuthSessionAudience
1457
- ): void {
1458
- // Check only the groups this invitation assigns. Existing memberships may
1459
- // be outside the caller's policy scope and must not affect this response.
1460
- const roles = this.security.listResolvedRoles()
1461
- const authorization = resolveAuthorizationContext({
1462
- principal: { type: "user", id: "invited-user" },
1463
- groupIds,
1464
- roles,
1465
- })
1466
-
1467
- if (canAccessApplication(authorization, roles, audience)) return
1468
-
1469
- throw new AuthRuntimeError(
1470
- "authorization_denied",
1471
- `[Sixb] Invitation groups do not grant access to application '${audience}'.`
1472
- )
1473
- }
1474
-
1475
1440
  private async assertCanInviteRecipient(
1476
1441
  strategy: InvitationDeliveryAuthStrategy,
1477
1442
  authStorage: AuthStorage,
@@ -1524,6 +1489,27 @@ export class AuthRuntime {
1524
1489
  )
1525
1490
  }
1526
1491
 
1492
+ private assertCanManageServiceAccountGroups(
1493
+ callerGroupIds: readonly string[],
1494
+ groupIds: readonly string[]
1495
+ ): void {
1496
+ const scope = this.resolveMembershipPolicyScopeForUser(callerGroupIds)
1497
+
1498
+ if (canPerformMembershipOperation(scope, "serviceAccounts", groupIds)) {
1499
+ return
1500
+ }
1501
+
1502
+ if (scope.operations.serviceAccounts.policyIds.length === 0) {
1503
+ throw missingServiceAccountsPolicyError()
1504
+ }
1505
+
1506
+ const missing = missingMembershipGroupIds(scope, "serviceAccounts", groupIds)
1507
+ throw new AuthRuntimeError(
1508
+ "authorization_denied",
1509
+ `[Sixb] The current user is not allowed to place service accounts in group(s): ${missing.join(", ")}.`
1510
+ )
1511
+ }
1512
+
1527
1513
  private assertCanManageInvitationGroups(
1528
1514
  callerGroupIds: readonly string[],
1529
1515
  groupIds: readonly string[]
@@ -1590,15 +1576,11 @@ function constrainTokenGroupIds(
1590
1576
  return principalGroupIds.filter((groupId) => allowed.has(groupId))
1591
1577
  }
1592
1578
 
1593
- // A caller may manage a service account only when it belongs to every group the
1594
- // account is in, so managing it can never grant more than the caller already
1595
- // has. An account with no groups is powerless and therefore freely manageable.
1596
- function callerCanManageServiceAccount(
1597
- callerGroupIds: readonly string[],
1598
- serviceAccountGroupIds: readonly string[]
1599
- ): boolean {
1600
- const callerGroups = new Set(callerGroupIds)
1601
- return serviceAccountGroupIds.every((groupId) => callerGroups.has(groupId))
1579
+ function missingServiceAccountsPolicyError(): AuthRuntimeError {
1580
+ return new AuthRuntimeError(
1581
+ "authorization_denied",
1582
+ "[Sixb] Managing service accounts needs a membership policy with the 'serviceAccounts' operation."
1583
+ )
1602
1584
  }
1603
1585
 
1604
1586
  function missingAccessTokenError(tokenId: string, projectId: string): AuthStorageError {
@@ -1701,6 +1683,7 @@ function membershipCapabilities(scope: MembershipPolicyScope): MembershipCapabil
1701
1683
  invite: scope.operations.invite.policyIds.length > 0,
1702
1684
  assignGroups: scope.operations.assignGroups.policyIds.length > 0,
1703
1685
  suspend: scope.operations.suspend.policyIds.length > 0,
1686
+ serviceAccounts: scope.operations.serviceAccounts.policyIds.length > 0,
1704
1687
  },
1705
1688
  assignableGroupIds: [...scope.operations.assignGroups.groupIds],
1706
1689
  covers: (operation, memberGroups) =>
@@ -1,10 +1,8 @@
1
- import type { AuthSessionAudience } from "./audience"
2
1
  import type { AuthenticatedAuthSession } from "./types"
3
2
 
4
3
  interface SessionCacheEntry {
5
4
  readonly tokenHash: string
6
5
  readonly transport: "cookie" | "bearer"
7
- readonly audience: AuthSessionAudience
8
6
  readonly session: AuthenticatedAuthSession
9
7
  readonly expiresAtMs: number
10
8
  }
@@ -14,15 +12,12 @@ export interface SessionCacheGetInput {
14
12
  readonly tokenHash: string
15
13
  /** A cookie is only ever answered from a cookie entry, and a bearer token from a bearer entry. */
16
14
  readonly transport: "cookie" | "bearer"
17
- /** The browser audience a cookie was read for. Bearer sessions carry their own. */
18
- readonly audience?: AuthSessionAudience
19
15
  readonly nowMs: number
20
16
  }
21
17
 
22
18
  export interface SessionCacheSetInput {
23
19
  readonly sessionId: string
24
20
  readonly tokenHash: string
25
- readonly audience: AuthSessionAudience
26
21
  readonly nowMs: number
27
22
  readonly session: AuthenticatedAuthSession
28
23
  readonly sessionExpiresAtMs: number
@@ -38,7 +33,7 @@ export interface SessionCacheSetInput {
38
33
  * API stalls. Caching the resolved result for a short TTL collapses those reads to one
39
34
  * per session per window.
40
35
  *
41
- * Safety: entries are pinned to the exact token hash, transport, and audience that produced them and
36
+ * Safety: entries are pinned to the exact token hash and transport that produced them and
42
37
  * are never served past the session's rolling or absolute deadline. The short TTL bounds how long
43
38
  * a revoked session can linger; sign-out additionally invalidates eagerly via
44
39
  * {@link SessionCache.invalidate}.
@@ -60,8 +55,7 @@ export class SessionCache {
60
55
  if (
61
56
  entry.expiresAtMs <= input.nowMs ||
62
57
  entry.tokenHash !== input.tokenHash ||
63
- entry.transport !== input.transport ||
64
- (input.audience !== undefined && entry.audience !== input.audience)
58
+ entry.transport !== input.transport
65
59
  ) {
66
60
  this.entries.delete(input.sessionId)
67
61
  return undefined
@@ -88,7 +82,6 @@ export class SessionCache {
88
82
  this.entries.set(input.sessionId, {
89
83
  tokenHash: input.tokenHash,
90
84
  transport: bearer ? "bearer" : "cookie",
91
- audience: input.audience,
92
85
  session: input.session,
93
86
  expiresAtMs,
94
87
  })