permdock 0.3.0 → 0.4.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/dist/a2a/index.d.ts +7 -5
- package/dist/a2a/index.js +14 -21
- package/dist/ai-sdk/index.d.ts +18 -6
- package/dist/ai-sdk/index.js +8 -5
- package/dist/app-data-CV8pqqMi.js +59 -0
- package/dist/approvals/index.d.ts +2 -2
- package/dist/approvals/index.js +3 -3
- package/dist/{approvals-DbYAuNkG.js → approvals-DZL76lKW.js} +35 -19
- package/dist/{approvers-DT4AVyIg.js → approvers-CqPOLD-o.js} +1 -1
- package/dist/{arazzo-BAgw9ap6.js → arazzo-C4BcskbX.js} +6 -5
- package/dist/{arazzo-CKwwqFWz.js → arazzo-CD8d0WLb.js} +2 -2
- package/dist/authzen/index.d.ts +3 -3
- package/dist/authzen/index.js +161 -23
- package/dist/better-auth/index.d.ts +2 -2
- package/dist/better-auth/index.js +6 -19
- package/dist/better-supabase/index.d.ts +112 -87
- package/dist/better-supabase/index.js +257 -156
- package/dist/{bind-C_ob3LKa.d.ts → bind-BzqG8SMb.d.ts} +16 -5
- package/dist/{bind-CuzGytRf.js → bind-kk-uyCwH.js} +14 -6
- package/dist/build-instance-DIIV9DbC.js +51 -0
- package/dist/{canonical-json-DemiK4Vp.js → canonical-json-CFKyFOke.js} +1 -3
- package/dist/{capability-2kYTMWDv.d.ts → capability-CksyCWDH.d.ts} +2 -2
- package/dist/{capability-4qPdO9gk.js → capability-txATtKV4.js} +3 -2
- package/dist/catalog/index.d.ts +1 -1
- package/dist/catalog/index.js +1 -1
- package/dist/catalog-6yWAX6Ps.js +2 -0
- package/dist/{catalog-dFZdWCGN.js → catalog-WHG4kBq7.js} +2 -2
- package/dist/{catalog-doc-DdGm82XT.js → catalog-doc-DWtg0gGR.js} +17 -10
- package/dist/{catalog-DWF5cYqB.js → catalog-tZUyOfOv.js} +4 -4
- package/dist/claude-agent/index.d.ts +4 -4
- package/dist/claude-agent/index.js +4 -5
- package/dist/clerk/index.d.ts +3 -3
- package/dist/clerk/index.js +8 -33
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +3 -3
- package/dist/cloud/index.d.ts +4 -4
- package/dist/cloud/index.js +9 -15
- package/dist/{cloud-CB_ELYuX.js → cloud-C7bSDgX4.js} +2 -2
- package/dist/{cloud-DWLXO2af.js → cloud-PeBN3IEn.js} +5 -5
- package/dist/{collect-DSTE3ml9.js → collect-2SrB7lfk.js} +6 -8
- package/dist/collect-Bw2Jdq1q.js +2 -0
- package/dist/{collect-DClJsheJ.js → collect-CQx4hX4N.js} +3 -3
- package/dist/{commands-DSxCqG9A.js → commands-Cpip4ULx.js} +13 -13
- package/dist/{compact-y6vfu2_f.js → compact-CAf557ZB.js} +11 -1
- package/dist/compile/index.d.ts +1 -1
- package/dist/compile/index.js +1 -1
- package/dist/{compile-Ba4blROR.js → compile-CcEu2ZQ1.js} +6 -5
- package/dist/{compile-BkRyBDBw.d.ts → compile-CtTP7eur.d.ts} +2 -2
- package/dist/{config-BJiM-xAm.js → config-BIjREpyE.js} +4 -4
- package/dist/{config-Dnszbv-6.js → config-DLt6BvV7.js} +2 -2
- package/dist/{config-report-DMvWKUxL.js → config-report--Xb9APJS.js} +5 -6
- package/dist/{connection-CU8MQxRi.js → connection-DUsczpB5.js} +3 -2
- package/dist/constants-DcJABbLW.js +20 -0
- package/dist/{context-Bcy85rGi.js → context-DieZVJXu.js} +16 -5
- package/dist/convex/index.d.ts +4 -4
- package/dist/convex/index.js +14 -16
- package/dist/create-BBO24vj6.js +324 -0
- package/dist/{credential-8P81ff4u.js → credential-kue0qpbm.js} +4 -4
- package/dist/deciding-columns-Sq12mEA6.js +123 -0
- package/dist/delegation-input-FTxMK3ji.js +19 -0
- package/dist/denied-text-DfRk15uw.d.ts +19 -0
- package/dist/{describe-DMYiCjJV.d.ts → describe-C3ldA9os.d.ts} +11 -2
- package/dist/{describe-B_gVZEVi.js → describe-Cgkp7eP0.js} +5 -4
- package/dist/{diff-DBIhz_f2.js → diff-Cnghh_Ip.js} +2 -2
- package/dist/{diff-2VaeChzX.js → diff-rpqoe7Ag.js} +9 -9
- package/dist/{doctor-BwCAMLx_.js → doctor-CuVJvhV_.js} +2 -2
- package/dist/doctor-owlv6ddh.js +2166 -0
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/drizzle/index.js +6 -14
- package/dist/elysia/index.d.ts +4 -4
- package/dist/elysia/index.js +7 -7
- package/dist/{errors-DPdqI50v.d.ts → errors-OD_4c__H.d.ts} +2 -2
- package/dist/{errors-Cz5zn0mW.js → errors-drnfxYtm.js} +3 -3
- package/dist/{evaluations-tz6D9A2G.js → evaluations-C9YJsv3H.js} +45 -7
- package/dist/eve/index.d.ts +5 -5
- package/dist/eve/index.js +5 -5
- package/dist/express/index.d.ts +4 -4
- package/dist/express/index.js +8 -7
- package/dist/fastify/index.d.ts +15 -5
- package/dist/fastify/index.js +9 -29
- package/dist/fields-fwfXN01n.js +1016 -0
- package/dist/{files-DWUN9PzI.js → files-D_JIzUrP.js} +12 -3
- package/dist/{fixtures-ht28Cplr.js → fixtures-h2eG2OZV.js} +5 -6
- package/dist/{from-snapshot-CTLijvdm.js → from-snapshot-7REQZe0H.js} +32 -22
- package/dist/{generate-CH7ThJ14.js → generate-CNU1pIOo.js} +1 -3
- package/dist/grantee-CXY-0C87.js +254 -0
- package/dist/grantee-conditions-MQs5NIuX.js +270 -0
- package/dist/grantee-match-fxYp9Nmt.js +141 -0
- package/dist/{helpers-H_KARDVC.js → helpers-C9YmyBIa.js} +7 -6
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +8 -8
- package/dist/hosted-CBHgkzDl.js +655 -0
- package/dist/{http-SO7qGttf.js → http-BBoKefeS.js} +35 -2
- package/dist/{http-BIhmLfCc.js → http-BEbdMZ05.js} +2 -24
- package/dist/{rls-import-BTFVk3jH.js → import-BFIlhetD.js} +86 -80
- package/dist/{openapi-import-cmwetbzw.js → import-UHk1N7vH.js} +6 -7
- package/dist/{index-C8z4RjQV.d.ts → index-BwMe94Xq.d.ts} +1 -1
- package/dist/{index-0nNqHspG.d.ts → index-DgM7w96K.d.ts} +2 -2
- package/dist/{index-C7Tw7MaW.d.ts → index-Dz7didpC.d.ts} +3 -3
- package/dist/{index-BNc7Wer_.d.ts → index-UdVQgq48.d.ts} +105 -38
- package/dist/index.d.ts +15 -13
- package/dist/index.js +22 -22
- package/dist/{instance-options-jARdwfPN.d.ts → instance-options-plkrsAog.d.ts} +1 -1
- package/dist/{json-schema-BsAflUGW.js → json-schema-DBkdUuCO.js} +1 -3
- package/dist/jwt/index.d.ts +4 -4
- package/dist/jwt/index.js +13 -13
- package/dist/{kernel-_RRHmnMY.js → kernel-CB3LrIJM.js} +81 -32
- package/dist/kysely/index.d.ts +2 -2
- package/dist/kysely/index.js +6 -14
- package/dist/{live-options-H2eG8dfJ.js → live-options-BaAFCIiu.js} +16 -3
- package/dist/load-B_shHrmd.js +2 -0
- package/dist/{load-DhWEB9P1.js → load-C3_oTHyO.js} +11 -3
- package/dist/{manifest-iaoBXHKc.js → manifest-BngWKryL.js} +5 -18
- package/dist/{map-claims-Z4QZOiFF.js → map-claims-AVlBaJoa.js} +7 -16
- package/dist/{map-error-pgUWNNtG.js → map-error-BE27PYkE.js} +5 -5
- package/dist/{markers-B0hYLvMD.js → markers-CiwAOZtO.js} +6 -2
- package/dist/{may-use-DndQ5tQ-.js → may-use-BOn_dR_w.js} +4 -3
- package/dist/mcp/index.d.ts +26 -9
- package/dist/mcp/index.js +456 -446
- package/dist/{rls-migrate-CN4TlJTO.js → migrate-BwlB5-Wk.js} +75 -15
- package/dist/nest/index.d.ts +4 -4
- package/dist/nest/index.js +11 -12
- package/dist/next/index.d.ts +31 -8
- package/dist/next/index.js +29 -33
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +1 -1
- package/dist/node/index.d.ts +4 -4
- package/dist/node/index.js +4 -4
- package/dist/ocsf-uYFXGVw2.js +115 -0
- package/dist/openai/index.d.ts +5 -5
- package/dist/openai/index.js +4 -4
- package/dist/openapi/index.d.ts +3 -3
- package/dist/openapi/index.js +1 -1
- package/dist/{openapi-CqqEbHsL.js → openapi-BJdBmYDG.js} +19 -23
- package/dist/{openapi-BqRBvAng.js → openapi-DBzHQbov.js} +2 -5
- package/dist/{openapi-l0xYHkcv.js → openapi-DcQ1Kg40.js} +3 -3
- package/dist/orpc/index.d.ts +5 -5
- package/dist/orpc/index.js +9 -11
- package/dist/otel/index.d.ts +2 -2
- package/dist/otel/index.js +26 -23
- package/dist/output-files-CgIsvdSa.js +140 -0
- package/dist/{rls-ownership-RuFqaqGz.js → ownership-BgnbOJFT.js} +387 -379
- package/dist/{package-root-zGkxO3oN.js → package-root-DtNnpmUd.js} +3 -2
- package/dist/{parse-BuyjxhZV.js → parse-CVFQHk6c.js} +3 -3
- package/dist/{parse-local-manifest-BrMozJCo.js → parse-local-manifest-C-q02Pal.js} +2 -4
- package/dist/{parse-local-manifest-JLnaBH0S.d.ts → parse-local-manifest-DvYUR0QL.d.ts} +1 -1
- package/dist/pdp/index.d.ts +2 -2
- package/dist/pdp/index.js +8 -9
- package/dist/{permdock-CbgvLnuo.js → permdock-L26udHSk.js} +1387 -1220
- package/dist/{rls-fields-74oZPXWL.js → permission-keys-B26jeyUv.js} +1289 -2066
- package/dist/permission-registry-BsblpB-z.js +385 -0
- package/dist/{permissions-DttnqqxC.d.ts → permission-types-Dg39z9Kv.d.ts} +59 -31
- package/dist/{permissions-RJrovw98.js → permissions-CCJ6lmxB.js} +3 -3
- package/dist/{permissions-CDgvKG5L.d.ts → permissions-COH-KRgT.d.ts} +2 -2
- package/dist/{policy-IB6yxpC3.d.ts → policy-types-sp9P1iIV.d.ts} +661 -582
- package/dist/{policy-D2W7uv19.d.ts → policy-ur0BBK_e.d.ts} +2 -2
- package/dist/{powersync-DliZK_-y.js → powersync-BFSbSElQ.js} +2 -2
- package/dist/powersync-DCDgZgfZ.js +2 -0
- package/dist/{powersync-BylawD_U.js → powersync-cZe4kzhL.js} +26 -27
- package/dist/prisma/index.d.ts +1 -1
- package/dist/prisma/index.js +6 -12
- package/dist/{problem-B43ztKIm.js → problem-CnWraVhC.js} +8 -7
- package/dist/{problem-details-_AMOYz-w.js → problem-details-DECUnXAn.js} +2 -2
- package/dist/{problem-details-DX075l9V.d.ts → problem-details-rIIo8B2C.d.ts} +1 -1
- package/dist/{protected-BdnIEFkY.d.ts → protected-B3_P7xuw.d.ts} +9 -6
- package/dist/{protected-utU-SLuy.js → protected-BN7BUdY1.js} +20 -8
- package/dist/{provider-CSQd7m92.js → provider-Bi-0HNL3.js} +23 -10
- package/dist/{provider-DZY281jO.d.ts → provider-kwHC9CZD.d.ts} +1 -1
- package/dist/{provider-store-Cfbvo4DE.js → provider-store-Ctt-81Ni.js} +6 -3
- package/dist/react/index.d.ts +7 -7
- package/dist/react/index.js +5 -5
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +20 -11
- package/dist/react-native/index.js +33 -17
- package/dist/{refs-KYb4ntaz.js → refs-f3imMjNW.js} +1 -1
- package/dist/relation-walk-BXnlLtg2.js +186 -0
- package/dist/relations-CvmSpG67.js +163 -0
- package/dist/{replay-CYyiLiwO.d.ts → replay-COpmZUfx.d.ts} +1 -1
- package/dist/request-context-BVM7aWNs.js +71 -0
- package/dist/request-context-C2_1lchh.d.ts +5 -0
- package/dist/resource-relations-D1Un3pcz.js +243 -0
- package/dist/retire-BFcxL6un.js +240 -0
- package/dist/{rls-B4ur8nKQ.js → rls-55DQTuf5.js} +14 -2
- package/dist/{rls-DQtdgTHB.js → rls-BEktUaqg.js} +884 -484
- package/dist/{policy-xyWg7QdR.js → role-builder-B4GbKM-i.js} +235 -541
- package/dist/{rpc-DL9Sqvb1.js → rpc-nYC3cR_u.js} +15 -5
- package/dist/{run-DKDbM4Du.js → run-DMcNW_8T.js} +3 -3
- package/dist/{runtime-CB8gQFvS.js → runtime-D_tMXnsq.js} +1 -1
- package/dist/{saas-DhpJjnBA.js → saas-DtaA4JuW.js} +9 -8
- package/dist/{openapi-schema--ARjyfQr.js → schema-Bol6gqXA.js} +3 -5
- package/dist/{schema-D3MnDMxa.js → schema-DjQBcAP9.js} +4 -2
- package/dist/scim/index.d.ts +1 -1
- package/dist/scim/index.js +1 -1
- package/dist/{scim-BFGBBAqR.js → scim-vFR1O5oG.js} +6 -12
- package/dist/{scopes-CVdPrWN-.js → scopes-tvpa34ep.js} +10 -2
- package/dist/server/index.d.ts +18 -8
- package/dist/server/index.js +8 -8
- package/dist/{server-DlZ28Oz5.js → server-ZYEHtNHS.js} +4 -4
- package/dist/{create-B1d519XK.d.ts → server-types-DdqBwZN_.d.ts} +69 -33
- package/dist/shared-1uhI-e-b.js +294 -0
- package/dist/{shared-DRu8VFVM.js → shared-JhMeOsDF.js} +1 -1
- package/dist/{sink-Bd9PSyfq.js → sink-BTtmfPnE.js} +1 -1
- package/dist/{sink-B1fZzIMf.d.ts → sink-CPN4zLfs.d.ts} +1 -1
- package/dist/{skills-Biq5uup3.js → skills-BZdRQkxs.js} +4 -3
- package/dist/{skills-Bx-U0irG.js → skills-Dle4ZoLF.js} +2 -2
- package/dist/{snapshot-Enxd0n-s.js → snapshot-Dc9CHPME.js} +116 -13
- package/dist/{snapshot-cache-D6jLelln.js → snapshot-cache-Cod40D-X.js} +1 -1
- package/dist/{snapshot-cache-B-LxUahj.d.ts → snapshot-cache-J5T7t_vD.d.ts} +1 -1
- package/dist/solid/index.d.ts +22 -22
- package/dist/solid/index.js +40 -10
- package/dist/{sources-4p0-4xQm.js → sources-B1-b-R0t.js} +25 -26
- package/dist/{sources-BdOYLw9j.d.ts → sources-Dljy06zL.d.ts} +6 -2
- package/dist/{sql-xdg5f4Fi.js → sql-t8teWOfo.js} +19 -3
- package/dist/{src-BDwEZWrZ.js → src-Bb7no-hS.js} +194 -123
- package/dist/ssf/index.d.ts +3 -3
- package/dist/ssf/index.js +58 -61
- package/dist/store-9KO4BlkB.d.ts +147 -0
- package/dist/{store-DMAWwAJV.js → store-ILkLUj_o.js} +4 -4
- package/dist/{store-options-ByhZq1jV.js → store-options-CbUHDoSe.js} +16 -7
- package/dist/{stores-BT2pSCub.js → stores-BHXdSbw9.js} +7 -3
- package/dist/stores-Cxz_80g-.d.ts +31 -0
- package/dist/{stream-DDpvynSB.js → stream-BMui98KK.js} +2 -1
- package/dist/{stream-D1RXubw2.d.ts → stream-Dwsg6WwE.d.ts} +2 -2
- package/dist/{subject-settings-BwBmCdTR.js → subject-settings-CkEwrw3W.js} +23 -5
- package/dist/supabase/index.d.ts +4 -4
- package/dist/supabase/index.js +3 -3
- package/dist/supabase/middleware.d.ts +11 -5
- package/dist/supabase/middleware.js +10 -7
- package/dist/{supabase-C0qESOa-.js → supabase-C1TWlnYt.js} +36 -52
- package/dist/{supabase-Boqb9a_Y.js → supabase-Dbqr141s.js} +2 -2
- package/dist/supabase-hook-BULg7Ut_.js +2 -0
- package/dist/{supabase-hook-CSLQ4zJ3.js → supabase-hook-Cva3ikXz.js} +731 -782
- package/dist/{supautils-Cn4R4cJ4.js → supautils-B6HYL9eL.js} +2 -2
- package/dist/svelte/Protected.svelte +9 -2
- package/dist/svelte/index.d.ts +6 -6
- package/dist/svelte/index.js +25 -11
- package/dist/svelte/runtime.d.ts +10 -3
- package/dist/svelte/runtime.js +4 -3
- package/dist/svelte/source.d.ts +6 -6
- package/dist/svelte/source.js +4 -4
- package/dist/{validity-uOp8UpYn.js → tenancy-DshjqY0n.js} +3 -39
- package/dist/terminal/index.d.ts +5 -5
- package/dist/terminal/index.js +18 -34
- package/dist/testing/index.d.ts +89 -77
- package/dist/testing/index.js +1276 -1262
- package/dist/testing/saas/index.d.ts +4 -4
- 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/thenable-QSmvt-vZ.js +65 -0
- package/dist/{token-CIWxJOCh.js → token-Bx9qy30p.js} +1 -1
- package/dist/tool-refusal-CQ7OEia9.js +41 -0
- package/dist/trpc/index.d.ts +5 -5
- package/dist/trpc/index.js +7 -8
- package/dist/{types-DbjRN55U.d.ts → types-7rJVLWe5.d.ts} +82 -4
- package/dist/{types-aqOHTHcp.d.ts → types-Br9IXUBG.d.ts} +1 -1
- package/dist/types-ByUo56un.d.ts +88 -0
- package/dist/{types-Cq_H8N_X.d.ts → types-C0dee0Qf.d.ts} +2 -2
- package/dist/{types-DxiCGmmd.d.ts → types-CIlTojhq.d.ts} +2 -2
- package/dist/{types-QCuYJh4q.d.ts → types-CUcFZfpU.d.ts} +1 -1
- package/dist/{types-C97IskBw.d.ts → types-CqrjB9o6.d.ts} +1 -1
- package/dist/{types-BnIEz1sU.d.ts → types-DHrmBJLH.d.ts} +24 -6
- package/dist/{types-Dnemwd77.d.ts → types-DpWfQdSh.d.ts} +5 -1
- package/dist/{types-Bvc4oWT6.d.ts → types-DvupZE0w.d.ts} +1 -1
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-GTixvDDU.js → usage-4G6t643F.js} +2 -2
- package/dist/{usage-ItS7nLcl.js → usage-CG9nOYZw.js} +7 -7
- package/dist/usage-iFLJ0-rr.js +2 -0
- package/dist/{validation-error-Ba264OaJ.d.ts → validation-error-BSSw0l_8.d.ts} +1 -1
- package/dist/{validation-error-CnjZ4t92.js → validation-error-ZfUHbKvf.js} +1 -1
- package/dist/validity-dVrUEPJt.js +62 -0
- package/dist/{verifier-BxBo6I44.js → verifier-DMr_Zmb_.js} +51 -15
- package/dist/{rls-verify-CVQTHTh5.js → verify-BztUB3GX.js} +668 -239
- package/dist/{version-BvacVTZR.js → version-BEogC-rB.js} +1 -1
- package/dist/{views-Soe7bGSC.js → views-CJsrBS1f.js} +23 -1
- package/dist/{vocabulary-DA8a8zif.d.ts → vocabulary-hhEFLFoL.d.ts} +15 -6
- package/dist/vue/index.d.ts +24 -19
- package/dist/vue/index.js +24 -8
- package/dist/watch-C8TpsAl4.js +2 -0
- package/dist/{watch-DVBJ9cBq.js → watch-zeucB7eF.js} +6 -6
- package/dist/webmcp/index.d.ts +2 -2
- package/dist/webmcp/index.js +13 -37
- package/dist/wrap-Cr93qqdP.d.ts +14 -0
- package/dist/wrap-DWsU_5Bd.js +26 -0
- package/package.json +8 -8
- package/schemas/catalog-v1.json +6 -0
- package/skills/permdock-credentials/SKILL.md +1 -1
- package/skills/permdock-credentials/references/tokens-keys-links.md +7 -2
- package/skills/permdock-data/references/queries-and-rls.md +4 -0
- package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +1 -0
- package/skills/permdock-wire/SKILL.md +2 -2
- package/skills/permdock-wire/references/adapters.md +9 -1
- package/skills/permdock-wire/references/policy-options.md +10 -1
- package/dist/catalog-CRW5Mx_B.js +0 -2
- package/dist/collect-DSWOk19R.js +0 -2
- package/dist/create-CMwIl-w2.js +0 -253
- package/dist/delegation-D8pUEuce.js +0 -103
- package/dist/doctor-collect-CHk6XWOA.js +0 -665
- package/dist/doctor-igIiM_Hl.js +0 -1194
- package/dist/evaluation-items-CfCCejQd.js +0 -40
- package/dist/fields-BMl1RxoX.js +0 -26
- package/dist/grantee-Cv5Sogfv.js +0 -602
- package/dist/hosted-DJQw46hn.js +0 -266
- package/dist/instance-options-Dhhcnm3y.js +0 -22
- package/dist/load-DwJUafYN.js +0 -2
- package/dist/map-AcxK9o_D.js +0 -147
- package/dist/permissions-DVoF6dMt.js +0 -662
- package/dist/powersync-e_AZrKbg.js +0 -2
- package/dist/protected-xAr24FEC.d.ts +0 -40
- package/dist/relations-cjOL01hZ.js +0 -505
- package/dist/rls-graph-CHwx0V8q.js +0 -435
- package/dist/rls-shared-Cewd_-zI.js +0 -495
- package/dist/store-jOBYpiXC.d.ts +0 -36
- package/dist/stores-C0IMQrGI.d.ts +0 -52
- package/dist/supabase-config-BpPXt3x1.js +0 -472
- package/dist/supabase-hook-6sYLXg_u.js +0 -2
- package/dist/thenable-okc2xDsj.js +0 -10
- package/dist/types-CKNSyIf_.d.ts +0 -52
- package/dist/usage-DorAJiU_.js +0 -2
- package/dist/watch-BwxLTYMZ.js +0 -2
package/dist/drizzle/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { It as WhereResult, jr as Condition, kr as Subject } from "../policy-types-sp9P1iIV.js";
|
|
2
2
|
import { r as RelationsMapping } from "../graph-sql-B-dsAT6j.js";
|
|
3
|
-
import { s as MembershipsMapping } from "../compile-
|
|
3
|
+
import { s as MembershipsMapping } from "../compile-CtTP7eur.js";
|
|
4
4
|
import { n as WithSubjectOptions, t as RowCheck } from "../row-check-Dt35czLy.js";
|
|
5
5
|
import { SQL, Table } from "drizzle-orm";
|
|
6
6
|
//#region src/drizzle/types.d.ts
|
package/dist/drizzle/index.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { t as compact } from "../compact-
|
|
2
|
-
import {
|
|
3
|
-
import { n as escapeLike, t as compileWhere } from "../compile-
|
|
4
|
-
import {
|
|
1
|
+
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
|
+
import { a as assertSafeKey } from "../thenable-QSmvt-vZ.js";
|
|
3
|
+
import { n as escapeLike, t as compileWhere } from "../compile-CcEu2ZQ1.js";
|
|
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/drizzle/to-where.ts
|
|
6
6
|
function loadOperators(injected) {
|
|
7
7
|
if (injected !== void 0) return injected;
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
if (loader === void 0) throw new Error("no module loader");
|
|
11
|
-
return loader.createRequire(import.meta.url)("drizzle-orm");
|
|
12
|
-
} catch {
|
|
13
|
-
throw new Error("PermDock: permdock/drizzle requires the drizzle-orm peer; pass `operators` on runtimes without require");
|
|
14
|
-
}
|
|
8
|
+
return loadPeer("drizzle-orm", "PermDock: permdock/drizzle requires the drizzle-orm peer; pass `operators` on runtimes without require");
|
|
15
9
|
}
|
|
16
10
|
function ident(name) {
|
|
17
11
|
assertSafeKey(name, "sql identifier");
|
|
@@ -38,9 +32,7 @@ function tagged(parts, ops) {
|
|
|
38
32
|
values.push(part.value);
|
|
39
33
|
strings.push("");
|
|
40
34
|
}
|
|
41
|
-
|
|
42
|
-
Object.defineProperty(template, "raw", { value: strings });
|
|
43
|
-
return ops.sql(template, ...values);
|
|
35
|
+
return ops.sql(templateOf(strings), ...values);
|
|
44
36
|
}
|
|
45
37
|
function existsSql(node, table, options, ops) {
|
|
46
38
|
const m = (name) => `m.${ident(name)}`;
|
package/dist/elysia/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { E as Policy, Or as Principal, j as PolicyVocabulary, jt as PermDock } from "../policy-types-sp9P1iIV.js";
|
|
2
|
+
import { d as Permission } from "../permission-types-Dg39z9Kv.js";
|
|
3
3
|
import { n as RevocationFeed } from "../revocations-Cy06JNx2.js";
|
|
4
|
-
import { A as ConnectionOptions,
|
|
5
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
4
|
+
import { A as ConnectionOptions, C as verifyWebBotAuth, O as Connection, b as discoverViaSignatureAgent, i as OpenApiHooks, m as InvalidSignatureError, o as ProtectOptions } from "../server-types-DdqBwZN_.js";
|
|
5
|
+
import { t as ServerAdapterOptions } from "../bind-BzqG8SMb.js";
|
|
6
6
|
import { Elysia } from "elysia";
|
|
7
7
|
//#region src/elysia/create.d.ts
|
|
8
8
|
type ElysiaCtx = {
|
package/dist/elysia/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as discoverViaSignatureAgent, r as InvalidSignatureError, s as verifyWebBotAuth } from "../evaluations-
|
|
3
|
-
import { t as problemFromError } from "../map-error-
|
|
4
|
-
import { a as socketConnection, i as decorate, r as bindKernel } from "../bind-
|
|
5
|
-
import { i as onRevoked, t as POLICY_VIOLATION } from "../stream-
|
|
1
|
+
import { a as parsedBody, r as hasCredentials } from "../http-BBoKefeS.js";
|
|
2
|
+
import { i as discoverViaSignatureAgent, r as InvalidSignatureError, s as verifyWebBotAuth } from "../evaluations-C9YJsv3H.js";
|
|
3
|
+
import { t as problemFromError } from "../map-error-BE27PYkE.js";
|
|
4
|
+
import { a as socketConnection, i as decorate, r as bindKernel } from "../bind-kk-uyCwH.js";
|
|
5
|
+
import { i as onRevoked, t as POLICY_VIOLATION } from "../stream-BMui98KK.js";
|
|
6
6
|
import { Elysia } from "elysia";
|
|
7
7
|
//#region src/elysia/create.ts
|
|
8
8
|
function createPermDock(policy, options) {
|
|
9
9
|
const seed = globalThis.crypto.randomUUID();
|
|
10
|
-
const { kernel, bind, scopeOf, handlerScope } = bindKernel(policy, options, "elysia", toRequest);
|
|
10
|
+
const { kernel, bind, scopeOf, handlerScope, guard: runGuard } = bindKernel(policy, options, "elysia", toRequest);
|
|
11
11
|
const permdock = () => new Elysia({
|
|
12
12
|
name: "permdock",
|
|
13
13
|
seed
|
|
@@ -17,7 +17,7 @@ function createPermDock(policy, options) {
|
|
|
17
17
|
return { permdock: instance };
|
|
18
18
|
}).onError({ as: "global" }, ({ error, request }) => problemFromError(error, { credentials: hasCredentials(request) }));
|
|
19
19
|
const protect = (permission, loadData, protectOptions) => async (ctx) => {
|
|
20
|
-
const guard = await
|
|
20
|
+
const guard = await runGuard(permission, loadData, ctx, protectOptions);
|
|
21
21
|
if (!guard.ok) return guard.response;
|
|
22
22
|
decorate(ctx, guard.permdock, guard.data);
|
|
23
23
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Disclosure } from "./problem-details-
|
|
1
|
+
import { En as WireDenial, ir as Decision, kr as Subject } from "./policy-types-sp9P1iIV.js";
|
|
2
|
+
import { t as Disclosure } from "./problem-details-rIIo8B2C.js";
|
|
3
3
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
4
|
//#region src/core/errors.d.ts
|
|
5
5
|
/** Where and how a human approves; carries no secret. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as compact } from "./compact-
|
|
2
|
-
import { t as PROBLEM_BASE } from "./validation-error-
|
|
3
|
-
import { a as wireDenials, n as problemDetails } from "./problem-details-
|
|
1
|
+
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { t as PROBLEM_BASE } from "./validation-error-ZfUHbKvf.js";
|
|
3
|
+
import { a as wireDenials, n as problemDetails } from "./problem-details-DECUnXAn.js";
|
|
4
4
|
import { n as deniedDigest, t as approvalDigest } from "./digest-BI-6aa6d.js";
|
|
5
5
|
//#region src/core/errors.ts
|
|
6
6
|
var PermDockDeniedError = class extends Error {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as compact } from "./compact-
|
|
2
|
-
import { t as PROBLEM_BASE } from "./validation-error-
|
|
3
|
-
import { a as wireDenials } from "./problem-details-
|
|
1
|
+
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { t as PROBLEM_BASE } from "./validation-error-ZfUHbKvf.js";
|
|
3
|
+
import { a as wireDenials } from "./problem-details-DECUnXAn.js";
|
|
4
|
+
import { c as listPermissions, g as formerScopes, h as formerKeys } from "./permission-registry-BsblpB-z.js";
|
|
4
5
|
import { n as resourceRef } from "./resource-ref-CaS9yVPi.js";
|
|
5
|
-
import {
|
|
6
|
-
import { i as readApprovalHeader, s as resumeDecision } from "./helpers-
|
|
6
|
+
import { c as problemResponse, d as validationProblem, n as batchTooLarge } from "./problem-CnWraVhC.js";
|
|
7
|
+
import { i as readApprovalHeader, s as resumeDecision } from "./helpers-C9YmyBIa.js";
|
|
7
8
|
import { t as timeoutSignal } from "./timeout-D51niuQP.js";
|
|
8
|
-
import { n as permissionLookup, t as itemResourceData } from "./evaluation-items-CfCCejQd.js";
|
|
9
9
|
//#region src/core/decision.ts
|
|
10
10
|
/** The denial for a check that failed or named no declared permission. */
|
|
11
11
|
const NO_GRANT = Object.freeze({
|
|
@@ -17,6 +17,44 @@ const NO_GRANT = Object.freeze({
|
|
|
17
17
|
alternatives: Object.freeze([])
|
|
18
18
|
});
|
|
19
19
|
//#endregion
|
|
20
|
+
//#region src/server/evaluation-items.ts
|
|
21
|
+
function firstWins(map, name, leaf) {
|
|
22
|
+
if (!map.has(name)) map.set(name, leaf);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Indexes `tree` once. The lookup tries `action` as a permission key or
|
|
26
|
+
* scope, then `<resource.type>.<action>`, then the leaf with that resource
|
|
27
|
+
* and action; current names win over former ones and earlier leaves over
|
|
28
|
+
* later ones. Anything else is `undefined`, which the caller denies.
|
|
29
|
+
*/
|
|
30
|
+
function permissionLookup(tree) {
|
|
31
|
+
const current = /* @__PURE__ */ new Map();
|
|
32
|
+
const former = /* @__PURE__ */ new Map();
|
|
33
|
+
const byPair = /* @__PURE__ */ new Map();
|
|
34
|
+
for (const leaf of listPermissions(tree)) {
|
|
35
|
+
firstWins(current, leaf.key, leaf);
|
|
36
|
+
firstWins(current, leaf.scope, leaf);
|
|
37
|
+
for (const name of [...formerKeys(leaf), ...formerScopes(leaf)]) firstWins(former, name, leaf);
|
|
38
|
+
firstWins(byPair, `${leaf.resource}\u0000${leaf.action}`, leaf);
|
|
39
|
+
}
|
|
40
|
+
const named = (name) => current.get(name) ?? former.get(name);
|
|
41
|
+
return (action, resource) => {
|
|
42
|
+
if (action === void 0) return;
|
|
43
|
+
const byKey = named(action);
|
|
44
|
+
if (byKey !== void 0) return byKey;
|
|
45
|
+
const type = typeof resource?.type === "string" ? resource.type : void 0;
|
|
46
|
+
if (type === void 0) return;
|
|
47
|
+
return named(`${type}.${action}`) ?? byPair.get(`${type}\u0000${action}`);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** The row an item's resource describes: its `properties`, else `{ id }`. */
|
|
51
|
+
function itemResourceData(resource) {
|
|
52
|
+
const properties = resource?.properties;
|
|
53
|
+
if (properties !== null && typeof properties === "object") return properties;
|
|
54
|
+
const id = resource?.id;
|
|
55
|
+
if (typeof id === "string" || typeof id === "number") return { id: String(id) };
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
20
58
|
//#region src/server/web-bot-auth.ts
|
|
21
59
|
/** Milliseconds a key directory fetch may take before the signature counts as unverifiable. */
|
|
22
60
|
const DIRECTORY_TIMEOUT_MS = 5e3;
|
|
@@ -458,4 +496,4 @@ function createEvaluationsHandler(options) {
|
|
|
458
496
|
};
|
|
459
497
|
}
|
|
460
498
|
//#endregion
|
|
461
|
-
export { invalidSignatureProblem as a,
|
|
499
|
+
export { invalidSignatureProblem as a, itemResourceData as c, discoverViaSignatureAgent as i, permissionLookup as l, createEvaluationsHandler as n, invalidSignatureResponse as o, InvalidSignatureError as r, verifyWebBotAuth as s, applyApprovalResume as t, NO_GRANT as u };
|
package/dist/eve/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { c as ApprovalRequest, f as ApprovalStore } from "../types-
|
|
4
|
-
import { t as InstanceOptions } from "../instance-options-
|
|
5
|
-
import { t as ToolMap } from "../types-
|
|
1
|
+
import { E as Policy, Or as Principal, j as PolicyVocabulary, jt as PermDock, wr as Delegation } from "../policy-types-sp9P1iIV.js";
|
|
2
|
+
import { d as Permission } from "../permission-types-Dg39z9Kv.js";
|
|
3
|
+
import { c as ApprovalRequest, f as ApprovalStore } from "../types-Br9IXUBG.js";
|
|
4
|
+
import { t as InstanceOptions } from "../instance-options-plkrsAog.js";
|
|
5
|
+
import { t as ToolMap } from "../types-DvupZE0w.js";
|
|
6
6
|
//#region src/eve/create.d.ts
|
|
7
7
|
/** Structural `SessionAuthContext` from `eve`. */
|
|
8
8
|
type EvePrincipal = {
|
package/dist/eve/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as compact } from "../compact-
|
|
1
|
+
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { n as isApprovalError } from "../errors-DRnGZHzF.js";
|
|
3
|
-
import { r as memoryApprovalStore } from "../store-
|
|
4
|
-
import { o as resolveApproval } from "../helpers-
|
|
5
|
-
import {
|
|
6
|
-
import { n as createAgentKernel } from "../kernel-
|
|
3
|
+
import { r as memoryApprovalStore } from "../store-ILkLUj_o.js";
|
|
4
|
+
import { o as resolveApproval } from "../helpers-C9YmyBIa.js";
|
|
5
|
+
import { r as instanceOptions } from "../build-instance-DIIV9DbC.js";
|
|
6
|
+
import { n as createAgentKernel } from "../kernel-CB3LrIJM.js";
|
|
7
7
|
import { t as boundedMap } from "../lru-8q4WZjBV.js";
|
|
8
8
|
//#region src/eve/create.ts
|
|
9
9
|
const TOKENS_PER_PROCESS = 1e3;
|
package/dist/express/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
1
|
+
import { E as Policy, Or as Principal, j as PolicyVocabulary, jt as PermDock } from "../policy-types-sp9P1iIV.js";
|
|
2
|
+
import { d as Permission } from "../permission-types-Dg39z9Kv.js";
|
|
3
|
+
import { C as verifyWebBotAuth, b as discoverViaSignatureAgent, i as OpenApiHooks, m as InvalidSignatureError, o as ProtectOptions } from "../server-types-DdqBwZN_.js";
|
|
4
|
+
import { t as ServerAdapterOptions } from "../bind-BzqG8SMb.js";
|
|
5
5
|
import { a as toRequest, i as sendResponse } from "../http-DPuDaChb.js";
|
|
6
6
|
import { ErrorRequestHandler, Request, RequestHandler, Response, Router } from "express";
|
|
7
7
|
//#region src/express/create.d.ts
|
package/dist/express/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as
|
|
1
|
+
import { r as hasCredentials } from "../http-BBoKefeS.js";
|
|
2
|
+
import { i as discoverViaSignatureAgent, r as InvalidSignatureError, s as verifyWebBotAuth } from "../evaluations-C9YJsv3H.js";
|
|
3
|
+
import { t as problemFromError } from "../map-error-BE27PYkE.js";
|
|
4
|
+
import { i as decorate, r as bindKernel } from "../bind-kk-uyCwH.js";
|
|
5
|
+
import { i as toRequest, r as sendResponse } from "../http-BEbdMZ05.js";
|
|
5
6
|
import express from "express";
|
|
6
7
|
//#region src/express/create.ts
|
|
7
8
|
function run(work, next) {
|
|
8
9
|
work().catch(next);
|
|
9
10
|
}
|
|
10
11
|
function sendProblem(err, req, res, next) {
|
|
11
|
-
const problem = problemFromError(err, { credentials: req
|
|
12
|
+
const problem = problemFromError(err, { credentials: hasCredentials(req) });
|
|
12
13
|
if (problem === void 0) {
|
|
13
14
|
next(err);
|
|
14
15
|
return;
|
|
@@ -32,7 +33,7 @@ const withPermDock = (fn) => (req, res, next) => {
|
|
|
32
33
|
}, next);
|
|
33
34
|
};
|
|
34
35
|
function createPermDock(policy, options) {
|
|
35
|
-
const { kernel, bind, rebind, scopeOf, handlerScope } = bindKernel(policy, options, "express", toRequest);
|
|
36
|
+
const { kernel, bind, rebind, scopeOf, handlerScope, guard: runGuard } = bindKernel(policy, options, "express", toRequest);
|
|
36
37
|
const permdock = () => (req, res, next) => {
|
|
37
38
|
respond(req, res, next, async () => {
|
|
38
39
|
decorate(req, await kernel.permdock(bind(req), await scopeOf(req)));
|
|
@@ -41,7 +42,7 @@ function createPermDock(policy, options) {
|
|
|
41
42
|
};
|
|
42
43
|
const protect = (permission, loadData, protectOptions) => (req, res, next) => {
|
|
43
44
|
respond(req, res, next, async () => {
|
|
44
|
-
const guard = await
|
|
45
|
+
const guard = await runGuard(permission, loadData, req, protectOptions);
|
|
45
46
|
if (!guard.ok) {
|
|
46
47
|
await sendResponse(res, guard.response);
|
|
47
48
|
return;
|
package/dist/fastify/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
1
|
+
import { E as Policy, Or as Principal, j as PolicyVocabulary, jt as PermDock } from "../policy-types-sp9P1iIV.js";
|
|
2
|
+
import { d as Permission } from "../permission-types-Dg39z9Kv.js";
|
|
3
|
+
import { C as verifyWebBotAuth, b as discoverViaSignatureAgent, i as OpenApiHooks, m as InvalidSignatureError, o as ProtectOptions } from "../server-types-DdqBwZN_.js";
|
|
4
|
+
import { t as ServerAdapterOptions } from "../bind-BzqG8SMb.js";
|
|
5
5
|
import { FastifyPluginAsync, FastifyReply, FastifyRequest, FastifySchema, FastifyTypeProvider, FastifyTypeProviderDefault, RawRequestDefaultExpression, RawServerDefault, RouteGenericInterface } from "fastify";
|
|
6
6
|
//#region src/fastify/create.d.ts
|
|
7
7
|
type FastifyPermDockOptions<TUser = unknown> = ServerAdapterOptions<FastifyRequest, TUser>;
|
|
@@ -26,8 +26,18 @@ type FastifyPermDock<V extends PolicyVocabulary = PolicyVocabulary> = {
|
|
|
26
26
|
};
|
|
27
27
|
export declare function createPermDock<TUser, TPrincipal extends Principal = Principal, V extends PolicyVocabulary = PolicyVocabulary>(policy: Policy<TUser, TPrincipal, V>, options: FastifyPermDockOptions<TUser>): FastifyPermDock<V>;
|
|
28
28
|
//#endregion
|
|
29
|
+
//#region src/server/http.d.ts
|
|
30
|
+
/** A Fastify-style reply: `code`, `header` and `send`. */
|
|
31
|
+
type ReplyLike = {
|
|
32
|
+
code(status: number): unknown;
|
|
33
|
+
header(key: string, value: string): unknown;
|
|
34
|
+
send(body: string): unknown;
|
|
35
|
+
};
|
|
36
|
+
/** Writes `response` to a Fastify-style reply. */
|
|
37
|
+
declare function writeReply(reply: ReplyLike, response: Response): Promise<void>;
|
|
38
|
+
//#endregion
|
|
29
39
|
//#region src/fastify/http.d.ts
|
|
30
40
|
export declare function toRequest(request: FastifyRequest): Request;
|
|
31
|
-
export declare
|
|
41
|
+
export declare const sendReply: typeof writeReply;
|
|
32
42
|
//#endregion
|
|
33
43
|
export { type FastifyPermDock, type FastifyPermDockOptions, type FastifyProtect, InvalidSignatureError, type PermDockRequest, discoverViaSignatureAgent, verifyWebBotAuth };
|
package/dist/fastify/index.js
CHANGED
|
@@ -1,33 +1,13 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import { i as discoverViaSignatureAgent, r as InvalidSignatureError, s as verifyWebBotAuth } from "../evaluations-
|
|
3
|
-
import { t as problemFromError } from "../map-error-
|
|
4
|
-
import { i as decorate, r as bindKernel } from "../bind-
|
|
1
|
+
import { c as writeReply, i as headersFrom, n as firstHeader, r as hasCredentials, t as fetchRequest } from "../http-BBoKefeS.js";
|
|
2
|
+
import { i as discoverViaSignatureAgent, r as InvalidSignatureError, s as verifyWebBotAuth } from "../evaluations-C9YJsv3H.js";
|
|
3
|
+
import { t as problemFromError } from "../map-error-BE27PYkE.js";
|
|
4
|
+
import { i as decorate, r as bindKernel } from "../bind-kk-uyCwH.js";
|
|
5
5
|
//#region src/fastify/http.ts
|
|
6
6
|
function toRequest(request) {
|
|
7
7
|
const host = firstHeader(request.headers.host) ?? "localhost";
|
|
8
|
-
|
|
9
|
-
const headers = headersFrom(request.headers);
|
|
10
|
-
const method = request.method;
|
|
11
|
-
if (method === "GET" || method === "HEAD") return new Request(url, {
|
|
12
|
-
method,
|
|
13
|
-
headers
|
|
14
|
-
});
|
|
15
|
-
const body = parsedBody(request.body, headers);
|
|
16
|
-
if (body === void 0) return new Request(url, {
|
|
17
|
-
method,
|
|
18
|
-
headers
|
|
19
|
-
});
|
|
20
|
-
return new Request(url, {
|
|
21
|
-
method,
|
|
22
|
-
headers,
|
|
23
|
-
body
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
async function sendReply(reply, response) {
|
|
27
|
-
reply.code(response.status);
|
|
28
|
-
for (const [key, value] of response.headers.entries()) reply.header(key, value);
|
|
29
|
-
await reply.send(await response.text());
|
|
8
|
+
return fetchRequest(`${request.protocol}://${host}${request.url}`, request.method, headersFrom(request.headers), request.body);
|
|
30
9
|
}
|
|
10
|
+
const sendReply = writeReply;
|
|
31
11
|
//#endregion
|
|
32
12
|
//#region src/fastify/create.ts
|
|
33
13
|
const SKIP_OVERRIDE = Symbol.for("skip-override");
|
|
@@ -41,7 +21,7 @@ function skipped(request) {
|
|
|
41
21
|
return typeof config === "object" && config !== null && Reflect.get(config, "permdock") === false;
|
|
42
22
|
}
|
|
43
23
|
function createPermDock(policy, options) {
|
|
44
|
-
const { kernel, bind, rebind, scopeOf, handlerScope } = bindKernel(policy, options, "fastify", toRequest);
|
|
24
|
+
const { kernel, bind, rebind, scopeOf, handlerScope, guard: runGuard } = bindKernel(policy, options, "fastify", toRequest);
|
|
45
25
|
const permdock = breakEncapsulation((app) => {
|
|
46
26
|
app.decorateRequest("permdock", null);
|
|
47
27
|
app.decorateRequest("permdockData", null);
|
|
@@ -51,7 +31,7 @@ function createPermDock(policy, options) {
|
|
|
51
31
|
});
|
|
52
32
|
const previous = app.errorHandler;
|
|
53
33
|
app.setErrorHandler(async function permdockErrors(err, request, reply) {
|
|
54
|
-
const problem = problemFromError(err, { credentials: request
|
|
34
|
+
const problem = problemFromError(err, { credentials: hasCredentials(request) });
|
|
55
35
|
if (problem === void 0) {
|
|
56
36
|
await previous.call(this, err, request, reply);
|
|
57
37
|
return;
|
|
@@ -62,7 +42,7 @@ function createPermDock(policy, options) {
|
|
|
62
42
|
});
|
|
63
43
|
const protect = (permission, loadData, protectOptions) => async (request, reply) => {
|
|
64
44
|
const plain = request;
|
|
65
|
-
const guard = await
|
|
45
|
+
const guard = await runGuard(permission, loadData === void 0 ? void 0 : () => loadData(request), plain, protectOptions);
|
|
66
46
|
if (!guard.ok) {
|
|
67
47
|
await sendReply(reply, guard.response);
|
|
68
48
|
return;
|