@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
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import { AuthorizationError, assertProviderAccess } from \"../authorization\"\nimport type { ExecutionContext } from \"../execution\"\nimport { resolveExecutionScopeAuthorization } from \"../execution/authorization\"\nimport type { SixbRuntimeContext } from \"../runtime/types\"\nimport { createConnectorCodedError } from \"./errors\"\nimport type { ConnectorService } from \"./service\"\nimport type {\n AnyConnectorAdapter,\n ConnectorAdapter,\n ConnectorClient,\n ConnectorConnectionMetadata,\n ConnectorConnectionSelector,\n ConnectorDefinition,\n OAuthConnectorAdapter,\n} from \"./types\"\nimport { isOAuthConnectorDefinition } from \"./types\"\n\n/** Resolve a registered connector through one authorized execution. */\nexport interface ConnectorRuntime {\n <TAdapter extends ConnectorAdapter>(\n definition: ConnectorDefinition<string, TAdapter>\n ): Promise<ConnectorClient<TAdapter>>\n <TAdapter extends OAuthConnectorAdapter>(\n definition: ConnectorDefinition<string, TAdapter>,\n selector: ConnectorConnectionSelector\n ): Promise<ConnectorClient<TAdapter>>\n}\n\nexport interface ConnectorExecutionSource<\n TAdapter extends AnyConnectorAdapter = AnyConnectorAdapter,\n> {\n readonly connection?: ConnectorConnectionMetadata\n connect(signal: AbortSignal): Promise<ConnectorClient<TAdapter>>\n}\n\nexport interface ConnectorExecutionSourceResolver {\n list<TAdapter extends AnyConnectorAdapter>(\n definition: ConnectorDefinition<string, TAdapter>\n ): Promise<readonly ConnectorExecutionSource<TAdapter>[]>\n}\n\nconst sourceResolvers = new WeakMap<ConnectorRuntime, ConnectorExecutionSourceResolver>()\n\nexport function createConnectorRuntime(\n runtime: SixbRuntimeContext,\n execution: ExecutionContext,\n service: ConnectorService\n): ConnectorRuntime {\n const connector = ((definition: ConnectorDefinition, selector?: ConnectorConnectionSelector) => {\n if (isOAuthConnectorDefinition(definition)) {\n assertConnectorConnectionAccess(runtime, execution)\n if (!selector) {\n throw createConnectorCodedError(\n \"connector.configuration_invalid\",\n `[Sixb] Connector '${definition.id}' uses persistent connections and requires an explicit owner and slot.`\n )\n }\n return service.connectConnection(definition, selector)\n }\n if (selector) {\n throw createConnectorCodedError(\n \"connector.configuration_invalid\",\n `[Sixb] Static connector '${definition.id}' does not accept a connection.`\n )\n }\n assertProviderAccess(runtime, execution, \"connector.connect\")\n return service.connect(definition as ConnectorDefinition<string, ConnectorAdapter>)\n }) as ConnectorRuntime\n\n registerConnectorExecutionSourceResolver(connector, {\n async list<TAdapter extends AnyConnectorAdapter>(\n definition: ConnectorDefinition<string, TAdapter>\n ): Promise<readonly ConnectorExecutionSource<TAdapter>[]> {\n if (!isOAuthConnectorDefinition(definition)) {\n return [\n {\n connect: (_signal) =>\n connector(definition as ConnectorDefinition<string, ConnectorAdapter>) as Promise<\n ConnectorClient<TAdapter>\n >,\n },\n ]\n }\n\n assertConnectorConnectionAccess(runtime, execution)\n const connections = await service.listExecutionConnections(definition)\n return connections.map((connection) => ({\n connection: {\n id: connection.id,\n connectorId: connection.connectorId,\n owner: connection.owner,\n slot: connection.slot,\n account: connection.account,\n },\n connect: (signal) =>\n service.connectExecutionConnection(definition, connection, signal) as Promise<\n ConnectorClient<TAdapter>\n >,\n }))\n },\n })\n return connector\n}\n\nfunction registerConnectorExecutionSourceResolver(\n connector: ConnectorRuntime,\n resolver: ConnectorExecutionSourceResolver\n): void {\n const registered = sourceResolvers.get(connector)\n if (registered && registered !== resolver) {\n throw new Error(\"[Sixb] Connector source resolver is already registered for this execution.\")\n }\n sourceResolvers.set(connector, resolver)\n}\n\nexport function getConnectorExecutionSourceResolver(\n connector: ConnectorRuntime\n): ConnectorExecutionSourceResolver {\n const resolver = sourceResolvers.get(connector)\n if (resolver) return resolver\n\n return {\n async list<TAdapter extends AnyConnectorAdapter>(\n definition: ConnectorDefinition<string, TAdapter>\n ): Promise<readonly ConnectorExecutionSource<TAdapter>[]> {\n if (isOAuthConnectorDefinition(definition)) {\n throw createConnectorCodedError(\n \"connector.configuration_invalid\",\n `[Sixb] OAuth connector '${definition.id}' cannot be resolved without the managed connection runtime.`\n )\n }\n return [\n {\n connect: (_signal) =>\n connector(definition as ConnectorDefinition<string, ConnectorAdapter>) as Promise<\n ConnectorClient<TAdapter>\n >,\n },\n ]\n },\n }\n}\n\nfunction assertConnectorConnectionAccess(\n runtime: SixbRuntimeContext,\n execution: ExecutionContext\n): void {\n const resolved = resolveExecutionScopeAuthorization(runtime.projectId, {\n execution,\n authorization: runtime.runtimeAuthorization,\n })\n if (resolved.type === \"unrestricted\" && resolved.ref.type === \"trustedPrimitive\") return\n throw new AuthorizationError(\n \"privileged:connector-connection.connect\",\n \"[Sixb] Connector connection clients are restricted to trusted primitive executions.\"\n )\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": "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",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "3C1D35D66FA59CBC64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
validateSchemaValue2,
|
|
12
12
|
normalizeSchemaValue2
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-hvsb78a1.js";
|
|
14
14
|
import {
|
|
15
15
|
AgentDefinitionError2,
|
|
16
16
|
AgentToolResultValidationError2
|
|
17
17
|
} from "./chunk-pfp1txq2.js";
|
|
18
18
|
import {
|
|
19
19
|
assertValidSchema
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-1k89ecfr.js";
|
|
21
21
|
import {
|
|
22
22
|
OntologyValidationError2
|
|
23
23
|
} from "./chunk-cqr3acm1.js";
|
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
canAccessApplication2,
|
|
4
3
|
resolveRoleGrants2,
|
|
5
4
|
resolveAuthorizationContext2
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-d0bqz29d.js";
|
|
7
6
|
import {
|
|
8
7
|
assertValidFileRefs2
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-hvsb78a1.js";
|
|
10
9
|
import {
|
|
11
10
|
SecurityValidationError2,
|
|
12
11
|
resolveMembershipPolicyScope,
|
|
13
12
|
canPerformMembershipOperation,
|
|
14
13
|
missingMembershipGroupIds,
|
|
15
14
|
validateSecurityDefinitionsAtStartup
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-es1gxsbf.js";
|
|
17
16
|
import {
|
|
18
|
-
AuthRuntimeError2,
|
|
19
|
-
DEFAULT_AUTH_SESSION_AUDIENCE2,
|
|
20
|
-
resolveAuthSessionAudience2,
|
|
21
|
-
resolveAuthCookieOptionsForAudience,
|
|
22
17
|
getCookie2,
|
|
18
|
+
AuthRuntimeError2,
|
|
23
19
|
resolveAuthConfig2,
|
|
24
20
|
resolveInvitationExpiresAt,
|
|
25
21
|
assertNonEmpty3,
|
|
26
22
|
normalizePagination,
|
|
27
23
|
isInvitationDeliveryAuthStrategy2
|
|
28
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-hcbyfxbe.js";
|
|
29
25
|
import {
|
|
30
26
|
normalizeParams,
|
|
31
27
|
coerceParamsToTyped
|
|
32
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-c85m1hyj.js";
|
|
33
29
|
import {
|
|
34
30
|
snapshotLinkPathSelection
|
|
35
31
|
} from "./chunk-t6f3tdnr.js";
|
|
@@ -161,13 +157,6 @@ function safeEqual(left, right) {
|
|
|
161
157
|
}
|
|
162
158
|
// src/auth/runtime.ts
|
|
163
159
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
164
|
-
|
|
165
|
-
// src/security/applications.ts
|
|
166
|
-
var applications2 = {
|
|
167
|
-
atlas: { kind: "application", id: "atlas", label: "Atlas" },
|
|
168
|
-
app: { kind: "application", id: "app", label: "Custom app" }
|
|
169
|
-
};
|
|
170
|
-
var APPLICATION_IDS = new Set(Object.values(applications2).map((application) => application.id));
|
|
171
160
|
// src/security/every.ts
|
|
172
161
|
var BREADTH_TARGETS = [
|
|
173
162
|
"object",
|
|
@@ -176,7 +165,6 @@ var BREADTH_TARGETS = [
|
|
|
176
165
|
"workflow",
|
|
177
166
|
"sync",
|
|
178
167
|
"pipeline",
|
|
179
|
-
"application",
|
|
180
168
|
"connector",
|
|
181
169
|
"share"
|
|
182
170
|
];
|
|
@@ -211,7 +199,6 @@ var every2 = {
|
|
|
211
199
|
workflow: () => all("workflow"),
|
|
212
200
|
sync: () => all("sync"),
|
|
213
201
|
pipeline: () => all("pipeline"),
|
|
214
|
-
application: () => all("application"),
|
|
215
202
|
connector: () => all("connector"),
|
|
216
203
|
share: () => all("share")
|
|
217
204
|
};
|
|
@@ -219,10 +206,6 @@ var every2 = {
|
|
|
219
206
|
class ActionDefinitionError2 extends Error {
|
|
220
207
|
name = "ActionDefinitionError";
|
|
221
208
|
}
|
|
222
|
-
|
|
223
|
-
class ActionEditCommitError2 extends Error {
|
|
224
|
-
name = "ActionEditCommitError";
|
|
225
|
-
}
|
|
226
209
|
function missingActionMutationMessage(actionId) {
|
|
227
210
|
return `Action "${actionId}" must declare .writeback(...) or .edits(...).`;
|
|
228
211
|
}
|
|
@@ -254,7 +237,7 @@ function normalizeActionParams(runtime, paramsConfig, params, pathPrefix) {
|
|
|
254
237
|
assertValidFileRefs2(normalized, pathPrefix);
|
|
255
238
|
return normalized;
|
|
256
239
|
}
|
|
257
|
-
function
|
|
240
|
+
function coerceActionParamsToTyped(paramsConfig, params, valueTypesById) {
|
|
258
241
|
return coerceParamsToTyped(paramsConfig, params, valueTypesById);
|
|
259
242
|
}
|
|
260
243
|
function validateActionSubject(action, subject) {
|
|
@@ -578,7 +561,6 @@ var TARGET_BY_DEFINITION_KIND = {
|
|
|
578
561
|
sync: "sync",
|
|
579
562
|
pipeline: "pipeline",
|
|
580
563
|
workflow: "workflow",
|
|
581
|
-
application: "application",
|
|
582
564
|
connector: "connector",
|
|
583
565
|
share: "share"
|
|
584
566
|
};
|
|
@@ -626,10 +608,6 @@ function resolveGrant(input, label, allowedTargets) {
|
|
|
626
608
|
const ids = [...new Set(items.map((item) => definitionIdOf(item, label)))];
|
|
627
609
|
return { target, selection: { all: false, ids } };
|
|
628
610
|
}
|
|
629
|
-
function access(input) {
|
|
630
|
-
const { selection } = resolveGrant(input, "can.access", ["application"]);
|
|
631
|
-
return { kind: "grant", capability: "access", target: "application", selection };
|
|
632
|
-
}
|
|
633
611
|
function view(input) {
|
|
634
612
|
if (isShareTarget(input))
|
|
635
613
|
return createShareViewGrant(input);
|
|
@@ -691,22 +669,11 @@ function observe(input) {
|
|
|
691
669
|
if (input !== "logs" && !isAgentUsageReference(input)) {
|
|
692
670
|
throw new SecurityValidationError2('[Sixb] can.observe accepts "logs" or agent.usage.');
|
|
693
671
|
}
|
|
694
|
-
|
|
695
|
-
return {
|
|
696
|
-
kind: "grant",
|
|
697
|
-
capability: "observe",
|
|
698
|
-
target,
|
|
699
|
-
selection: { all: false, ids: [target] }
|
|
700
|
-
};
|
|
672
|
+
return { kind: "grant", capability: "observe", target: input === "logs" ? "logs" : "aiUsage" };
|
|
701
673
|
}
|
|
702
674
|
function manage(input) {
|
|
703
675
|
if (isAgentUsageReference(input)) {
|
|
704
|
-
return {
|
|
705
|
-
kind: "grant",
|
|
706
|
-
capability: "manage",
|
|
707
|
-
target: "aiUsage",
|
|
708
|
-
selection: { all: false, ids: ["aiUsage"] }
|
|
709
|
-
};
|
|
676
|
+
return { kind: "grant", capability: "manage", target: "aiUsage" };
|
|
710
677
|
}
|
|
711
678
|
return {
|
|
712
679
|
kind: "grant",
|
|
@@ -716,7 +683,6 @@ function manage(input) {
|
|
|
716
683
|
};
|
|
717
684
|
}
|
|
718
685
|
var can2 = {
|
|
719
|
-
access,
|
|
720
686
|
view,
|
|
721
687
|
edit,
|
|
722
688
|
append,
|
|
@@ -739,7 +705,6 @@ class SecurityRegistry {
|
|
|
739
705
|
groups: input.groups ?? [],
|
|
740
706
|
roles: input.roles ?? [],
|
|
741
707
|
membershipPolicies: input.membershipPolicies ?? [],
|
|
742
|
-
applicationIds: input.applicationIds ?? APPLICATION_IDS,
|
|
743
708
|
objectTypeIds: input.objectTypeIds,
|
|
744
709
|
datasetIds: input.datasetIds,
|
|
745
710
|
actionIds: input.actionIds,
|
|
@@ -748,12 +713,9 @@ class SecurityRegistry {
|
|
|
748
713
|
pipelineIds: input.pipelineIds,
|
|
749
714
|
agentAvailable: input.agentAvailable,
|
|
750
715
|
connectorIds: input.connectorIds,
|
|
751
|
-
observableIds: new Set(["logs", "aiUsage"]),
|
|
752
|
-
manageableIds: new Set(["aiUsage"]),
|
|
753
716
|
shareIds: input.shareIds
|
|
754
717
|
});
|
|
755
718
|
const universe = {
|
|
756
|
-
applicationIds: input.applicationIds ?? APPLICATION_IDS,
|
|
757
719
|
objectTypeIds: input.objectTypeIds ?? new Set,
|
|
758
720
|
datasetIds: input.datasetIds ?? new Set,
|
|
759
721
|
actionIds: input.actionIds ?? new Set,
|
|
@@ -761,8 +723,6 @@ class SecurityRegistry {
|
|
|
761
723
|
syncIds: input.syncIds ?? new Set,
|
|
762
724
|
pipelineIds: input.pipelineIds ?? new Set,
|
|
763
725
|
connectorIds: input.connectorIds ?? new Set,
|
|
764
|
-
observableIds: new Set(["logs", "aiUsage"]),
|
|
765
|
-
manageableIds: new Set(["aiUsage"]),
|
|
766
726
|
shareIds: input.shareIds ?? new Set,
|
|
767
727
|
getSubTypes: input.getSubTypes ?? (() => [])
|
|
768
728
|
};
|
|
@@ -930,15 +890,12 @@ function getActiveInvitationByEmail(state, projectId, email, now) {
|
|
|
930
890
|
const invitations = [...state.invitations.values()].filter((invitation) => invitation.projectId === projectId).filter((invitation) => invitation.email === normalizedEmail).filter((invitation) => isActiveInvitation(invitation, now)).sort((a, b) => compareByCreatedAt(a, b, "desc"));
|
|
931
891
|
return invitations[0] ?? null;
|
|
932
892
|
}
|
|
933
|
-
function revokeActiveSessionsForUser(state, projectId, userId, revokedAt
|
|
893
|
+
function revokeActiveSessionsForUser(state, projectId, userId, revokedAt) {
|
|
934
894
|
const revoked = [];
|
|
935
895
|
for (const [key, session] of state.sessions) {
|
|
936
896
|
if (session.projectId !== projectId || session.userId !== userId) {
|
|
937
897
|
continue;
|
|
938
898
|
}
|
|
939
|
-
if (audience !== undefined && session.audience !== audience) {
|
|
940
|
-
continue;
|
|
941
|
-
}
|
|
942
899
|
if (!isActiveSession(session, revokedAt)) {
|
|
943
900
|
continue;
|
|
944
901
|
}
|
|
@@ -977,7 +934,6 @@ function assertSessionIdAvailable(state, projectId, sessionId) {
|
|
|
977
934
|
}
|
|
978
935
|
function validateCompleteSessionInput(state, projectId, session) {
|
|
979
936
|
const sessionId = assertNonEmpty4(session.id, "Session id");
|
|
980
|
-
assertNonEmpty4(session.audience, "Session audience");
|
|
981
937
|
assertNonEmpty4(session.tokenHash, "Session token hash");
|
|
982
938
|
assertSessionIdAvailable(state, projectId, sessionId);
|
|
983
939
|
}
|
|
@@ -986,7 +942,6 @@ function createSessionRecord(state, input) {
|
|
|
986
942
|
const projectId = assertNonEmpty4(input.projectId, "Project id");
|
|
987
943
|
const userId = assertNonEmpty4(input.userId, "User id");
|
|
988
944
|
const strategyId = assertNonEmpty4(input.strategyId, "Strategy id");
|
|
989
|
-
const audience = resolveAuthSessionAudience2(input.audience);
|
|
990
945
|
const tokenHash = assertNonEmpty4(input.tokenHash, "Session token hash");
|
|
991
946
|
assertSessionIdAvailable(state, projectId, id);
|
|
992
947
|
const session = {
|
|
@@ -994,7 +949,6 @@ function createSessionRecord(state, input) {
|
|
|
994
949
|
projectId,
|
|
995
950
|
userId,
|
|
996
951
|
strategyId,
|
|
997
|
-
audience,
|
|
998
952
|
tokenHash,
|
|
999
953
|
createdAt: cloneDate(input.createdAt),
|
|
1000
954
|
expiresAt: cloneDate(input.expiresAt),
|
|
@@ -1514,7 +1468,6 @@ class InMemoryAuthMagicLinkStore {
|
|
|
1514
1468
|
const id = assertNonEmpty4(input.id, "Magic link id");
|
|
1515
1469
|
const projectId = assertNonEmpty4(input.projectId, "Project id");
|
|
1516
1470
|
const strategyId = assertNonEmpty4(input.strategyId, "Strategy id");
|
|
1517
|
-
const audience = resolveAuthSessionAudience2(input.audience);
|
|
1518
1471
|
const email = normalizeEmail(input.email);
|
|
1519
1472
|
const tokenHash = assertNonEmpty4(input.tokenHash, "Magic link token hash");
|
|
1520
1473
|
const key = magicLinkKey(projectId, id);
|
|
@@ -1526,7 +1479,6 @@ class InMemoryAuthMagicLinkStore {
|
|
|
1526
1479
|
id,
|
|
1527
1480
|
projectId,
|
|
1528
1481
|
strategyId,
|
|
1529
|
-
audience,
|
|
1530
1482
|
email,
|
|
1531
1483
|
tokenHash,
|
|
1532
1484
|
returnTo: input.returnTo,
|
|
@@ -1563,7 +1515,6 @@ class InMemoryAuthOidcAuthorizationAttemptStore {
|
|
|
1563
1515
|
const id = assertNonEmpty4(input.id, "OIDC authorization attempt id");
|
|
1564
1516
|
const projectId = assertNonEmpty4(input.projectId, "Project id");
|
|
1565
1517
|
const strategyId = assertNonEmpty4(input.strategyId, "Strategy id");
|
|
1566
|
-
const audience = resolveAuthSessionAudience2(input.audience);
|
|
1567
1518
|
const stateHash = assertNonEmpty4(input.stateHash, "OIDC state hash");
|
|
1568
1519
|
const nonceHash = assertNonEmpty4(input.nonceHash, "OIDC nonce hash");
|
|
1569
1520
|
const codeVerifier = assertNonEmpty4(input.codeVerifier, "OIDC code verifier");
|
|
@@ -1575,7 +1526,6 @@ class InMemoryAuthOidcAuthorizationAttemptStore {
|
|
|
1575
1526
|
id,
|
|
1576
1527
|
projectId,
|
|
1577
1528
|
strategyId,
|
|
1578
|
-
audience,
|
|
1579
1529
|
stateHash,
|
|
1580
1530
|
nonceHash,
|
|
1581
1531
|
codeVerifier,
|
|
@@ -1701,10 +1651,6 @@ class InMemoryAuthSessionStore {
|
|
|
1701
1651
|
const record = this.state.sessions.get(sessionKey(params.projectId, params.id)) ?? null;
|
|
1702
1652
|
return cloneOptionalRecord(record);
|
|
1703
1653
|
}
|
|
1704
|
-
async getActiveByUserId(params) {
|
|
1705
|
-
const sessions = [...this.state.sessions.values()].filter((session) => session.projectId === params.projectId).filter((session) => session.userId === params.userId).filter((session) => session.audience === params.audience).filter((session) => isActiveSession(session, params.now)).sort((a, b) => compareByCreatedAt(a, b, "desc"));
|
|
1706
|
-
return cloneOptionalRecord(sessions[0] ?? null);
|
|
1707
|
-
}
|
|
1708
1654
|
async listActiveByUserId(params) {
|
|
1709
1655
|
return [...this.state.sessions.values()].filter((session) => session.projectId === params.projectId).filter((session) => session.userId === params.userId).filter((session) => isActiveSession(session, params.now)).sort((a, b) => {
|
|
1710
1656
|
const activity = (b.lastSeenAt ?? b.createdAt).getTime() - (a.lastSeenAt ?? a.createdAt).getTime();
|
|
@@ -1716,7 +1662,7 @@ class InMemoryAuthSessionStore {
|
|
|
1716
1662
|
}
|
|
1717
1663
|
async findValidByTokenHash(params) {
|
|
1718
1664
|
const session = this.state.sessions.get(sessionKey(params.projectId, params.id));
|
|
1719
|
-
if (!session || session.bearer || session.
|
|
1665
|
+
if (!session || session.bearer || session.tokenHash !== params.tokenHash || !isActiveSession(session, params.now)) {
|
|
1720
1666
|
return null;
|
|
1721
1667
|
}
|
|
1722
1668
|
return cloneRecord(session);
|
|
@@ -1763,7 +1709,7 @@ class InMemoryAuthSessionStore {
|
|
|
1763
1709
|
async renewIfValid(params) {
|
|
1764
1710
|
const key = sessionKey(params.projectId, params.id);
|
|
1765
1711
|
const session = this.state.sessions.get(key);
|
|
1766
|
-
if (!session || session.bearer || session.
|
|
1712
|
+
if (!session || session.bearer || session.tokenHash !== params.tokenHash || !isActiveSession(session, params.now)) {
|
|
1767
1713
|
return null;
|
|
1768
1714
|
}
|
|
1769
1715
|
const requestedExpiresAt = session.absoluteExpiresAt ? new Date(Math.min(params.expiresAt.getTime(), session.absoluteExpiresAt.getTime())) : params.expiresAt;
|
|
@@ -1789,7 +1735,7 @@ class InMemoryAuthSessionStore {
|
|
|
1789
1735
|
return cloneRecord(next);
|
|
1790
1736
|
}
|
|
1791
1737
|
async revokeActiveForUser(params) {
|
|
1792
|
-
return revokeActiveSessionsForUser(this.state, params.projectId, params.userId, params.revokedAt
|
|
1738
|
+
return revokeActiveSessionsForUser(this.state, params.projectId, params.userId, params.revokedAt).map(cloneRecord);
|
|
1793
1739
|
}
|
|
1794
1740
|
async touch(params) {
|
|
1795
1741
|
const key = sessionKey(params.projectId, params.id);
|
|
@@ -1997,7 +1943,6 @@ class InMemoryAuthStorage2 {
|
|
|
1997
1943
|
throw new AuthStorageError2("user_creation_not_allowed", `[Sixb] Magic link '${input.magicLinkId}' cannot create a user for project '${projectId}'.`);
|
|
1998
1944
|
}
|
|
1999
1945
|
validateCompleteSessionInput(this.state, projectId, input.session);
|
|
2000
|
-
assertSignInSessionAudience(projectId, input.session.audience, magicLink.audience);
|
|
2001
1946
|
let newUserId;
|
|
2002
1947
|
if (shouldCreateUser) {
|
|
2003
1948
|
newUserId = assertNonEmpty4(input.newUserId, "User id");
|
|
@@ -2086,7 +2031,6 @@ class InMemoryAuthStorage2 {
|
|
|
2086
2031
|
throw new AuthStorageError2("user_creation_not_allowed", `[Sixb] OIDC authorization attempt '${input.oidcAuthorizationAttemptId}' cannot create a user for project '${projectId}'.`);
|
|
2087
2032
|
}
|
|
2088
2033
|
validateCompleteSessionInput(this.state, projectId, input.session);
|
|
2089
|
-
assertSignInSessionAudience(projectId, input.session.audience, attempt.audience);
|
|
2090
2034
|
let newUserId;
|
|
2091
2035
|
if (shouldCreateUser) {
|
|
2092
2036
|
newUserId = assertNonEmpty4(input.newUserId, "User id");
|
|
@@ -2217,7 +2161,6 @@ class InMemoryAuthStorage2 {
|
|
|
2217
2161
|
projectId: input.projectId,
|
|
2218
2162
|
userId: input.userId,
|
|
2219
2163
|
strategyId: input.strategyId,
|
|
2220
|
-
audience: input.session.audience,
|
|
2221
2164
|
tokenHash: input.session.tokenHash,
|
|
2222
2165
|
createdAt: input.session.createdAt,
|
|
2223
2166
|
expiresAt: input.session.expiresAt,
|
|
@@ -2241,12 +2184,6 @@ function restoreMap(target, snapshot) {
|
|
|
2241
2184
|
target.set(key, value);
|
|
2242
2185
|
}
|
|
2243
2186
|
}
|
|
2244
|
-
function assertSignInSessionAudience(projectId, sessionAudience, storedAudience) {
|
|
2245
|
-
if (sessionAudience === storedAudience) {
|
|
2246
|
-
return;
|
|
2247
|
-
}
|
|
2248
|
-
throw new AuthStorageError2("invalid_input", `[Sixb] Sign-in session audience '${sessionAudience}' does not match stored auth audience '${storedAudience}' for project '${projectId}'.`);
|
|
2249
|
-
}
|
|
2250
2187
|
// src/auth/session-cache.ts
|
|
2251
2188
|
class SessionCache {
|
|
2252
2189
|
ttlMs;
|
|
@@ -2261,7 +2198,7 @@ class SessionCache {
|
|
|
2261
2198
|
if (!entry) {
|
|
2262
2199
|
return;
|
|
2263
2200
|
}
|
|
2264
|
-
if (entry.expiresAtMs <= input.nowMs || entry.tokenHash !== input.tokenHash || entry.transport !== input.transport
|
|
2201
|
+
if (entry.expiresAtMs <= input.nowMs || entry.tokenHash !== input.tokenHash || entry.transport !== input.transport) {
|
|
2265
2202
|
this.entries.delete(input.sessionId);
|
|
2266
2203
|
return;
|
|
2267
2204
|
}
|
|
@@ -2277,7 +2214,6 @@ class SessionCache {
|
|
|
2277
2214
|
this.entries.set(input.sessionId, {
|
|
2278
2215
|
tokenHash: input.tokenHash,
|
|
2279
2216
|
transport: bearer ? "bearer" : "cookie",
|
|
2280
|
-
audience: input.audience,
|
|
2281
2217
|
session: input.session,
|
|
2282
2218
|
expiresAtMs
|
|
2283
2219
|
});
|
|
@@ -2391,8 +2327,8 @@ class AuthRuntime2 {
|
|
|
2391
2327
|
...absoluteTimeoutMs === undefined ? {} : { absoluteExpiresAt: new Date(now.getTime() + absoluteTimeoutMs) }
|
|
2392
2328
|
};
|
|
2393
2329
|
}
|
|
2394
|
-
getCookieOptions(
|
|
2395
|
-
return
|
|
2330
|
+
getCookieOptions() {
|
|
2331
|
+
return this.config.cookies;
|
|
2396
2332
|
}
|
|
2397
2333
|
assertCanServeHttp(params) {
|
|
2398
2334
|
const strategy = this.config.strategy;
|
|
@@ -2413,7 +2349,6 @@ class AuthRuntime2 {
|
|
|
2413
2349
|
if (!this.isEnabled()) {
|
|
2414
2350
|
return { authenticated: false, reason: "auth_disabled" };
|
|
2415
2351
|
}
|
|
2416
|
-
const audience = resolveAuthSessionAudience2(options.audience);
|
|
2417
2352
|
if (options.credentialSource === "any") {
|
|
2418
2353
|
const tokenValue = getBearerAccessTokenValue2(request);
|
|
2419
2354
|
if (tokenValue?.startsWith(SESSION_ACCESS_TOKEN_PREFIX)) {
|
|
@@ -2426,10 +2361,10 @@ class AuthRuntime2 {
|
|
|
2426
2361
|
return { authenticated: false, reason: "invalid_access_token" };
|
|
2427
2362
|
}
|
|
2428
2363
|
}
|
|
2429
|
-
return this.resolveCookieSession(request,
|
|
2364
|
+
return this.resolveCookieSession(request, options.sessionActivity);
|
|
2430
2365
|
}
|
|
2431
|
-
async resolveCookieSession(request,
|
|
2432
|
-
const cookieOptions = this.getCookieOptions(
|
|
2366
|
+
async resolveCookieSession(request, activity) {
|
|
2367
|
+
const cookieOptions = this.getCookieOptions();
|
|
2433
2368
|
const cookieValue = getCookie2(request, cookieOptions.sessionCookieName);
|
|
2434
2369
|
if (!cookieValue) {
|
|
2435
2370
|
return { authenticated: false, reason: "missing_cookie" };
|
|
@@ -2444,7 +2379,6 @@ class AuthRuntime2 {
|
|
|
2444
2379
|
sessionId: parts.sessionId,
|
|
2445
2380
|
tokenHash,
|
|
2446
2381
|
transport: "cookie",
|
|
2447
|
-
audience,
|
|
2448
2382
|
nowMs
|
|
2449
2383
|
});
|
|
2450
2384
|
if (cached) {
|
|
@@ -2458,7 +2392,6 @@ class AuthRuntime2 {
|
|
|
2458
2392
|
let session = await storage.sessions.findValidByTokenHash({
|
|
2459
2393
|
projectId: this.projectId,
|
|
2460
2394
|
id: parts.sessionId,
|
|
2461
|
-
audience,
|
|
2462
2395
|
tokenHash,
|
|
2463
2396
|
now
|
|
2464
2397
|
});
|
|
@@ -2470,7 +2403,6 @@ class AuthRuntime2 {
|
|
|
2470
2403
|
const renewed = await storage.sessions.renewIfValid({
|
|
2471
2404
|
projectId: this.projectId,
|
|
2472
2405
|
id: parts.sessionId,
|
|
2473
|
-
audience,
|
|
2474
2406
|
tokenHash,
|
|
2475
2407
|
now,
|
|
2476
2408
|
expiresAt: this.getRenewedSessionExpiresAt(session, nowMs)
|
|
@@ -2533,7 +2465,6 @@ class AuthRuntime2 {
|
|
|
2533
2465
|
this.sessionCache?.set({
|
|
2534
2466
|
sessionId: session.id,
|
|
2535
2467
|
tokenHash,
|
|
2536
|
-
audience: session.audience,
|
|
2537
2468
|
session: result,
|
|
2538
2469
|
nowMs: now.getTime(),
|
|
2539
2470
|
sessionExpiresAtMs: session.expiresAt.getTime(),
|
|
@@ -2551,7 +2482,6 @@ class AuthRuntime2 {
|
|
|
2551
2482
|
projectId: this.projectId,
|
|
2552
2483
|
userId: input.userId,
|
|
2553
2484
|
strategyId: "device",
|
|
2554
|
-
audience: DEFAULT_AUTH_SESSION_AUDIENCE2,
|
|
2555
2485
|
tokenHash: tokens.tokenHash,
|
|
2556
2486
|
createdAt: input.now,
|
|
2557
2487
|
...this.createSessionDeadlines(input.now),
|
|
@@ -2753,6 +2683,10 @@ class AuthRuntime2 {
|
|
|
2753
2683
|
}
|
|
2754
2684
|
async listServiceAccounts(caller) {
|
|
2755
2685
|
const storage = this.requireAuthStorage();
|
|
2686
|
+
const scope = this.resolveMembershipPolicyScopeForUser(caller.groupIds);
|
|
2687
|
+
if (scope.operations.serviceAccounts.policyIds.length === 0) {
|
|
2688
|
+
return { serviceAccounts: [] };
|
|
2689
|
+
}
|
|
2756
2690
|
const result = await storage.serviceAccounts.list({
|
|
2757
2691
|
projectId: this.projectId,
|
|
2758
2692
|
order: "desc",
|
|
@@ -2763,14 +2697,13 @@ class AuthRuntime2 {
|
|
|
2763
2697
|
groupIds: await this.listServiceAccountGroupIds(storage, serviceAccount.id)
|
|
2764
2698
|
})));
|
|
2765
2699
|
return {
|
|
2766
|
-
serviceAccounts: withGroups.filter(({ groupIds }) =>
|
|
2700
|
+
serviceAccounts: withGroups.filter(({ groupIds }) => canPerformMembershipOperation(scope, "serviceAccounts", groupIds))
|
|
2767
2701
|
};
|
|
2768
2702
|
}
|
|
2769
2703
|
async createServiceAccount(caller, input) {
|
|
2770
2704
|
const storage = this.requireAuthStorage();
|
|
2771
|
-
const groupIds =
|
|
2772
|
-
|
|
2773
|
-
}) ?? [];
|
|
2705
|
+
const groupIds = normalizeRequestedGroupIds(input.groupIds) ?? [];
|
|
2706
|
+
this.assertCanManageServiceAccountGroups(caller.groupIds, groupIds);
|
|
2774
2707
|
const now = new Date;
|
|
2775
2708
|
const serviceAccount = await storage.serviceAccounts.create({
|
|
2776
2709
|
id: input.id ?? `svc_${randomUUID3()}`,
|
|
@@ -2862,12 +2795,16 @@ class AuthRuntime2 {
|
|
|
2862
2795
|
return { serviceAccount, accessToken };
|
|
2863
2796
|
}
|
|
2864
2797
|
async requireManageableServiceAccount(storage, callerGroupIds, serviceAccountId) {
|
|
2798
|
+
const scope = this.resolveMembershipPolicyScopeForUser(callerGroupIds);
|
|
2799
|
+
if (scope.operations.serviceAccounts.policyIds.length === 0) {
|
|
2800
|
+
throw missingServiceAccountsPolicyError();
|
|
2801
|
+
}
|
|
2865
2802
|
const serviceAccount = await storage.serviceAccounts.getById({
|
|
2866
2803
|
projectId: this.projectId,
|
|
2867
2804
|
id: serviceAccountId
|
|
2868
2805
|
});
|
|
2869
2806
|
const groupIds = serviceAccount ? await this.listServiceAccountGroupIds(storage, serviceAccountId) : [];
|
|
2870
|
-
if (!serviceAccount || !
|
|
2807
|
+
if (!serviceAccount || !canPerformMembershipOperation(scope, "serviceAccounts", groupIds)) {
|
|
2871
2808
|
throw new AuthStorageError2("missing_service_account", `[Sixb] Service account '${serviceAccountId}' not found for project '${this.projectId}'.`);
|
|
2872
2809
|
}
|
|
2873
2810
|
return { serviceAccount, groupIds };
|
|
@@ -2901,6 +2838,7 @@ class AuthRuntime2 {
|
|
|
2901
2838
|
const scope = this.resolveMembershipPolicyScopeForUser(caller.groupIds);
|
|
2902
2839
|
return {
|
|
2903
2840
|
groups: this.scopedGroupOptions(scope.operations.assignGroups.groupIds),
|
|
2841
|
+
serviceAccountGroups: this.scopedGroupOptions(scope.operations.serviceAccounts.groupIds),
|
|
2904
2842
|
capabilities: membershipCapabilities(scope).holds
|
|
2905
2843
|
};
|
|
2906
2844
|
}
|
|
@@ -3073,7 +3011,6 @@ class AuthRuntime2 {
|
|
|
3073
3011
|
throw new AuthRuntimeError2("invalid_auth_config", "[Sixb] The active auth strategy does not support invitations.");
|
|
3074
3012
|
}
|
|
3075
3013
|
await this.assertCanInviteRecipient(strategy, authStorage, input.email, now);
|
|
3076
|
-
this.assertInvitationApplicationAccess(groupIds, destination.audience);
|
|
3077
3014
|
const invitation = await authStorage.invitations.createOrUpdateActive({
|
|
3078
3015
|
id: `inv_${randomUUID3()}`,
|
|
3079
3016
|
projectId: this.projectId,
|
|
@@ -3091,7 +3028,6 @@ class AuthRuntime2 {
|
|
|
3091
3028
|
projectId: this.projectId,
|
|
3092
3029
|
authStorage,
|
|
3093
3030
|
invitation,
|
|
3094
|
-
audience: destination.audience,
|
|
3095
3031
|
returnTo: destination.returnTo,
|
|
3096
3032
|
requestOrigin: destination.requestOrigin,
|
|
3097
3033
|
revealLink: input.revealLink,
|
|
@@ -3188,17 +3124,6 @@ class AuthRuntime2 {
|
|
|
3188
3124
|
}
|
|
3189
3125
|
return { state: "enabled" };
|
|
3190
3126
|
}
|
|
3191
|
-
assertInvitationApplicationAccess(groupIds, audience) {
|
|
3192
|
-
const roles = this.security.listResolvedRoles();
|
|
3193
|
-
const authorization = resolveAuthorizationContext2({
|
|
3194
|
-
principal: { type: "user", id: "invited-user" },
|
|
3195
|
-
groupIds,
|
|
3196
|
-
roles
|
|
3197
|
-
});
|
|
3198
|
-
if (canAccessApplication2(authorization, roles, audience))
|
|
3199
|
-
return;
|
|
3200
|
-
throw new AuthRuntimeError2("authorization_denied", `[Sixb] Invitation groups do not grant access to application '${audience}'.`);
|
|
3201
|
-
}
|
|
3202
3127
|
async assertCanInviteRecipient(strategy, authStorage, email, now) {
|
|
3203
3128
|
if (!strategy.validateInvitationRecipient) {
|
|
3204
3129
|
return;
|
|
@@ -3227,6 +3152,17 @@ class AuthRuntime2 {
|
|
|
3227
3152
|
}
|
|
3228
3153
|
return new AuthRuntimeError2("invalid_auth_input", "[Sixb] Invitation delivery was skipped by the active auth strategy.");
|
|
3229
3154
|
}
|
|
3155
|
+
assertCanManageServiceAccountGroups(callerGroupIds, groupIds) {
|
|
3156
|
+
const scope = this.resolveMembershipPolicyScopeForUser(callerGroupIds);
|
|
3157
|
+
if (canPerformMembershipOperation(scope, "serviceAccounts", groupIds)) {
|
|
3158
|
+
return;
|
|
3159
|
+
}
|
|
3160
|
+
if (scope.operations.serviceAccounts.policyIds.length === 0) {
|
|
3161
|
+
throw missingServiceAccountsPolicyError();
|
|
3162
|
+
}
|
|
3163
|
+
const missing = missingMembershipGroupIds(scope, "serviceAccounts", groupIds);
|
|
3164
|
+
throw new AuthRuntimeError2("authorization_denied", `[Sixb] The current user is not allowed to place service accounts in group(s): ${missing.join(", ")}.`);
|
|
3165
|
+
}
|
|
3230
3166
|
assertCanManageInvitationGroups(callerGroupIds, groupIds) {
|
|
3231
3167
|
const scope = this.resolveMembershipPolicyScopeForUser(callerGroupIds);
|
|
3232
3168
|
if (canPerformMembershipOperation(scope, "invite", groupIds)) {
|
|
@@ -3260,9 +3196,8 @@ function constrainTokenGroupIds(principalGroupIds, accessToken) {
|
|
|
3260
3196
|
const allowed = new Set(accessToken.groupIds);
|
|
3261
3197
|
return principalGroupIds.filter((groupId) => allowed.has(groupId));
|
|
3262
3198
|
}
|
|
3263
|
-
function
|
|
3264
|
-
|
|
3265
|
-
return serviceAccountGroupIds.every((groupId) => callerGroups.has(groupId));
|
|
3199
|
+
function missingServiceAccountsPolicyError() {
|
|
3200
|
+
return new AuthRuntimeError2("authorization_denied", "[Sixb] Managing service accounts needs a membership policy with the 'serviceAccounts' operation.");
|
|
3266
3201
|
}
|
|
3267
3202
|
function missingAccessTokenError(tokenId, projectId) {
|
|
3268
3203
|
return new AuthStorageError2("missing_access_token", `[Sixb] Access token '${tokenId}' not found for project '${projectId}'.`);
|
|
@@ -3313,7 +3248,8 @@ function membershipCapabilities(scope) {
|
|
|
3313
3248
|
holds: {
|
|
3314
3249
|
invite: scope.operations.invite.policyIds.length > 0,
|
|
3315
3250
|
assignGroups: scope.operations.assignGroups.policyIds.length > 0,
|
|
3316
|
-
suspend: scope.operations.suspend.policyIds.length > 0
|
|
3251
|
+
suspend: scope.operations.suspend.policyIds.length > 0,
|
|
3252
|
+
serviceAccounts: scope.operations.serviceAccounts.policyIds.length > 0
|
|
3317
3253
|
},
|
|
3318
3254
|
assignableGroupIds: [...scope.operations.assignGroups.groupIds],
|
|
3319
3255
|
covers: (operation, memberGroups) => canPerformMembershipOperation(scope, operation, groupIdsOf(memberGroups))
|
|
@@ -3327,6 +3263,6 @@ var SYSTEM_PRINCIPAL2 = { type: "system", id: "system" };
|
|
|
3327
3263
|
function principalsEqual2(left, right) {
|
|
3328
3264
|
return left.type === right.type && left.id === right.id;
|
|
3329
3265
|
}
|
|
3330
|
-
export { ActionDefinitionError2,
|
|
3266
|
+
export { ActionDefinitionError2, missingActionMutationMessage, effectsWithoutEditsMessage, assertNonEmpty2, isActionDefinition2, isGlobalActionDefinition2, isObjectActionDefinition2, normalizeActionParams, coerceActionParamsToTyped, validateActionSubject, resolveObjectActionSubject, PERSONAL_ACCESS_TOKEN_PREFIX2, SERVICE_ACCOUNT_ACCESS_TOKEN_PREFIX2, generateAccessTokenSecret2, hashAccessTokenSecret2, formatAccessTokenValue2, parseAccessTokenValue2, getBearerAccessTokenValue2, createAccessTokenCredential2, setRequestClientAddress2, getRequestClientAddress2, CSRF_HEADER_NAME2, generateCsrfToken2, isCsrfExemptMethod2, verifyDoubleSubmitCsrf2, verifyCsrfToken2, every2, ShareDefinitionError2, defineShare2, isShareDefinition, snapshotShareDefinition, can2, SecurityRegistry, AuthStorageError2, MAX_PENDING_DEVICE_AUTHORIZATIONS2, paginate, InMemoryAuthStorage2, generateSessionSecret2, hashSessionSecret2, formatSessionCookieValue2, parseSessionCookieValue2, createSessionCredential2, AuthRuntime2, SYSTEM_PRINCIPAL2, principalsEqual2 };
|
|
3331
3267
|
|
|
3332
|
-
//# debugId=
|
|
3268
|
+
//# debugId=DF55B99B002A92F564756E2164756E21
|