@sixb/core 0.1.18 → 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.
- package/README.md +7 -6
- package/dist/actions/commit-edits.d.ts +7 -19
- package/dist/actions/commit-edits.d.ts.map +1 -1
- package/dist/actions/errors.d.ts +0 -3
- package/dist/actions/errors.d.ts.map +1 -1
- package/dist/actions/execution.d.ts +10 -3
- package/dist/actions/execution.d.ts.map +1 -1
- package/dist/actions/index.d.ts +6 -9
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +51 -50
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts +14 -25
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run/context.d.ts +40 -0
- package/dist/actions/run/context.d.ts.map +1 -0
- package/dist/actions/run/edits-commit.d.ts +31 -0
- package/dist/actions/run/edits-commit.d.ts.map +1 -0
- package/dist/actions/run/effects.d.ts +23 -0
- package/dist/actions/run/effects.d.ts.map +1 -0
- package/dist/actions/run/execute.d.ts +30 -0
- package/dist/actions/run/execute.d.ts.map +1 -0
- package/dist/actions/run/executor.d.ts +95 -0
- package/dist/actions/run/executor.d.ts.map +1 -0
- package/dist/actions/run/normalize.d.ts +36 -0
- package/dist/actions/run/normalize.d.ts.map +1 -0
- package/dist/actions/run/phase-types.d.ts +18 -0
- package/dist/actions/run/phase-types.d.ts.map +1 -0
- package/dist/actions/run/phases.d.ts +20 -0
- package/dist/actions/run/phases.d.ts.map +1 -0
- package/dist/actions/run/run-action.d.ts +25 -0
- package/dist/actions/run/run-action.d.ts.map +1 -0
- package/dist/actions/run/signals.d.ts +67 -0
- package/dist/actions/run/signals.d.ts.map +1 -0
- package/dist/actions/run/state.d.ts +47 -0
- package/dist/actions/run/state.d.ts.map +1 -0
- package/dist/actions/run/types.d.ts +54 -0
- package/dist/actions/run/types.d.ts.map +1 -0
- package/dist/actions/run/writeback.d.ts +17 -0
- package/dist/actions/run/writeback.d.ts.map +1 -0
- package/dist/actions/run-authorization.d.ts +1 -1
- package/dist/actions/run-authorization.d.ts.map +1 -1
- package/dist/actions/run-persistence.d.ts +53 -0
- package/dist/actions/run-persistence.d.ts.map +1 -0
- package/dist/actions/types/context.d.ts +10 -0
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/agents/index.js +52 -55
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/streams/index.js +2 -2
- package/dist/agents/streams/internal.js +2 -2
- package/dist/auth/cookies.d.ts +2 -4
- package/dist/auth/cookies.d.ts.map +1 -1
- package/dist/auth/index.d.ts +0 -2
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +15 -21
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/runtime.d.ts +8 -10
- package/dist/auth/runtime.d.ts.map +1 -1
- package/dist/auth/session-cache.d.ts +1 -5
- package/dist/auth/session-cache.d.ts.map +1 -1
- package/dist/auth/strategy.js +1 -1
- package/dist/auth/types.d.ts +4 -8
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/validation.d.ts +0 -1
- package/dist/auth/validation.d.ts.map +1 -1
- package/dist/authorization/decision.d.ts +0 -4
- package/dist/authorization/decision.d.ts.map +1 -1
- package/dist/authorization/event-visibility.d.ts.map +1 -1
- package/dist/authorization/grant-kinds.d.ts +6 -8
- package/dist/authorization/grant-kinds.d.ts.map +1 -1
- package/dist/authorization/index.d.ts +0 -1
- package/dist/authorization/index.d.ts.map +1 -1
- package/dist/authorization/index.js +5 -9
- package/dist/authorization/index.js.map +1 -1
- package/dist/authorization/resolve.d.ts +1 -1
- package/dist/authorization/resolve.d.ts.map +1 -1
- package/dist/bootstrap/index.js +50 -53
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/{chunk-vz3gc1tm.js → chunk-0rbyz4qy.js} +67 -69
- package/dist/{chunk-vz3gc1tm.js.map → chunk-0rbyz4qy.js.map} +4 -4
- package/dist/{chunk-rz53yb4v.js → chunk-0yh890a4.js} +1 -1
- package/dist/{chunk-vgk3hknm.js → chunk-1k89ecfr.js} +1 -1
- package/dist/{chunk-ny3xyvcn.js → chunk-1zq2p6g0.js} +3 -3
- package/dist/{chunk-dnmadg9k.js → chunk-3t2hgbgd.js} +2 -2
- package/dist/{chunk-k6hrnf35.js → chunk-4vyr1j8f.js} +51 -4
- package/dist/chunk-4vyr1j8f.js.map +11 -0
- package/dist/{chunk-22v5bpz3.js → chunk-5e43w60z.js} +1 -1
- package/dist/{chunk-de4z2bj6.js → chunk-5j58wjct.js} +17 -17
- package/dist/chunk-5j58wjct.js.map +18 -0
- package/dist/{chunk-fe52eczz.js → chunk-6c6sn0bh.js} +6352 -2127
- package/dist/chunk-6c6sn0bh.js.map +106 -0
- package/dist/{chunk-7hpdd6r9.js → chunk-6p49a5cq.js} +4 -4
- package/dist/{chunk-b9affek3.js → chunk-7n440zgt.js} +30 -30
- package/dist/{chunk-b9affek3.js.map → chunk-7n440zgt.js.map} +4 -4
- package/dist/{chunk-kkqwzy6h.js → chunk-7t429e3f.js} +1 -1
- package/dist/{chunk-6fsr7y93.js → chunk-8mx7qw3y.js} +14 -13
- package/dist/{chunk-6fsr7y93.js.map → chunk-8mx7qw3y.js.map} +4 -4
- package/dist/{chunk-kpx7jrmn.js → chunk-91mg3nj9.js} +59 -59
- package/dist/{chunk-kpx7jrmn.js.map → chunk-91mg3nj9.js.map} +5 -5
- package/dist/{chunk-ex496vct.js → chunk-9dmt152s.js} +1 -1
- package/dist/{chunk-48e3cn2d.js → chunk-9gyp8hg1.js} +2 -2
- package/dist/{chunk-ewqa58h9.js → chunk-9k93ah50.js} +4 -4
- package/dist/{chunk-ewqa58h9.js.map → chunk-9k93ah50.js.map} +1 -1
- package/dist/{chunk-zxawp1n2.js → chunk-9w055r5b.js} +1 -1
- package/dist/{chunk-4wn7bxxa.js → chunk-9ybhtmg4.js} +1 -1
- package/dist/{chunk-fc5zfxy1.js → chunk-a40ad1ft.js} +5 -13
- package/dist/chunk-a40ad1ft.js.map +10 -0
- package/dist/{chunk-y2aq6ag9.js → chunk-b38szspf.js} +5 -14
- package/dist/chunk-b38szspf.js.map +11 -0
- package/dist/{chunk-r2y23egw.js → chunk-bkpke1sg.js} +1 -10
- package/dist/chunk-bkpke1sg.js.map +10 -0
- package/dist/{chunk-htr6wjmv.js → chunk-bx9q3cwv.js} +22 -22
- package/dist/{chunk-htr6wjmv.js.map → chunk-bx9q3cwv.js.map} +1 -1
- package/dist/{chunk-vx2yp45y.js → chunk-c85m1hyj.js} +2 -2
- package/dist/{chunk-bs7sqkre.js → chunk-d09tj99x.js} +2 -2
- package/dist/{chunk-qkbx3tf6.js → chunk-d0bqz29d.js} +27 -47
- package/dist/chunk-d0bqz29d.js.map +23 -0
- package/dist/{chunk-zb77kjth.js → chunk-dk8tkk5f.js} +4 -4
- package/dist/{chunk-xt1zt7gv.js → chunk-es1gxsbf.js} +24 -15
- package/dist/chunk-es1gxsbf.js.map +13 -0
- package/dist/{chunk-vjcd8d27.js → chunk-fa02jy15.js} +1 -1
- package/dist/{chunk-za5yd58j.js → chunk-fkgc1wt8.js} +2 -2
- package/dist/{chunk-enpsx8k5.js → chunk-gsjm1wms.js} +16 -20
- package/dist/chunk-gsjm1wms.js.map +10 -0
- package/dist/{chunk-2jntasmh.js → chunk-hcbyfxbe.js} +25 -49
- package/dist/chunk-hcbyfxbe.js.map +12 -0
- package/dist/{chunk-p0dqwj3n.js → chunk-hjzdd750.js} +66 -47
- package/dist/{chunk-p0dqwj3n.js.map → chunk-hjzdd750.js.map} +4 -4
- package/dist/chunk-hkc3jct7.js.map +1 -1
- package/dist/{chunk-y05543x6.js → chunk-hvsb78a1.js} +4 -4
- package/dist/{chunk-y05543x6.js.map → chunk-hvsb78a1.js.map} +1 -1
- package/dist/{chunk-1b1f2d5f.js → chunk-k6q3n2sc.js} +9 -9
- package/dist/{chunk-1b1f2d5f.js.map → chunk-k6q3n2sc.js.map} +1 -1
- package/dist/{chunk-wr8qp979.js → chunk-m427qgq0.js} +9 -5
- package/dist/{chunk-wr8qp979.js.map → chunk-m427qgq0.js.map} +4 -3
- package/dist/{chunk-qq90g05n.js → chunk-n33z5bjw.js} +50 -240
- package/dist/{chunk-qq90g05n.js.map → chunk-n33z5bjw.js.map} +4 -4
- package/dist/{chunk-e1c18xjx.js → chunk-nq6gpjt7.js} +4 -45
- package/dist/{chunk-e1c18xjx.js.map → chunk-nq6gpjt7.js.map} +5 -5
- package/dist/{chunk-1hqwggsn.js → chunk-nzapm6p0.js} +1 -2
- package/dist/chunk-nzapm6p0.js.map +12 -0
- package/dist/{chunk-wt4szfec.js → chunk-pbcbn83d.js} +4 -4
- package/dist/{chunk-wt4szfec.js.map → chunk-pbcbn83d.js.map} +1 -1
- package/dist/{chunk-s4jhg8a3.js → chunk-ren4kg2j.js} +15 -15
- package/dist/{chunk-s4jhg8a3.js.map → chunk-ren4kg2j.js.map} +1 -1
- package/dist/{chunk-d0eb5yy6.js → chunk-rrzt8jdy.js} +5 -5
- package/dist/{chunk-d0eb5yy6.js.map → chunk-rrzt8jdy.js.map} +1 -1
- package/dist/{chunk-y9jmd7e5.js → chunk-s16apyk9.js} +102 -16
- package/dist/chunk-s16apyk9.js.map +16 -0
- package/dist/{chunk-6gmfggss.js → chunk-t7x8dmn0.js} +2 -2
- package/dist/{chunk-f1zxad2t.js → chunk-tg2cw67r.js} +6 -6
- package/dist/{chunk-f1zxad2t.js.map → chunk-tg2cw67r.js.map} +1 -1
- package/dist/{chunk-p844e0rn.js → chunk-tpn40322.js} +2 -2
- package/dist/{chunk-rt9p8m9t.js → chunk-v9xd5wzd.js} +1 -1
- package/dist/{chunk-6h5m9xjx.js → chunk-vpq4shxz.js} +49 -113
- package/dist/chunk-vpq4shxz.js.map +39 -0
- package/dist/{chunk-2vhg6ysa.js → chunk-vyf9kfqf.js} +1 -1
- package/dist/{chunk-bwjcehza.js → chunk-way52z4h.js} +1 -1
- package/dist/{chunk-qkvz64nd.js → chunk-x6m907x7.js} +3 -3
- package/dist/{chunk-yv9czyfr.js → chunk-xfs8x8m9.js} +5 -5
- package/dist/chunk-y0c4e6ex.js +16 -0
- package/dist/chunk-y0c4e6ex.js.map +10 -0
- package/dist/{chunk-v6xpd60t.js → chunk-yevzdx4y.js} +5 -5
- package/dist/{chunk-dfm066qg.js → chunk-yxd3nnqt.js} +2 -29
- package/dist/chunk-yxd3nnqt.js.map +11 -0
- package/dist/{chunk-70jmg2zx.js → chunk-yzwja0mj.js} +4 -19
- package/dist/{chunk-70jmg2zx.js.map → chunk-yzwja0mj.js.map} +3 -3
- package/dist/{chunk-qmnnhde6.js → chunk-z4m0yz8c.js} +1 -1
- package/dist/datasets/write.js +5 -5
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +13 -10
- package/dist/deploy/internal.js.map +4 -4
- package/dist/deploy/services.d.ts +1 -2
- package/dist/deploy/services.d.ts.map +1 -1
- package/dist/deploy/types.d.ts +7 -7
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/deploy/validation.d.ts.map +1 -1
- package/dist/edits/index.js +3 -5
- package/dist/edits/index.js.map +1 -1
- package/dist/error-reporting/internal.js +3 -3
- package/dist/error-reporting/types.d.ts +2 -9
- package/dist/error-reporting/types.d.ts.map +1 -1
- package/dist/errors/catalog.d.ts +12 -0
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/internal.js +1 -1
- package/dist/events/definitions.d.ts +0 -5
- package/dist/events/definitions.d.ts.map +1 -1
- package/dist/events/index.d.ts +3 -3
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +6 -8
- package/dist/events/index.js.map +1 -1
- package/dist/events/scope.d.ts +0 -1
- package/dist/events/scope.d.ts.map +1 -1
- package/dist/events/scope.js +1 -1
- package/dist/events/selectors/builder.d.ts +1 -8
- package/dist/events/selectors/builder.d.ts.map +1 -1
- package/dist/events/selectors/index.d.ts +2 -2
- package/dist/events/selectors/index.d.ts.map +1 -1
- package/dist/events/selectors/index.js +2 -2
- package/dist/events/selectors/predicate.d.ts.map +1 -1
- package/dist/events/selectors/types.d.ts +2 -33
- package/dist/events/selectors/types.d.ts.map +1 -1
- package/dist/events/types/index.d.ts +1 -12
- package/dist/events/types/index.d.ts.map +1 -1
- package/dist/execution/agent.js +41 -44
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/primitive.js +60 -91
- package/dist/execution/primitive.js.map +3 -4
- package/dist/execution/request.js +40 -43
- package/dist/execution/request.js.map +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +105 -127
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +5 -5
- package/dist/materialization/index.js +3 -3
- package/dist/materialization/index.js.map +1 -1
- package/dist/materialization/model.d.ts +19 -6
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/index.js +31 -31
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/shared/normalize.d.ts.map +1 -1
- package/dist/models/execution/index.js +21 -21
- package/dist/objects/action/errors.d.ts +0 -9
- package/dist/objects/action/errors.d.ts.map +1 -1
- package/dist/objects/action/index.d.ts +3 -3
- package/dist/objects/action/index.d.ts.map +1 -1
- package/dist/objects/action/request.d.ts +2 -8
- package/dist/objects/action/request.d.ts.map +1 -1
- package/dist/objects/execution.d.ts +0 -2
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +44 -29
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/index.js +29 -29
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/sdk/object-handle.d.ts.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/objects/service/index.d.ts +0 -1
- package/dist/objects/service/index.d.ts.map +1 -1
- package/dist/objects/vectors/handle.d.ts.map +1 -1
- package/dist/objects/vectors/profile.d.ts +5 -0
- package/dist/objects/vectors/profile.d.ts.map +1 -1
- package/dist/ontology/index.js +6 -6
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/internal.js +2 -2
- package/dist/pipelines/index.js +28 -28
- package/dist/projections/internal.js +22 -22
- package/dist/projections/internal.js.map +1 -1
- package/dist/query.js +2 -2
- package/dist/queues/in-memory.d.ts +1 -2
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +0 -7
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.js +27 -28
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +16 -36
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/sandboxes/index.js +5 -5
- package/dist/schedules/builders.d.ts.map +1 -1
- package/dist/schedules/index.js +3 -3
- package/dist/schedules/runtime.d.ts.map +1 -1
- package/dist/schedules/validation.d.ts +0 -1
- package/dist/schedules/validation.d.ts.map +1 -1
- package/dist/security/builders.d.ts.map +1 -1
- package/dist/security/every.d.ts +2 -5
- package/dist/security/every.d.ts.map +1 -1
- package/dist/security/grants.d.ts +2 -4
- package/dist/security/grants.d.ts.map +1 -1
- package/dist/security/index.d.ts +1 -2
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/membership-policies.d.ts.map +1 -1
- package/dist/security/public.d.ts +10 -0
- package/dist/security/public.d.ts.map +1 -0
- package/dist/security/public.js +10 -0
- package/dist/security/public.js.map +9 -0
- package/dist/security/registry.d.ts +0 -1
- package/dist/security/registry.d.ts.map +1 -1
- package/dist/security/types.d.ts +13 -18
- package/dist/security/types.d.ts.map +1 -1
- package/dist/security/validation.d.ts +0 -6
- package/dist/security/validation.d.ts.map +1 -1
- package/dist/shares/internal.js +20 -20
- package/dist/storage/action-runs/failure.js +2 -2
- package/dist/storage/action-runs/idempotency.d.ts +3 -4
- package/dist/storage/action-runs/idempotency.d.ts.map +1 -1
- package/dist/storage/action-runs/in-memory.d.ts +2 -9
- package/dist/storage/action-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/action-runs/index.d.ts +1 -3
- package/dist/storage/action-runs/index.d.ts.map +1 -1
- package/dist/storage/action-runs/provider.js +1 -1
- package/dist/storage/action-runs/record.d.ts +20 -0
- package/dist/storage/action-runs/record.d.ts.map +1 -0
- package/dist/storage/action-runs/types.d.ts +39 -68
- package/dist/storage/action-runs/types.d.ts.map +1 -1
- package/dist/storage/agents/types.d.ts +1 -1
- package/dist/storage/ai-limits/enforcement.js +2 -2
- package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/magic-links.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/oidc-attempts.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/sessions.d.ts +0 -10
- package/dist/storage/auth/in-memory/sessions.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/shared.d.ts +1 -2
- package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
- package/dist/storage/auth/types.d.ts +1 -17
- package/dist/storage/auth/types.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +1 -1
- package/dist/storage/file-upload-sessions/provider.js +10 -10
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +21 -22
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +1 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +9 -12
- package/dist/storage/internal.js.map +1 -1
- package/dist/storage/objects/execution-limits.d.ts +1 -1
- package/dist/storage/objects/execution-limits.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +2 -2
- package/dist/storage/projection-runs/provider.js +2 -2
- package/dist/storage/types.d.ts +1 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +10 -10
- package/dist/syncs/index.js +29 -29
- package/dist/testing/action-execution.d.ts +34 -4
- package/dist/testing/action-execution.d.ts.map +1 -1
- package/dist/testing/action-run-storage-contract.d.ts +11 -0
- package/dist/testing/action-run-storage-contract.d.ts.map +1 -0
- package/dist/testing/auth-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +2 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3205 -2946
- package/dist/testing/index.js.map +9 -8
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +26 -26
- package/dist/webhooks/internal.js.map +1 -1
- package/dist/workers/index.js +1 -1
- package/dist/workflows/index.js +48 -51
- package/dist/workflows/index.js.map +1 -1
- package/package.json +8 -8
- package/src/actions/commit-edits.ts +9 -37
- package/src/actions/errors.ts +0 -4
- package/src/actions/execution.ts +10 -10
- package/src/actions/index.ts +5 -24
- package/src/actions/request.ts +157 -295
- package/src/actions/run/context.ts +193 -0
- package/src/actions/run/edits-commit.ts +102 -0
- package/src/actions/run/effects.ts +105 -0
- package/src/actions/run/execute.ts +113 -0
- package/src/actions/run/executor.ts +314 -0
- package/src/actions/run/normalize.ts +142 -0
- package/src/actions/run/phase-types.ts +20 -0
- package/src/actions/run/phases.ts +150 -0
- package/src/actions/run/run-action.ts +170 -0
- package/src/actions/run/signals.ts +118 -0
- package/src/actions/run/state.ts +95 -0
- package/src/actions/run/types.ts +61 -0
- package/src/actions/run/writeback.ts +79 -0
- package/src/actions/run-authorization.ts +1 -1
- package/src/actions/run-persistence.ts +105 -0
- package/src/actions/types/context.ts +10 -0
- package/src/auth/cookies.ts +3 -20
- package/src/auth/index.ts +0 -6
- package/src/auth/runtime.ts +59 -76
- package/src/auth/session-cache.ts +2 -9
- package/src/auth/types.ts +4 -8
- package/src/auth/validation.ts +0 -2
- package/src/authorization/decision.ts +8 -23
- package/src/authorization/event-visibility.ts +0 -12
- package/src/authorization/grant-kinds.ts +20 -27
- package/src/authorization/index.ts +0 -1
- package/src/authorization/resolve.ts +10 -6
- package/src/deploy/index.ts +0 -1
- package/src/deploy/services.ts +2 -12
- package/src/deploy/types.ts +7 -8
- package/src/deploy/validation.ts +15 -7
- package/src/error-reporting/types.ts +2 -10
- package/src/errors/catalog.ts +13 -0
- package/src/events/definitions.ts +0 -17
- package/src/events/index.ts +0 -14
- package/src/events/scope.ts +0 -12
- package/src/events/selectors/builder.ts +0 -51
- package/src/events/selectors/index.ts +0 -6
- package/src/events/selectors/predicate.ts +0 -2
- package/src/events/selectors/types.ts +7 -65
- package/src/events/types/index.ts +0 -11
- package/src/execution/authorization.ts +11 -5
- package/src/index.ts +2 -33
- package/src/materialization/model.ts +26 -9
- package/src/materializer/README.md +6 -1
- package/src/materializer/edits/commit.ts +42 -32
- package/src/materializer/shared/normalize.ts +25 -14
- package/src/models/execution/embedding.ts +6 -6
- package/src/objects/action/errors.ts +0 -12
- package/src/objects/action/index.ts +3 -3
- package/src/objects/action/request.ts +2 -29
- package/src/objects/execution.ts +2 -2
- package/src/objects/sdk/object-handle.ts +3 -29
- package/src/objects/sdk/object-set.ts +5 -30
- package/src/objects/service/index.ts +0 -1
- package/src/objects/vectors/README.md +4 -0
- package/src/objects/vectors/handle.ts +11 -2
- package/src/objects/vectors/indexing-generate.ts +2 -2
- package/src/objects/vectors/profile.ts +5 -0
- package/src/queues/in-memory.ts +0 -6
- package/src/queues/index.ts +0 -2
- package/src/queues/types.ts +0 -11
- package/src/runtime/host.ts +5 -0
- package/src/runtime/resolve-definitions.ts +0 -1
- package/src/runtime/types.ts +16 -45
- package/src/schedules/builders.ts +1 -4
- package/src/schedules/runtime.ts +0 -41
- package/src/schedules/validation.ts +2 -16
- package/src/security/builders.ts +7 -2
- package/src/security/every.ts +1 -5
- package/src/security/grants.ts +5 -25
- package/src/security/index.ts +0 -3
- package/src/security/membership-policies.ts +3 -1
- package/src/security/public.ts +10 -0
- package/src/security/registry.ts +0 -8
- package/src/security/types.ts +19 -25
- package/src/security/validation.ts +19 -17
- package/src/storage/action-runs/idempotency.ts +13 -41
- package/src/storage/action-runs/in-memory.ts +20 -311
- package/src/storage/action-runs/index.ts +1 -16
- package/src/storage/action-runs/record.ts +130 -0
- package/src/storage/action-runs/types.ts +37 -92
- package/src/storage/agents/types.ts +1 -1
- package/src/storage/auth/in-memory/auth-storage.ts +0 -18
- package/src/storage/auth/in-memory/magic-links.ts +0 -3
- package/src/storage/auth/in-memory/oidc-attempts.ts +0 -3
- package/src/storage/auth/in-memory/sessions.ts +1 -25
- package/src/storage/auth/in-memory/shared.ts +1 -10
- package/src/storage/auth/types.ts +2 -18
- package/src/storage/index.ts +1 -9
- package/src/storage/internal.ts +1 -7
- package/src/storage/objects/execution-limits.ts +3 -2
- package/src/storage/types.ts +2 -4
- package/src/testing/action-execution.ts +73 -13
- package/src/testing/action-run-storage-contract.ts +335 -0
- package/src/testing/auth-storage-contract.ts +14 -107
- package/src/testing/execution-storage-contract.ts +0 -2
- package/src/testing/index.ts +8 -1
- package/src/testing/materializer-storage-contract.ts +174 -18
- package/src/testing/queues-contract.ts +0 -18
- package/dist/actions/run-dispatch.d.ts +0 -25
- package/dist/actions/run-dispatch.d.ts.map +0 -1
- package/dist/actions/worker.d.ts +0 -3
- package/dist/actions/worker.d.ts.map +0 -1
- package/dist/actions/worker.js +0 -325
- package/dist/actions/worker.js.map +0 -11
- package/dist/auth/audience.d.ts +0 -8
- package/dist/auth/audience.d.ts.map +0 -1
- package/dist/authorization/application-access.d.ts +0 -18
- package/dist/authorization/application-access.d.ts.map +0 -1
- package/dist/chunk-1hqwggsn.js.map +0 -12
- package/dist/chunk-2jntasmh.js.map +0 -13
- package/dist/chunk-6h5m9xjx.js.map +0 -40
- package/dist/chunk-85cd7e8c.js +0 -51
- package/dist/chunk-85cd7e8c.js.map +0 -10
- package/dist/chunk-de4z2bj6.js.map +0 -18
- package/dist/chunk-dfm066qg.js.map +0 -11
- package/dist/chunk-enpsx8k5.js.map +0 -10
- package/dist/chunk-fc5zfxy1.js.map +0 -11
- package/dist/chunk-fe52eczz.js.map +0 -49
- package/dist/chunk-fx93hd2n.js +0 -1614
- package/dist/chunk-fx93hd2n.js.map +0 -20
- package/dist/chunk-k6hrnf35.js.map +0 -10
- package/dist/chunk-qkbx3tf6.js.map +0 -24
- package/dist/chunk-qxvp5epv.js +0 -1329
- package/dist/chunk-qxvp5epv.js.map +0 -36
- package/dist/chunk-r2y23egw.js.map +0 -10
- package/dist/chunk-tffvfy6s.js +0 -593
- package/dist/chunk-tffvfy6s.js.map +0 -15
- package/dist/chunk-xt1zt7gv.js.map +0 -13
- package/dist/chunk-y2aq6ag9.js.map +0 -11
- package/dist/chunk-y9jmd7e5.js.map +0 -15
- package/dist/chunk-zvx7h87b.js +0 -12
- package/dist/chunk-zvx7h87b.js.map +0 -10
- package/dist/events/types/actions.d.ts +0 -39
- package/dist/events/types/actions.d.ts.map +0 -1
- package/dist/objects/service/action-service.d.ts +0 -13
- package/dist/objects/service/action-service.d.ts.map +0 -1
- package/dist/security/applications.d.ts +0 -15
- package/dist/security/applications.d.ts.map +0 -1
- package/src/actions/run-dispatch.ts +0 -282
- package/src/actions/worker.ts +0 -2
- package/src/auth/audience.ts +0 -28
- package/src/authorization/application-access.ts +0 -34
- package/src/events/types/actions.ts +0 -42
- package/src/objects/service/action-service.ts +0 -43
- package/src/security/applications.ts +0 -11
- /package/dist/{chunk-rz53yb4v.js.map → chunk-0yh890a4.js.map} +0 -0
- /package/dist/{chunk-vgk3hknm.js.map → chunk-1k89ecfr.js.map} +0 -0
- /package/dist/{chunk-ny3xyvcn.js.map → chunk-1zq2p6g0.js.map} +0 -0
- /package/dist/{chunk-dnmadg9k.js.map → chunk-3t2hgbgd.js.map} +0 -0
- /package/dist/{chunk-22v5bpz3.js.map → chunk-5e43w60z.js.map} +0 -0
- /package/dist/{chunk-7hpdd6r9.js.map → chunk-6p49a5cq.js.map} +0 -0
- /package/dist/{chunk-kkqwzy6h.js.map → chunk-7t429e3f.js.map} +0 -0
- /package/dist/{chunk-ex496vct.js.map → chunk-9dmt152s.js.map} +0 -0
- /package/dist/{chunk-48e3cn2d.js.map → chunk-9gyp8hg1.js.map} +0 -0
- /package/dist/{chunk-zxawp1n2.js.map → chunk-9w055r5b.js.map} +0 -0
- /package/dist/{chunk-4wn7bxxa.js.map → chunk-9ybhtmg4.js.map} +0 -0
- /package/dist/{chunk-vx2yp45y.js.map → chunk-c85m1hyj.js.map} +0 -0
- /package/dist/{chunk-bs7sqkre.js.map → chunk-d09tj99x.js.map} +0 -0
- /package/dist/{chunk-zb77kjth.js.map → chunk-dk8tkk5f.js.map} +0 -0
- /package/dist/{chunk-vjcd8d27.js.map → chunk-fa02jy15.js.map} +0 -0
- /package/dist/{chunk-za5yd58j.js.map → chunk-fkgc1wt8.js.map} +0 -0
- /package/dist/{chunk-6gmfggss.js.map → chunk-t7x8dmn0.js.map} +0 -0
- /package/dist/{chunk-p844e0rn.js.map → chunk-tpn40322.js.map} +0 -0
- /package/dist/{chunk-rt9p8m9t.js.map → chunk-v9xd5wzd.js.map} +0 -0
- /package/dist/{chunk-2vhg6ysa.js.map → chunk-vyf9kfqf.js.map} +0 -0
- /package/dist/{chunk-bwjcehza.js.map → chunk-way52z4h.js.map} +0 -0
- /package/dist/{chunk-qkvz64nd.js.map → chunk-x6m907x7.js.map} +0 -0
- /package/dist/{chunk-yv9czyfr.js.map → chunk-xfs8x8m9.js.map} +0 -0
- /package/dist/{chunk-v6xpd60t.js.map → chunk-yevzdx4y.js.map} +0 -0
- /package/dist/{chunk-qmnnhde6.js.map → chunk-z4m0yz8c.js.map} +0 -0
package/src/auth/cookies.ts
CHANGED
|
@@ -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
|
-
|
|
6
|
-
export const
|
|
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,
|
package/src/auth/runtime.ts
CHANGED
|
@@ -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(
|
|
188
|
-
return
|
|
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,
|
|
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(
|
|
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
|
|
728
|
-
// listing never leaks the groups of
|
|
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
|
-
|
|
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
|
|
742
|
-
const groupIds =
|
|
743
|
-
|
|
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
|
|
833
|
-
//
|
|
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
|
|
892
|
-
* the account is in ("you can manage what you could have created"). This
|
|
893
|
-
*
|
|
894
|
-
*
|
|
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 || !
|
|
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
|
|
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
|
|
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
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
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
|
|
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
|
})
|
package/src/auth/types.ts
CHANGED
|
@@ -11,7 +11,6 @@ import type {
|
|
|
11
11
|
SessionRecord,
|
|
12
12
|
UserRecord,
|
|
13
13
|
} from "../storage/auth"
|
|
14
|
-
import type { AuthSessionAudience, AuthSessionAudienceOptions } from "./audience"
|
|
15
14
|
|
|
16
15
|
export type Principal =
|
|
17
16
|
| { readonly type: "user"; readonly id: string }
|
|
@@ -63,7 +62,6 @@ export interface InvitationDeliveryInput {
|
|
|
63
62
|
readonly projectId: string
|
|
64
63
|
readonly authStorage: AuthStorage
|
|
65
64
|
readonly invitation: InvitationRecord
|
|
66
|
-
readonly audience: AuthSessionAudience
|
|
67
65
|
readonly returnTo: string
|
|
68
66
|
readonly requestOrigin: string
|
|
69
67
|
/** Return the delivered link once so the inviter can copy it through an approved channel. */
|
|
@@ -98,7 +96,6 @@ export interface MagicLinkRequestInput {
|
|
|
98
96
|
readonly projectId: string
|
|
99
97
|
readonly authStorage: AuthStorage
|
|
100
98
|
readonly email: string
|
|
101
|
-
readonly audience: AuthSessionAudience
|
|
102
99
|
readonly returnTo: string
|
|
103
100
|
readonly requestOrigin: string
|
|
104
101
|
/**
|
|
@@ -140,7 +137,6 @@ export interface MagicLinkCallbackInput {
|
|
|
140
137
|
}
|
|
141
138
|
|
|
142
139
|
export interface MagicLinkCallbackResult extends CompleteSignInResult {
|
|
143
|
-
readonly audience: AuthSessionAudience
|
|
144
140
|
readonly returnTo: string
|
|
145
141
|
}
|
|
146
142
|
|
|
@@ -182,7 +178,6 @@ export interface MagicLinkAuthStrategy extends InvitationDeliveryAuthStrategy {
|
|
|
182
178
|
export interface OidcStartSignInInput {
|
|
183
179
|
readonly projectId: string
|
|
184
180
|
readonly authStorage: AuthStorage
|
|
185
|
-
readonly audience: AuthSessionAudience
|
|
186
181
|
readonly returnTo: string
|
|
187
182
|
readonly requestOrigin: string
|
|
188
183
|
readonly now?: Date
|
|
@@ -208,7 +203,6 @@ export interface OidcCallbackInput {
|
|
|
208
203
|
}
|
|
209
204
|
|
|
210
205
|
export interface OidcCallbackResult extends CompleteSignInResult {
|
|
211
|
-
readonly audience: AuthSessionAudience
|
|
212
206
|
readonly returnTo: string
|
|
213
207
|
}
|
|
214
208
|
|
|
@@ -277,11 +271,14 @@ export interface MembershipOperationCapabilities {
|
|
|
277
271
|
readonly invite: boolean
|
|
278
272
|
readonly assignGroups: boolean
|
|
279
273
|
readonly suspend: boolean
|
|
274
|
+
readonly serviceAccounts: boolean
|
|
280
275
|
}
|
|
281
276
|
|
|
282
277
|
export interface GetMembershipOptionsResult {
|
|
283
278
|
/** Groups the caller may assign to a member (the `assignGroups` scope). */
|
|
284
279
|
readonly groups: readonly InvitationGroupOption[]
|
|
280
|
+
/** Groups the caller may place a service account in (the `serviceAccounts` scope). */
|
|
281
|
+
readonly serviceAccountGroups: readonly InvitationGroupOption[]
|
|
285
282
|
readonly capabilities: MembershipOperationCapabilities
|
|
286
283
|
}
|
|
287
284
|
|
|
@@ -377,7 +374,7 @@ export interface ReactivateMemberResult {
|
|
|
377
374
|
/** `"session"` reads only the cookie; `"any"` reads a bearer access token, else the cookie. */
|
|
378
375
|
export type AuthCredentialSource = "session" | "any"
|
|
379
376
|
|
|
380
|
-
export interface AuthSessionResolutionOptions
|
|
377
|
+
export interface AuthSessionResolutionOptions {
|
|
381
378
|
readonly credentialSource?: AuthCredentialSource
|
|
382
379
|
/** Marks this request as eligible to renew a near-expiry browser session. */
|
|
383
380
|
readonly sessionActivity?: "foreground"
|
|
@@ -385,7 +382,6 @@ export interface AuthSessionResolutionOptions extends AuthSessionAudienceOptions
|
|
|
385
382
|
|
|
386
383
|
/** Where an invitation link sends its recipient. */
|
|
387
384
|
export interface InvitationDestination {
|
|
388
|
-
readonly audience: AuthSessionAudience
|
|
389
385
|
readonly requestOrigin: string
|
|
390
386
|
readonly returnTo: string
|
|
391
387
|
}
|
package/src/auth/validation.ts
CHANGED
|
@@ -22,8 +22,6 @@ export const MAX_AUTH_INVITATION_TTL_MS = 30 * DAY
|
|
|
22
22
|
*/
|
|
23
23
|
export const DEFAULT_AUTH_SESSION_CACHE_TTL_MS = 5_000
|
|
24
24
|
|
|
25
|
-
export { resolveAuthSessionAudience } from "./audience"
|
|
26
|
-
|
|
27
25
|
export function resolveAuthConfig(config: SixbAuthConfig | undefined): ResolvedAuthConfig {
|
|
28
26
|
if (!config) {
|
|
29
27
|
return {
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* is unrestricted.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type { AuthSessionAudience } from "../auth/audience"
|
|
14
13
|
import {
|
|
15
14
|
type ResolvedRuntimeAuthorization,
|
|
16
15
|
resolveExecutionScopeAuthorization,
|
|
@@ -18,12 +17,11 @@ import {
|
|
|
18
17
|
} from "../execution/authorization"
|
|
19
18
|
import type { ExecutionContext, RuntimeAuthorization } from "../execution/types"
|
|
20
19
|
import { AuthorizationError } from "./errors"
|
|
21
|
-
import type {
|
|
20
|
+
import type { SingletonGrantKind, TargetedGrantKind } from "./grant-kinds"
|
|
22
21
|
import type { AuthorizationContext, GrantIndex } from "./types"
|
|
23
22
|
|
|
24
23
|
/** Something a principal may attempt, paired with the resource it targets. */
|
|
25
24
|
export type AuthzRequest =
|
|
26
|
-
| { readonly kind: "application.access"; readonly audience: AuthSessionAudience }
|
|
27
25
|
| { readonly kind: "object.view"; readonly objectTypeId: string }
|
|
28
26
|
| { readonly kind: "dataset.view"; readonly datasetId: string }
|
|
29
27
|
| { readonly kind: "object.edit"; readonly objectTypeId: string }
|
|
@@ -59,13 +57,11 @@ interface AuthorizedRuntime {
|
|
|
59
57
|
// the two can never drift. `kind` is the resolved-index key, so enforcement is
|
|
60
58
|
// a direct lookup with no per-target dispatch.
|
|
61
59
|
type Atom =
|
|
62
|
-
| { readonly kind:
|
|
63
|
-
| { readonly kind:
|
|
60
|
+
| { readonly kind: SingletonGrantKind }
|
|
61
|
+
| { readonly kind: TargetedGrantKind; readonly id: string }
|
|
64
62
|
|
|
65
63
|
function atomsFor(request: AuthzRequest): readonly Atom[] {
|
|
66
64
|
switch (request.kind) {
|
|
67
|
-
case "application.access":
|
|
68
|
-
return [{ kind: "access:application", id: request.audience }]
|
|
69
65
|
case "object.view":
|
|
70
66
|
return [{ kind: "view:object", id: request.objectTypeId }]
|
|
71
67
|
case "dataset.view":
|
|
@@ -87,11 +83,11 @@ function atomsFor(request: AuthzRequest): readonly Atom[] {
|
|
|
87
83
|
case "agent.run":
|
|
88
84
|
return [{ kind: "run:agent" }]
|
|
89
85
|
case "logs.observe":
|
|
90
|
-
return [{ kind: "observe:logs"
|
|
86
|
+
return [{ kind: "observe:logs" }]
|
|
91
87
|
case "aiUsage.observe":
|
|
92
|
-
return [{ kind: "observe:aiUsage"
|
|
88
|
+
return [{ kind: "observe:aiUsage" }]
|
|
93
89
|
case "aiUsage.manage":
|
|
94
|
-
return [{ kind: "manage:aiUsage"
|
|
90
|
+
return [{ kind: "manage:aiUsage" }]
|
|
95
91
|
case "connector.manage":
|
|
96
92
|
return [{ kind: "manage:connector", id: request.connectorId }]
|
|
97
93
|
case "object.query":
|
|
@@ -100,20 +96,11 @@ function atomsFor(request: AuthzRequest): readonly Atom[] {
|
|
|
100
96
|
}
|
|
101
97
|
|
|
102
98
|
function atomKey(atom: Atom): string {
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
atom.kind === "observe:logs" ||
|
|
106
|
-
atom.kind === "observe:aiUsage" ||
|
|
107
|
-
atom.kind === "manage:aiUsage"
|
|
108
|
-
) {
|
|
109
|
-
return atom.kind
|
|
110
|
-
}
|
|
111
|
-
return `${atom.kind}:${atom.id}`
|
|
99
|
+
return "id" in atom ? `${atom.kind}:${atom.id}` : atom.kind
|
|
112
100
|
}
|
|
113
101
|
|
|
114
102
|
function holds(grants: GrantIndex, atom: Atom): boolean {
|
|
115
|
-
|
|
116
|
-
return grants[atom.kind].has(atom.id)
|
|
103
|
+
return "id" in atom ? grants[atom.kind].has(atom.id) : grants[atom.kind]
|
|
117
104
|
}
|
|
118
105
|
|
|
119
106
|
/** Resolve a request against a principal's grants. Never throws. */
|
|
@@ -267,8 +254,6 @@ function deniedMessage(
|
|
|
267
254
|
): string {
|
|
268
255
|
const principalId = authorization?.principal.id ?? "unknown"
|
|
269
256
|
switch (request.kind) {
|
|
270
|
-
case "application.access":
|
|
271
|
-
return `[Sixb] Principal '${principalId}' is not allowed to access application '${request.audience}'.`
|
|
272
257
|
case "object.view":
|
|
273
258
|
return `[Sixb] Principal '${principalId}' is not allowed to view object type '${request.objectTypeId}'.`
|
|
274
259
|
case "dataset.view":
|
|
@@ -38,18 +38,6 @@ export function canViewEvent(
|
|
|
38
38
|
}) &&
|
|
39
39
|
isAllowed(authorization, { kind: "object.view", objectTypeId: event.payload.targetTypeId })
|
|
40
40
|
)
|
|
41
|
-
case "actions": {
|
|
42
|
-
// Apply is necessary; for object-bound actions the principal must also be
|
|
43
|
-
// able to view the subject type, or the event would leak a hidden
|
|
44
|
-
// object's id/type — mirroring the rule in `canListAction`.
|
|
45
|
-
if (!isAllowed(authorization, { kind: "action.apply", actionId: event.payload.actionId })) {
|
|
46
|
-
return false
|
|
47
|
-
}
|
|
48
|
-
const subject = event.payload.subject
|
|
49
|
-
return subject.kind === "object"
|
|
50
|
-
? isAllowed(authorization, { kind: "object.view", objectTypeId: subject.objectTypeId })
|
|
51
|
-
: true
|
|
52
|
-
}
|
|
53
41
|
case "workflows":
|
|
54
42
|
return isAllowed(authorization, {
|
|
55
43
|
kind: "workflow.run",
|