permdock 0.7.0 → 0.9.0
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 +1 -3
- package/dist/a2a/index.d.ts +7 -7
- package/dist/a2a/index.js +8 -8
- package/dist/action-result-BcudBQOF.d.ts +19 -0
- package/dist/{adapter-context-CRhqyzCk.js → adapter-context-CIQpQxbE.js} +8 -2
- package/dist/{adoption-scan-D-feE7BE.js → adoption-scan-Ch07MdxN.js} +5 -5
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/ai-sdk/index.d.ts +19 -13
- package/dist/ai-sdk/index.js +6 -6
- package/dist/{app-data-MuyzVqX8.js → app-data-UNNm07jV.js} +10 -7
- package/dist/{approval-header-CJACtHkv.js → approval-header-8QV6MU4H.js} +6 -3
- package/dist/{approval-prompt-K0faOLFp.d.ts → approval-prompt-3BqWczTt.d.ts} +13 -11
- package/dist/{approval-prompt-Dg5LeAcT.js → approval-prompt-B8hQY69x.js} +5 -6
- package/dist/approvals/index.d.ts +4 -4
- package/dist/approvals/index.js +6 -6
- package/dist/{approvals-CMRfsbBh.js → approvals-DnIBTuXE.js} +66 -42
- package/dist/{approvers-CqPOLD-o.js → approvers-B4r0N_Uz.js} +8 -2
- package/dist/{arazzo-ClrF3PVb.js → arazzo-BpS7LnV0.js} +2 -2
- package/dist/{arazzo-rdeJ8n1J.js → arazzo-CmQaGPkM.js} +6 -6
- package/dist/{args-CC3OwyHW.js → args-0FrVs5EH.js} +14 -7
- package/dist/astro/index.d.ts +30 -12
- package/dist/astro/index.js +2 -2
- package/dist/{audience-BrMs8c4o.js → audience-DTjR8xet.js} +8 -8
- package/dist/{auth-CscUX8Sy.js → auth--yPyZNgr.js} +19 -7
- package/dist/authzen/index.d.ts +34 -28
- package/dist/authzen/index.js +23 -20
- package/dist/{automation-DOtAFWdy.d.ts → automation-C6Jg75xq.d.ts} +42 -32
- package/dist/{automation-ySsxp_Yp.js → automation-x3KEUusw.js} +22 -21
- package/dist/better-auth/index.d.ts +2 -2
- package/dist/better-auth/index.js +13 -7
- package/dist/better-supabase/index.d.ts +357 -227
- package/dist/better-supabase/index.js +219 -140
- package/dist/{bind-D1nO6fiC.js → bind-BNQA9JK9.js} +26 -10
- package/dist/{bind-JDuvxjuW.d.ts → bind-YYjvfpB9.d.ts} +32 -12
- package/dist/{body-CH5of8Ne.js → body-CJQwYVa8.js} +3 -3
- package/dist/{body-text-QcXok_SI.js → body-text-DQhcmqdY.js} +8 -4
- package/dist/{boundary-BM8a_P6E.js → boundary-BV3O1eud.js} +8 -2
- package/dist/{boundary-BmHxVH1J.d.ts → boundary-C9ck-3uK.d.ts} +13 -4
- package/dist/{budget-NbEtbJC_.js → budget-BELja5A9.js} +6 -3
- package/dist/{budget-JqcRqyhK.d.ts → budget-hYsPz_yE.d.ts} +6 -3
- package/dist/{build-instance-DxE7czo9.js → build-instance-BWXqwQYU.js} +3 -3
- package/dist/{capability-L7NnfhiE.js → capability-BqX94r07.js} +31 -25
- package/dist/{capability-D4UC9TTW.d.ts → capability-Di9tiUvi.d.ts} +41 -29
- package/dist/{casbin-BHijLuHY.js → casbin-B7_yS-oo.js} +2 -2
- package/dist/{casbin-BW9pS47J.js → casbin-bHyIxTNQ.js} +16 -8
- package/dist/{casl-CmJlgziS.js → casl-C4OINZHI.js} +2 -2
- package/dist/{casl-UbI8v-Wq.js → casl-CHHoCldP.js} +19 -10
- package/dist/catalog/index.d.ts +51 -30
- package/dist/catalog/index.js +18 -15
- package/dist/{catalog-D69WhFii.js → catalog-CGlSwU6j.js} +20 -19
- package/dist/catalog-D3oS2GH3.js +1 -0
- package/dist/{catalog-BaMQfQ6Y.js → catalog-amPDr0JQ.js} +3 -3
- package/dist/{catalog-doc-CV9s6B1S.js → catalog-doc-DjMKzJp9.js} +28 -14
- package/dist/{catalog-fingerprint-C144oW4M.js → catalog-fingerprint-e6aCWosn.js} +18 -14
- package/dist/catalog-operations-DeHTrJSV.js +60 -0
- package/dist/{challenge-nGWma08S.js → challenge-DImNcR7B.js} +48 -27
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +13 -10
- package/dist/chat-sdk/index.d.ts +44 -26
- package/dist/chat-sdk/index.js +17 -17
- package/dist/{checks-BC_0mPIq.js → checks-CGkP3Z7A.js} +4 -1
- package/dist/{claims-map-7oQ3ue4X.js → claims-map-CKkoAAYF.js} +5 -2
- package/dist/{claims-map-Ca-QX8C6.d.ts → claims-map-D1Pb5oRq.d.ts} +8 -5
- package/dist/claude-agent/index.d.ts +6 -6
- package/dist/claude-agent/index.js +6 -3
- package/dist/clerk/index.d.ts +11 -7
- package/dist/clerk/index.js +6 -6
- package/dist/cli/bin.js +4 -4
- package/dist/cli/index.d.ts +82 -7
- package/dist/cli/index.js +6 -6
- package/dist/{clients-C7zLFuWT.d.ts → clients-C_NOET3z.d.ts} +5 -5
- package/dist/{clients-DjU5ABMy.js → clients-DYr3U86j.js} +3 -3
- package/dist/cloud/index.d.ts +84 -52
- package/dist/cloud/index.js +53 -39
- package/dist/{cloud-CO8pYtwr.js → cloud-3kWfjnYy.js} +4 -5
- package/dist/{codemod-BP6n8N9L.js → codemod-Bv5i-Mzo.js} +523 -201
- package/dist/{codemod-i4N2BhDc.js → codemod-D9Aiii1r.js} +3 -4
- package/dist/{collect-DNm3oKOk.js → collect-B80GYEot.js} +4 -5
- package/dist/collect-D-eroIfV.js +1 -0
- package/dist/{collect-BaWeMjwV.js → collect-WCl8cJQV.js} +26 -63
- package/dist/{compare-pfyVnBjE.js → compare-DTfyUunF.js} +2 -2
- package/dist/compile/index.d.ts +2 -2
- package/dist/compile/index.js +1 -1
- package/dist/{compile-COM2VKuN.d.ts → compile-BEklRUYo.d.ts} +36 -12
- package/dist/{compile-BAEO5bOk.js → compile-EzEMB-7v.js} +77 -33
- package/dist/{completion-BNdVf7X2.js → completion-_bc0OUQ-.js} +17 -8
- package/dist/config-BwPBfN0t.js +108 -0
- package/dist/{config-DGZzMV1B.js → config-D5XrLWpk.js} +2 -2
- package/dist/{config-report-Cm7UITNA.js → config-report-BmWIskD7.js} +9 -6
- package/dist/config-shape-ykV0Vm2n.js +134 -0
- package/dist/{connection-DjhIJSs2.js → connection-B72dg5Q2.js} +23 -22
- package/dist/{connector-schema-_VCSsdtD.js → connector-schema-CYLQNMYq.js} +3 -2
- package/dist/{context--uM9V3Ui.js → context-BnIzxTNE.js} +4 -3
- package/dist/convex/index.d.ts +13 -7
- package/dist/convex/index.js +9 -6
- package/dist/{core-CQkE8Esr.d.ts → core-CFepFiDP.d.ts} +49 -22
- package/dist/{core-B5-w6Kw9.js → core-DzVINFbU.js} +26 -20
- package/dist/{create-Cb86Z8Im.js → create-6EwRQlig.js} +10 -7
- package/dist/{create-DJrlhEp9.js → create-BLPKnJKa.js} +35 -25
- package/dist/{create-UTnUVETj.d.ts → create-BPUopdfL.d.ts} +70 -37
- package/dist/{create-QHuuPw3q.d.ts → create-BamXmeob.d.ts} +37 -29
- package/dist/{create-B2-CQqCI.d.ts → create-DBvUsgzK.d.ts} +49 -28
- package/dist/{credential-CIM7wHwA.js → credential-CyyyvCsL.js} +41 -38
- package/dist/{credentials-BpuTwd7a.js → credentials-CdDxp7jN.js} +6 -6
- package/dist/{deciding-columns-DRo2QM6E.js → deciding-columns-NB4wcyBf.js} +2 -2
- package/dist/{delegation-C5rOdTp5.js → delegation-CDB6_keF.js} +31 -22
- package/dist/delivery/index.d.ts +4 -4
- package/dist/delivery/index.js +5 -5
- package/dist/{delivery-rwOKLWRm.js → delivery-BupfvJIV.js} +34 -22
- package/dist/{delivery-event-xX4obB8F.js → delivery-event-JioK5YbS.js} +6 -6
- package/dist/denied-text-DHldhVUv.d.ts +22 -0
- package/dist/{describe-DZlnEtLy.js → describe-Bb4hGK5d.js} +5 -5
- package/dist/{describe-O0SwYIK8.d.ts → describe-BbFPBSms.d.ts} +5 -5
- package/dist/{device-BARQ8eYG.js → device-BwbJNmb2.js} +11 -8
- package/dist/{diff-Btr1c1Ow.js → diff-BwR1JdP2.js} +2 -2
- package/dist/{diff-DzT-xD13.js → diff-CQegtBAo.js} +22 -13
- package/dist/{digest-B3kc_PgQ.d.ts → digest-8Yx2CchM.d.ts} +3 -3
- package/dist/{doctor-BU1szn63.js → doctor-ClRVAtXQ.js} +287 -135
- package/dist/{doctor-BoK_y0KO.js → doctor-LPMYjSqO.js} +4 -4
- package/dist/drizzle/index.d.ts +33 -19
- package/dist/drizzle/index.js +17 -9
- package/dist/elysia/index.d.ts +17 -11
- package/dist/elysia/index.js +5 -5
- package/dist/{errors-BKy0EfhN.js → errors-B6R_lg2a.js} +13 -4
- package/dist/{errors-B_Qg9D3e.d.ts → errors-BIM4MFsJ.d.ts} +22 -6
- package/dist/{errors-BWXBMaKK.d.ts → errors-CHwoRRpB.d.ts} +4 -1
- package/dist/{errors-DpP_U6Bf.js → errors-Vpu6rKHl.js} +13 -10
- package/dist/{evaluate-B_oqFbWC.js → evaluate-BAmf_AQd.js} +153 -82
- package/dist/{evaluations-BCddEOfO.d.ts → evaluations-DOWuBpWv.d.ts} +11 -5
- package/dist/{evaluations-DReoiVBw.js → evaluations-IBceAeKT.js} +40 -19
- package/dist/eve/index.d.ts +9 -6
- package/dist/eve/index.js +4 -4
- package/dist/{event-time-CsegxXxB.js → event-time-BGy48400.js} +8 -4
- package/dist/{expiry-D4_YKRKD.js → expiry-6XByK0dm.js} +8 -5
- package/dist/express/index.d.ts +9 -6
- package/dist/express/index.js +9 -6
- package/dist/fastify/index.d.ts +16 -10
- package/dist/fastify/index.js +8 -5
- package/dist/{fetch-adapter-CuhyYwC1.d.ts → fetch-adapter-BIbBAtPZ.d.ts} +9 -6
- package/dist/{fetch-adapter-De-u6vhJ.js → fetch-adapter-dPTgJVHd.js} +14 -11
- package/dist/fields-D0vUI6dq.js +498 -0
- package/dist/{files-acUbNwWt.js → files-B3AA05f1.js} +8 -5
- package/dist/{files-D_JIzUrP.js → files-BSjrtIHw.js} +11 -4
- package/dist/{fixtures-BTMW6zgU.js → fixtures-A1_sp_tR.js} +15 -6
- package/dist/{flags-aaeRAdiD.js → flags-DXjoTVbS.js} +2 -2
- package/dist/{freeze-CrU8nQeX.js → freeze-jjan0lCv.js} +4 -1
- package/dist/{from-snapshot-Bz469dIh.js → from-snapshot-DCakWRsr.js} +18 -15
- package/dist/gen-BFfzZSLH.js +58 -0
- package/dist/gen-BtfFWGbz.js +827 -0
- package/dist/{generate-3FNO5P5Q.js → generate-CRVV5V7l.js} +14 -8
- package/dist/generate-CezbCaTI.js +275 -0
- package/dist/{grantee-BrRANrpT.js → grantee-Dke-9rd1.js} +4 -4
- package/dist/{grantee-conditions-C6P1Tvol.js → grantee-conditions-BrYPe-w0.js} +12 -12
- package/dist/{grantee-match-0RtHWQDx.js → grantee-match-7RZZvoT_.js} +12 -6
- package/dist/{graph-sql-B-dsAT6j.d.ts → graph-sql-BwFC4Qjs.d.ts} +3 -3
- package/dist/h3/index.d.ts +10 -7
- package/dist/h3/index.js +3 -3
- package/dist/headers-B9jQxjtW.d.ts +10 -0
- package/dist/{helpers-DY3vXuGs.js → helpers-DJicaG6f.js} +40 -28
- package/dist/hono/index.d.ts +16 -10
- package/dist/hono/index.js +5 -5
- package/dist/{hosted-XBgU6RGT.js → hosted-D0IzESu_.js} +42 -21
- package/dist/{hosted-BmjzxQhp.d.ts → hosted-DVxlLZMe.d.ts} +33 -21
- package/dist/{http-ujKm0JXE.js → http-DH94eh6f.js} +4 -4
- package/dist/{http-BBoKefeS.js → http-DKLXrFGk.js} +13 -7
- package/dist/{http-Ca3Sr5x1.js → http-DOL33cO0.js} +11 -8
- package/dist/{import-DB2EG_iy.js → import-ACkOrv6g.js} +6 -6
- package/dist/{import-Bz0GefWg.js → import-CST57XLp.js} +64 -51
- package/dist/{index-CMiPH2Tv.d.ts → index-BinlXeU-.d.ts} +64 -37
- package/dist/{index-BSfRl0hZ.d.ts → index-CV-7DWeD.d.ts} +64 -52
- package/dist/{index-BE8y3moU.d.ts → index-DJwEgYzA.d.ts} +127 -82
- package/dist/{index-DH9DUDEM.d.ts → index-Dj2qF9VC.d.ts} +54 -30
- package/dist/{index-BTkwrK7v.d.ts → index-vYjMrXyK.d.ts} +336 -173
- package/dist/{index-DLwcuCN_.d.ts → index-ymept53A.d.ts} +51 -30
- package/dist/index.d.ts +22 -22
- package/dist/index.js +34 -34
- package/dist/{init-B-4t1NzC.js → init-BjuFDYT1.js} +10 -10
- package/dist/{init-5TXNji88.js → init-txYTuW9u.js} +5 -5
- package/dist/{instance-options-CU0YQCLH.d.ts → instance-options-CoHn-0e8.d.ts} +4 -4
- package/dist/{instance-snapshot-CjcwnEiV.js → instance-snapshot-DuWf1cT3.js} +86 -61
- package/dist/{instant-BluqDvyS.js → instant-DK3Iz83e.js} +2 -2
- package/dist/{internals-Dk8A8fX3.js → internals-B3IgHrvo.js} +6 -3
- package/dist/{json-schema-B-vAwlde.js → json-schema-BPGa-RjQ.js} +9 -3
- package/dist/{json-schema-CN_iLFH2.d.ts → json-schema-BfXgnRNT.d.ts} +4 -4
- package/dist/jwt/index.d.ts +57 -27
- package/dist/jwt/index.js +24 -21
- package/dist/{kernel-DVExUwkp.js → kernel-qv4cr9w8.js} +32 -23
- package/dist/kysely/index.d.ts +49 -33
- package/dist/kysely/index.js +9 -7
- package/dist/{live-options-BaAFCIiu.js → live-options-BBIT68le.js} +2 -2
- package/dist/{load-DxroEzH1.js → load-DjSU5KXO.js} +6 -6
- package/dist/load-Dm0pSYH3.js +1 -0
- package/dist/{login-ClSJh5t5.js → login-CfImTJGb.js} +4 -4
- package/dist/{login-WC9HPJpU.js → login-CgfCTO3F.js} +16 -9
- package/dist/{manifest-Dv6q4i5s.js → manifest-B2QPh19C.js} +49 -38
- package/dist/{manifest-BVhExYhw.d.ts → manifest-CzzWtnAb.d.ts} +126 -31
- package/dist/{manifest-schema-Cv492Qev.js → manifest-schema-2r37XRhD.js} +44 -3
- package/dist/{manifest-B79YuF2T.js → manifest-wg8WkkpD.js} +6 -6
- package/dist/{map-claims-etGIS_Dv.js → map-claims-C-nv08_n.js} +16 -9
- package/dist/{map-error-BQGyDm_M.js → map-error-pasIGqMT.js} +7 -7
- package/dist/{markers-C6joDI3o.js → markers-BeHZ4x9Q.js} +20 -5
- package/dist/mcp/index.d.ts +114 -61
- package/dist/mcp/index.js +70 -40
- package/dist/{migrate-Dodel0IJ.js → migrate-B7oP_sQU.js} +35 -17
- package/dist/module-values-BJTBdo6y.js +107 -0
- package/dist/nest/index.d.ts +23 -13
- package/dist/nest/index.js +18 -11
- package/dist/next/client.d.ts +5 -2
- package/dist/next/client.js +1 -1
- package/dist/next/index.d.ts +79 -26
- package/dist/next/index.js +121 -10
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +4 -3
- package/dist/node/index.d.ts +5 -5
- package/dist/node/index.js +3 -3
- package/dist/{ocsf-BFp-PZZA.js → ocsf-TcjRBgIs.js} +15 -5
- package/dist/openai/index.d.ts +13 -7
- package/dist/openai/index.js +3 -3
- package/dist/openapi/index.d.ts +51 -30
- package/dist/openapi/index.js +2 -2
- package/dist/{openapi-ztVaux6j.js → openapi-BGeuunWC.js} +23 -14
- package/dist/{openapi-DMocl1bh.js → openapi-BIpw3Mb7.js} +4 -5
- package/dist/{openapi-Ddb4628T.js → openapi-BOsx0xn9.js} +33 -18
- package/dist/{operation-findings-kRcEp8lE.js → operation-findings-CXtFzlKJ.js} +3 -3
- package/dist/{operations-BNLes61x.d.ts → operations-Ci_rT6Uo.d.ts} +10 -7
- package/dist/orpc/index.d.ts +68 -14
- package/dist/orpc/index.js +62 -13
- package/dist/otel/index.d.ts +7 -4
- package/dist/otel/index.js +8 -5
- package/dist/{output-DgSDLrta.js → output-DV5dwOTs.js} +9 -5
- package/dist/output-files-BHOIlrfD.js +1 -0
- package/dist/{output-files-CCMdcFWb.js → output-files-BIQ_9pIs.js} +29 -17
- package/dist/ownership-DA5YdYTm.js +1059 -0
- package/dist/{parse-Ddhz2xf4.js → parse-1_ZheTW5.js} +16 -13
- package/dist/parse-local-manifest-CCmbhnxP.d.ts +10 -0
- package/dist/{parse-local-manifest-T1Q8X3A2.js → parse-local-manifest-DEiCF4ah.js} +19 -7
- package/dist/{parse-request-D_tUXG6M.js → parse-request-CwCZpyjV.js} +7 -8
- package/dist/{paths-DXSHAMIa.js → paths-CUvURzHp.js} +4 -1
- package/dist/pdp/index.d.ts +9 -6
- package/dist/pdp/index.js +20 -13
- package/dist/{peer-DOzzMfZL.js → peer-C9LvBCcb.js} +1 -1
- package/dist/{peer-12Q5I_RH.js → peer-Q0fuZ6hx.js} +9 -3
- package/dist/{permdock-BfWEeMqk.js → permdock-BvjivVb9.js} +200 -140
- package/dist/{permdock-Dco6dyCK.d.ts → permdock-CprAPN3w.d.ts} +260 -129
- package/dist/{permission-registry-DpPtSKNZ.js → permission-registry-B8tYxPIt.js} +23 -10
- package/dist/{permission-types-DhNEmoRG.d.ts → permission-types-CAY-GU7e.d.ts} +127 -41
- package/dist/{permissions-CoqCOfJ3.d.ts → permissions-Bx6UI8n1.d.ts} +6 -3
- package/dist/{permissions-CyH2MV_B.js → permissions-CVXmRILq.js} +3 -3
- package/dist/{permissions-DArULThq.js → permissions-CYcHj_w7.js} +8 -5
- package/dist/pg-DQTqRrou.js +60 -0
- package/dist/{pins-8ILTftC9.js → pins-nqarl3oE.js} +4 -1
- package/dist/{pkce-5h8NgMQJ.js → pkce-CnmmYqUZ.js} +1 -1
- package/dist/{policy-B7dg_yzu.d.ts → policy-BycVKnXv.d.ts} +5 -5
- package/dist/{policy-DaJy4nK4.js → policy-CLQ8__GF.js} +43 -23
- package/dist/{policy-from-catalog-DFWYkNdu.js → policy-from-catalog-CU3An8uP.js} +28 -25
- package/dist/{policy-module-CTlwMvLI.js → policy-module-xym9fnSq.js} +12 -6
- package/dist/{policy-types-B-F-qAZk.d.ts → policy-types-DGIO_gxq.d.ts} +782 -357
- package/dist/{postgres-store-BL9M_CA1.js → postgres-store-DcyrPS-r.js} +43 -16
- package/dist/{postgrest-r5faDIzD.js → postgrest-5Dr3W64L.js} +84 -86
- package/dist/{postgrest-CYacM_u7.d.ts → postgrest-D5nUGm-c.d.ts} +55 -35
- package/dist/powersync-B701tvhE.js +1 -0
- package/dist/{powersync-13odBwiM.js → powersync-Bg8u-JcR.js} +3 -3
- package/dist/{powersync-53ryOZip.js → powersync-CJrT1DSc.js} +127 -69
- package/dist/preset/index.d.ts +38 -28
- package/dist/preset/index.js +1 -1
- package/dist/{preset-CHTbd-DQ.js → preset-BjLzeFpp.js} +56 -32
- package/dist/{principal-source-pHneukrx.js → principal-source-C6N60GtM.js} +10 -10
- package/dist/prisma/index.d.ts +69 -41
- package/dist/prisma/index.js +21 -17
- package/dist/{problem-CTviyH5L.js → problem-BVLHFK33.js} +41 -21
- package/dist/{problem-details-cn5X30gZ.js → problem-details-CLDgX1KV.js} +13 -4
- package/dist/{problem-types-CJ2325SZ.js → problem-types-DSsRfONQ.js} +4 -1
- package/dist/{prompt-DwtVemER.js → prompt-BYc6drYW.js} +4 -1
- package/dist/protected-action-D8x73IGm.d.ts +58 -0
- package/dist/protected-action-DUYqb-Ma.js +80 -0
- package/dist/{protected-DXE3cQYg.js → protected-action-QEA8arRB.js} +48 -14
- package/dist/{provider-BQsTYYy0.js → provider-C55OGXJ7.js} +5 -4
- package/dist/{provider-Csk-THAn.d.ts → provider-DfLeek9O.d.ts} +1 -1
- package/dist/{provider-store-IgqQipCO.js → provider-store-CaTv00tr.js} +13 -9
- package/dist/{pull-CN5OLxrF.js → pull-2nJr0qg_.js} +12 -11
- package/dist/pull-C3EEGzSw.js +1 -0
- package/dist/{push-tVdG8dUL.js → push-Bn-lMEmI.js} +19 -13
- package/dist/{pushed-policy-CmYeSQqq.js → pushed-policy-CDuOL2de.js} +10 -7
- package/dist/{pushed-policy-BbcY9r_4.d.ts → pushed-policy-CryQheKq.d.ts} +12 -6
- package/dist/react/index.d.ts +9 -8
- package/dist/react/index.js +7 -6
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +94 -55
- package/dist/react-native/index.js +200 -61
- package/dist/{refs-CNJBiTFo.js → refs-C8BKxc_e.js} +2 -2
- package/dist/{relation-walk-3OyDBF0S.js → relation-walk-DK_gkgL7.js} +12 -9
- package/dist/{relations-BnCWnJGI.js → relations-BxvRvDHK.js} +3 -3
- package/dist/{replay-Du1tJjG7.js → replay-BU09ad4L.js} +1 -1
- package/dist/{replay-DCDD_ZfL.d.ts → replay-Bs9Df2fQ.d.ts} +1 -1
- package/dist/{request-context-BykKLmyE.js → request-context-Duzdf0cd.js} +8 -8
- package/dist/{request-schema-CMreVuFM.js → request-schema-DhX7UbfQ.js} +4 -1
- package/dist/resend/index.d.ts +34 -28
- package/dist/resend/index.js +29 -29
- package/dist/resolve-names-ConCSj1y.js +201 -0
- package/dist/{resource-relations-D_jw0BFx.js → resource-relations-8-pCScBO.js} +18 -9
- package/dist/{retire-Wj6dkyDE.js → retire-B2xffQgY.js} +15 -6
- package/dist/{revocations-R07lFBnX.d.ts → revocations-BaUXHM1N.d.ts} +6 -3
- package/dist/{rls-Ck_PocSp.js → rls-Ba9wN0SP.js} +13 -6
- package/dist/{rls-CxBZb4rZ.js → rls-Cx0dtsB7.js} +310 -128
- package/dist/{role-builder-C1VJzvcr.js → role-builder-BK2-T6oD.js} +41 -20
- package/dist/{row-conditions-h2HythXQ.js → row-conditions-BAGHOmVq.js} +4 -3
- package/dist/{rpc-Bk1bE-ch.js → rpc-vHIwyXCp.js} +8 -5
- package/dist/run-Ck22anC2.js +1 -0
- package/dist/{run-uLD2aWuO.js → run-PbRlXTfh.js} +26 -23
- package/dist/{run-ticket-BpNi7BCi.d.ts → run-ticket-B2o2Kxz8.d.ts} +29 -14
- package/dist/{run-ticket-B5d_63Ma.js → run-ticket-Dv7aF7Dk.js} +9 -9
- package/dist/{runtime-Vif3_-zf.js → runtime-BGnrOkVH.js} +5 -2
- package/dist/{saas-Az_Kz-4D.js → saas-DK4V-3Is.js} +42 -29
- package/dist/{scan-DSljDE1Y.js → scan-CRTj6fke.js} +1 -1
- package/dist/{schema-B4v0Qrac.js → schema-BOJjqlWL.js} +3 -2
- package/dist/{schema-gIcCx7zM.js → schema-BTsE1WRT.js} +8 -4
- package/dist/scim/index.d.ts +2 -2
- package/dist/scim/index.js +2 -2
- package/dist/{scim-C7JYhySg.js → scim-D8YupzX1.js} +2 -2
- package/dist/{scim-YNieBO1U.js → scim-jJBJ7g1Z.js} +33 -15
- package/dist/{scopes-BHsc-wp-.js → scopes-0Up_UA2t.js} +41 -23
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.js +12 -12
- package/dist/{server-Bnga6I50.js → server-3cVlTLde.js} +31 -31
- package/dist/{server-types-C4gZUEZy.d.ts → server-types-CyRN0-Cd.d.ts} +88 -46
- package/dist/{sha256-D9ihqmvd.js → sha256-C-4WXKIu.js} +4 -3
- package/dist/{shared-fMKOv8hP.js → shared-Afctg7B0.js} +65 -32
- package/dist/{shared-C8LjUdVU.js → shared-l0oGGetg.js} +9 -6
- package/dist/{signals-D3NcTKUS.js → signals-B1vHR3fN.js} +2 -2
- package/dist/{sink-Cp_Eot9W.d.ts → sink-B5zoUW_O.d.ts} +44 -20
- package/dist/{sink-BEZSlMS_.js → sink-D9_vh372.js} +32 -21
- package/dist/{skills-g_3BS9NC.js → skills-C9uKfSF5.js} +3 -3
- package/dist/{skills-Dcjw9_1C.js → skills-CQQcuGBi.js} +12 -8
- package/dist/{snapshot-CbGmYiJx.js → snapshot-CXlzi69u.js} +21 -18
- package/dist/{snapshot-cache-Pahd3IYJ.d.ts → snapshot-cache-BjAWkchD.d.ts} +21 -12
- package/dist/{snapshot-cache-DT2Kx1F8.js → snapshot-cache-Bx_4xC_6.js} +14 -11
- package/dist/solid/index.d.ts +55 -16
- package/dist/solid/index.js +46 -12
- package/dist/solid-start/index.d.ts +30 -12
- package/dist/solid-start/index.js +3 -3
- package/dist/{sources-B-zYB4GS.js → sources-CMAM-2A3.js} +46 -27
- package/dist/{sources-DEEuGb8S.d.ts → sources-CWG32C0G.d.ts} +126 -53
- package/dist/{sql-B96movIM.js → sql-0WjxIp9g.js} +28 -7
- package/dist/{sql-CDEPCA0g.d.ts → sql-B80DFdpG.d.ts} +2 -2
- package/dist/{src-DLFrtrrC.js → src-C_pi2Rnh.js} +292 -101
- package/dist/ssf/index.d.ts +3 -3
- package/dist/ssf/index.js +47 -35
- package/dist/{standard-webhooks-DgFFD-Ga.js → standard-webhooks-D67a3nzk.js} +5 -5
- package/dist/{standard-webhooks-B_qRg0ws.d.ts → standard-webhooks-DOYEuOLx.d.ts} +7 -7
- package/dist/{store-DSP9oGvh.js → store-RNFvaJJv.js} +32 -26
- package/dist/{store-options-B_poyYvg.js → store-options-Dil3lraY.js} +105 -15
- package/dist/stores-DZJvxFIZ.d.ts +59 -0
- package/dist/{stores-BqEuHC05.js → stores-DxZWDXCs.js} +42 -5
- package/dist/{stream-2Vwhl7Er.d.ts → stream-9y9qw51m.d.ts} +4 -3
- package/dist/{stream-CvdUS9V1.js → stream-CDvF0sJm.js} +5 -5
- package/dist/{style-Ds1gNm77.js → style-DblOtSga.js} +1 -1
- package/dist/{style-Cqo7-73x.js → style-Ds11Hmk4.js} +2 -1
- package/dist/{subject-settings-CkEwrw3W.js → subject-settings-8sH5HlII.js} +8 -4
- package/dist/{row-check-Dt35czLy.d.ts → subject-settings-vNW8qmUH.d.ts} +30 -18
- package/dist/supabase/index.d.ts +48 -38
- package/dist/supabase/index.js +5 -5
- package/dist/supabase/middleware.d.ts +19 -13
- package/dist/supabase/middleware.js +7 -7
- package/dist/{supabase--0aJdLEd.js → supabase-DnMMg5Fn.js} +79 -35
- package/dist/{supabase-Bqp7iIY2.js → supabase-SBs3MYUE.js} +3 -3
- package/dist/supabase-hook-C0FyEACZ.js +1 -0
- package/dist/{supabase-hook-Dg0SrQWR.js → supabase-hook-CrgU06WH.js} +175 -196
- package/dist/{supautils-MESd81bF.js → supautils-ByezN3b8.js} +385 -219
- package/dist/{support-session-Cna49-3f.js → support-session-BsmPCbz8.js} +21 -21
- package/dist/svelte/PermissionBoundary.svelte +2 -6
- package/dist/svelte/Protected.svelte +2 -8
- package/dist/svelte/index.d.ts +9 -8
- package/dist/svelte/index.js +10 -9
- package/dist/svelte/runtime.d.ts +4 -4
- package/dist/svelte/runtime.js +4 -4
- package/dist/svelte/source.d.ts +9 -8
- package/dist/svelte/source.js +6 -5
- package/dist/sveltekit/index.d.ts +30 -12
- package/dist/sveltekit/index.js +2 -2
- package/dist/{ownership-Z2LpxsGa.js → tables-BqrxBCir.js} +641 -1104
- package/dist/tanstack-start/index.d.ts +22 -10
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{target-Bw37TFNA.js → target-qdEAnnhU.js} +6 -6
- package/dist/{tenancy-CmeBQ6Nv.js → tenancy-5d1zVBvK.js} +25 -19
- package/dist/terminal/index.d.ts +23 -14
- package/dist/terminal/index.js +17 -20
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.d.ts +8 -5
- package/dist/testing/fixtures/index.js +78 -17
- package/dist/testing/index.d.ts +225 -141
- package/dist/testing/index.js +352 -234
- package/dist/testing/saas/index.d.ts +43 -27
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.d.ts +1 -1
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/{text-diff-DhITNCnD.js → text-diff-BtfSmdUo.js} +2 -2
- package/dist/{thenable-yD7SabqG.js → thenable-BNSM1U2R.js} +12 -3
- package/dist/{time-DkWjdL98.js → time-nR1JesoH.js} +32 -8
- package/dist/{token-2qYDvXz2.js → token-DC9EQiet.js} +14 -12
- package/dist/{tool-refusal-reAhIzdl.js → tool-refusal-Qpjs_W6M.js} +5 -2
- package/dist/trpc/index.d.ts +11 -8
- package/dist/trpc/index.js +15 -9
- package/dist/type-helpers-c7Xo_2Cu.d.ts +50 -0
- package/dist/{types-CfiKC5aN.d.ts → types-B2efzoSX.d.ts} +14 -11
- package/dist/{types-CIeZcG8v.d.ts → types-B6ExllNo.d.ts} +2 -2
- package/dist/{types-DBHftjgS.d.ts → types-BB-zWDcR.d.ts} +45 -33
- package/dist/{types-BfVmNJO5.d.ts → types-BMVDHvI0.d.ts} +128 -50
- package/dist/{types-DXmwu78Z.d.ts → types-CEinc15V.d.ts} +31 -14
- package/dist/{types-g7Oy6Zg4.d.ts → types-CN0LsqbK.d.ts} +47 -24
- package/dist/{types-CeIscIKp.d.ts → types-CWBsAwqn.d.ts} +23 -12
- package/dist/{types-DqzsnlSA.js → types-CcUXciSj.js} +17 -5
- package/dist/{types-BWZybqs9.d.ts → types-CzOeVvcC.d.ts} +384 -203
- package/dist/{types-DC44-hqb.d.ts → types-DLvhVm1r.d.ts} +59 -32
- package/dist/{types-D3A19w4A.d.ts → types-DlelvQk4.d.ts} +22 -13
- package/dist/{types-cTos-H7p.d.ts → types-DsHGPtkR.d.ts} +68 -32
- package/dist/{types-BXMYB7BY.d.ts → types-ZzRGoViD.d.ts} +77 -24
- package/dist/{types-CQVEQawv.d.ts → types-rCRV4Ge-.d.ts} +24 -14
- package/dist/types-tQB2CEnY.d.ts +262 -0
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +2 -2
- package/dist/usage-0hjZPIRX.js +1 -0
- package/dist/{usage-Bybmck7f.js → usage-B9EtHWLa.js} +50 -26
- package/dist/{usage-CDaLXCfL.js → usage-CBzgwfIs.js} +2 -2
- package/dist/{validation-error-ZfUHbKvf.js → validation-error-CYg2kJEw.js} +4 -1
- package/dist/{validation-error-CQpoquwj.d.ts → validation-error-uvp-kyfO.d.ts} +5 -2
- package/dist/{validity-CZ7-y0Cj.js → validity-Buc7w8E9.js} +13 -10
- package/dist/{verifier-DHuh-okk.js → verifier-DUV6pLqZ.js} +10 -4
- package/dist/{verify-pe8rL_Qw.js → verify-DlUcTDBz.js} +148 -487
- package/dist/version-DMQ0dnN5.js +48 -0
- package/dist/version-DizhmD72.js +1 -0
- package/dist/{views-BB8E9dTP.js → views-CD8wuL4Z.js} +19 -6
- package/dist/{vocabulary-Bg3eeT2H.d.ts → vocabulary-DEJ5j4mR.d.ts} +7 -4
- package/dist/vue/index.d.ts +71 -22
- package/dist/vue/index.js +50 -13
- package/dist/{waiter-DwEyouan.d.ts → waiter-CqUKX6CY.d.ts} +13 -10
- package/dist/{waiter-BGUtGYoU.js → waiter-aBLM63_f.js} +1 -1
- package/dist/{watch-C-4VmFlL.js → watch-BFDKqmUa.js} +8 -8
- package/dist/watch-ClLuO2TL.js +1 -0
- package/dist/webmcp/index.d.ts +11 -11
- package/dist/webmcp/index.js +8 -5
- package/dist/{where-scope-wq2coopv.js → where-scope-DlCdCM_8.js} +24 -18
- package/dist/{who-can-BwNsI_Js.js → who-can-BoDJm0Nc.js} +23 -20
- package/dist/workflow/index.d.ts +3 -3
- package/dist/workflow/index.js +13 -13
- package/dist/workflow-sdk/index.d.ts +19 -13
- package/dist/workflow-sdk/index.js +6 -6
- package/dist/{wrap-CiSc_KCq.js → wrap-B2wziJI_.js} +4 -4
- package/dist/{wrap-B6R0cMRL.d.ts → wrap-DxXB54Wu.d.ts} +8 -5
- package/package.json +8 -8
- package/schemas/catalog-v1.json +3 -0
- package/schemas/supabase-manifest-v1.json +33 -1
- package/skills/permdock-credentials/references/tokens-keys-links.md +8 -6
- package/skills/permdock-data/references/queries-and-rls.md +2 -1
- package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +2 -2
- package/skills/permdock-wire/references/adapters.md +16 -23
- package/dist/catalog-BCCjSAdH.js +0 -1
- package/dist/collect-k_Dulxr5.js +0 -1
- package/dist/config-CoQHDrDi.js +0 -166
- package/dist/denied-text-D4qkEtFz.d.ts +0 -19
- package/dist/fields-ClcQLrVc.js +0 -238
- package/dist/generate-CNU1pIOo.js +0 -171
- package/dist/headers-BIjfMaoC.js +0 -8
- package/dist/headers-CIbDTUTK.d.ts +0 -7
- package/dist/load-DrMHXzgN.js +0 -1
- package/dist/output-files-DPAY7-GX.js +0 -1
- package/dist/package-root-Dk_ETdkp.js +0 -31
- package/dist/parse-local-manifest-e4mdwAKd.d.ts +0 -10
- package/dist/policies-B2lZIurj.js +0 -295
- package/dist/powersync-CExtTLyA.js +0 -1
- package/dist/problem-details-Tcfmj3bV.d.ts +0 -7
- package/dist/protected-BwZYL1X_.d.ts +0 -39
- package/dist/pull-Cty6Ovyu.js +0 -1
- package/dist/run-Bz7DXGEv.js +0 -1
- package/dist/stores-BAZwSYZA.d.ts +0 -31
- package/dist/supabase-hook-DJxC4PoP.js +0 -1
- package/dist/types-CKV71kKh.d.ts +0 -172
- package/dist/usage-y-kBNdqs.js +0 -1
- package/dist/version-CEbQ5UeM.js +0 -18
- package/dist/version-DXkYUISx.js +0 -1
- package/dist/watch-Bd9mx3rd.js +0 -1
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
import { a as sole, n as isReadonlyArray, t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
-
import { n as freezeDeep } from "./freeze-
|
|
3
|
-
import { n as isForbiddenKey } from "./paths-
|
|
4
|
-
import { n as role, t as normalizeAssurance } from "./role-builder-
|
|
5
|
-
import { n as PermDockValidationError } from "./validation-error-
|
|
2
|
+
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
3
|
+
import { n as isForbiddenKey } from "./paths-CUvURzHp.js";
|
|
4
|
+
import { n as role, t as normalizeAssurance } from "./role-builder-BK2-T6oD.js";
|
|
5
|
+
import { n as PermDockValidationError } from "./validation-error-CYg2kJEw.js";
|
|
6
6
|
import { t as wireDenials } from "./wire-denial-C7PaVYEM.js";
|
|
7
|
-
import { o as sameId } from "./expiry-
|
|
8
|
-
import { n as internalsOf } from "./internals-
|
|
9
|
-
import { a as getResource, c as listPermissions, h as formerKeys, m as annotationsFor, n as findPermission } from "./permission-registry-
|
|
10
|
-
import { n as isThenable, t as ignoreRejection } from "./thenable-
|
|
11
|
-
import { i as readAppData } from "./app-data-
|
|
12
|
-
import { a as durationOf, d as isoNow, o as epochSeconds, r as assertDuration, s as instantAt, t as INVALID_NOW } from "./time-
|
|
7
|
+
import { o as sameId } from "./expiry-6XByK0dm.js";
|
|
8
|
+
import { n as internalsOf } from "./internals-B3IgHrvo.js";
|
|
9
|
+
import { a as getResource, c as listPermissions, h as formerKeys, m as annotationsFor, n as findPermission } from "./permission-registry-B8tYxPIt.js";
|
|
10
|
+
import { n as isThenable, t as ignoreRejection } from "./thenable-BNSM1U2R.js";
|
|
11
|
+
import { i as readAppData } from "./app-data-UNNm07jV.js";
|
|
12
|
+
import { a as durationOf, d as isoNow, o as epochSeconds, r as assertDuration, s as instantAt, t as INVALID_NOW } from "./time-nR1JesoH.js";
|
|
13
13
|
import { t as canonicalJson } from "./canonical-json-DwilZ1iB.js";
|
|
14
|
-
import { c as rootMembershipId, f as scopeList, h as tenantOf, i as keepsPermission, o as normalizeMemberships, p as subjectForPermission, s as resolveScope } from "./scopes-
|
|
15
|
-
import { a as readOnlyActorRefuses, c as rowIdOf, i as delegatedPermissions, l as rowValues, n as coveredByDelegation, o as requiresStandIn, r as coversRequirements, s as isRowPair, u as evaluateCondition } from "./delegation-
|
|
16
|
-
import { a as authenticated, g as isRole, i as assurance, m as findRole, o as flattenGrantee, r as asGrantee } from "./grantee-
|
|
17
|
-
import { a as grantCoversField, i as wireValidity, t as isActive } from "./validity-
|
|
18
|
-
import { o as resourceRoleCondition } from "./grantee-conditions-
|
|
19
|
-
import { c as nowSeconds, i as matchScopedMembership, l as partitionsOf, n as inTeam, p as scopeField, r as isMembershipExpired } from "./tenancy-
|
|
20
|
-
import {
|
|
14
|
+
import { c as rootMembershipId, f as scopeList, h as tenantOf, i as keepsPermission, o as normalizeMemberships, p as subjectForPermission, s as resolveScope } from "./scopes-0Up_UA2t.js";
|
|
15
|
+
import { a as readOnlyActorRefuses, c as rowIdOf, i as delegatedPermissions, l as rowValues, n as coveredByDelegation, o as requiresStandIn, r as coversRequirements, s as isRowPair, u as evaluateCondition } from "./delegation-CDB6_keF.js";
|
|
16
|
+
import { a as authenticated, g as isRole, i as assurance, m as findRole, o as flattenGrantee, r as asGrantee } from "./grantee-Dke-9rd1.js";
|
|
17
|
+
import { a as grantCoversField, i as wireValidity, t as isActive } from "./validity-Buc7w8E9.js";
|
|
18
|
+
import { o as resourceRoleCondition } from "./grantee-conditions-BrYPe-w0.js";
|
|
19
|
+
import { c as nowSeconds, i as matchScopedMembership, l as partitionsOf, n as inTeam, p as scopeField, r as isMembershipExpired } from "./tenancy-5d1zVBvK.js";
|
|
20
|
+
import { i as grantList, n as declaredRoleNames, s as levelCondition } from "./policy-CLQ8__GF.js";
|
|
21
21
|
import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
|
|
22
|
-
import { i as versionOf, r as tokenPayload, t as decisionToken } from "./token-
|
|
23
|
-
import { n as resolveRelated } from "./relation-walk-
|
|
24
|
-
import { t as eventInstant } from "./event-time-
|
|
22
|
+
import { i as versionOf, r as tokenPayload, t as decisionToken } from "./token-DC9EQiet.js";
|
|
23
|
+
import { n as resolveRelated } from "./relation-walk-DK_gkgL7.js";
|
|
24
|
+
import { t as eventInstant } from "./event-time-BGy48400.js";
|
|
25
25
|
import { n as toWireDelegation } from "./wire-delegation-Cv3W2eaM.js";
|
|
26
|
-
import { n as matchGrantee, t as combineWhere } from "./grantee-match-
|
|
26
|
+
import { n as matchGrantee, t as combineWhere } from "./grantee-match-7RZZvoT_.js";
|
|
27
27
|
import { t as resourceIdOf } from "./resource-ref-CaS9yVPi.js";
|
|
28
28
|
//#region src/core/approval-state.ts
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* The denial detail when an `ApprovalPolicySource` threw or returned an invalid
|
|
31
|
+
* entry.
|
|
32
|
+
*/
|
|
30
33
|
const APPROVAL_POLICY_UNAVAILABLE = "approval-policy-unavailable";
|
|
31
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The tenant a matched allow applies in: its membership's root scope, else the
|
|
36
|
+
* active tenant.
|
|
37
|
+
*/
|
|
32
38
|
function decisionTenant(subject, membership) {
|
|
33
39
|
return (membership === void 0 ? void 0 : rootMembershipId(membership)) ?? subject.principal?.tenant;
|
|
34
40
|
}
|
|
@@ -38,9 +44,9 @@ function isContact(principal) {
|
|
|
38
44
|
return principal?.kind === "contact";
|
|
39
45
|
}
|
|
40
46
|
/**
|
|
41
|
-
* A contact's memberships: only the `{ on }` ones count, each as
|
|
42
|
-
*
|
|
43
|
-
*
|
|
47
|
+
* A contact's memberships: only the `{ on }` ones count, each as `via:
|
|
48
|
+
* 'contact'` and without seats, so a role whose `for` excludes `contact` never
|
|
49
|
+
* applies and no `plan()` grantee matches.
|
|
44
50
|
*/
|
|
45
51
|
function contactMemberships(memberships) {
|
|
46
52
|
const kept = [];
|
|
@@ -58,14 +64,17 @@ function optsIn(policy, grant) {
|
|
|
58
64
|
if (grant.role === null) return false;
|
|
59
65
|
return policy.roles.find(({ name }) => name === grant.role)?.for?.includes("contact") === true;
|
|
60
66
|
}
|
|
61
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Whether `subject` may use the allow `grant`: false only for a contact and a
|
|
69
|
+
* write its role does not open to contacts.
|
|
70
|
+
*/
|
|
62
71
|
function contactMayUse(policy, subject, grant) {
|
|
63
72
|
return grant.effect !== "allow" || !isContact(subject.principal) || annotationsFor(grant.permission).readOnlyHint || optsIn(policy, grant);
|
|
64
73
|
}
|
|
65
74
|
/**
|
|
66
|
-
* The allows a contact may use for `permission`: all of them for a
|
|
67
|
-
*
|
|
68
|
-
*
|
|
75
|
+
* The allows a contact may use for `permission`: all of them for a read-only
|
|
76
|
+
* permission, otherwise only those from a role whose `for` lists `contact`.
|
|
77
|
+
* Every other subject keeps every allow.
|
|
69
78
|
*/
|
|
70
79
|
function contactAllows(policy, subject, permission, allows) {
|
|
71
80
|
if (!isContact(subject.principal) || annotationsFor(permission).readOnlyHint) return allows;
|
|
@@ -190,7 +199,10 @@ function evaluateBreakGlass(spec, subject, now) {
|
|
|
190
199
|
}] : []]
|
|
191
200
|
};
|
|
192
201
|
}
|
|
193
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* Support memberships (`via: 'support'`) the subject holds that demand an
|
|
204
|
+
* actor.
|
|
205
|
+
*/
|
|
194
206
|
function actorRequiredVias(supports) {
|
|
195
207
|
return new Set(supports.filter((spec) => spec.actorRequired).map((spec) => spec.role));
|
|
196
208
|
}
|
|
@@ -225,18 +237,18 @@ function activationDenied(reason, to) {
|
|
|
225
237
|
});
|
|
226
238
|
}
|
|
227
239
|
/**
|
|
228
|
-
* Requests a just-in-time role activation. It never writes: a granted
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
240
|
+
* Requests a just-in-time role activation. It never writes: a granted decision
|
|
241
|
+
* carries the elevated membership under `elevation` for the app to write.
|
|
242
|
+
* `approval-required` comes back first when the role's `activation` sets
|
|
243
|
+
* `approval`. Fail-closed: an unknown role, an ineligible subject, a missing
|
|
244
|
+
* justification or stale authentication all deny.
|
|
233
245
|
*/
|
|
234
246
|
/**
|
|
235
247
|
* Requests a just-in-time activation of an eligible role for the subject of
|
|
236
248
|
* `permdock`. It never writes: a granted decision carries the elevated
|
|
237
|
-
* membership under `elevation` for the app to write, and
|
|
238
|
-
*
|
|
239
|
-
*
|
|
249
|
+
* membership under `elevation` for the app to write, and `approval-required`
|
|
250
|
+
* comes back first when the role's `activation` sets `approval`. An instance
|
|
251
|
+
* built from a snapshot denies with `unsupported`.
|
|
240
252
|
*/
|
|
241
253
|
function activate(permdock, input) {
|
|
242
254
|
const internals = internalsOf(permdock);
|
|
@@ -526,7 +538,10 @@ function credentialRef(subject) {
|
|
|
526
538
|
kind
|
|
527
539
|
} : void 0;
|
|
528
540
|
}
|
|
529
|
-
/**
|
|
541
|
+
/**
|
|
542
|
+
* `context.supportSession` counts only next to the `support` actor
|
|
543
|
+
* `subjectFromSupportSession` sets.
|
|
544
|
+
*/
|
|
530
545
|
function supportSessionRef(subject) {
|
|
531
546
|
const value = subject.context["supportSession"];
|
|
532
547
|
if (subject.actor?.kind !== "support" || value === null || typeof value !== "object" || !("id" in value) || typeof value.id !== "string" || value.id === "") return;
|
|
@@ -610,7 +625,10 @@ function finish(policy, subject, permission, data, decision, options, env, trust
|
|
|
610
625
|
}
|
|
611
626
|
//#endregion
|
|
612
627
|
//#region src/core/evaluate/complete.ts
|
|
613
|
-
/**
|
|
628
|
+
/**
|
|
629
|
+
* Every exit of `evaluate`: names the permission, freezes, attaches the trace
|
|
630
|
+
* and emits.
|
|
631
|
+
*/
|
|
614
632
|
function complete(call, raw, membership) {
|
|
615
633
|
const { env, permission, tracer } = call;
|
|
616
634
|
const decision = env.outcomeOnly !== true && raw.outcome === "denied" && raw.permission === void 0 ? {
|
|
@@ -640,7 +658,10 @@ function deniedWithAlternatives(state, denials) {
|
|
|
640
658
|
}
|
|
641
659
|
//#endregion
|
|
642
660
|
//#region src/core/evaluate/allowed.ts
|
|
643
|
-
/**
|
|
661
|
+
/**
|
|
662
|
+
* The `granted` or `approval-required` decision for the chosen allow, with its
|
|
663
|
+
* token.
|
|
664
|
+
*/
|
|
644
665
|
function allowedDecision(state, allow, approval, quotaState) {
|
|
645
666
|
const { policy, subject, permission, resource, env, current, next } = state;
|
|
646
667
|
const resourceId = permission.kind === "collection" ? "*" : rowIdOf(current, resource?.id);
|
|
@@ -679,7 +700,10 @@ function allowedDecision(state, allow, approval, quotaState) {
|
|
|
679
700
|
}
|
|
680
701
|
//#endregion
|
|
681
702
|
//#region src/core/custom-roles.ts
|
|
682
|
-
/**
|
|
703
|
+
/**
|
|
704
|
+
* The current key for a stored key, current or former; `undefined` when
|
|
705
|
+
* neither.
|
|
706
|
+
*/
|
|
683
707
|
function currentKey(policy, raw) {
|
|
684
708
|
const leaf = findPermission(policy.permissions, raw);
|
|
685
709
|
if (leaf === void 0) return;
|
|
@@ -711,8 +735,8 @@ function leveled(grant, level, condition) {
|
|
|
711
735
|
}
|
|
712
736
|
/**
|
|
713
737
|
* The scope a custom role is held at: `scope` (a name or alias), the second
|
|
714
|
-
* scope for the `team` input shape, else the first scope. `undefined` when
|
|
715
|
-
*
|
|
738
|
+
* scope for the `team` input shape, else the first scope. `undefined` when the
|
|
739
|
+
* policy does not declare it; such a role resolves to nothing.
|
|
716
740
|
*/
|
|
717
741
|
function customRoleScope(role, scopes) {
|
|
718
742
|
if (role.scope === "global") return role.shared === true ? void 0 : "global";
|
|
@@ -723,11 +747,17 @@ function customRoleScope(role, scopes) {
|
|
|
723
747
|
function customRoleId(role) {
|
|
724
748
|
return role.scope === void 0 ? role.team : role.id;
|
|
725
749
|
}
|
|
726
|
-
/**
|
|
750
|
+
/**
|
|
751
|
+
* A platform custom role: held through `principal.roles`, capped by the
|
|
752
|
+
* assignable global roles.
|
|
753
|
+
*/
|
|
727
754
|
function isGlobalCustomRole(role) {
|
|
728
755
|
return role.scope === "global";
|
|
729
756
|
}
|
|
730
|
-
/**
|
|
757
|
+
/**
|
|
758
|
+
* A shared custom role: defined once for every tenant, held on memberships of
|
|
759
|
+
* its scope in any tenant.
|
|
760
|
+
*/
|
|
731
761
|
function isSharedCustomRole(role) {
|
|
732
762
|
return role.shared === true;
|
|
733
763
|
}
|
|
@@ -752,7 +782,8 @@ function isAssignableRole(policy, name) {
|
|
|
752
782
|
* Every scope's ceiling, keyed by scope name (`global` for platform custom
|
|
753
783
|
* roles): the code allows of declared `assignable` roles in that scope,
|
|
754
784
|
* everything a custom role of the scope may ever reach. Hosted grants never
|
|
755
|
-
* widen it. `assignable` narrows it to those role names
|
|
785
|
+
* widen it. `assignable` narrows it to those role names
|
|
786
|
+
* (`CustomRoleSource.assignable`).
|
|
756
787
|
*/
|
|
757
788
|
function ceilings(policy, assignable) {
|
|
758
789
|
const allowed = assignable === void 0 ? void 0 : new Set(assignable);
|
|
@@ -885,7 +916,7 @@ function resolveCustomRole(policy, role) {
|
|
|
885
916
|
if (level !== void 0) {
|
|
886
917
|
const leaf = findPermission(policy.permissions, key);
|
|
887
918
|
const condition = typeof level === "string" && leaf?.kind === "instance" ? levelCondition(policy, leaf.resource, level) : void 0;
|
|
888
|
-
if (condition === void 0) {
|
|
919
|
+
if (condition === void 0 || typeof level !== "string") {
|
|
889
920
|
drop({
|
|
890
921
|
permission: key,
|
|
891
922
|
reason: "unknown-level",
|
|
@@ -894,7 +925,7 @@ function resolveCustomRole(policy, role) {
|
|
|
894
925
|
denyKeys.add(key);
|
|
895
926
|
continue;
|
|
896
927
|
}
|
|
897
|
-
narrowing = [
|
|
928
|
+
narrowing = [level, condition];
|
|
898
929
|
}
|
|
899
930
|
if (!ceilingKeys.has(key)) {
|
|
900
931
|
drop({
|
|
@@ -1010,7 +1041,10 @@ function unknownLevelsFor(policy, roles) {
|
|
|
1010
1041
|
}
|
|
1011
1042
|
return out;
|
|
1012
1043
|
}
|
|
1013
|
-
/**
|
|
1044
|
+
/**
|
|
1045
|
+
* Every custom role's resolved grants, once per instance. Malformed roles
|
|
1046
|
+
* resolve to nothing.
|
|
1047
|
+
*/
|
|
1014
1048
|
function customGrantsFor(policy, roles) {
|
|
1015
1049
|
const declared = declaredRoleNames(policy);
|
|
1016
1050
|
const out = [];
|
|
@@ -1032,7 +1066,10 @@ function tenantCustomRoles(policy, roles) {
|
|
|
1032
1066
|
const declared = declaredRoleNames(policy);
|
|
1033
1067
|
return effectiveCustomRoles(roles).filter((role) => !isGlobalCustomRole(role) && !declared.has(role.name));
|
|
1034
1068
|
}
|
|
1035
|
-
/**
|
|
1069
|
+
/**
|
|
1070
|
+
* Whether a custom role held on memberships belongs to `tenant`: its own, or
|
|
1071
|
+
* shared by every tenant.
|
|
1072
|
+
*/
|
|
1036
1073
|
function customRoleOf(role, tenant) {
|
|
1037
1074
|
return isSharedCustomRole(role) || sameId(role.tenant, tenant);
|
|
1038
1075
|
}
|
|
@@ -1051,15 +1088,18 @@ function holdsCustomRole(membership, role, scopes) {
|
|
|
1051
1088
|
function holdsGlobalCustomRole(roles, role) {
|
|
1052
1089
|
return isGlobalCustomRole(role) && (roles ?? []).includes(role.name);
|
|
1053
1090
|
}
|
|
1054
|
-
/**
|
|
1091
|
+
/**
|
|
1092
|
+
* A tenant's custom role inside that tenant, a shared role in any tenant, or a
|
|
1093
|
+
* platform custom role anywhere.
|
|
1094
|
+
*/
|
|
1055
1095
|
function isCustomRoleName(name, roles, tenant) {
|
|
1056
1096
|
return effectiveCustomRoles(roles).some((item) => item.name === name && (isGlobalCustomRole(item) || tenant !== void 0 && customRoleOf(item, tenant)));
|
|
1057
1097
|
}
|
|
1058
1098
|
/**
|
|
1059
|
-
* The compact JWT form of custom roles for the `memberships[].grants` claim
|
|
1060
|
-
*
|
|
1061
|
-
*
|
|
1062
|
-
*
|
|
1099
|
+
* The compact JWT form of custom roles for the `memberships[].grants` claim RLS
|
|
1100
|
+
* reads in `jwt` mode: role name to entries, where `key` allows, `-key` denies
|
|
1101
|
+
* and `@role` includes. Put a team custom role on its team membership. Pass
|
|
1102
|
+
* `policy` to write keys stored under a former name as the current key.
|
|
1063
1103
|
*/
|
|
1064
1104
|
function customRoleClaim(roles, policy) {
|
|
1065
1105
|
const keyOf = (raw) => policy === void 0 ? raw : currentKey(policy, raw) ?? raw;
|
|
@@ -1097,7 +1137,10 @@ function membershipsClaim(memberships, customRoles, scopes) {
|
|
|
1097
1137
|
}
|
|
1098
1138
|
//#endregion
|
|
1099
1139
|
//#region src/core/source-name.ts
|
|
1100
|
-
/**
|
|
1140
|
+
/**
|
|
1141
|
+
* `{ name }` for a source that names itself, `{}` otherwise: what an auth event
|
|
1142
|
+
* reports about it.
|
|
1143
|
+
*/
|
|
1101
1144
|
function sourceName(source) {
|
|
1102
1145
|
return source?.name === void 0 ? {} : { name: source.name };
|
|
1103
1146
|
}
|
|
@@ -1115,7 +1158,10 @@ function isSharedRole(value) {
|
|
|
1115
1158
|
function onlyShared(roles) {
|
|
1116
1159
|
return Array.isArray(roles) ? roles.filter(isSharedRole) : [];
|
|
1117
1160
|
}
|
|
1118
|
-
/**
|
|
1161
|
+
/**
|
|
1162
|
+
* The `customRoles` option as a source: a factory is called with the resolved
|
|
1163
|
+
* subject, and a throw reads none.
|
|
1164
|
+
*/
|
|
1119
1165
|
function roleSourceFor(option, subject, auth) {
|
|
1120
1166
|
if (typeof option !== "function") return option;
|
|
1121
1167
|
try {
|
|
@@ -1128,11 +1174,14 @@ function roleSourceFor(option, subject, auth) {
|
|
|
1128
1174
|
return;
|
|
1129
1175
|
}
|
|
1130
1176
|
}
|
|
1131
|
-
function customRolesFor(source, tenants, auth, globalHeld, heldIn) {
|
|
1177
|
+
function customRolesFor(source, tenants, auth, globalHeld, heldIn, memo) {
|
|
1132
1178
|
if (source === void 0) return [];
|
|
1133
1179
|
const loaded = [];
|
|
1134
1180
|
for (const tenant of tenants) try {
|
|
1135
|
-
loaded.push(source.rolesFor(tenant, {
|
|
1181
|
+
loaded.push(source.rolesFor(tenant, compact({
|
|
1182
|
+
held: heldIn(tenant),
|
|
1183
|
+
memo
|
|
1184
|
+
})));
|
|
1136
1185
|
} catch {
|
|
1137
1186
|
auth.push({
|
|
1138
1187
|
reason: "source-threw",
|
|
@@ -1156,12 +1205,18 @@ function customRolesFor(source, tenants, auth, globalHeld, heldIn) {
|
|
|
1156
1205
|
};
|
|
1157
1206
|
if (globalHeld !== void 0 && source.globalRoles !== void 0) {
|
|
1158
1207
|
const read = source.globalRoles.bind(source);
|
|
1159
|
-
once(() => read({
|
|
1208
|
+
once(() => read(compact({
|
|
1209
|
+
held: globalHeld,
|
|
1210
|
+
memo
|
|
1211
|
+
})), onlyGlobal);
|
|
1160
1212
|
}
|
|
1161
1213
|
if (tenants.length > 0 && source.sharedRoles !== void 0) {
|
|
1162
1214
|
const read = source.sharedRoles.bind(source);
|
|
1163
1215
|
const held = [...new Set(tenants.flatMap((tenant) => heldIn(tenant)))];
|
|
1164
|
-
once(() => read({
|
|
1216
|
+
once(() => read(compact({
|
|
1217
|
+
held,
|
|
1218
|
+
memo
|
|
1219
|
+
})), onlyShared);
|
|
1165
1220
|
}
|
|
1166
1221
|
if (loaded.some((item) => isThenable(item))) return Promise.all(loaded.map((item) => Promise.resolve(item).catch(() => {
|
|
1167
1222
|
auth.push({
|
|
@@ -1202,8 +1257,8 @@ function assignableNamesFor(source, tenants, auth) {
|
|
|
1202
1257
|
return toMap(loaded);
|
|
1203
1258
|
}
|
|
1204
1259
|
/**
|
|
1205
|
-
* The declared role names among `names`. A custom role of `tenant` is known
|
|
1206
|
-
*
|
|
1260
|
+
* The declared role names among `names`. A custom role of `tenant` is known but
|
|
1261
|
+
* contributes no declared name: its grants are resolved separately
|
|
1207
1262
|
* (`customGrantsFor`), bounded by the ceiling. A tenant's custom role is
|
|
1208
1263
|
* unknown inside another tenant and for a membership without one.
|
|
1209
1264
|
*/
|
|
@@ -1261,7 +1316,10 @@ function validationMessage(permission, resource, issues) {
|
|
|
1261
1316
|
}
|
|
1262
1317
|
//#endregion
|
|
1263
1318
|
//#region src/core/evaluate/call.ts
|
|
1264
|
-
/**
|
|
1319
|
+
/**
|
|
1320
|
+
* The rows after boundary validation; on `invalid`, the rows validated before
|
|
1321
|
+
* the failure.
|
|
1322
|
+
*/
|
|
1265
1323
|
function validatedRows(call, data, rows) {
|
|
1266
1324
|
const { permission, policy, options } = call;
|
|
1267
1325
|
if (data === void 0 && !(permission.kind === "instance" && policy.validate === "always")) return rows;
|
|
@@ -1341,9 +1399,9 @@ function isUnconditionedAllow(grant, now) {
|
|
|
1341
1399
|
return grant.where === void 0 && grant.check === void 0 && grant.closure === void 0 && grant.portable && grant.purpose === void 0 && grant.viaOnly === void 0 && grant.requires === void 0 && isActive(grant.validity, now);
|
|
1342
1400
|
}
|
|
1343
1401
|
/**
|
|
1344
|
-
* The row condition a grant's `requires` adds: the row's instance of some
|
|
1345
|
-
*
|
|
1346
|
-
*
|
|
1402
|
+
* The row condition a grant's `requires` adds: the row's instance of some scope
|
|
1403
|
+
* is one where the subject holds `key` through a role grant without a row
|
|
1404
|
+
* condition, minus the instances a deny of `key` reaches at that scope.
|
|
1347
1405
|
* `undefined` when the subject holds `key` globally that way, so every row
|
|
1348
1406
|
* passes. The in-process mirror of the SQL `permdock_has_permission` and
|
|
1349
1407
|
* `permitted_<scope>_ids_by_permission`.
|
|
@@ -1417,9 +1475,9 @@ function keyRequirement(policy, subject, key, resource, now, customRoles, custom
|
|
|
1417
1475
|
//#endregion
|
|
1418
1476
|
//#region src/core/evaluate/candidates.ts
|
|
1419
1477
|
/**
|
|
1420
|
-
* A collection write proposes `next`; an update pair may move `next` out of
|
|
1421
|
-
*
|
|
1422
|
-
*
|
|
1478
|
+
* A collection write proposes `next`; an update pair may move `next` out of the
|
|
1479
|
+
* scope `current` is in. An allow needs both in scope; a deny applies when
|
|
1480
|
+
* either is, so a move into or out of its scope stays denied.
|
|
1423
1481
|
*/
|
|
1424
1482
|
function matchWriteScope(match, instance, current, next, deny) {
|
|
1425
1483
|
const first = match(instance ? current : next);
|
|
@@ -1429,7 +1487,10 @@ function matchWriteScope(match, instance, current, next, deny) {
|
|
|
1429
1487
|
const moved = match(next);
|
|
1430
1488
|
return moved.ok ? first : moved;
|
|
1431
1489
|
}
|
|
1432
|
-
/**
|
|
1490
|
+
/**
|
|
1491
|
+
* The code grants and custom-role grants for the permission, break-glass grants
|
|
1492
|
+
* aside.
|
|
1493
|
+
*/
|
|
1433
1494
|
function candidatesFor(call) {
|
|
1434
1495
|
const { permission } = call;
|
|
1435
1496
|
const candidates = (call.policy.index.grantsByKey.get(permission.key) ?? []).filter((grant) => grant.breakGlass === void 0).map((grant) => ({ grant }));
|
|
@@ -1487,7 +1548,8 @@ function holdsRole(state, item, custom) {
|
|
|
1487
1548
|
}
|
|
1488
1549
|
/**
|
|
1489
1550
|
* Whether the subject holds every role the grantee names, at a scope the row
|
|
1490
|
-
* (and a write's next row) is in. `held: false` when a denial or skip was
|
|
1551
|
+
* (and a write's next row) is in. `held: false` when a denial or skip was
|
|
1552
|
+
* recorded.
|
|
1491
1553
|
*/
|
|
1492
1554
|
function roleScope(state, grant, custom) {
|
|
1493
1555
|
const { subject, permission, tracer } = state;
|
|
@@ -1553,7 +1615,10 @@ function granteeOf(state, grant, custom) {
|
|
|
1553
1615
|
reason
|
|
1554
1616
|
});
|
|
1555
1617
|
}
|
|
1556
|
-
/**
|
|
1618
|
+
/**
|
|
1619
|
+
* One candidate grant: records an allow, a denial or a skip, or returns the
|
|
1620
|
+
* decision a deny ends with.
|
|
1621
|
+
*/
|
|
1557
1622
|
function evaluateCandidate(state, { grant, custom }, breakGlass) {
|
|
1558
1623
|
const { policy, subject, permission, now, env, tracer } = state;
|
|
1559
1624
|
const displayRole = grant.role;
|
|
@@ -1618,7 +1683,10 @@ function evaluateCandidate(state, { grant, custom }, breakGlass) {
|
|
|
1618
1683
|
membership: scoped.membership
|
|
1619
1684
|
});
|
|
1620
1685
|
}
|
|
1621
|
-
/**
|
|
1686
|
+
/**
|
|
1687
|
+
* Adds the break-glass allow, or puts its denial first, once every candidate
|
|
1688
|
+
* has run.
|
|
1689
|
+
*/
|
|
1622
1690
|
function mergeBreakGlass(state, breakGlass) {
|
|
1623
1691
|
if (breakGlass.grant !== void 0) {
|
|
1624
1692
|
state.tracer?.allows.push(matchedOf(breakGlass.grant, state.permission.key, true));
|
|
@@ -1641,8 +1709,8 @@ function noAllowDecision(state) {
|
|
|
1641
1709
|
}
|
|
1642
1710
|
/**
|
|
1643
1711
|
* The allows a delegation leaves usable. A policy delegation is a ceiling for
|
|
1644
|
-
* the actor: outside it, nothing is delegated; inside it, a token delegation
|
|
1645
|
-
*
|
|
1712
|
+
* the actor: outside it, nothing is delegated; inside it, a token delegation on
|
|
1713
|
+
* the call must still cover.
|
|
1646
1714
|
*/
|
|
1647
1715
|
function delegatedAllows(state) {
|
|
1648
1716
|
const { policy, subject, permission, current } = state;
|
|
@@ -1681,7 +1749,10 @@ function approvalOf(state, candidate) {
|
|
|
1681
1749
|
}
|
|
1682
1750
|
//#endregion
|
|
1683
1751
|
//#region src/core/evaluate/quota.ts
|
|
1684
|
-
/**
|
|
1752
|
+
/**
|
|
1753
|
+
* The quota verdict for one allow: free without a `limit`, unavailable without
|
|
1754
|
+
* the `limits()` feature.
|
|
1755
|
+
*/
|
|
1685
1756
|
function quotaOf(state, grant, consume) {
|
|
1686
1757
|
const { env, subject } = state;
|
|
1687
1758
|
if (grant.limit === void 0) return { ok: true };
|
|
@@ -1729,9 +1800,9 @@ function quotaAllow(state, usable) {
|
|
|
1729
1800
|
/**
|
|
1730
1801
|
* One decision, in stages: the call (clock, rows, delegated permission), the
|
|
1731
1802
|
* subject (held roles, actor), the candidate grants (a matching deny ends
|
|
1732
|
-
* here), break-glass, freshness, delegation and contact, the approval and
|
|
1733
|
-
*
|
|
1734
|
-
*
|
|
1803
|
+
* here), break-glass, freshness, delegation and contact, the approval and quota
|
|
1804
|
+
* of each usable allow, and the decision. Every exit goes through `complete`,
|
|
1805
|
+
* which freezes and emits.
|
|
1735
1806
|
*/
|
|
1736
1807
|
function evaluate(policy, given, permission, data, options, env) {
|
|
1737
1808
|
const call = {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { T as Policy } from "./policy-types-
|
|
2
|
-
import { a as PermDock } from "./permdock-
|
|
3
|
-
import { m as ApprovalStore } from "./types-
|
|
1
|
+
import { T as Policy } from "./policy-types-DGIO_gxq.js";
|
|
2
|
+
import { a as PermDock } from "./permdock-CprAPN3w.js";
|
|
3
|
+
import { m as ApprovalStore } from "./types-DLvhVm1r.js";
|
|
4
4
|
//#region src/server/evaluations.d.ts
|
|
5
5
|
/** AuthZEN 1.0 section 7.1.2.1 `options.evaluations_semantic` values. */
|
|
6
6
|
declare const EVALUATIONS_SEMANTICS: readonly ["execute_all", "deny_on_first_deny", "permit_on_first_permit"];
|
|
7
7
|
type EvaluationsSemantic = (typeof EVALUATIONS_SEMANTICS)[number];
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The batch's `evaluations_semantic`: `execute_all` when absent, `undefined`
|
|
10
|
+
* for an unknown value.
|
|
11
|
+
*/
|
|
9
12
|
declare function evaluationsSemantic(body: Readonly<Record<string, unknown>>): EvaluationsSemantic | undefined;
|
|
10
13
|
/**
|
|
11
14
|
* Evaluates `items` under `semantic`: all at once for `execute_all`, else in
|
|
@@ -22,7 +25,10 @@ declare function evaluationsHandler(options: {
|
|
|
22
25
|
}) => Promise<PermDock>;
|
|
23
26
|
readonly store?: ApprovalStore;
|
|
24
27
|
readonly adapter?: string;
|
|
25
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* The most evaluations one POST may carry; a larger batch is a 413 before any
|
|
30
|
+
* instance is resolved.
|
|
31
|
+
*/
|
|
26
32
|
readonly maxEvaluations?: number;
|
|
27
33
|
}): {
|
|
28
34
|
readonly POST: (request: Request) => Promise<Response>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
-
import { t as PROBLEM_BASE } from "./validation-error-
|
|
2
|
+
import { t as PROBLEM_BASE } from "./validation-error-CYg2kJEw.js";
|
|
3
3
|
import { t as wireDenials } from "./wire-denial-C7PaVYEM.js";
|
|
4
|
-
import { c as listPermissions, g as formerScopes, h as formerKeys } from "./permission-registry-
|
|
5
|
-
import { h as secondsAt } from "./time-
|
|
4
|
+
import { c as listPermissions, g as formerScopes, h as formerKeys } from "./permission-registry-B8tYxPIt.js";
|
|
5
|
+
import { h as secondsAt } from "./time-nR1JesoH.js";
|
|
6
6
|
import { n as resourceRef } from "./resource-ref-CaS9yVPi.js";
|
|
7
|
-
import { n as readBodyText } from "./body-text-
|
|
8
|
-
import {
|
|
9
|
-
import { i as readApprovalHeader, s as resumeDecision } from "./helpers-
|
|
10
|
-
import { t as bodyTooLarge } from "./body-
|
|
7
|
+
import { n as readBodyText } from "./body-text-DQhcmqdY.js";
|
|
8
|
+
import { f as validationProblem, l as problemResponse, n as batchTooLarge } from "./problem-BVLHFK33.js";
|
|
9
|
+
import { i as readApprovalHeader, s as resumeDecision } from "./helpers-DJicaG6f.js";
|
|
10
|
+
import { t as bodyTooLarge } from "./body-CJQwYVa8.js";
|
|
11
11
|
import { t as timeoutSignal } from "./timeout-D51niuQP.js";
|
|
12
12
|
//#region src/core/decision.ts
|
|
13
13
|
/** The denial for a check that failed or named no declared permission. */
|
|
@@ -19,16 +19,25 @@ const NO_GRANT = Object.freeze({
|
|
|
19
19
|
})]),
|
|
20
20
|
alternatives: Object.freeze([])
|
|
21
21
|
});
|
|
22
|
+
/** The denial for a check whose row loader threw: it fails closed. */
|
|
23
|
+
const LOAD_FAILED = Object.freeze({
|
|
24
|
+
outcome: "denied",
|
|
25
|
+
denials: Object.freeze([Object.freeze({
|
|
26
|
+
role: null,
|
|
27
|
+
reason: "validation"
|
|
28
|
+
})]),
|
|
29
|
+
alternatives: Object.freeze([])
|
|
30
|
+
});
|
|
22
31
|
//#endregion
|
|
23
32
|
//#region src/server/evaluation-items.ts
|
|
24
33
|
function firstWins(map, name, leaf) {
|
|
25
34
|
if (!map.has(name)) map.set(name, leaf);
|
|
26
35
|
}
|
|
27
36
|
/**
|
|
28
|
-
* Indexes `tree` once. The lookup tries `action` as a permission key or
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
37
|
+
* Indexes `tree` once. The lookup tries `action` as a permission key or scope,
|
|
38
|
+
* then `<resource.type>.<action>`, then the leaf with that resource and action;
|
|
39
|
+
* current names win over former ones and earlier leaves over later ones.
|
|
40
|
+
* Anything else is `undefined`, which the caller denies.
|
|
32
41
|
*/
|
|
33
42
|
function permissionLookup(tree) {
|
|
34
43
|
const current = /* @__PURE__ */ new Map();
|
|
@@ -52,13 +61,19 @@ function permissionLookup(tree) {
|
|
|
52
61
|
}
|
|
53
62
|
/** AuthZEN's sentinel resource id for a collection: the type as a whole, no row. */
|
|
54
63
|
const COLLECTION_ID = "*";
|
|
55
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* A resource id as a row id: `undefined` for none, a non-scalar or the
|
|
66
|
+
* collection sentinel `*`.
|
|
67
|
+
*/
|
|
56
68
|
function wireResourceId(id) {
|
|
57
69
|
if (typeof id !== "string" && typeof id !== "number") return;
|
|
58
70
|
const text = String(id);
|
|
59
71
|
return text === COLLECTION_ID ? void 0 : text;
|
|
60
72
|
}
|
|
61
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* The row an item's resource describes: its `properties`, else `{ id }`, else
|
|
75
|
+
* none for `id: "*"`.
|
|
76
|
+
*/
|
|
62
77
|
function itemResourceData(resource) {
|
|
63
78
|
const properties = resource?.properties;
|
|
64
79
|
if (properties !== null && typeof properties === "object") return properties;
|
|
@@ -67,7 +82,10 @@ function itemResourceData(resource) {
|
|
|
67
82
|
}
|
|
68
83
|
//#endregion
|
|
69
84
|
//#region src/server/web-bot-auth.ts
|
|
70
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Milliseconds a key directory fetch may take before the signature counts as
|
|
87
|
+
* unverifiable.
|
|
88
|
+
*/
|
|
71
89
|
const DIRECTORY_TIMEOUT_MS = 5e3;
|
|
72
90
|
const DEFAULT_MAX_AGE = 300;
|
|
73
91
|
const FUTURE_SKEW = 60;
|
|
@@ -405,7 +423,10 @@ const EVALUATIONS_SEMANTICS = [
|
|
|
405
423
|
"deny_on_first_deny",
|
|
406
424
|
"permit_on_first_permit"
|
|
407
425
|
];
|
|
408
|
-
/**
|
|
426
|
+
/**
|
|
427
|
+
* The batch's `evaluations_semantic`: `execute_all` when absent, `undefined`
|
|
428
|
+
* for an unknown value.
|
|
429
|
+
*/
|
|
409
430
|
function evaluationsSemantic(body) {
|
|
410
431
|
const options = body["options"];
|
|
411
432
|
const value = isRecord(options) ? options["evaluations_semantic"] : void 0;
|
|
@@ -454,9 +475,9 @@ function authzenMetadata(pdp, search = {}) {
|
|
|
454
475
|
});
|
|
455
476
|
}
|
|
456
477
|
/**
|
|
457
|
-
* `reason_admin` and `reason_user` for a decision that is not granted, from
|
|
458
|
-
*
|
|
459
|
-
*
|
|
478
|
+
* `reason_admin` and `reason_user` for a decision that is not granted, from the
|
|
479
|
+
* denial roles and reasons the context already carries. The user reason names
|
|
480
|
+
* no role, grant or subject.
|
|
460
481
|
*/
|
|
461
482
|
function evaluationReasons(decision, permission) {
|
|
462
483
|
switch (decision.outcome) {
|
|
@@ -607,4 +628,4 @@ function evaluationsHandler(options) {
|
|
|
607
628
|
};
|
|
608
629
|
}
|
|
609
630
|
//#endregion
|
|
610
|
-
export {
|
|
631
|
+
export { LOAD_FAILED as _, evaluationReasons as a, withRequestId as c, invalidSignatureProblem as d, invalidSignatureResponse as f, wireResourceId as g, permissionLookup as h, evaluateBatch as i, InvalidSignatureError as l, itemResourceData as m, applyApprovalResume as n, evaluationsHandler as o, webBotAuthVerifier as p, authzenMetadata as r, evaluationsSemantic as s, EVALUATIONS_SEMANTICS as t, discoverViaSignatureAgent as u, NO_GRANT as v };
|
package/dist/eve/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as Policy, j as PolicyVocabulary,
|
|
2
|
-
import { u as Permission } from "../permission-types-
|
|
3
|
-
import { a as PermDock } from "../permdock-
|
|
4
|
-
import { u as ApprovalRequest } from "../types-
|
|
5
|
-
import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-
|
|
1
|
+
import { T as Policy, j as PolicyVocabulary, pr as Principal } from "../policy-types-DGIO_gxq.js";
|
|
2
|
+
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
|
+
import { a as PermDock } from "../permdock-CprAPN3w.js";
|
|
4
|
+
import { u as ApprovalRequest } from "../types-DLvhVm1r.js";
|
|
5
|
+
import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-BPUopdfL.js";
|
|
6
6
|
//#region src/eve/create.d.ts
|
|
7
7
|
/** Structural `SessionAuthContext` from `eve`. */
|
|
8
8
|
type EvePrincipal = {
|
|
@@ -50,7 +50,10 @@ type EveApprovers = {
|
|
|
50
50
|
readonly roles: readonly string[];
|
|
51
51
|
} | ((responder: EvePrincipal, request: ApprovalRequest) => boolean);
|
|
52
52
|
type EvePermDockOptions<TUser = unknown> = Omit<AgentAdapterOptions<EveContext, TUser>, "subject"> & {
|
|
53
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Defaults to `subjectFromEve`: the session initiator's id and `roles`
|
|
55
|
+
* attribute.
|
|
56
|
+
*/
|
|
54
57
|
readonly subject?: (context: EveContext) => TUser | Promise<TUser>;
|
|
55
58
|
readonly approvers?: EveApprovers;
|
|
56
59
|
};
|