permdock 0.6.0 → 0.7.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 -0
- package/dist/{2020-C9VN-x8c.js → 2020-CJbO8Bvz.js} +1 -3
- package/dist/a2a/index.d.ts +5 -5
- package/dist/a2a/index.js +4 -4
- package/dist/{adoption-scan-DCYe60Pi.js → adoption-scan-D-feE7BE.js} +1 -1
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +1 -1
- package/dist/ai-sdk/index.d.ts +21 -6
- package/dist/ai-sdk/index.js +19 -9
- package/dist/{approval-prompt-DvSSPQJX.d.ts → approval-prompt-K0faOLFp.d.ts} +2 -2
- package/dist/approvals/index.d.ts +4 -4
- package/dist/approvals/index.js +4 -4
- package/dist/{approvals-p1PGoVjb.js → approvals-CMRfsbBh.js} +74 -48
- package/dist/{arazzo-41WuzHou.js → arazzo-ClrF3PVb.js} +2 -2
- package/dist/{arazzo-CaUVBn7D.js → arazzo-rdeJ8n1J.js} +4 -4
- package/dist/{args-IIolxxKA.js → args-CC3OwyHW.js} +112 -2
- package/dist/astro/index.d.ts +6 -6
- package/dist/astro/index.js +2 -2
- package/dist/{audience-DabClFLQ.js → audience-BrMs8c4o.js} +1 -1
- package/dist/{auth-DRLEizbL.js → auth-CscUX8Sy.js} +3 -4
- package/dist/authzen/index.d.ts +162 -22
- package/dist/authzen/index.js +315 -146
- package/dist/{automation-BNM3TtDo.d.ts → automation-DOtAFWdy.d.ts} +3 -3
- package/dist/{automation-DVjOckjV.js → automation-ySsxp_Yp.js} +1 -1
- package/dist/base-url-BQbddZO5.js +9 -0
- package/dist/better-auth/index.d.ts +2 -2
- package/dist/better-auth/index.js +2 -2
- package/dist/better-supabase/index.d.ts +50 -8
- package/dist/better-supabase/index.js +94 -32
- package/dist/{bind-CAvgUuKs.js → bind-D1nO6fiC.js} +5 -5
- package/dist/{bind-DOyrv6zi.d.ts → bind-JDuvxjuW.d.ts} +7 -7
- package/dist/{build-instance-Bu_eDqYw.js → build-instance-DxE7czo9.js} +1 -1
- package/dist/{canonical-json-BC8_nMTw.js → canonical-json-DwilZ1iB.js} +6 -3
- package/dist/{capability-Drg-1YhL.d.ts → capability-D4UC9TTW.d.ts} +2 -2
- package/dist/{capability-N1K9IpqS.js → capability-L7NnfhiE.js} +1 -1
- package/dist/{casbin-Cr7RLtA3.js → casbin-BHijLuHY.js} +2 -2
- package/dist/{casbin-Dyu2gnUD.js → casbin-BW9pS47J.js} +1 -1
- package/dist/{casl-64gpT-8x.js → casl-CmJlgziS.js} +2 -2
- package/dist/{casl-DjEDhTCP.js → casl-UbI8v-Wq.js} +1 -1
- package/dist/catalog/index.d.ts +70 -10
- package/dist/catalog/index.js +112 -6
- package/dist/catalog-BCCjSAdH.js +1 -0
- package/dist/{catalog-DZVbrF-z.js → catalog-BaMQfQ6Y.js} +3 -3
- package/dist/{catalog-HD2gf5mY.js → catalog-D69WhFii.js} +43 -13
- package/dist/{catalog-doc-Cdn7-0pQ.js → catalog-doc-CV9s6B1S.js} +28 -5
- package/dist/{catalog-fingerprint-CCP0-yQS.js → catalog-fingerprint-C144oW4M.js} +1 -1
- package/dist/{create-CQWIpUG-.js → challenge-nGWma08S.js} +122 -25
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +2 -2
- package/dist/chat-sdk/index.d.ts +3 -3
- package/dist/checks-BC_0mPIq.js +37 -0
- package/dist/claude-agent/index.d.ts +3 -3
- package/dist/claude-agent/index.js +2 -2
- package/dist/clerk/index.d.ts +3 -3
- package/dist/clerk/index.js +1 -1
- package/dist/cli/bin.js +2 -2
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +3 -3
- package/dist/cloud/index.d.ts +127 -11
- package/dist/cloud/index.js +251 -3
- package/dist/{cloud-ytQ3uviA.js → cloud-CO8pYtwr.js} +5 -5
- package/dist/{codemod-ua2hHy7w.js → codemod-BP6n8N9L.js} +3 -3
- package/dist/{codemod-5mpSpnUY.js → codemod-i4N2BhDc.js} +3 -3
- package/dist/{collect-mLTY4nwb.js → collect-BaWeMjwV.js} +17 -8
- package/dist/{collect-Ci6akVwH.js → collect-DNm3oKOk.js} +6 -5
- package/dist/collect-k_Dulxr5.js +1 -0
- package/dist/compile/index.d.ts +1 -1
- package/dist/compile/index.js +1 -1
- package/dist/{compile-CMqMx_IN.js → compile-BAEO5bOk.js} +2 -2
- package/dist/{compile-1bsAezL0.d.ts → compile-COM2VKuN.d.ts} +3 -3
- package/dist/{completion-BTFrHZhX.js → completion-BNdVf7X2.js} +3 -3
- package/dist/{config-bs_kZeYq.js → config-CoQHDrDi.js} +7 -3
- package/dist/{config-Bj2Ixq3d.js → config-DGZzMV1B.js} +2 -2
- package/dist/{config-report-DSpsLpCE.js → config-report-Cm7UITNA.js} +3 -3
- package/dist/connector-schema-_VCSsdtD.js +433 -0
- package/dist/{context-B_u3_bDJ.js → context--uM9V3Ui.js} +2 -2
- package/dist/convex/index.d.ts +5 -5
- package/dist/convex/index.js +2 -2
- package/dist/core-B5-w6Kw9.js +335 -0
- package/dist/core-CQkE8Esr.d.ts +179 -0
- package/dist/{create-B30OMUOJ.d.ts → create-B2-CQqCI.d.ts} +5 -5
- package/dist/{create-CGm28gyI.js → create-Cb86Z8Im.js} +9 -8
- package/dist/{create-DCF2SvoT.js → create-DJrlhEp9.js} +5 -5
- package/dist/{create-D_NmPOdH.d.ts → create-QHuuPw3q.d.ts} +7 -7
- package/dist/{create-CBMmFie-.d.ts → create-UTnUVETj.d.ts} +30 -10
- package/dist/{credential-BcoiejpY.js → credential-CIM7wHwA.js} +4 -4
- package/dist/{credentials-DPyHmYz5.js → credentials-BpuTwd7a.js} +1 -1
- package/dist/{deciding-columns-Sq12mEA6.js → deciding-columns-DRo2QM6E.js} +13 -2
- package/dist/{delegation-j6-rc37o.js → delegation-C5rOdTp5.js} +5 -5
- package/dist/delivery/index.d.ts +5 -5
- package/dist/delivery/index.js +4 -3
- package/dist/{delivery-DCAgNyCn.js → delivery-rwOKLWRm.js} +51 -2
- package/dist/{denied-text-CiFQNuMV.d.ts → denied-text-D4qkEtFz.d.ts} +2 -2
- package/dist/{describe-BybMRY7A.js → describe-DZlnEtLy.js} +1 -0
- package/dist/{describe-B5qgDvEW.d.ts → describe-O0SwYIK8.d.ts} +2 -2
- package/dist/{diff-CmuSD3vc.js → diff-Btr1c1Ow.js} +2 -2
- package/dist/{diff-3jbx6Rm4.js → diff-DzT-xD13.js} +10 -10
- package/dist/{doctor-BdZw53-k.js → doctor-BU1szn63.js} +241 -49
- package/dist/{doctor-3ZqNHX_G.js → doctor-BoK_y0KO.js} +4 -4
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/drizzle/index.js +1 -1
- package/dist/elysia/index.d.ts +5 -5
- package/dist/elysia/index.js +3 -3
- package/dist/{errors-DH5QEGXh.d.ts → errors-B_Qg9D3e.d.ts} +2 -2
- package/dist/{errors-CWTY6uih.js → errors-DpP_U6Bf.js} +1 -0
- package/dist/{evaluate-CNClBvcj.js → evaluate-B_oqFbWC.js} +55 -12
- package/dist/{evaluations-C_1vdSZc.d.ts → evaluations-BCddEOfO.d.ts} +4 -4
- package/dist/{evaluations-beAooV0n.js → evaluations-DReoiVBw.js} +4 -4
- package/dist/eve/index.d.ts +5 -5
- package/dist/eve/index.js +3 -3
- package/dist/express/index.d.ts +5 -5
- package/dist/express/index.js +3 -3
- package/dist/fastify/index.d.ts +5 -5
- package/dist/fastify/index.js +3 -3
- package/dist/{fetch-adapter-Dw0MTS3D.d.ts → fetch-adapter-CuhyYwC1.d.ts} +4 -4
- package/dist/{fetch-adapter-DD_gfmrC.js → fetch-adapter-De-u6vhJ.js} +3 -3
- package/dist/{fields-OYG_JR78.js → fields-ClcQLrVc.js} +48 -13
- package/dist/{files-C5ZI27eV.js → files-acUbNwWt.js} +15 -2
- package/dist/{fixtures-B7XrLeY7.js → fixtures-BTMW6zgU.js} +2 -2
- package/dist/{flags-C3DktBDY.js → flags-aaeRAdiD.js} +2 -2
- package/dist/{from-snapshot-CTCMsFZk.js → from-snapshot-Bz469dIh.js} +17 -10
- package/dist/generate-3FNO5P5Q.js +159 -0
- package/dist/{grantee-hxrUsbpM.js → grantee-BrRANrpT.js} +1 -1
- package/dist/{grantee-conditions-CcXf8hMM.js → grantee-conditions-C6P1Tvol.js} +1 -1
- package/dist/{grantee-match-DbENBHLB.js → grantee-match-0RtHWQDx.js} +3 -3
- package/dist/h3/index.d.ts +4 -4
- package/dist/h3/index.js +3 -3
- package/dist/{helpers-CBYVMjwh.js → helpers-DY3vXuGs.js} +3 -3
- package/dist/hono/index.d.ts +5 -5
- package/dist/hono/index.js +3 -3
- package/dist/{hosted-BPk51-kX.d.ts → hosted-BmjzxQhp.d.ts} +14 -2
- package/dist/{hosted-B46-5LYE.js → hosted-XBgU6RGT.js} +34 -12
- package/dist/{http-DXJ37RDA.js → http-Ca3Sr5x1.js} +1 -1
- package/dist/{import-wyqXUyjm.js → import-Bz0GefWg.js} +5 -5
- package/dist/{import-CNV7I2Dw.js → import-DB2EG_iy.js} +3 -3
- package/dist/{index-C-6Letxg.d.ts → index-BE8y3moU.d.ts} +50 -8
- package/dist/{index-B8YjkEZ4.d.ts → index-BSfRl0hZ.d.ts} +6 -6
- package/dist/{index-DuWxc5dt.d.ts → index-BTkwrK7v.d.ts} +143 -14
- package/dist/index-CMiPH2Tv.d.ts +206 -0
- package/dist/{index-Ch8LpNDp.d.ts → index-DH9DUDEM.d.ts} +18 -3
- package/dist/{index-CueFnxQc.d.ts → index-DLwcuCN_.d.ts} +86 -7
- package/dist/index.d.ts +18 -17
- package/dist/index.js +27 -25
- package/dist/{init-GG6Jh8HD.js → init-5TXNji88.js} +5 -5
- package/dist/{init-DeMYsnYJ.js → init-B-4t1NzC.js} +4 -4
- package/dist/{instance-options-BsVpyGIk.d.ts → instance-options-CU0YQCLH.d.ts} +1 -1
- package/dist/{instance-snapshot-BOEhcqIF.js → instance-snapshot-CjcwnEiV.js} +16 -11
- package/dist/jwt/index.d.ts +83 -5
- package/dist/jwt/index.js +143 -5
- package/dist/{kernel-D0NVb1cK.js → kernel-DVExUwkp.js} +138 -12
- package/dist/kysely/index.d.ts +3 -3
- package/dist/kysely/index.js +1 -1
- package/dist/load-DrMHXzgN.js +1 -0
- package/dist/{load-DFS_ry0W.js → load-DxroEzH1.js} +2 -2
- package/dist/{login-Dfe5RlYk.js → login-ClSJh5t5.js} +4 -4
- package/dist/{login-imhuwvn3.js → login-WC9HPJpU.js} +6 -10
- package/dist/{manifest-C8IzW3Do.js → manifest-B79YuF2T.js} +6 -2
- package/dist/{manifest-mx5ghSFM.d.ts → manifest-BVhExYhw.d.ts} +23 -2
- package/dist/{manifest-dvL2XEe1.js → manifest-Dv6q4i5s.js} +54 -35
- package/dist/{manifest-schema-C0kK_8V0.js → manifest-schema-Cv492Qev.js} +37 -7
- package/dist/{map-claims-D3oRmTk0.js → map-claims-etGIS_Dv.js} +14 -11
- package/dist/{map-error-Dr70oA_3.js → map-error-BQGyDm_M.js} +1 -1
- package/dist/mcp/index.d.ts +64 -10
- package/dist/mcp/index.js +151 -22
- package/dist/{migrate-CIq4-E9F.js → migrate-Dodel0IJ.js} +77 -24
- package/dist/nest/index.d.ts +5 -5
- package/dist/nest/index.js +3 -3
- package/dist/next/index.d.ts +9 -9
- package/dist/next/index.js +5 -5
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +2 -2
- package/dist/node/index.d.ts +5 -5
- package/dist/node/index.js +2 -2
- package/dist/openai/index.d.ts +5 -5
- package/dist/openai/index.js +3 -3
- package/dist/openapi/index.d.ts +14 -4
- package/dist/openapi/index.js +1 -1
- package/dist/{openapi-C4dDTVEd.js → openapi-DMocl1bh.js} +4 -4
- package/dist/{openapi-B7HZ0f-r.js → openapi-Ddb4628T.js} +2 -7
- package/dist/{openapi-DD1SV-5-.js → openapi-ztVaux6j.js} +8 -8
- package/dist/{operation-findings-DgATDpvh.js → operation-findings-kRcEp8lE.js} +1 -1
- package/dist/{operations-X0VM7F3m.d.ts → operations-BNLes61x.d.ts} +1 -1
- package/dist/orpc/index.d.ts +6 -6
- package/dist/orpc/index.js +4 -4
- package/dist/otel/index.d.ts +3 -3
- package/dist/otel/index.js +1 -1
- package/dist/{output-1im__-08.js → output-DgSDLrta.js} +7 -3
- package/dist/{output-files-DhRBBE4n.js → output-files-CCMdcFWb.js} +2 -2
- package/dist/output-files-DPAY7-GX.js +1 -0
- package/dist/{ownership-DqaJNJPn.js → ownership-Z2LpxsGa.js} +443 -40
- package/dist/parse-Ddhz2xf4.js +148 -0
- package/dist/{parse-local-manifest-CVSs6J9I.js → parse-local-manifest-T1Q8X3A2.js} +24 -1
- package/dist/{parse-local-manifest-5ODwqu8b.d.ts → parse-local-manifest-e4mdwAKd.d.ts} +1 -1
- package/dist/pdp/index.d.ts +3 -3
- package/dist/pdp/index.js +7 -3
- package/dist/peer-12Q5I_RH.js +976 -0
- package/dist/{peer-CRvC7Hg1.js → peer-DOzzMfZL.js} +1 -1
- package/dist/{permdock-BrAscV28.js → permdock-BfWEeMqk.js} +177 -49
- package/dist/{permdock-SV8ZINYT.d.ts → permdock-Dco6dyCK.d.ts} +34 -5
- package/dist/{permission-registry-Br4jSNVi.js → permission-registry-DpPtSKNZ.js} +1 -1
- package/dist/{vocabulary-CN8H_9UF.d.ts → permission-types-DhNEmoRG.d.ts} +4 -64
- package/dist/{permissions-u_KHg-sN.d.ts → permissions-CoqCOfJ3.d.ts} +2 -1
- package/dist/{permissions-B-wCP5ZC.js → permissions-CyH2MV_B.js} +1 -1
- package/dist/{permissions-BPxlwVhN.js → permissions-DArULThq.js} +4 -4
- package/dist/pkce-5h8NgMQJ.js +21 -0
- package/dist/{policies-DP2nqRoF.js → policies-B2lZIurj.js} +3 -3
- package/dist/{policy-77FSAq_V.d.ts → policy-B7dg_yzu.d.ts} +2 -2
- package/dist/{policy-DbM5YYtV.js → policy-DaJy4nK4.js} +17 -8
- package/dist/{policy-from-catalog-C2gMa2Dj.js → policy-from-catalog-DFWYkNdu.js} +9 -9
- package/dist/{policy-types-n0uRTsW8.d.ts → policy-types-B-F-qAZk.d.ts} +83 -4
- package/dist/postgres-store-BL9M_CA1.js +1001 -0
- package/dist/{postgrest-CEgRbefE.d.ts → postgrest-CYacM_u7.d.ts} +12 -1
- package/dist/{postgrest-DAjUkF9w.js → postgrest-r5faDIzD.js} +37 -4
- package/dist/{powersync-DISt6SUe.js → powersync-13odBwiM.js} +3 -3
- package/dist/powersync-53ryOZip.js +1059 -0
- package/dist/powersync-CExtTLyA.js +1 -0
- package/dist/preset/index.js +1 -1
- package/dist/{preset-DZdU0tne.js → preset-CHTbd-DQ.js} +2 -2
- package/dist/prisma/index.d.ts +2 -2
- package/dist/prisma/index.js +1 -1
- package/dist/{problem-details-B45V5d2b.d.ts → problem-details-Tcfmj3bV.d.ts} +1 -1
- package/dist/prompt-DwtVemER.js +935 -0
- package/dist/{protected-RFGpakN9.d.ts → protected-BwZYL1X_.d.ts} +6 -5
- package/dist/{protected-BlF0F6wL.js → protected-DXE3cQYg.js} +2 -2
- package/dist/{provider-B1al-AZz.js → provider-BQsTYYy0.js} +2 -2
- package/dist/{provider-DILL9oPK.d.ts → provider-Csk-THAn.d.ts} +1 -1
- package/dist/{provider-store-DM6DNcta.js → provider-store-IgqQipCO.js} +2 -2
- package/dist/{pull-jEwbf80J.js → pull-CN5OLxrF.js} +7 -7
- package/dist/pull-Cty6Ovyu.js +1 -0
- package/dist/{push-BD4f15co.js → push-tVdG8dUL.js} +54 -14
- package/dist/{pushed-policy-DCW91KQU.d.ts → pushed-policy-BbcY9r_4.d.ts} +1 -1
- package/dist/{pushed-policy-CqtxkV4G.js → pushed-policy-CmYeSQqq.js} +1 -1
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +3 -3
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +25 -11
- package/dist/react-native/index.js +209 -21
- package/dist/{refs-K6eWUJ0H.js → refs-CNJBiTFo.js} +15 -1
- package/dist/{replay-Bkm-Ne4l.d.ts → replay-DCDD_ZfL.d.ts} +1 -1
- package/dist/{request-context-C81Pip9n.js → request-context-BykKLmyE.js} +2 -2
- package/dist/resend/index.d.ts +4 -4
- package/dist/{retire-CALjIQ7e.js → retire-Wj6dkyDE.js} +2 -2
- package/dist/{rls-BAqP4q66.js → rls-Ck_PocSp.js} +32 -8
- package/dist/{rls-DTvYd-lI.js → rls-CxBZb4rZ.js} +478 -534
- package/dist/{role-builder-uWQZ4v84.js → role-builder-C1VJzvcr.js} +3 -3
- package/dist/rolldown-runtime-C3I60J0A.js +4 -0
- package/dist/{rpc-VSl5ylaQ.js → rpc-Bk1bE-ch.js} +1 -1
- package/dist/run-Bz7DXGEv.js +1 -0
- package/dist/{run-ticket-sxFI6LAk.js → run-ticket-B5d_63Ma.js} +22 -1
- package/dist/{run-ticket-DocwaTKn.d.ts → run-ticket-BpNi7BCi.d.ts} +8 -3
- package/dist/{run-CUKuz0A8.js → run-uLD2aWuO.js} +7 -7
- package/dist/{runtime-D3VTAiCA.js → runtime-Vif3_-zf.js} +1 -1
- package/dist/{saas-BCXRuXca.js → saas-Az_Kz-4D.js} +7 -7
- package/dist/{scan-qvOe0hS3.js → scan-DSljDE1Y.js} +1 -1
- package/dist/{schema-yLuBWWsh.js → schema-gIcCx7zM.js} +1 -1
- package/dist/scim/index.d.ts +3 -2
- package/dist/scim/index.js +3 -1
- package/dist/scim-C7JYhySg.js +44 -0
- package/dist/{scim-ClHtpyV3.js → scim-YNieBO1U.js} +3 -537
- package/dist/{scopes-CUPSjo9q.js → scopes-BHsc-wp-.js} +1 -1
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.js +7 -7
- package/dist/{server-C3WXAHZj.js → server-Bnga6I50.js} +3 -3
- package/dist/{server-types-CKQiCnON.d.ts → server-types-C4gZUEZy.d.ts} +9 -9
- package/dist/{shared-DvvFzYXe.js → shared-C8LjUdVU.js} +1 -1
- package/dist/{shared-BAK8t4Uo.js → shared-fMKOv8hP.js} +44 -38
- package/dist/{sink-4-eQIRWf.d.ts → sink-Cp_Eot9W.d.ts} +4 -4
- package/dist/{skills-B6lVdD_W.js → skills-Dcjw9_1C.js} +5 -5
- package/dist/{skills-CTYwkl44.js → skills-g_3BS9NC.js} +3 -3
- package/dist/{snapshot-B7DkYg6g.js → snapshot-CbGmYiJx.js} +4 -4
- package/dist/{snapshot-cache-DZHQ0KF6.js → snapshot-cache-DT2Kx1F8.js} +1 -1
- package/dist/{snapshot-cache-PXI-vGpY.d.ts → snapshot-cache-Pahd3IYJ.d.ts} +1 -1
- package/dist/solid/index.d.ts +6 -5
- package/dist/solid/index.js +4 -4
- package/dist/solid-start/index.d.ts +6 -6
- package/dist/solid-start/index.js +3 -3
- package/dist/{sources-vs5dGOsS.js → sources-B-zYB4GS.js} +111 -25
- package/dist/{sources-Xc4zkszI.d.ts → sources-DEEuGb8S.d.ts} +63 -14
- package/dist/sources-qoIJQrJv.js +11 -0
- package/dist/{sql-B5T1IL83.js → sql-B96movIM.js} +5 -1
- package/dist/sql-CDEPCA0g.d.ts +10 -0
- package/dist/{src-Cu2m75uo.js → src-DLFrtrrC.js} +140 -48
- package/dist/ssf/index.d.ts +4 -4
- package/dist/ssf/index.js +640 -211
- package/dist/{standard-webhooks-rbD7LS6h.d.ts → standard-webhooks-B_qRg0ws.d.ts} +2 -2
- package/dist/{store-BDutJkDL.js → store-DSP9oGvh.js} +15 -7
- package/dist/{store-options-u0ycEe8s.js → store-options-B_poyYvg.js} +6 -6
- package/dist/{stores-BUGNbJTt.d.ts → stores-BAZwSYZA.d.ts} +6 -5
- package/dist/{stores-CGhM8BN_.js → stores-BqEuHC05.js} +2 -2
- package/dist/{stream-CeCMJmBB.d.ts → stream-2Vwhl7Er.d.ts} +2 -2
- package/dist/{style-Uao76wO7.js → style-Cqo7-73x.js} +1 -0
- package/dist/{style-DiKWnAvn.js → style-Ds1gNm77.js} +1 -1
- package/dist/supabase/index.d.ts +8 -7
- package/dist/supabase/index.js +5 -5
- package/dist/supabase/middleware.d.ts +6 -6
- package/dist/supabase/middleware.js +6 -6
- package/dist/{supabase-x5JtR2tc.js → supabase--0aJdLEd.js} +8 -6
- package/dist/{supabase-By_frk3U.js → supabase-Bqp7iIY2.js} +3 -3
- package/dist/supabase-hook-DJxC4PoP.js +1 -0
- package/dist/{supabase-hook-BMoEhZir.js → supabase-hook-Dg0SrQWR.js} +1060 -119
- package/dist/supautils-MESd81bF.js +689 -0
- package/dist/{support-session-C6xJQYut.js → support-session-Cna49-3f.js} +2 -2
- package/dist/svelte/index.d.ts +5 -5
- package/dist/svelte/index.js +5 -5
- package/dist/svelte/runtime.d.ts +3 -3
- package/dist/svelte/runtime.js +3 -3
- package/dist/svelte/source.d.ts +5 -5
- package/dist/svelte/source.js +2 -2
- package/dist/sveltekit/index.d.ts +6 -6
- package/dist/sveltekit/index.js +2 -2
- package/dist/tanstack-start/index.d.ts +6 -6
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenancy-DN2QAx9z.js → tenancy-CmeBQ6Nv.js} +12 -3
- package/dist/terminal/index.d.ts +6 -6
- package/dist/terminal/index.js +3 -3
- package/dist/testing/core.d.ts +2 -0
- package/dist/testing/core.js +1 -0
- package/dist/testing/fixtures/index.d.ts +12 -0
- package/dist/testing/fixtures/index.js +770 -0
- package/dist/testing/index.d.ts +41 -174
- package/dist/testing/index.js +241 -731
- package/dist/testing/saas/index.d.ts +5 -5
- 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 +444 -0
- package/dist/{token-BLZcjQgt.js → token-2qYDvXz2.js} +1 -1
- package/dist/{tool-refusal-CMLN5xhn.js → tool-refusal-reAhIzdl.js} +1 -1
- package/dist/trpc/index.d.ts +6 -6
- package/dist/trpc/index.js +3 -3
- package/dist/{types-Dfv0aTER.d.ts → types-BWZybqs9.d.ts} +110 -8
- package/dist/{types-Druu9wLM.d.ts → types-BXMYB7BY.d.ts} +2 -2
- package/dist/{types-BzzaHxt3.d.ts → types-BfVmNJO5.d.ts} +14 -3
- package/dist/{types-lUlG3TVd.d.ts → types-CIeZcG8v.d.ts} +2 -2
- package/dist/{types-B3_ooZgZ.d.ts → types-CKV71kKh.d.ts} +4 -4
- package/dist/{types-CX7AvRqP.d.ts → types-CQVEQawv.d.ts} +4 -4
- package/dist/{types-C863OQiR.d.ts → types-CeIscIKp.d.ts} +4 -4
- package/dist/{types-C_IiEs64.d.ts → types-CfiKC5aN.d.ts} +1 -1
- package/dist/{types-_WhUP7ud.d.ts → types-D3A19w4A.d.ts} +8 -4
- package/dist/{types-8RnwUAvE.d.ts → types-DBHftjgS.d.ts} +15 -8
- package/dist/{types-BdtSDbBO.d.ts → types-DC44-hqb.d.ts} +2 -2
- package/dist/{types-CVZSNocA.d.ts → types-DXmwu78Z.d.ts} +4 -4
- package/dist/{types-C791HFu9.d.ts → types-cTos-H7p.d.ts} +2 -2
- package/dist/{types-BtHtcKMr.d.ts → types-g7Oy6Zg4.d.ts} +3 -3
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +2 -2
- package/dist/{usage-SveTRTyr.js → usage-Bybmck7f.js} +7 -7
- package/dist/{usage-CRVl9V3t.js → usage-CDaLXCfL.js} +2 -2
- package/dist/usage-y-kBNdqs.js +1 -0
- package/dist/{validation-error-DHUrAkku.d.ts → validation-error-CQpoquwj.d.ts} +1 -1
- package/dist/{verify-BaAKx7t6.js → verify-pe8rL_Qw.js} +350 -83
- package/dist/{views-DTIIO-oQ.js → views-BB8E9dTP.js} +1 -1
- package/dist/vocabulary-Bg3eeT2H.d.ts +67 -0
- package/dist/vue/index.d.ts +6 -5
- package/dist/vue/index.js +4 -4
- package/dist/{waiter-B986w1oK.d.ts → waiter-DwEyouan.d.ts} +2 -2
- package/dist/watch-Bd9mx3rd.js +1 -0
- package/dist/{watch-vea54PRw.js → watch-C-4VmFlL.js} +3 -3
- package/dist/webmcp/index.d.ts +2 -2
- package/dist/webmcp/index.js +2 -2
- package/dist/{where-scope-C9vfEphl.js → where-scope-wq2coopv.js} +41 -21
- package/dist/{who-can-DWBAcaCQ.js → who-can-BwNsI_Js.js} +6 -6
- package/dist/workflow/index.d.ts +3 -3
- package/dist/workflow/index.js +5 -5
- package/dist/workflow-sdk/index.d.ts +5 -5
- package/dist/{wrap-C5jC6sKI.d.ts → wrap-B6R0cMRL.d.ts} +2 -2
- package/dist/{wrap-gX61EtpB.js → wrap-CiSc_KCq.js} +8 -2
- package/package.json +22 -11
- package/schemas/cli-result-v1.json +1 -0
- package/schemas/cloud-api-v1.json +152 -7
- package/schemas/connector-v1.json +8 -0
- package/schemas/supabase-claims-v1.json +5 -0
- package/schemas/supabase-manifest-v1.json +276 -75
- package/skills/permdock/SKILL.md +1 -0
- package/skills/permdock-agents/references/runtimes.md +3 -1
- package/skills/permdock-approvals/references/stores-and-resume.md +2 -1
- package/skills/permdock-data/references/queries-and-rls.md +4 -1
- package/skills/permdock-tenancy/SKILL.md +1 -1
- package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +1 -0
- package/skills/permdock-wire/references/adapters.md +14 -0
- package/skills/permdock-wire/references/policy-options.md +1 -0
- package/dist/catalog-BoWglDPI.js +0 -1
- package/dist/collect-D7eQDffE.js +0 -1
- package/dist/index-Cp_ilKi1.d.ts +0 -91
- package/dist/load-BxEtwlBS.js +0 -1
- package/dist/output-files-B3IZJksC.js +0 -1
- package/dist/parse-Cxq0WxrA.js +0 -53
- package/dist/peer-C8swJ2GH.js +0 -50
- package/dist/powersync-BkWWCS1K.js +0 -538
- package/dist/powersync-MMJ2mI2q.js +0 -1
- package/dist/prompt-DfZLJLIn.js +0 -32
- package/dist/pull-CvpINcMK.js +0 -1
- package/dist/run-DDwUaJDU.js +0 -1
- package/dist/supabase-hook-CCw5m35C.js +0 -1
- package/dist/supautils-B6HYL9eL.js +0 -91
- package/dist/text-diff-BQcUapOb.js +0 -15
- package/dist/usage-CZpSQP6L.js +0 -1
- package/dist/watch--ovlPOc0.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as PermDockOptions } from "./permdock-Dco6dyCK.js";
|
|
2
2
|
//#region src/core/instance-options.d.ts
|
|
3
3
|
type InstanceKey = "memberships" | "relations" | "entitlements" | "customRoles" | "policies" | "approvalPolicies" | "sink" | "limits" | "principals";
|
|
4
4
|
/**
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "./freeze-CrU8nQeX.js";
|
|
3
|
-
import {
|
|
3
|
+
import { o as hasConditionOp } from "./refs-CNJBiTFo.js";
|
|
4
4
|
import { o as sameId } from "./expiry-D4_YKRKD.js";
|
|
5
|
-
import { a as getResource, c as listPermissions } from "./permission-registry-
|
|
5
|
+
import { a as getResource, c as listPermissions } from "./permission-registry-DpPtSKNZ.js";
|
|
6
6
|
import { n as isThenable } from "./thenable-yD7SabqG.js";
|
|
7
7
|
import { u as isPrincipalRelation } from "./resource-relations-D_jw0BFx.js";
|
|
8
8
|
import { p as nowSeconds, s as instantAt } from "./time-DkWjdL98.js";
|
|
9
|
-
import { t as canonicalJson } from "./canonical-json-
|
|
10
|
-
import {
|
|
11
|
-
import { a as readOnlyActorRefuses, i as delegatedPermissions, r as coversRequirements } from "./delegation-
|
|
12
|
-
import { b as synthesiseRole, m as findRole, o as flattenGrantee, v as listRoles, x as treeXSchema, y as sourceRoleMeta } from "./grantee-
|
|
13
|
-
import { c as nowSeconds$1, d as resolveActiveTenant, l as partitionsOf, p as scopeField, r as isMembershipExpired } from "./tenancy-
|
|
14
|
-
import {
|
|
9
|
+
import { t as canonicalJson } from "./canonical-json-DwilZ1iB.js";
|
|
10
|
+
import { f as scopeList, h as tenantOf, i as keepsPermission, l as rootScope, s as resolveScope } from "./scopes-BHsc-wp-.js";
|
|
11
|
+
import { a as readOnlyActorRefuses, i as delegatedPermissions, r as coversRequirements } from "./delegation-C5rOdTp5.js";
|
|
12
|
+
import { b as synthesiseRole, m as findRole, o as flattenGrantee, v as listRoles, x as treeXSchema, y as sourceRoleMeta } from "./grantee-BrRANrpT.js";
|
|
13
|
+
import { c as nowSeconds$1, d as resolveActiveTenant, l as partitionsOf, p as scopeField, r as isMembershipExpired } from "./tenancy-CmeBQ6Nv.js";
|
|
14
|
+
import { o as levelCondition, r as grantList, s as levelNames, t as declaredRoleNames } from "./policy-DaJy4nK4.js";
|
|
15
15
|
import { t as byCodePoint } from "./compare-pfyVnBjE.js";
|
|
16
|
-
import {
|
|
17
|
-
import { n as matchGrantee, t as combineWhere } from "./grantee-match-
|
|
18
|
-
import { t as buildSnapshot } from "./snapshot-
|
|
16
|
+
import { C as tenantCustomRoles, D as emptyListeners, M as contactMayUse, S as roleAllowKeys, _ as isSharedCustomRole, a as expandRoleNames, g as holdsGlobalCustomRole, h as holdsCustomRole, l as ceilingGrants, m as customRoleScope, n as requirementCondition, p as customRoleOf, t as evaluate, u as customGrantsFor, x as resolveCustomRole } from "./evaluate-B_oqFbWC.js";
|
|
17
|
+
import { n as matchGrantee, t as combineWhere } from "./grantee-match-0RtHWQDx.js";
|
|
18
|
+
import { t as buildSnapshot } from "./snapshot-CbGmYiJx.js";
|
|
19
19
|
//#region src/core/memberships.ts
|
|
20
20
|
/** Two memberships are the same row when everything but `roles` matches. */
|
|
21
21
|
function identity(membership) {
|
|
@@ -71,7 +71,11 @@ function then(value, next) {
|
|
|
71
71
|
function composeMemberships(sources) {
|
|
72
72
|
const listing = sources.filter((source) => source.list !== void 0);
|
|
73
73
|
const versioned = sources.filter((source) => source.version !== void 0);
|
|
74
|
+
const rolesReaders = sources.filter((source) => source.globalRolesFor !== void 0);
|
|
74
75
|
return {
|
|
76
|
+
...rolesReaders.length === 0 ? {} : { globalRolesFor(principal) {
|
|
77
|
+
return then(all(rolesReaders.map((source) => source.globalRolesFor?.(principal) ?? [])), (lists) => [...new Set(lists.flat())]);
|
|
78
|
+
} },
|
|
75
79
|
membershipsFor(principal, options) {
|
|
76
80
|
return then(all(sources.map((source) => source.membershipsFor(principal, options))), (lists) => mergeMemberships(lists));
|
|
77
81
|
},
|
|
@@ -117,6 +121,7 @@ function claimsFirst(source, options = {}) {
|
|
|
117
121
|
membershipsFor: (principal, query) => inner.membershipsFor(principal, query),
|
|
118
122
|
...inner.list === void 0 ? {} : { list: (query) => inner.list?.(query) ?? [] },
|
|
119
123
|
...version === void 0 ? {} : { version },
|
|
124
|
+
...inner.globalRolesFor === void 0 ? {} : { globalRolesFor: (principal) => inner.globalRolesFor?.(principal) ?? [] },
|
|
120
125
|
...options.onStale === "reread" ? { onStale: "reread" } : {},
|
|
121
126
|
claimsFirst: true
|
|
122
127
|
};
|
package/dist/jwt/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Y as JwtClaims,
|
|
2
|
-
import { c as LinkPolicy, o as CapabilityPrincipal, t as Capability } from "../capability-
|
|
3
|
-
import { B as JwtAlgorithm, F as DpopProofResult, H as JwtPrincipal, I as IntrospectionPrincipal, L as JoseTokenSignerOptions, P as DiscoveryInput, R as JoseTokenVerifierOptions, U as JwtSubjectOptions, V as JwtJwks, W as MappedSubject, l as ReplayStore, z as JsonWebKeySet } from "../types-
|
|
4
|
-
import { t as memoryReplayStore } from "../replay-
|
|
1
|
+
import { Y as JwtClaims, Zt as AuthEvent, dt as TokenVerifier, lr as Subject, lt as TokenFailureCause, pt as VerifiedToken, sr as Principal, ut as TokenSigner } from "../policy-types-B-F-qAZk.js";
|
|
2
|
+
import { c as LinkPolicy, o as CapabilityPrincipal, t as Capability } from "../capability-D4UC9TTW.js";
|
|
3
|
+
import { B as JwtAlgorithm, F as DpopProofResult, H as JwtPrincipal, I as IntrospectionPrincipal, L as JoseTokenSignerOptions, P as DiscoveryInput, R as JoseTokenVerifierOptions, U as JwtSubjectOptions, V as JwtJwks, W as MappedSubject, l as ReplayStore, z as JsonWebKeySet } from "../types-cTos-H7p.js";
|
|
4
|
+
import { t as memoryReplayStore } from "../replay-DCDD_ZfL.js";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
//#region src/jwt/capability.d.ts
|
|
7
7
|
/** `on('auth')` causes: a verification failure, or one of the three capability checks. */
|
|
@@ -82,6 +82,48 @@ type DpopProofOptions = {
|
|
|
82
82
|
};
|
|
83
83
|
export declare function verifyDpopProof(request: Request, claims: JwtClaims, accessToken?: string, options?: DpopProofOptions): Promise<DpopProofResult>;
|
|
84
84
|
//#endregion
|
|
85
|
+
//#region src/jwt/id-token.d.ts
|
|
86
|
+
/** `TokenFailureCause` plus `nonce-mismatch`; a `TokenVerifier` never returns it. */
|
|
87
|
+
type IdTokenFailureCause = TokenFailureCause | "nonce-mismatch";
|
|
88
|
+
type VerifyIdTokenOptions = {
|
|
89
|
+
/** The OpenID Provider's issuer; `iss` must equal it. */
|
|
90
|
+
readonly issuer: string;
|
|
91
|
+
/** The relying party's `client_id`; `aud` must contain it and `azp`, when present, must equal it. */
|
|
92
|
+
readonly clientId: string;
|
|
93
|
+
/** The `nonce` sent in the authentication request; the token's must equal it. */
|
|
94
|
+
readonly nonce?: string;
|
|
95
|
+
readonly clockTolerance?: number;
|
|
96
|
+
} & ({
|
|
97
|
+
/** A verifier the caller keeps, so its JWKS cache outlives one call. */
|
|
98
|
+
readonly verifier: TokenVerifier;
|
|
99
|
+
readonly jwks?: never;
|
|
100
|
+
readonly algorithms?: never;
|
|
101
|
+
} | {
|
|
102
|
+
readonly jwks: JsonWebKeySet;
|
|
103
|
+
readonly algorithms?: readonly JwtAlgorithm[];
|
|
104
|
+
readonly verifier?: never;
|
|
105
|
+
});
|
|
106
|
+
type IdTokenClaims = JwtClaims & {
|
|
107
|
+
readonly iss: string;
|
|
108
|
+
readonly sub: string;
|
|
109
|
+
readonly iat: number;
|
|
110
|
+
};
|
|
111
|
+
type VerifyIdTokenResult = {
|
|
112
|
+
readonly ok: true;
|
|
113
|
+
readonly claims: IdTokenClaims;
|
|
114
|
+
readonly header: VerifiedToken["header"];
|
|
115
|
+
} | {
|
|
116
|
+
readonly ok: false;
|
|
117
|
+
readonly cause: IdTokenFailureCause;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Verifies an OpenID Connect ID token for a relying party (Core section
|
|
121
|
+
* 3.1.3.7): signature, `iss`, `aud`, `exp`, `iat`, `typ` `JWT` or absent,
|
|
122
|
+
* `azp` and, when `nonce` is given, `nonce`. It does not check `at_hash`,
|
|
123
|
+
* `c_hash`, `auth_time` or `acr`. Never throws.
|
|
124
|
+
*/
|
|
125
|
+
export declare function verifyIdToken(token: string, options: VerifyIdTokenOptions): Promise<VerifyIdTokenResult>;
|
|
126
|
+
//#endregion
|
|
85
127
|
//#region src/jwt/introspection.d.ts
|
|
86
128
|
export declare function subjectFromIntrospection(response: unknown, options?: JwtSubjectOptions): Subject<IntrospectionPrincipal>;
|
|
87
129
|
//#endregion
|
|
@@ -92,7 +134,43 @@ export declare function joseTokenSigner(options: JoseTokenSignerOptions): TokenS
|
|
|
92
134
|
export declare function subjectFromJwt(token: string | undefined | null, options: JwtSubjectOptions, request?: Request): Promise<Subject<JwtPrincipal>>;
|
|
93
135
|
export declare function jwtSubjectResolver(options: JwtSubjectOptions): (token: string | undefined | null, request?: Request) => Promise<MappedSubject>;
|
|
94
136
|
//#endregion
|
|
137
|
+
//#region src/jwt/subject-token.d.ts
|
|
138
|
+
/** `TokenFailureCause` plus the two checks `verifySubjectToken` adds; a `TokenVerifier` never returns them. */
|
|
139
|
+
type SubjectTokenFailureCause = TokenFailureCause | "replayed" | "lifetime-exceeded";
|
|
140
|
+
type VerifySubjectTokenOptions = {
|
|
141
|
+
/** Tried in order; the first that accepts the token wins. */
|
|
142
|
+
readonly verifiers: readonly TokenVerifier[];
|
|
143
|
+
readonly audience: string | readonly string[];
|
|
144
|
+
/** Records each `jti` once; `claim` when the store has it, else `seen` and `remember`. */
|
|
145
|
+
readonly replay: ReplayStore;
|
|
146
|
+
/** The largest `exp - iat`, in seconds; default 300. */
|
|
147
|
+
readonly maxLifetime?: number;
|
|
148
|
+
readonly clockTolerance?: number;
|
|
149
|
+
};
|
|
150
|
+
type SubjectTokenClaims = JwtClaims & {
|
|
151
|
+
readonly sub: string;
|
|
152
|
+
readonly jti: string;
|
|
153
|
+
readonly iat: number;
|
|
154
|
+
readonly exp: number;
|
|
155
|
+
};
|
|
156
|
+
type VerifySubjectTokenResult = {
|
|
157
|
+
readonly ok: true;
|
|
158
|
+
readonly claims: SubjectTokenClaims;
|
|
159
|
+
readonly header: VerifiedToken["header"];
|
|
160
|
+
} | {
|
|
161
|
+
readonly ok: false;
|
|
162
|
+
readonly cause: SubjectTokenFailureCause;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Verifies a subject token: an RFC 9068 `at+jwt` naming one subject for one
|
|
166
|
+
* request, such as the `PermDock-Subject` header. The first of `verifiers`
|
|
167
|
+
* that accepts it wins. The token must carry `sub`, `jti`, `iat` and `exp`,
|
|
168
|
+
* live at most `maxLifetime` seconds, and present its `jti` once. A replay
|
|
169
|
+
* store that throws refuses the token as `replayed`. Never throws.
|
|
170
|
+
*/
|
|
171
|
+
export declare function verifySubjectToken(token: string, options: VerifySubjectTokenOptions): Promise<VerifySubjectTokenResult>;
|
|
172
|
+
//#endregion
|
|
95
173
|
//#region src/jwt/verifier.d.ts
|
|
96
174
|
export declare function joseTokenVerifier(options: JoseTokenVerifierOptions): TokenVerifier;
|
|
97
175
|
//#endregion
|
|
98
|
-
export { type CapabilityFailureCause, type CapabilitySubjectOptions, type CiOidcPrincipal, type CiOidcProvider, type CiOidcSubjectOptions, type DiscoveryInput, type DpopProofOptions, type DpopProofResult, type IntrospectionPrincipal, type JoseTokenSignerOptions, type JoseTokenVerifierOptions, type JsonWebKeySet, type JwtAlgorithm, type JwtJwks, type JwtPrincipal, type JwtSubjectOptions, type ReplayStore, memoryReplayStore };
|
|
176
|
+
export { type CapabilityFailureCause, type CapabilitySubjectOptions, type CiOidcPrincipal, type CiOidcProvider, type CiOidcSubjectOptions, type DiscoveryInput, type DpopProofOptions, type DpopProofResult, type IdTokenClaims, type IdTokenFailureCause, type IntrospectionPrincipal, type JoseTokenSignerOptions, type JoseTokenVerifierOptions, type JsonWebKeySet, type JwtAlgorithm, type JwtJwks, type JwtPrincipal, type JwtSubjectOptions, type ReplayStore, type SubjectTokenClaims, type SubjectTokenFailureCause, type VerifyIdTokenOptions, type VerifyIdTokenResult, type VerifySubjectTokenOptions, type VerifySubjectTokenResult, memoryReplayStore };
|
package/dist/jwt/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import { n as freezeDeep } from "../freeze-CrU8nQeX.js";
|
|
|
3
3
|
import { o as epochSeconds, p as nowSeconds } from "../time-DkWjdL98.js";
|
|
4
4
|
import { n as sha256, t as bytesToBase64Url } from "../sha256-D9ihqmvd.js";
|
|
5
5
|
import { t as anonymousSubject } from "../subject-BGoM5o8B.js";
|
|
6
|
-
import { i as linkPolicyViolation, r as capabilitySubject, s as redeemerAllows, t as capabilityFromClaims } from "../capability-
|
|
6
|
+
import { i as linkPolicyViolation, r as capabilitySubject, s as redeemerAllows, t as capabilityFromClaims } from "../capability-L7NnfhiE.js";
|
|
7
7
|
import { a as verifierOptions, i as issuerFromDiscovery, n as assertSubjectConfig, o as decodeHeader, r as fail, s as normalizeTyp, t as joseTokenVerifier } from "../verifier-DHuh-okk.js";
|
|
8
8
|
import { t as loadJose } from "../load-jose-DZ4dnjri.js";
|
|
9
|
-
import { n as
|
|
9
|
+
import { i as validateCustomClaims, n as idTokenMismatch, r as mapClaimsToSubject, t as acceptMismatch } from "../map-claims-etGIS_Dv.js";
|
|
10
10
|
import { t as memoryReplayStore } from "../replay-Du1tJjG7.js";
|
|
11
11
|
//#region src/jwt/dpop.ts
|
|
12
12
|
const DPOP_WINDOW_SECONDS = 60;
|
|
@@ -124,7 +124,7 @@ function emit(options, reason, cause, token) {
|
|
|
124
124
|
requestId: options.requestId
|
|
125
125
|
}));
|
|
126
126
|
}
|
|
127
|
-
async function claimOnce(replay, key, expiresAt) {
|
|
127
|
+
async function claimOnce$1(replay, key, expiresAt) {
|
|
128
128
|
if (replay.claim !== void 0) return replay.claim(key, expiresAt);
|
|
129
129
|
if (await replay.seen(key)) return false;
|
|
130
130
|
await replay.remember(key, expiresAt);
|
|
@@ -136,7 +136,7 @@ async function stores(options, capability, issuedAt, once) {
|
|
|
136
136
|
if (policy !== void 0 && linkPolicyViolation(capability, policy, issuedAt) !== void 0) return "link-policy";
|
|
137
137
|
if (options.revoked !== void 0 && await options.revoked(capability.id)) return "capability-revoked";
|
|
138
138
|
const replay = options.replay;
|
|
139
|
-
if (once !== void 0 && (replay === void 0 || !await claimOnce(replay, once.key, once.expiresAt))) return "capability-replayed";
|
|
139
|
+
if (once !== void 0 && (replay === void 0 || !await claimOnce$1(replay, once.key, once.expiresAt))) return "capability-replayed";
|
|
140
140
|
return { ok: true };
|
|
141
141
|
} catch {
|
|
142
142
|
return {
|
|
@@ -318,6 +318,66 @@ async function subjectFromCiOidc(token, options) {
|
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
320
|
//#endregion
|
|
321
|
+
//#region src/jwt/id-token.ts
|
|
322
|
+
/**
|
|
323
|
+
* Verifies an OpenID Connect ID token for a relying party (Core section
|
|
324
|
+
* 3.1.3.7): signature, `iss`, `aud`, `exp`, `iat`, `typ` `JWT` or absent,
|
|
325
|
+
* `azp` and, when `nonce` is given, `nonce`. It does not check `at_hash`,
|
|
326
|
+
* `c_hash`, `auth_time` or `acr`. Never throws.
|
|
327
|
+
*/
|
|
328
|
+
async function verifyIdToken(token, options) {
|
|
329
|
+
const verifier = options.verifier ?? joseTokenVerifier(compact({
|
|
330
|
+
jwks: options.jwks,
|
|
331
|
+
issuer: options.issuer,
|
|
332
|
+
algorithms: options.algorithms
|
|
333
|
+
}));
|
|
334
|
+
let verified;
|
|
335
|
+
try {
|
|
336
|
+
verified = await verifier.verify(token, compact({
|
|
337
|
+
issuer: options.issuer,
|
|
338
|
+
audience: options.clientId,
|
|
339
|
+
clockTolerance: options.clockTolerance
|
|
340
|
+
}));
|
|
341
|
+
} catch {
|
|
342
|
+
return {
|
|
343
|
+
ok: false,
|
|
344
|
+
cause: "invalid-signature"
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
if (!verified.ok) return {
|
|
348
|
+
ok: false,
|
|
349
|
+
cause: verified.cause
|
|
350
|
+
};
|
|
351
|
+
const { claims, header } = verified;
|
|
352
|
+
if (idTokenMismatch(claims, header.typ, options.clientId)) return {
|
|
353
|
+
ok: false,
|
|
354
|
+
cause: "wrong-token-type"
|
|
355
|
+
};
|
|
356
|
+
const { iss, sub, iat } = claims;
|
|
357
|
+
if (iss !== options.issuer) return {
|
|
358
|
+
ok: false,
|
|
359
|
+
cause: "wrong-issuer"
|
|
360
|
+
};
|
|
361
|
+
if (typeof sub !== "string" || sub === "" || typeof iat !== "number") return {
|
|
362
|
+
ok: false,
|
|
363
|
+
cause: "malformed"
|
|
364
|
+
};
|
|
365
|
+
if (options.nonce !== void 0 && claims["nonce"] !== options.nonce) return {
|
|
366
|
+
ok: false,
|
|
367
|
+
cause: "nonce-mismatch"
|
|
368
|
+
};
|
|
369
|
+
return {
|
|
370
|
+
ok: true,
|
|
371
|
+
claims: {
|
|
372
|
+
...claims,
|
|
373
|
+
iss,
|
|
374
|
+
sub,
|
|
375
|
+
iat
|
|
376
|
+
},
|
|
377
|
+
header
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
//#endregion
|
|
321
381
|
//#region src/jwt/introspection.ts
|
|
322
382
|
function emitAuth$1(options, cause) {
|
|
323
383
|
if (options.onAuth === void 0) return;
|
|
@@ -608,4 +668,82 @@ async function resolveSubject(token, options, request) {
|
|
|
608
668
|
return extraMemberships(options, mapped.subject, mapped.subject.principal.tenant);
|
|
609
669
|
}
|
|
610
670
|
//#endregion
|
|
611
|
-
|
|
671
|
+
//#region src/jwt/subject-token.ts
|
|
672
|
+
const DEFAULT_MAX_LIFETIME = 300;
|
|
673
|
+
/** Causes a verifier for another issuer answers; a different cause names the token's real fault. */
|
|
674
|
+
const OTHER_ISSUER = /* @__PURE__ */ new Set(["wrong-issuer", "unknown-kid"]);
|
|
675
|
+
async function firstAccepted(token, options) {
|
|
676
|
+
const causes = [];
|
|
677
|
+
for (const verifier of options.verifiers) {
|
|
678
|
+
let verified;
|
|
679
|
+
try {
|
|
680
|
+
verified = await verifier.verify(token, {
|
|
681
|
+
typ: "at+jwt",
|
|
682
|
+
audience: options.audience,
|
|
683
|
+
...options.clockTolerance === void 0 ? {} : { clockTolerance: options.clockTolerance }
|
|
684
|
+
});
|
|
685
|
+
} catch {
|
|
686
|
+
causes.push("invalid-signature");
|
|
687
|
+
continue;
|
|
688
|
+
}
|
|
689
|
+
if (verified.ok) return verified;
|
|
690
|
+
causes.push(verified.cause);
|
|
691
|
+
}
|
|
692
|
+
return { cause: causes.find((cause) => !OTHER_ISSUER.has(cause)) ?? causes[0] ?? "invalid-signature" };
|
|
693
|
+
}
|
|
694
|
+
async function claimOnce(replay, key, expiresAt) {
|
|
695
|
+
try {
|
|
696
|
+
if (replay.claim !== void 0) return await replay.claim(key, expiresAt);
|
|
697
|
+
if (await replay.seen(key)) return false;
|
|
698
|
+
await replay.remember(key, expiresAt);
|
|
699
|
+
return true;
|
|
700
|
+
} catch {
|
|
701
|
+
return false;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Verifies a subject token: an RFC 9068 `at+jwt` naming one subject for one
|
|
706
|
+
* request, such as the `PermDock-Subject` header. The first of `verifiers`
|
|
707
|
+
* that accepts it wins. The token must carry `sub`, `jti`, `iat` and `exp`,
|
|
708
|
+
* live at most `maxLifetime` seconds, and present its `jti` once. A replay
|
|
709
|
+
* store that throws refuses the token as `replayed`. Never throws.
|
|
710
|
+
*/
|
|
711
|
+
async function verifySubjectToken(token, options) {
|
|
712
|
+
const verified = await firstAccepted(token, options);
|
|
713
|
+
if (!("ok" in verified)) return {
|
|
714
|
+
ok: false,
|
|
715
|
+
cause: verified.cause
|
|
716
|
+
};
|
|
717
|
+
if (normalizeTyp(verified.header.typ)?.toLowerCase() !== "at+jwt") return {
|
|
718
|
+
ok: false,
|
|
719
|
+
cause: "wrong-token-type"
|
|
720
|
+
};
|
|
721
|
+
const { claims } = verified;
|
|
722
|
+
const { sub, jti, iat, exp } = claims;
|
|
723
|
+
if (typeof sub !== "string" || sub === "" || typeof jti !== "string" || jti === "" || typeof iat !== "number" || typeof exp !== "number") return {
|
|
724
|
+
ok: false,
|
|
725
|
+
cause: "malformed"
|
|
726
|
+
};
|
|
727
|
+
if (exp - iat > (options.maxLifetime ?? DEFAULT_MAX_LIFETIME)) return {
|
|
728
|
+
ok: false,
|
|
729
|
+
cause: "lifetime-exceeded"
|
|
730
|
+
};
|
|
731
|
+
const key = `subject-token\n${claims.iss ?? ""}\n${jti}`;
|
|
732
|
+
if (!await claimOnce(options.replay, key, exp + (options.clockTolerance ?? 0))) return {
|
|
733
|
+
ok: false,
|
|
734
|
+
cause: "replayed"
|
|
735
|
+
};
|
|
736
|
+
return {
|
|
737
|
+
ok: true,
|
|
738
|
+
claims: {
|
|
739
|
+
...claims,
|
|
740
|
+
sub,
|
|
741
|
+
jti,
|
|
742
|
+
iat,
|
|
743
|
+
exp
|
|
744
|
+
},
|
|
745
|
+
header: verified.header
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
//#endregion
|
|
749
|
+
export { joseTokenSigner, joseTokenVerifier, jwtSubjectResolver, memoryReplayStore, subjectFromCapability, subjectFromCiOidc, subjectFromIntrospection, subjectFromJwt, verifyDpopProof, verifyIdToken, verifySubjectToken };
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as stepUpOf } from "./problem-details-cn5X30gZ.js";
|
|
3
|
+
import { t as describe } from "./describe-DZlnEtLy.js";
|
|
3
4
|
import { a as deniedMessage } from "./errors-BKy0EfhN.js";
|
|
4
|
-
import { t as actorMayCallTool } from "./delegation-
|
|
5
|
+
import { t as actorMayCallTool } from "./delegation-C5rOdTp5.js";
|
|
6
|
+
import { c as nowSeconds, r as isMembershipExpired } from "./tenancy-CmeBQ6Nv.js";
|
|
7
|
+
import { k as activate } from "./evaluate-B_oqFbWC.js";
|
|
5
8
|
import { n as resourceRef } from "./resource-ref-CaS9yVPi.js";
|
|
6
|
-
import {
|
|
7
|
-
import { l as
|
|
8
|
-
import {
|
|
9
|
+
import { n as delegationAllows } from "./where-scope-wq2coopv.js";
|
|
10
|
+
import { l as withApp } from "./permdock-BfWEeMqk.js";
|
|
11
|
+
import { l as storedApprovalToken, s as resumeDecision } from "./helpers-DY3vXuGs.js";
|
|
12
|
+
import { n as resolveOrNull } from "./build-instance-DxE7czo9.js";
|
|
9
13
|
import { n as tenantScope, t as actorFrom } from "./adapter-context-CRhqyzCk.js";
|
|
10
|
-
import { n as requestContext, t as buildReportingInstance } from "./request-context-
|
|
14
|
+
import { n as requestContext, t as buildReportingInstance } from "./request-context-BykKLmyE.js";
|
|
11
15
|
//#region src/agent/denied-text.ts
|
|
12
16
|
/** The hook's text, or `event.text` when there is no hook or it throws or returns no string. */
|
|
13
17
|
function refusalText(hook, event, report) {
|
|
@@ -35,6 +39,126 @@ function thrownReason(toolName) {
|
|
|
35
39
|
return `Denied: ${toolName} failed closed.`;
|
|
36
40
|
}
|
|
37
41
|
//#endregion
|
|
42
|
+
//#region src/agent/step-up.ts
|
|
43
|
+
/** Denials neither a fresh sign-in nor an activation can lift. */
|
|
44
|
+
const FINAL = /* @__PURE__ */ new Set([
|
|
45
|
+
"deny",
|
|
46
|
+
"validation",
|
|
47
|
+
"anonymous",
|
|
48
|
+
"not-delegated",
|
|
49
|
+
"no-delegation",
|
|
50
|
+
"agent-tool-not-delegated",
|
|
51
|
+
"approval",
|
|
52
|
+
"stale-approval"
|
|
53
|
+
]);
|
|
54
|
+
/** Activation denials the activation flow itself asks the user to fix. */
|
|
55
|
+
const ACTIVATION_ASKS = /* @__PURE__ */ new Set(["reason-required", "insufficient-user-authentication"]);
|
|
56
|
+
function elevated(membership, role) {
|
|
57
|
+
return compact({
|
|
58
|
+
scope: membership.scope,
|
|
59
|
+
id: membership.id,
|
|
60
|
+
within: membership.within,
|
|
61
|
+
roles: [role],
|
|
62
|
+
via: "elevated"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function activationFor(permdock, permission, data) {
|
|
66
|
+
const held = permdock.subject.principal?.memberships ?? [];
|
|
67
|
+
const now = nowSeconds();
|
|
68
|
+
for (const membership of held) {
|
|
69
|
+
const { scope, id } = membership;
|
|
70
|
+
if (scope === void 0 || id === void 0 || isMembershipExpired(membership, now)) continue;
|
|
71
|
+
for (const role of membership.eligible ?? []) {
|
|
72
|
+
const offered = activate(permdock, compact({
|
|
73
|
+
role,
|
|
74
|
+
scope,
|
|
75
|
+
id,
|
|
76
|
+
within: membership.within
|
|
77
|
+
}));
|
|
78
|
+
if (offered.outcome === "denied" && !offered.denials.every((denial) => ACTIVATION_ASKS.has(denial.reason))) continue;
|
|
79
|
+
const [decision] = permdock.simulate({ memberships: [...held, elevated({
|
|
80
|
+
...membership,
|
|
81
|
+
scope,
|
|
82
|
+
id
|
|
83
|
+
}, role)] }).simulate([[permission, data]]);
|
|
84
|
+
if (decision !== void 0 && decision.outcome !== "denied") return compact({
|
|
85
|
+
kind: "activation",
|
|
86
|
+
role,
|
|
87
|
+
scope,
|
|
88
|
+
id,
|
|
89
|
+
within: membership.within
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The step-up that could lift `decision`, or `undefined`. A denial with
|
|
96
|
+
* `insufficient-user-authentication` asks for a fresh sign-in when the
|
|
97
|
+
* delegation and the actor still cover the permission; any other
|
|
98
|
+
* denial asks for the first eligible role whose activation the simulated
|
|
99
|
+
* decision grants. A matched deny, a validation failure, an anonymous
|
|
100
|
+
* subject, a delegation that does not cover the call, an undelegated tool
|
|
101
|
+
* and a failed approval resume never step up.
|
|
102
|
+
*/
|
|
103
|
+
function stepUpFor(permdock, permission, data, decision) {
|
|
104
|
+
if (decision.outcome !== "denied" || decision.denials.length === 0 || decision.denials.some((denial) => FINAL.has(denial.reason))) return;
|
|
105
|
+
try {
|
|
106
|
+
if (decision.denials.some((denial) => denial.reason === "insufficient-user-authentication")) return delegationAllows(permdock, permission) ? {
|
|
107
|
+
kind: "authentication",
|
|
108
|
+
...stepUpOf(decision)
|
|
109
|
+
} : void 0;
|
|
110
|
+
return activationFor(permdock, permission, data);
|
|
111
|
+
} catch {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The subject's instance with every eligible role activated, for a tool
|
|
117
|
+
* listing that keeps tools an activation would open. `undefined` when the
|
|
118
|
+
* subject is eligible for nothing.
|
|
119
|
+
*/
|
|
120
|
+
function eligiblePreview(permdock) {
|
|
121
|
+
const held = permdock.subject.principal?.memberships ?? [];
|
|
122
|
+
const now = nowSeconds();
|
|
123
|
+
const activations = held.flatMap((membership) => {
|
|
124
|
+
const { scope, id } = membership;
|
|
125
|
+
return scope === void 0 || id === void 0 || isMembershipExpired(membership, now) ? [] : (membership.eligible ?? []).map((role) => elevated({
|
|
126
|
+
...membership,
|
|
127
|
+
scope,
|
|
128
|
+
id
|
|
129
|
+
}, role));
|
|
130
|
+
});
|
|
131
|
+
if (activations.length === 0) return;
|
|
132
|
+
try {
|
|
133
|
+
return permdock.simulate({ memberships: [...held, ...activations] });
|
|
134
|
+
} catch {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** The URL the user signs in again at, with the RFC 9470 `acr_values` and `max_age` added. */
|
|
139
|
+
function signInUrl(at, stepUp) {
|
|
140
|
+
let url;
|
|
141
|
+
try {
|
|
142
|
+
url = new URL(at);
|
|
143
|
+
} catch {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (stepUp.acrValues !== void 0 && stepUp.acrValues.length > 0) url.searchParams.set("acr_values", stepUp.acrValues.join(" "));
|
|
147
|
+
if (stepUp.maxAge !== void 0) url.searchParams.set("max_age", String(stepUp.maxAge));
|
|
148
|
+
return url.href;
|
|
149
|
+
}
|
|
150
|
+
/** The sentence the user reads on the step-up prompt. */
|
|
151
|
+
function stepUpText(stepUp, permission, at) {
|
|
152
|
+
switch (stepUp.kind) {
|
|
153
|
+
case "authentication": {
|
|
154
|
+
const url = at === void 0 ? void 0 : signInUrl(at, stepUp);
|
|
155
|
+
return url === void 0 ? `Sign in again to use ${permission.key}.` : `Sign in again to use ${permission.key}: ${url}`;
|
|
156
|
+
}
|
|
157
|
+
case "activation": return `Activate the ${stepUp.role} role on ${stepUp.scope} ${stepUp.id} to use ${permission.key}.`;
|
|
158
|
+
default: return stepUp;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
38
162
|
//#region src/agent/kernel.ts
|
|
39
163
|
/** The resume token an agent run carries under the namespaced `permdockApproval` key. */
|
|
40
164
|
function approvalTokenOf(context) {
|
|
@@ -210,12 +334,13 @@ function createAgentKernel(policy, given) {
|
|
|
210
334
|
token: decision.token,
|
|
211
335
|
summary: modelReason(decision, binding.permission, permdock.subject.principal?.id)
|
|
212
336
|
};
|
|
213
|
-
return {
|
|
337
|
+
return compact({
|
|
214
338
|
outcome: "denied",
|
|
215
339
|
decision,
|
|
216
340
|
permission: binding.permission,
|
|
217
|
-
reason: modelReason(decision, binding.permission, permdock.subject.principal?.id)
|
|
218
|
-
|
|
341
|
+
reason: modelReason(decision, binding.permission, permdock.subject.principal?.id),
|
|
342
|
+
stepUp: options.stepUp === true ? stepUpFor(permdock, binding.permission, data, decision) : void 0
|
|
343
|
+
});
|
|
219
344
|
};
|
|
220
345
|
const evaluate = async (binding, toolName, args, context, decideOptions = {}) => {
|
|
221
346
|
const checked = await check(binding, args, context, {
|
|
@@ -265,10 +390,11 @@ function createAgentKernel(policy, given) {
|
|
|
265
390
|
}, void 0));
|
|
266
391
|
return evaluate(binding, toolName, args, context, decideOptions);
|
|
267
392
|
};
|
|
268
|
-
const allowedToolNames = async (context) => {
|
|
393
|
+
const allowedToolNames = async (context, listOptions = {}) => {
|
|
269
394
|
const permdock = await instance(context);
|
|
395
|
+
const preview = listOptions.eligible === true ? eligiblePreview(permdock) : void 0;
|
|
270
396
|
const allowed = /* @__PURE__ */ new Set();
|
|
271
|
-
for (const [name, binding] of Object.entries(tools)) if (actorMayCallTool(permdock.subject.actor, name) && permdock.mayUse(binding.permission)) allowed.add(name);
|
|
397
|
+
for (const [name, binding] of Object.entries(tools)) if (actorMayCallTool(permdock.subject.actor, name) && (permdock.mayUse(binding.permission) || preview?.mayUse(binding.permission) === true)) allowed.add(name);
|
|
272
398
|
return allowed;
|
|
273
399
|
};
|
|
274
400
|
return {
|
|
@@ -282,4 +408,4 @@ function createAgentKernel(policy, given) {
|
|
|
282
408
|
};
|
|
283
409
|
}
|
|
284
410
|
//#endregion
|
|
285
|
-
export { createAgentKernel as n,
|
|
411
|
+
export { refusalText as i, createAgentKernel as n, stepUpText as r, approvalTokenOf as t };
|
package/dist/kysely/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Rt as Instant,
|
|
2
|
-
import {
|
|
1
|
+
import { Rt as Instant, lr as Subject, mr as Condition } from "../policy-types-B-F-qAZk.js";
|
|
2
|
+
import { u as WhereResult } from "../permdock-Dco6dyCK.js";
|
|
3
3
|
import { r as RelationsMapping } from "../graph-sql-B-dsAT6j.js";
|
|
4
|
-
import { s as MembershipsMapping } from "../compile-
|
|
4
|
+
import { s as MembershipsMapping } from "../compile-COM2VKuN.js";
|
|
5
5
|
import { n as WithSubjectOptions, t as RowCheck } from "../row-check-Dt35czLy.js";
|
|
6
6
|
//#region src/kysely/types.d.ts
|
|
7
7
|
type KyselySelectQuery = {
|
package/dist/kysely/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { t as assertSafeKey } from "../paths-DXSHAMIa.js";
|
|
3
|
-
import { n as escapeLike, t as compileWhere } from "../compile-
|
|
3
|
+
import { n as escapeLike, t as compileWhere } from "../compile-BAEO5bOk.js";
|
|
4
4
|
import { a as rowCheckFrom, i as templateOf, r as subjectStatements, s as loadPeer, t as statementTemplate } from "../subject-settings-CkEwrw3W.js";
|
|
5
5
|
//#region src/kysely/to-where.ts
|
|
6
6
|
function ident(name) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { a as loadModule, s as pickNamed } from "./load-DxroEzH1.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as listPermissions } from "./permission-registry-
|
|
2
|
-
import { a as describeError, n as CliError } from "./errors-
|
|
1
|
+
import { c as listPermissions } from "./permission-registry-DpPtSKNZ.js";
|
|
2
|
+
import { a as describeError, n as CliError } from "./errors-DpP_U6Bf.js";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { createJiti } from "jiti";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as defineLeaf } from "./command-L8EstFNm.js";
|
|
2
|
-
import { c as given } from "./flags-
|
|
2
|
+
import { c as given } from "./flags-aaeRAdiD.js";
|
|
3
3
|
//#region src/cli/commands/login.ts
|
|
4
4
|
const urlFlag = { url: {
|
|
5
5
|
type: "string",
|
|
@@ -27,7 +27,7 @@ const login = defineLeaf({
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
async run(ctx, { flags }) {
|
|
30
|
-
const { runLogin } = await import("./login-
|
|
30
|
+
const { runLogin } = await import("./login-WC9HPJpU.js");
|
|
31
31
|
return runLogin({
|
|
32
32
|
cwd: ctx.cwd,
|
|
33
33
|
url: given(flags.url),
|
|
@@ -43,7 +43,7 @@ const login = defineLeaf({
|
|
|
43
43
|
const logout = defineLeaf({
|
|
44
44
|
flags: { ...urlFlag },
|
|
45
45
|
async run(ctx, { flags }) {
|
|
46
|
-
const { runLogout } = await import("./login-
|
|
46
|
+
const { runLogout } = await import("./login-WC9HPJpU.js");
|
|
47
47
|
return runLogout({
|
|
48
48
|
url: given(flags.url),
|
|
49
49
|
json: ctx.json,
|
|
@@ -55,7 +55,7 @@ const logout = defineLeaf({
|
|
|
55
55
|
const whoami = defineLeaf({
|
|
56
56
|
flags: { ...urlFlag },
|
|
57
57
|
async run(ctx, { flags }) {
|
|
58
|
-
const { runWhoami } = await import("./login-
|
|
58
|
+
const { runWhoami } = await import("./login-WC9HPJpU.js");
|
|
59
59
|
return runWhoami({
|
|
60
60
|
url: given(flags.url),
|
|
61
61
|
json: ctx.json,
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { h as secondsAt, i as dateAt, s as instantAt } from "./time-DkWjdL98.js";
|
|
2
|
-
import { n as CliError } from "./errors-
|
|
2
|
+
import { n as CliError } from "./errors-DpP_U6Bf.js";
|
|
3
3
|
import { i as postForm, r as parseToken, s as runDeviceFlow } from "./device-BARQ8eYG.js";
|
|
4
4
|
import { i as writeCredentials, n as deleteCredentials, r as readCredentials, t as credentialsPath } from "./storage-C2bWdvJH.js";
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { n as randomToken, t as pkce } from "./pkce-5h8NgMQJ.js";
|
|
6
|
+
import { n as httpRequest } from "./http-Ca3Sr5x1.js";
|
|
7
|
+
import { c as READ_SCOPES, d as issuerMetadata, i as credentialsInsideRepository, l as cloudUrl, n as cliRuntime, r as credentialStorage, s as CLI_CLIENT_ID, t as CREDENTIAL_SERVICE } from "./auth-CscUX8Sy.js";
|
|
8
8
|
import { spawn } from "node:child_process";
|
|
9
9
|
import { createServer } from "node:http";
|
|
10
10
|
//#region src/cli/cloud/loopback.ts
|
|
11
11
|
/** How long the loopback listener waits for the browser to come back. */
|
|
12
12
|
const LOOPBACK_TIMEOUT_MS = 3e5;
|
|
13
|
-
function base64url(bytes) {
|
|
14
|
-
return bytes.toString("base64url");
|
|
15
|
-
}
|
|
16
13
|
function listen(server) {
|
|
17
14
|
return new Promise((resolve, reject) => {
|
|
18
15
|
server.once("error", reject);
|
|
@@ -28,9 +25,8 @@ function listen(server) {
|
|
|
28
25
|
* `state` that the callback must echo.
|
|
29
26
|
*/
|
|
30
27
|
async function runLoopbackFlow(options, runtime) {
|
|
31
|
-
const verifier =
|
|
32
|
-
const
|
|
33
|
-
const state = base64url(randomBytes(16));
|
|
28
|
+
const { verifier, challenge } = await pkce();
|
|
29
|
+
const state = randomToken(16);
|
|
34
30
|
const { promise: callback, resolve: settle } = Promise.withResolvers();
|
|
35
31
|
const server = createServer((request, response) => {
|
|
36
32
|
const url = new URL(request.url ?? "/", "http://127.0.0.1");
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { n as freezeDeep } from "./freeze-CrU8nQeX.js";
|
|
2
2
|
import { n as PermDockValidationError } from "./validation-error-ZfUHbKvf.js";
|
|
3
3
|
import { n as copyJson, t as checkSchema } from "./json-schema-B-vAwlde.js";
|
|
4
|
-
import { t as supabaseManifestSchema } from "./manifest-schema-
|
|
4
|
+
import { t as supabaseManifestSchema } from "./manifest-schema-Cv492Qev.js";
|
|
5
5
|
//#region src/supabase/manifest.ts
|
|
6
|
+
/** Whether the manifest describes a token hook. */
|
|
7
|
+
function hasTokenHook(manifest) {
|
|
8
|
+
return "hook" in manifest;
|
|
9
|
+
}
|
|
6
10
|
/**
|
|
7
11
|
* Reads a `permdock.manifest.json` document (parsed, or the JSON text) and
|
|
8
12
|
* validates it against `schemas/supabase-manifest-v1.json`. Returns a
|
|
@@ -39,4 +43,4 @@ function invalidManifest(issues) {
|
|
|
39
43
|
});
|
|
40
44
|
}
|
|
41
45
|
//#endregion
|
|
42
|
-
export { parseSupabaseManifest as t };
|
|
46
|
+
export { parseSupabaseManifest as n, hasTokenHook as t };
|