permdock 0.2.0 → 0.3.1
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 +4 -4
- package/dist/a2a/index.js +2 -2
- package/dist/ai-sdk/index.d.ts +3 -3
- package/dist/ai-sdk/index.js +1 -1
- package/dist/approvals/index.d.ts +2 -2
- package/dist/{arazzo-cmvX2jDe.js → arazzo-C9chp3ST.js} +1 -1
- package/dist/authzen/index.d.ts +3 -3
- package/dist/authzen/index.js +1 -1
- package/dist/better-auth/index.d.ts +1 -1
- package/dist/better-supabase/index.d.ts +27 -10
- package/dist/better-supabase/index.js +44 -16
- package/dist/{bind-CVy3Espv.d.ts → bind-C_ob3LKa.d.ts} +5 -5
- package/dist/{bind-VnYn2HKq.js → bind-CuzGytRf.js} +1 -1
- package/dist/{capability-Dq43tT1u.d.ts → capability-2kYTMWDv.d.ts} +1 -1
- package/dist/catalog-CRW5Mx_B.js +2 -0
- package/dist/{catalog-h2tlKFkq.js → catalog-CYj-mX2O.js} +2 -2
- package/dist/{catalog-z8q6bi_r.js → catalog-DWF5cYqB.js} +2 -2
- package/dist/{catalog-doc-Dsc9y7sd.js → catalog-doc-DdGm82XT.js} +3 -26
- package/dist/claude-agent/index.d.ts +3 -3
- package/dist/claude-agent/index.js +1 -1
- package/dist/clerk/index.d.ts +2 -2
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cloud/index.d.ts +4 -4
- package/dist/{cloud-BGhHS-lY.js → cloud-CfwZ39Rl.js} +2 -2
- package/dist/{cloud-Bo3e9Ak3.js → cloud-DWLXO2af.js} +3 -3
- package/dist/{collect-DLlujdHC.js → collect-CHB22Sx4.js} +3 -3
- package/dist/{collect-DDDv_ESs.js → collect-DSTE3ml9.js} +1 -1
- package/dist/collect-DSWOk19R.js +2 -0
- package/dist/{commands-DWOrSQic.js → commands-BeaGNj_o.js} +13 -13
- package/dist/compile/index.d.ts +1 -1
- package/dist/{compile-CNnl6uIt.d.ts → compile-BkRyBDBw.d.ts} +1 -1
- package/dist/{config-Bn00Z3ks.js → config-ir40y8m0.js} +2 -2
- package/dist/{config-report-Dw_JcUqT.js → config-report-CdCgbRnV.js} +4 -4
- package/dist/{context-Ttp0ekMT.js → context-Bcy85rGi.js} +2 -2
- package/dist/convex/index.d.ts +3 -3
- package/dist/convex/index.js +1 -1
- package/dist/{create-BWyx3jua.d.ts → create-B1d519XK.d.ts} +5 -5
- package/dist/{create-CPhDL6qx.js → create-CMwIl-w2.js} +1 -1
- package/dist/{describe-PdoqESvg.d.ts → describe-DMYiCjJV.d.ts} +1 -1
- package/dist/{diff-B8Tunc3o.js → diff-2VaeChzX.js} +3 -3
- package/dist/{diff-CzqLxZ77.js → diff-C9RDjjhs.js} +2 -2
- package/dist/{doctor-rOr-4ZfS.js → doctor-Djh6JDEk.js} +2 -2
- package/dist/{doctor-WpvG6p4k.js → doctor-DvH0IQff.js} +10 -10
- package/dist/{doctor-collect-ByfYlNv1.js → doctor-collect-CjdO0wQX.js} +10 -9
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/elysia/index.d.ts +3 -3
- package/dist/elysia/index.js +1 -1
- package/dist/{errors-DAqevpNk.d.ts → errors-DPdqI50v.d.ts} +2 -2
- package/dist/eve/index.d.ts +3 -3
- package/dist/eve/index.js +1 -1
- package/dist/express/index.d.ts +3 -3
- package/dist/express/index.js +1 -1
- package/dist/fastify/index.d.ts +3 -3
- package/dist/fastify/index.js +1 -1
- package/dist/{from-snapshot-C3sHpZNS.js → from-snapshot-CTLijvdm.js} +1 -0
- package/dist/hono/index.d.ts +3 -3
- package/dist/hono/index.js +1 -1
- package/dist/{index-CtE07CBF.d.ts → index-0nNqHspG.d.ts} +2 -2
- package/dist/{index-D3vbkoSI.d.ts → index-BNc7Wer_.d.ts} +1 -1
- package/dist/{index-D6_cSa1z.d.ts → index-C7Tw7MaW.d.ts} +2 -2
- package/dist/{index-A0YNL8jZ.d.ts → index-C8z4RjQV.d.ts} +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +3 -3
- package/dist/{instance-options-BK_rNOSC.d.ts → instance-options-jARdwfPN.d.ts} +1 -1
- package/dist/jwt/index.d.ts +4 -4
- package/dist/{kernel-GSQnMz3O.js → kernel-_RRHmnMY.js} +1 -1
- package/dist/kysely/index.d.ts +2 -2
- package/dist/mcp/index.d.ts +6 -6
- package/dist/mcp/index.js +2 -2
- package/dist/nest/index.d.ts +3 -3
- package/dist/nest/index.js +1 -1
- package/dist/next/index.d.ts +5 -5
- package/dist/next/index.js +1 -1
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +1 -1
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.js +1 -1
- package/dist/openai/index.d.ts +3 -3
- package/dist/openai/index.js +1 -1
- package/dist/openapi/index.d.ts +2 -2
- package/dist/{openapi-Bbg4wGVL.js → openapi-CQTsgKoB.js} +1 -1
- package/dist/orpc/index.d.ts +4 -4
- package/dist/orpc/index.js +2 -2
- package/dist/otel/index.d.ts +2 -2
- package/dist/{parse-local-manifest-BkGQNzAh.d.ts → parse-local-manifest-JLnaBH0S.d.ts} +1 -1
- package/dist/pdp/index.d.ts +2 -2
- package/dist/pdp/index.js +1 -1
- package/dist/{permdock-CzqXjCpU.js → permdock-CbgvLnuo.js} +35 -27
- package/dist/{permissions-CpZrivYv.js → permissions-RJrovw98.js} +1 -1
- package/dist/{policy-D8UFyERw.d.ts → policy-D2W7uv19.d.ts} +1 -1
- package/dist/{policy-CFZAr_Al.d.ts → policy-IB6yxpC3.d.ts} +21 -5
- package/dist/powersync-CrBX8hY6.js +2 -0
- package/dist/{powersync-yW1UUFzp.js → powersync-DE19b9dT.js} +2 -2
- package/dist/{powersync-C7kLglqX.js → powersync-Dv1_aWF7.js} +7 -7
- package/dist/prisma/index.d.ts +1 -1
- package/dist/{problem-details-CkL50EEf.d.ts → problem-details-DX075l9V.d.ts} +1 -1
- package/dist/{protected-CNsMzrVd.d.ts → protected-BdnIEFkY.d.ts} +3 -3
- package/dist/{protected-Cs6kTaHo.js → protected-utU-SLuy.js} +1 -1
- package/dist/{protected-bZs6rbT1.d.ts → protected-xAr24FEC.d.ts} +3 -3
- package/dist/{provider-DLzpb2Xz.js → provider-CSQd7m92.js} +2 -2
- package/dist/{provider-Cjr62YMV.d.ts → provider-DZY281jO.d.ts} +1 -1
- package/dist/{provider-store-DNyC1y48.js → provider-store-Cfbvo4DE.js} +2 -2
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +2 -2
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +8 -8
- package/dist/react-native/index.js +3 -3
- package/dist/{replay-sqBGMnNs.d.ts → replay-CYyiLiwO.d.ts} +1 -1
- package/dist/{rls-BMNydpHk.js → rls-DiinlRML.js} +12 -12
- package/dist/{rls-CEvs64Kj.js → rls-P-BeBx0n.js} +2 -2
- package/dist/{rls-fields-BMasREhR.js → rls-fields-CZOMlwHl.js} +96 -8
- package/dist/{rls-graph-pc9fuXYm.js → rls-graph-CHwx0V8q.js} +2 -2
- package/dist/{rls-import-D8F7j35Q.js → rls-import-4lLW_pbb.js} +2 -2
- package/dist/{rls-migrate-7wikfrVI.js → rls-migrate-CN4TlJTO.js} +2 -2
- package/dist/{rls-ownership-B5Lkq62W.js → rls-ownership-DcYlZ09B.js} +3 -3
- package/dist/{rls-shared-aOQ4hGTO.js → rls-shared-Cewd_-zI.js} +4 -2
- package/dist/{rls-verify-D8B7dOTh.js → rls-verify-CMv9H3wV.js} +8 -7
- package/dist/row-conditions-h2HythXQ.js +27 -0
- package/dist/{rpc-DOK54_CS.js → rpc-DL9Sqvb1.js} +1 -1
- package/dist/{run-YXCJDNYk.js → run-BWc9qqvE.js} +1 -1
- package/dist/{saas-Bj_FFkjN.js → saas-DhpJjnBA.js} +2 -2
- package/dist/scim/index.d.ts +1 -1
- package/dist/server/index.d.ts +6 -6
- package/dist/server/index.js +1 -1
- package/dist/{sink-Gs6TTVa-.d.ts → sink-B1fZzIMf.d.ts} +1 -1
- package/dist/{skills-JaymNCdK.js → skills-C5CbhhpG.js} +1 -1
- package/dist/{snapshot-cache-DwQH8ufx.d.ts → snapshot-cache-B-LxUahj.d.ts} +1 -1
- package/dist/solid/index.d.ts +4 -4
- package/dist/solid/index.js +2 -2
- package/dist/{sources-B0UvrJ21.js → sources-4p0-4xQm.js} +12 -1
- package/dist/{sources-BcJgw0lt.d.ts → sources-BdOYLw9j.d.ts} +2 -2
- package/dist/{src-CSbUiozF.js → src-BDwEZWrZ.js} +1 -1
- package/dist/ssf/index.d.ts +3 -3
- package/dist/{store-D_pjn91-.d.ts → store-jOBYpiXC.d.ts} +2 -2
- package/dist/{store-options-yO0V6gRn.js → store-options-ByhZq1jV.js} +1 -1
- package/dist/{stores-4_sqiOA1.js → stores-BT2pSCub.js} +1 -1
- package/dist/{stores-DVR5NHLE.d.ts → stores-C0IMQrGI.d.ts} +2 -2
- package/dist/{stream-DlvG2hs-.d.ts → stream-D1RXubw2.d.ts} +1 -1
- package/dist/supabase/index.d.ts +15 -4
- package/dist/supabase/index.js +2 -2
- package/dist/supabase/middleware.d.ts +4 -4
- package/dist/supabase/middleware.js +2 -2
- package/dist/{supabase-DTBaC20O.js → supabase-C0qESOa-.js} +7 -5
- package/dist/{supabase-config-Bs44dare.js → supabase-config-Bj3iDH2I.js} +1 -1
- package/dist/supabase-hook-gd3s8bxB.js +2 -0
- package/dist/{supabase-hook-BuxLQLpU.js → supabase-hook-ntETYCQu.js} +56 -10
- package/dist/{supabase-CwafwxxF.js → supabase-s4o9s1O1.js} +2 -2
- package/dist/{supautils-DYZnzRWV.js → supautils-u8jXTGrt.js} +1 -1
- package/dist/svelte/index.d.ts +5 -5
- package/dist/svelte/index.js +2 -2
- package/dist/svelte/runtime.d.ts +2 -2
- package/dist/svelte/runtime.js +1 -1
- package/dist/svelte/source.d.ts +5 -5
- package/dist/svelte/source.js +1 -1
- package/dist/terminal/index.d.ts +4 -4
- package/dist/terminal/index.js +1 -1
- package/dist/testing/index.d.ts +5 -5
- package/dist/testing/index.js +5 -5
- package/dist/testing/saas/index.d.ts +2 -2
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/trpc/index.d.ts +4 -4
- package/dist/trpc/index.js +2 -2
- package/dist/{types-C3s9xVJG.d.ts → types-BnIEz1sU.d.ts} +1 -1
- package/dist/{types-yF5LmQVD.d.ts → types-C97IskBw.d.ts} +1 -1
- package/dist/{types-kxznc7cn.d.ts → types-CKNSyIf_.d.ts} +1 -1
- package/dist/{types-9AWO9EGt.d.ts → types-Cq_H8N_X.d.ts} +2 -2
- package/dist/{types-BPxgszlT.d.ts → types-DbjRN55U.d.ts} +15 -2
- package/dist/{types-BVyImy5I.d.ts → types-DxiCGmmd.d.ts} +1 -1
- package/dist/{types-vNSDF7Dq.d.ts → types-QCuYJh4q.d.ts} +1 -1
- package/dist/{types-vKyAMtcX.d.ts → types-aqOHTHcp.d.ts} +1 -1
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-D07N9QJ3.js → usage-B0YuTQRO.js} +2 -2
- package/dist/usage-DorAJiU_.js +2 -0
- package/dist/{usage-DG1oeCca.js → usage-ItS7nLcl.js} +2 -2
- package/dist/{validation-error-CtF23SrC.d.ts → validation-error-Ba264OaJ.d.ts} +1 -1
- package/dist/vue/index.d.ts +4 -4
- package/dist/vue/index.js +2 -2
- package/dist/watch-BwxLTYMZ.js +2 -0
- package/dist/{watch-UihESpsJ.js → watch-DVBJ9cBq.js} +1 -1
- package/dist/webmcp/index.d.ts +1 -1
- package/package.json +3 -3
- package/dist/catalog-BjZSovXQ.js +0 -2
- package/dist/collect-rG2IQ3t0.js +0 -2
- package/dist/powersync-A8x_Yyvh.js +0 -2
- package/dist/supabase-hook-D5qVd_D8.js +0 -2
- package/dist/usage-D82l1CwK.js +0 -2
- package/dist/watch-Etoa_Mvr.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Policy, D as PolicyVocabulary, Nr as Principal, Pr as Subject, ln as PermDock } from "../policy-
|
|
1
|
+
import { C as Policy, D as PolicyVocabulary, Nr as Principal, Pr as Subject, ln as PermDock } from "../policy-IB6yxpC3.js";
|
|
2
2
|
import { f as Permission } from "../permissions-DttnqqxC.js";
|
|
3
|
-
import { t as InstanceOptions } from "../instance-options-
|
|
4
|
-
import { n as OpenApiHooks } from "../create-
|
|
5
|
-
import { n as ServerAdapterServices } from "../bind-
|
|
3
|
+
import { t as InstanceOptions } from "../instance-options-jARdwfPN.js";
|
|
4
|
+
import { n as OpenApiHooks } from "../create-B1d519XK.js";
|
|
5
|
+
import { n as ServerAdapterServices } from "../bind-C_ob3LKa.js";
|
|
6
6
|
import { Middleware } from "@supabase/middleware";
|
|
7
7
|
//#region src/supabase/middleware.d.ts
|
|
8
8
|
/**
|
|
@@ -2,8 +2,8 @@ import { t as compact } from "../compact-y6vfu2_f.js";
|
|
|
2
2
|
import { r as credentialSubject } from "../credential-8P81ff4u.js";
|
|
3
3
|
import { i as methodNotAllowed } from "../problem-B43ztKIm.js";
|
|
4
4
|
import { t as instanceOptions } from "../instance-options-Dhhcnm3y.js";
|
|
5
|
-
import { n as createServerKernel } from "../create-
|
|
6
|
-
import { n as attached } from "../bind-
|
|
5
|
+
import { n as createServerKernel } from "../create-CMwIl-w2.js";
|
|
6
|
+
import { n as attached } from "../bind-CuzGytRf.js";
|
|
7
7
|
import { defineMiddleware } from "@supabase/middleware";
|
|
8
8
|
//#region src/supabase/middleware.ts
|
|
9
9
|
const SECRET_KEY_NAME = /^[A-Za-z0-9_-]+$/u;
|
|
@@ -6,7 +6,7 @@ import { a as decodeApprovalCursor, i as approvalPageSize, o as encodeApprovalCu
|
|
|
6
6
|
import { t as loadJose } from "./load-jose-BL6LH4bL.js";
|
|
7
7
|
import "./budget-NbEtbJC_.js";
|
|
8
8
|
import { a as quoteSqlTable, i as quoteSqlLiteral, r as quoteSqlIdent } from "./sql-xdg5f4Fi.js";
|
|
9
|
-
import {
|
|
9
|
+
import { c as hookApiNames, d as keptKeys, l as roleColumn } from "./sources-4p0-4xQm.js";
|
|
10
10
|
import { i as readMemberships } from "./manifest-iaoBXHKc.js";
|
|
11
11
|
//#region src/supabase/capability.ts
|
|
12
12
|
const DEFAULT_TTL = 300;
|
|
@@ -319,10 +319,12 @@ function readSubjectRecord(value) {
|
|
|
319
319
|
* `postgrestSources` call, so create it per request or per job.
|
|
320
320
|
*/
|
|
321
321
|
function postgrestSources(client, options = {}) {
|
|
322
|
-
const
|
|
323
|
-
const
|
|
324
|
-
const
|
|
325
|
-
const
|
|
322
|
+
const api = options.api;
|
|
323
|
+
const names = api === void 0 ? void 0 : hookApiNames(api.prefix);
|
|
324
|
+
const schema = options.schema ?? (api === void 0 ? "permdock" : api.schema ?? "public");
|
|
325
|
+
const fn = options.fn ?? names?.subjectFor ?? "subject_for";
|
|
326
|
+
const membersFn = options.membersFn ?? names?.membersOf ?? "members_of";
|
|
327
|
+
const versionFn = options.versionFn ?? names?.authzVersionFor ?? "authz_version_for";
|
|
326
328
|
const declared = options.policy === void 0 ? void 0 : options.policy.index.declaredRoles;
|
|
327
329
|
const onlyDeclared = (held) => declared !== void 0 && held?.every((name) => declared.has(name)) === true;
|
|
328
330
|
const loaded = /* @__PURE__ */ new Map();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as describeError } from "./errors-CWfoNg9N.js";
|
|
2
2
|
import { a as sqlFiles, i as rel } from "./files-DWUN9PzI.js";
|
|
3
|
-
import { t as FIELD_VIEWS } from "./rls-fields-
|
|
3
|
+
import { t as FIELD_VIEWS } from "./rls-fields-CZOMlwHl.js";
|
|
4
4
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
5
5
|
import { dirname, join, posix, resolve } from "node:path";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -5,15 +5,15 @@ import { a as sqlFiles } from "./files-DWUN9PzI.js";
|
|
|
5
5
|
import { a as loadModule, n as asPolicy, o as pickNamed } from "./load-DhWEB9P1.js";
|
|
6
6
|
import { t as shortDiff } from "./text-diff-BdkkYSbi.js";
|
|
7
7
|
import { r as scopeColumn } from "./compile-Ba4blROR.js";
|
|
8
|
-
import { t as authorizeSql } from "./supabase-
|
|
8
|
+
import { t as authorizeSql } from "./supabase-C0qESOa-.js";
|
|
9
9
|
import "./budget-NbEtbJC_.js";
|
|
10
|
-
import { c as
|
|
10
|
+
import { c as hookApiNames, d as keptKeys, t as AUTHZ_VERSION_TABLE, u as roleManifest } from "./sources-4p0-4xQm.js";
|
|
11
11
|
import { i as readMemberships } from "./manifest-iaoBXHKc.js";
|
|
12
12
|
import { a as hookMarkerFields, n as HOOK_MARKER, t as GRANTS_MARKER } from "./markers-B0hYLvMD.js";
|
|
13
|
-
import { f as splitUndiffed, h as tableKey, m as decidingColumns, n as supabaseConfig, r as MIGRATION_DIRS } from "./supabase-config-
|
|
14
|
-
import {
|
|
15
|
-
import { G as API_KEY_ALLOWS, K as apiKeyFields, U as roleNames, _ as permissionKeysForHelper, w as connectPg, z as globalRoleSource } from "./rls-fields-
|
|
16
|
-
import { a as ownershipRules, i as guardedTables, n as OWNERSHIP, t as ASSIGNMENTS } from "./rls-ownership-
|
|
13
|
+
import { f as splitUndiffed, h as tableKey, m as decidingColumns, n as supabaseConfig, r as MIGRATION_DIRS } from "./supabase-config-Bj3iDH2I.js";
|
|
14
|
+
import { D as hasMemberFor, F as memberForHelper, G as quoteIdent, H as permittedForHelper, I as memberForSources, K as quoteLiteral, L as memberForTable, Q as scopeTypeOf, R as memberIdsHelper, U as permittedIdsHelper, W as qualifiedTable, at as tenantTypeOf, g as activeRowSql, p as USER_ID_HELPER, q as quoteTable, r as HELPERS, y as checkSuspension, z as memberRoleOf } from "./rls-shared-Cewd_-zI.js";
|
|
15
|
+
import { G as API_KEY_ALLOWS, K as apiKeyFields, U as roleNames, _ as permissionKeysForHelper, w as connectPg, z as globalRoleSource } from "./rls-fields-CZOMlwHl.js";
|
|
16
|
+
import { a as ownershipRules, i as guardedTables, n as OWNERSHIP, t as ASSIGNMENTS } from "./rls-ownership-DcYlZ09B.js";
|
|
17
17
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
18
18
|
import { dirname, join, resolve } from "node:path";
|
|
19
19
|
/** `--check`: one entry per file that is missing or differs, naming its part; a differing file carries a short diff. */
|
|
@@ -92,10 +92,25 @@ function isSeedsDirectory(cwd, out) {
|
|
|
92
92
|
function migrationVersion(now) {
|
|
93
93
|
return now.toISOString().replaceAll(/[^0-9]/gu, "").slice(0, 14);
|
|
94
94
|
}
|
|
95
|
+
const VERSION_PREFIX = /^\d{14}(?=_)/u;
|
|
96
|
+
/**
|
|
97
|
+
* The version of a new migration that sorts after every migration in
|
|
98
|
+
* `names`: one second past the newest, so the same directory always gives the
|
|
99
|
+
* same name. Only a directory with no versioned migration falls back to `now`.
|
|
100
|
+
*/
|
|
101
|
+
function nextMigrationVersion(names, now) {
|
|
102
|
+
const times = names.flatMap((name) => {
|
|
103
|
+
const stamp = VERSION_PREFIX.exec(name)?.[0];
|
|
104
|
+
return stamp === void 0 ? [] : [Date.UTC(Number(stamp.slice(0, 4)), Number(stamp.slice(4, 6)) - 1, Number(stamp.slice(6, 8)), Number(stamp.slice(8, 10)), Number(stamp.slice(10, 12)), Number(stamp.slice(12, 14)))];
|
|
105
|
+
});
|
|
106
|
+
return times.length === 0 ? migrationVersion(now) : migrationVersion(new Date(Math.max(...times) + 1e3));
|
|
107
|
+
}
|
|
95
108
|
/**
|
|
96
109
|
* The seeds part in a migrations directory: the newest migration there that
|
|
97
110
|
* starts with \`marker\` when its text is \`text\` already, otherwise a new
|
|
98
|
-
* \`<version>_permdock_seeds.sql
|
|
111
|
+
* \`<version>_permdock_seeds.sql\` one second after the newest migration
|
|
112
|
+
* (\`nextMigrationVersion\`), so a regeneration of the same directory names it
|
|
113
|
+
* the same. \`current\` is false when a new one is due.
|
|
99
114
|
*/
|
|
100
115
|
function seedsMigration(cwd, dir, marker, text, now) {
|
|
101
116
|
const base = dir.endsWith("/") ? dir.slice(0, -1) : dir;
|
|
@@ -106,7 +121,7 @@ function seedsMigration(cwd, dir, marker, text, now) {
|
|
|
106
121
|
current: true
|
|
107
122
|
};
|
|
108
123
|
return {
|
|
109
|
-
rel: `${base}/${
|
|
124
|
+
rel: `${base}/${nextMigrationVersion(existsSync(path) ? readdirSync(path) : [], now)}_permdock_seeds.sql`,
|
|
110
125
|
current: false
|
|
111
126
|
};
|
|
112
127
|
}
|
|
@@ -850,6 +865,36 @@ end;
|
|
|
850
865
|
$$;
|
|
851
866
|
revoke execute on function ${fn}(uuid) from public, anon, authenticated;`;
|
|
852
867
|
}
|
|
868
|
+
/**
|
|
869
|
+
* The PostgREST wrappers `supabase.hook.api` asks for: one `security definer`
|
|
870
|
+
* function per reader, in the API schema, executable by `service_role` only.
|
|
871
|
+
*/
|
|
872
|
+
function apiWrappersSql(parts) {
|
|
873
|
+
const api = parts.hook.api;
|
|
874
|
+
if (api === void 0) return "";
|
|
875
|
+
const target = api.schema ?? "public";
|
|
876
|
+
const names = hookApiNames(api.prefix);
|
|
877
|
+
const source = quoteIdent(parts.schema);
|
|
878
|
+
const wrapper = (name, inner, params, args, types, returns) => {
|
|
879
|
+
const fn = `${quoteIdent(target)}.${quoteIdent(name)}`;
|
|
880
|
+
if (target === parts.schema && name === inner) throw new Error(`PermDock CLI: supabase.hook.api would replace ${source}.${inner}: set api.schema or api.prefix`);
|
|
881
|
+
return `create or replace function ${fn}(${params})
|
|
882
|
+
returns ${returns}
|
|
883
|
+
language sql
|
|
884
|
+
stable
|
|
885
|
+
security definer
|
|
886
|
+
set search_path = ''
|
|
887
|
+
as $$ select ${source}.${inner}(${args}) $$;
|
|
888
|
+
revoke execute on function ${fn}(${types}) from public, anon, authenticated;
|
|
889
|
+
grant execute on function ${fn}(${types}) to service_role;`;
|
|
890
|
+
};
|
|
891
|
+
return `-- supabase.hook.api: wrappers in ${quoteIdent(target)} for a backend that reaches the hook schema through the Data API; only service_role may execute them
|
|
892
|
+
${wrapper(names.subjectFor, SUBJECT_FOR, "p_user uuid", "p_user", "uuid", "jsonb")}
|
|
893
|
+
|
|
894
|
+
${wrapper(names.membersOf, MEMBERS_OF, "p_scope text, p_id text", "p_scope, p_id", "text, text", "jsonb")}
|
|
895
|
+
|
|
896
|
+
${wrapper(names.authzVersionFor, AUTHZ_VERSION_FOR, "p_user uuid", "p_user", "uuid", "bigint")}`;
|
|
897
|
+
}
|
|
853
898
|
const AUTHZ_VERSION_FOR = "authz_version_for";
|
|
854
899
|
/**
|
|
855
900
|
* `authz_version_for(p_user uuid) returns bigint`: the authorization version
|
|
@@ -1265,7 +1310,7 @@ function hookParts(scopes, config, overrides) {
|
|
|
1265
1310
|
tenantClaim,
|
|
1266
1311
|
users: suspension?.users,
|
|
1267
1312
|
hook,
|
|
1268
|
-
roles: hook.roles === false ? void 0 : globalRoleSource(hook.roles ?? config.rls?.roles ?? { table: `${schema}.user_roles` }, "public", "r"),
|
|
1313
|
+
roles: hook.roles === false ? void 0 : globalRoleSource(hook.roles ?? config.rls?.roles ?? { table: `${schema}.user_roles` }, "public", "r", config.rls?.customRoleWrites?.roles),
|
|
1269
1314
|
active: activeFromSql(overrides.activeFrom ?? hook.activeFrom, root),
|
|
1270
1315
|
attrs: hook.attrs === void 0 ? void 0 : attrsPlan(hook.attrs),
|
|
1271
1316
|
extra: extraPlan.claims,
|
|
@@ -1618,7 +1663,7 @@ Reads supabase.hook from permdock.config.ts: the fromTable / fromJunction source
|
|
|
1618
1663
|
passes as memberships. hook generate emits custom_access_token_hook(jsonb), the grants it
|
|
1619
1664
|
needs (the ones db diff drops in --grants-out, for declarative schemas), the permdock_authz_version table
|
|
1620
1665
|
and its triggers. Never grants anything to
|
|
1621
|
-
service_role. inspect prints the manifest: helper schema, names and signatures, tenant claim,
|
|
1666
|
+
service_role unless supabase.hook.api is set, which grants its wrappers to it. inspect prints the manifest: helper schema, names and signatures, tenant claim,
|
|
1622
1667
|
budget, the claims the hook writes, the membership sources and the columns that decide them.
|
|
1623
1668
|
--out writes it as JSON, to permdock.manifest.json without a path; --check exits 1 when that
|
|
1624
1669
|
file differs.
|
|
@@ -1656,6 +1701,7 @@ ${toml}${grantsOut === void 0 ? "" : `\n-- what supabase db diff drops from this
|
|
|
1656
1701
|
subjectForSql(parts, config),
|
|
1657
1702
|
authzVersionForSql(parts),
|
|
1658
1703
|
membersOfSql(parts),
|
|
1704
|
+
apiWrappersSql(parts),
|
|
1659
1705
|
grantsSql(parts),
|
|
1660
1706
|
managedSql(parts)
|
|
1661
1707
|
].filter((chunk) => chunk !== "").join("\n\n");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as globalArgs, s as stringArg, t as COMMAND_DESCRIPTIONS } from "./commands-
|
|
1
|
+
import { i as globalArgs, s as stringArg, t as COMMAND_DESCRIPTIONS } from "./commands-BeaGNj_o.js";
|
|
2
2
|
import { defineCommand } from "citty";
|
|
3
3
|
//#region src/cli/commands/supabase.ts
|
|
4
4
|
function supabase(ctx) {
|
|
@@ -61,7 +61,7 @@ function supabase(ctx) {
|
|
|
61
61
|
const budget = stringArg(parsed.budget);
|
|
62
62
|
const schema = stringArg(parsed.schema);
|
|
63
63
|
const grantsOut = stringArg(parsed["grants-out"]);
|
|
64
|
-
const { runSupabase } = await import("./supabase-hook-
|
|
64
|
+
const { runSupabase } = await import("./supabase-hook-gd3s8bxB.js");
|
|
65
65
|
ctx.report(await runSupabase({
|
|
66
66
|
cwd: ctx.cwd,
|
|
67
67
|
config: ctx.config,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as group, p as sqlStatements } from "./supabase-config-
|
|
1
|
+
import { d as group, p as sqlStatements } from "./supabase-config-Bj3iDH2I.js";
|
|
2
2
|
//#region src/cli/supautils.ts
|
|
3
3
|
/** `supautils.reserved_roles` of supabase/postgres 17.11.0.002 (supautils 3.4.4). */
|
|
4
4
|
const RESERVED_ROLES = /* @__PURE__ */ new Set([
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as requiredPlans } from "../problem-details-
|
|
2
|
-
import { i as describe } from "../describe-
|
|
1
|
+
import { n as requiredPlans } from "../problem-details-DX075l9V.js";
|
|
2
|
+
import { i as describe } from "../describe-DMYiCjJV.js";
|
|
3
3
|
import { t as PermissionBoundaryState } from "../boundary-BmHxVH1J.js";
|
|
4
4
|
import { t as approvalHeaders } from "../headers-Cf-zWvsO.js";
|
|
5
|
-
import { a as FilterResult, c as SubjectView, i as ClientStatus, l as TenantView, n as ApprovalState, o as PermissionSet, r as ClientPermDock, s as PermissionState, t as ApprovalHandle, u as UseRolesOptions } from "../types-
|
|
6
|
-
import { i as PermissionBoundaryProps, t as ProtectedProps } from "../protected-
|
|
7
|
-
import { a as getPermDock, c as permissions, d as subject, f as tenant, i as filtered, l as roles, n as assignable, o as memberships, p as PermDockSvelteOptions, r as assignablePermissions, s as permission, t as approval, u as setPermDock } from "../stores-
|
|
5
|
+
import { a as FilterResult, c as SubjectView, i as ClientStatus, l as TenantView, n as ApprovalState, o as PermissionSet, r as ClientPermDock, s as PermissionState, t as ApprovalHandle, u as UseRolesOptions } from "../types-CKNSyIf_.js";
|
|
6
|
+
import { i as PermissionBoundaryProps, t as ProtectedProps } from "../protected-xAr24FEC.js";
|
|
7
|
+
import { a as getPermDock, c as permissions, d as subject, f as tenant, i as filtered, l as roles, n as assignable, o as memberships, p as PermDockSvelteOptions, r as assignablePermissions, s as permission, t as approval, u as setPermDock } from "../stores-C0IMQrGI.js";
|
|
8
8
|
import { Component } from "svelte";
|
|
9
9
|
//#region src/svelte/index.d.ts
|
|
10
10
|
export declare const Protected: Component<ProtectedProps>;
|
package/dist/svelte/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import { r as requiredPlans } from "../problem-details-_AMOYz-w.js";
|
|
|
2
2
|
import { t as describe } from "../describe-B_gVZEVi.js";
|
|
3
3
|
import { t as approvalHeaders } from "../headers-BZSDieNT.js";
|
|
4
4
|
import { n as boundaryFallback, t as boundaryDigest } from "../boundary-BM8a_P6E.js";
|
|
5
|
-
import { t as getStore } from "../context-
|
|
5
|
+
import { t as getStore } from "../context-Bcy85rGi.js";
|
|
6
6
|
import { n as viewFor, t as scopedFor } from "../runtime-CB8gQFvS.js";
|
|
7
|
-
import { a as getPermDock, c as permissions, d as subject, f as tenant, i as filtered, l as roles, n as assignable, o as memberships, r as assignablePermissions, s as permission, t as approval, u as setPermDock } from "../stores-
|
|
7
|
+
import { a as getPermDock, c as permissions, d as subject, f as tenant, i as filtered, l as roles, n as assignable, o as memberships, r as assignablePermissions, s as permission, t as approval, u as setPermDock } from "../stores-BT2pSCub.js";
|
|
8
8
|
import "svelte/internal/disclose-version";
|
|
9
9
|
import * as $ from "svelte/internal/client";
|
|
10
10
|
import { onDestroy } from "svelte";
|
package/dist/svelte/runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as boundaryDigest, r as boundaryFallback, t as PermissionBoundaryState } from "../boundary-BmHxVH1J.js";
|
|
2
|
-
import { t as ClientStore } from "../store-
|
|
3
|
-
import { i as PermissionBoundaryProps, n as scopedFor, r as viewFor, t as ProtectedProps } from "../protected-
|
|
2
|
+
import { t as ClientStore } from "../store-jOBYpiXC.js";
|
|
3
|
+
import { i as PermissionBoundaryProps, n as scopedFor, r as viewFor, t as ProtectedProps } from "../protected-xAr24FEC.js";
|
|
4
4
|
//#region src/svelte/context.d.ts
|
|
5
5
|
export declare function getStore(): ClientStore;
|
|
6
6
|
//#endregion
|
package/dist/svelte/runtime.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as boundaryFallback, t as boundaryDigest } from "../boundary-BM8a_P6E.js";
|
|
2
|
-
import { t as getStore } from "../context-
|
|
2
|
+
import { t as getStore } from "../context-Bcy85rGi.js";
|
|
3
3
|
import { n as viewFor, t as scopedFor } from "../runtime-CB8gQFvS.js";
|
|
4
4
|
export { boundaryDigest, boundaryFallback, getStore, scopedFor, viewFor };
|
package/dist/svelte/source.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as requiredPlans } from "../problem-details-
|
|
2
|
-
import { i as describe } from "../describe-
|
|
1
|
+
import { n as requiredPlans } from "../problem-details-DX075l9V.js";
|
|
2
|
+
import { i as describe } from "../describe-DMYiCjJV.js";
|
|
3
3
|
import { t as PermissionBoundaryState } from "../boundary-BmHxVH1J.js";
|
|
4
4
|
import { t as approvalHeaders } from "../headers-Cf-zWvsO.js";
|
|
5
|
-
import { a as FilterResult, c as SubjectView, i as ClientStatus, l as TenantView, n as ApprovalState, o as PermissionSet, r as ClientPermDock, s as PermissionState, t as ApprovalHandle, u as UseRolesOptions } from "../types-
|
|
6
|
-
import { i as PermissionBoundaryProps, t as ProtectedProps } from "../protected-
|
|
7
|
-
import { a as getPermDock, c as permissions, d as subject, f as tenant, i as filtered, l as roles, n as assignable, o as memberships, p as PermDockSvelteOptions, r as assignablePermissions, s as permission, t as approval, u as setPermDock } from "../stores-
|
|
5
|
+
import { a as FilterResult, c as SubjectView, i as ClientStatus, l as TenantView, n as ApprovalState, o as PermissionSet, r as ClientPermDock, s as PermissionState, t as ApprovalHandle, u as UseRolesOptions } from "../types-CKNSyIf_.js";
|
|
6
|
+
import { i as PermissionBoundaryProps, t as ProtectedProps } from "../protected-xAr24FEC.js";
|
|
7
|
+
import { a as getPermDock, c as permissions, d as subject, f as tenant, i as filtered, l as roles, n as assignable, o as memberships, p as PermDockSvelteOptions, r as assignablePermissions, s as permission, t as approval, u as setPermDock } from "../stores-C0IMQrGI.js";
|
|
8
8
|
import { Component } from "svelte";
|
|
9
9
|
//#region src/svelte/source.d.ts
|
|
10
10
|
export declare const Protected: Component<ProtectedProps>;
|
package/dist/svelte/source.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as requiredPlans } from "../problem-details-_AMOYz-w.js";
|
|
2
2
|
import { t as describe } from "../describe-B_gVZEVi.js";
|
|
3
3
|
import { t as approvalHeaders } from "../headers-BZSDieNT.js";
|
|
4
|
-
import { a as getPermDock, c as permissions, d as subject, f as tenant, i as filtered, l as roles, n as assignable, o as memberships, r as assignablePermissions, s as permission, t as approval, u as setPermDock } from "../stores-
|
|
4
|
+
import { a as getPermDock, c as permissions, d as subject, f as tenant, i as filtered, l as roles, n as assignable, o as memberships, r as assignablePermissions, s as permission, t as approval, u as setPermDock } from "../stores-BT2pSCub.js";
|
|
5
5
|
import PermissionBoundaryComponent from "./PermissionBoundary.svelte";
|
|
6
6
|
import ProtectedComponent from "./Protected.svelte";
|
|
7
7
|
//#region src/svelte/source.ts
|
package/dist/terminal/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Policy, D as PolicyVocabulary, Nr as Principal, Pr as Subject, Yn as Decision, ln as PermDock } from "../policy-
|
|
1
|
+
import { C as Policy, D as PolicyVocabulary, Nr as Principal, Pr as Subject, Yn as Decision, ln as PermDock } from "../policy-IB6yxpC3.js";
|
|
2
2
|
import { f as Permission } from "../permissions-DttnqqxC.js";
|
|
3
|
-
import { f as ApprovalStore } from "../types-
|
|
4
|
-
import { a as ProblemDetails, t as ApprovalHint } from "../errors-
|
|
5
|
-
import { t as InstanceOptions } from "../instance-options-
|
|
3
|
+
import { f as ApprovalStore } from "../types-aqOHTHcp.js";
|
|
4
|
+
import { a as ProblemDetails, t as ApprovalHint } from "../errors-DPdqI50v.js";
|
|
5
|
+
import { t as InstanceOptions } from "../instance-options-jARdwfPN.js";
|
|
6
6
|
//#region src/terminal/types.d.ts
|
|
7
7
|
type TokenSourceName = "device" | "keychain" | "env" | "ci-oidc";
|
|
8
8
|
type TokenSource = TokenSourceName | {
|
package/dist/terminal/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as compact } from "../compact-y6vfu2_f.js";
|
|
2
2
|
import { a as deniedMessage, i as approvalMessage, n as PermDockDeniedError, t as PermDockApprovalRequiredError } from "../errors-Cz5zn0mW.js";
|
|
3
|
-
import { t as createPermDock$1 } from "../permdock-
|
|
3
|
+
import { t as createPermDock$1 } from "../permdock-CbgvLnuo.js";
|
|
4
4
|
import { n as resourceRef } from "../resource-ref-CaS9yVPi.js";
|
|
5
5
|
import { i as isSubject } from "../subject-C6dLxqHU.js";
|
|
6
6
|
import { l as storedApprovalToken, s as resumeDecision } from "../helpers-H_KARDVC.js";
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { At as SnapshotSource, C as Policy, Ct as SettingsSource, Dr as CustomRole, Ft as TokenVerifier, Mr as Membership, Nr as Principal, Pr as Subject, Pt as TokenSigner, Rt as WhereCompiler, Tt as Snapshot, Wn as ApprovalPolicySource, at as DecisionSink, bn as PolicySource, bt as RelationSource, dt as LimitStore, gt as MembershipSource, jt as SubjectResolver, ln as PermDock, mn as WhereResult, nt as CredentialVerifier, st as EntitlementSource, un as PermDockOptions, xt as RoleSource } from "../policy-
|
|
1
|
+
import { At as SnapshotSource, C as Policy, Ct as SettingsSource, Dr as CustomRole, Ft as TokenVerifier, Mr as Membership, Nr as Principal, Pr as Subject, Pt as TokenSigner, Rt as WhereCompiler, Tt as Snapshot, Wn as ApprovalPolicySource, at as DecisionSink, bn as PolicySource, bt as RelationSource, dt as LimitStore, gt as MembershipSource, jt as SubjectResolver, ln as PermDock, mn as WhereResult, nt as CredentialVerifier, st as EntitlementSource, un as PermDockOptions, xt as RoleSource } from "../policy-IB6yxpC3.js";
|
|
2
2
|
import { f as Permission, g as ResourceInit, u as InferPermissionTree } from "../permissions-DttnqqxC.js";
|
|
3
3
|
import { r as Role } from "../vocabulary-DA8a8zif.js";
|
|
4
|
-
import { f as ApprovalStore } from "../types-
|
|
4
|
+
import { f as ApprovalStore } from "../types-aqOHTHcp.js";
|
|
5
5
|
import { t as ToolMap } from "../types-Bvc4oWT6.js";
|
|
6
6
|
import { n as SupabaseHookManifest } from "../manifest-uDS9y5de.js";
|
|
7
7
|
import { t as supabaseMembershipsBudget } from "../budget-JqcRqyhK.js";
|
|
8
8
|
import { n as RevocationFeed } from "../revocations-Cy06JNx2.js";
|
|
9
|
-
import { g as ReplayStore } from "../types-
|
|
10
|
-
import { v as DirectoryStore } from "../index-
|
|
9
|
+
import { g as ReplayStore } from "../types-Cq_H8N_X.js";
|
|
10
|
+
import { v as DirectoryStore } from "../index-C8z4RjQV.js";
|
|
11
11
|
import { a as SaasProject } from "../permissions-CDgvKG5L.js";
|
|
12
|
-
import { n as saasPolicy } from "../policy-
|
|
12
|
+
import { n as saasPolicy } from "../policy-D2W7uv19.js";
|
|
13
13
|
import { expectTypeOf } from "vitest";
|
|
14
14
|
//#region src/testing/describe-policy.d.ts
|
|
15
15
|
type MatrixOutcome = "granted" | "denied" | "approval-required";
|
package/dist/testing/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { _ as listPermissions, b as resource, n as definePermissions } from "../permissions-DVoF6dMt.js";
|
|
2
2
|
import { r as principal } from "../refs-KYb4ntaz.js";
|
|
3
3
|
import { _ as memoryLimitStore, a as definePolicy, m as role, t as allow } from "../policy-xyWg7QdR.js";
|
|
4
|
-
import { _ as memoryRoleSource, u as snapshotFor } from "../src-
|
|
4
|
+
import { _ as memoryRoleSource, u as snapshotFor } from "../src-BDwEZWrZ.js";
|
|
5
5
|
import { t as memoryRevocationFeed } from "../revocations-Bhr0aMIC.js";
|
|
6
6
|
import { a as normalizeMemberships, d as scopeList } from "../scopes-CVdPrWN-.js";
|
|
7
7
|
import { n as parseSnapshot, p as evaluateCondition } from "../snapshot-Enxd0n-s.js";
|
|
8
8
|
import { i as parsePolicyDocument, r as mergeHostedGrants } from "../hosted-DJQw46hn.js";
|
|
9
|
-
import { E as approvalPoliciesFor, b as validateCustomRole, t as createPermDock, v as membershipsClaim } from "../permdock-
|
|
9
|
+
import { E as approvalPoliciesFor, b as validateCustomRole, t as createPermDock, v as membershipsClaim } from "../permdock-CbgvLnuo.js";
|
|
10
10
|
import { t as byCodePoint } from "../compare-pfyVnBjE.js";
|
|
11
|
-
import { n as fromSnapshot } from "../from-snapshot-
|
|
11
|
+
import { n as fromSnapshot } from "../from-snapshot-CTLijvdm.js";
|
|
12
12
|
import { o as parseCredential } from "../credential-8P81ff4u.js";
|
|
13
13
|
import { o as problemFromDecision } from "../problem-B43ztKIm.js";
|
|
14
14
|
import { l as APPROVAL_HEADER, r as memoryApprovalStore } from "../store-DMAWwAJV.js";
|
|
@@ -17,8 +17,8 @@ import { a as parseApiKey } from "../server-DlZ28Oz5.js";
|
|
|
17
17
|
import { S as sha256Hex, n as directoryMembershipSource, r as scimHandler } from "../scim-BFGBBAqR.js";
|
|
18
18
|
import { t as supabaseMembershipsBudget } from "../budget-NbEtbJC_.js";
|
|
19
19
|
import { a as quoteSqlTable, r as quoteSqlIdent, t as SQL_IDENT } from "../sql-xdg5f4Fi.js";
|
|
20
|
-
import { i as saasPermissions } from "../permissions-
|
|
21
|
-
import { C as saasOrg, E as saasSeed, S as saasMemberships, a as saasProject, g as verifySaasSession, h as signSaasToken, k as saasPolicy, t as saasDoc, w as saasPrincipal, x as saasCustomRoles } from "../saas-
|
|
20
|
+
import { i as saasPermissions } from "../permissions-RJrovw98.js";
|
|
21
|
+
import { C as saasOrg, E as saasSeed, S as saasMemberships, a as saasProject, g as verifySaasSession, h as signSaasToken, k as saasPolicy, t as saasDoc, w as saasPrincipal, x as saasCustomRoles } from "../saas-DhpJjnBA.js";
|
|
22
22
|
import { afterAll, beforeAll, describe, expect, expectTypeOf, it, vi } from "vitest";
|
|
23
23
|
//#region src/testing/describe-policy.ts
|
|
24
24
|
function isOutcomeCell(value) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Cr as Actor, Dr as CustomRole, Mr as Membership, Nr as Principal, Pr as Subject, bt as RelationSource, dt as LimitStore, kr as Delegation, un as PermDockOptions } from "../../policy-
|
|
1
|
+
import { Cr as Actor, Dr as CustomRole, Mr as Membership, Nr as Principal, Pr as Subject, bt as RelationSource, dt as LimitStore, kr as Delegation, un as PermDockOptions } from "../../policy-IB6yxpC3.js";
|
|
2
2
|
import { f as Permission } from "../../permissions-DttnqqxC.js";
|
|
3
3
|
import { a as SaasProject, c as saasPlans, i as SaasFolderSchema, l as saasRoles, n as SaasDocSchema, o as SaasProjectSchema, r as SaasFolder, s as saasPermissions, t as SaasDoc, u as saasTenantRoleNames } from "../../permissions-CDgvKG5L.js";
|
|
4
|
-
import { n as saasPolicy, t as SAAS_API_KEY_LIMIT } from "../../policy-
|
|
4
|
+
import { n as saasPolicy, t as SAAS_API_KEY_LIMIT } from "../../policy-D2W7uv19.js";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
//#region src/testing/saas/schema.d.ts
|
|
7
7
|
type FieldKind = "string" | "boolean" | "nullable-string";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as saasPlans, c as rowSchema, i as saasPermissions, n as SaasFolderSchema, o as saasRoles, r as SaasProjectSchema, s as saasTenantRoleNames, t as SaasDocSchema } from "../../permissions-
|
|
2
|
-
import { C as saasOrg, D as saasUsers, E as saasSeed, O as SAAS_API_KEY_LIMIT, S as saasMemberships, T as saasRelations, _ as verifySaasToken, a as saasProject, b as SAAS_EXPIRED_AT, c as saasUser, d as saasIssuer, f as saasJwks, g as verifySaasSession, h as signSaasToken, i as saasLimitStore, k as saasPolicy, l as SAAS_TOKEN_TTL_SECONDS, m as saasPublicJwk, n as saasFolder, o as saasScenarioOptions, p as saasPrivateJwk, r as saasFolderScenarios, s as saasScenarios, t as saasDoc, u as saasAudience, v as saasSchemaSql, w as saasPrincipal, x as saasCustomRoles, y as saasSeedSql } from "../../saas-
|
|
1
|
+
import { a as saasPlans, c as rowSchema, i as saasPermissions, n as SaasFolderSchema, o as saasRoles, r as SaasProjectSchema, s as saasTenantRoleNames, t as SaasDocSchema } from "../../permissions-RJrovw98.js";
|
|
2
|
+
import { C as saasOrg, D as saasUsers, E as saasSeed, O as SAAS_API_KEY_LIMIT, S as saasMemberships, T as saasRelations, _ as verifySaasToken, a as saasProject, b as SAAS_EXPIRED_AT, c as saasUser, d as saasIssuer, f as saasJwks, g as verifySaasSession, h as signSaasToken, i as saasLimitStore, k as saasPolicy, l as SAAS_TOKEN_TTL_SECONDS, m as saasPublicJwk, n as saasFolder, o as saasScenarioOptions, p as saasPrivateJwk, r as saasFolderScenarios, s as saasScenarios, t as saasDoc, u as saasAudience, v as saasSchemaSql, w as saasPrincipal, x as saasCustomRoles, y as saasSeedSql } from "../../saas-DhpJjnBA.js";
|
|
3
3
|
export { SAAS_API_KEY_LIMIT, SAAS_EXPIRED_AT, SAAS_TOKEN_TTL_SECONDS, SaasDocSchema, SaasFolderSchema, SaasProjectSchema, rowSchema, saasAudience, saasCustomRoles, saasDoc, saasFolder, saasFolderScenarios, saasIssuer, saasJwks, saasLimitStore, saasMemberships, saasOrg, saasPermissions, saasPlans, saasPolicy, saasPrincipal, saasPrivateJwk, saasProject, saasPublicJwk, saasRelations, saasRoles, saasScenarioOptions, saasScenarios, saasSchemaSql, saasSeed, saasSeedSql, saasTenantRoleNames, saasUser, saasUsers, signSaasToken, verifySaasSession, verifySaasToken };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as saasPlans, i as saasPermissions, n as SaasFolderSchema, o as saasRoles, r as SaasProjectSchema, s as saasTenantRoleNames, t as SaasDocSchema } from "../../permissions-
|
|
1
|
+
import { a as saasPlans, i as saasPermissions, n as SaasFolderSchema, o as saasRoles, r as SaasProjectSchema, s as saasTenantRoleNames, t as SaasDocSchema } from "../../permissions-RJrovw98.js";
|
|
2
2
|
export { SaasDocSchema, SaasFolderSchema, SaasProjectSchema, saasPermissions, saasPlans, saasRoles, saasTenantRoleNames };
|
package/dist/trpc/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as Policy, Nr as Principal } from "../policy-
|
|
1
|
+
import { C as Policy, Nr as Principal } from "../policy-IB6yxpC3.js";
|
|
2
2
|
import { f as Permission } from "../permissions-DttnqqxC.js";
|
|
3
3
|
import { n as RevocationFeed } from "../revocations-Cy06JNx2.js";
|
|
4
|
-
import { A as ConnectionOptions, O as Connection, n as OpenApiHooks } from "../create-
|
|
5
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
6
|
-
import { t as StreamProtectOptions } from "../stream-
|
|
4
|
+
import { A as ConnectionOptions, O as Connection, n as OpenApiHooks } from "../create-B1d519XK.js";
|
|
5
|
+
import { t as ServerAdapterOptions } from "../bind-C_ob3LKa.js";
|
|
6
|
+
import { t as StreamProtectOptions } from "../stream-D1RXubw2.js";
|
|
7
7
|
import { AnyTRPCMiddlewareFunction } from "@trpc/server";
|
|
8
8
|
//#region src/trpc/create.d.ts
|
|
9
9
|
type TrpcMiddlewareOpts<TCtx = object, TInput = unknown> = {
|
package/dist/trpc/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as problemMessage } from "../http-SO7qGttf.js";
|
|
2
2
|
import { t as problemFromError } from "../map-error-pgUWNNtG.js";
|
|
3
|
-
import { n as attached } from "../bind-
|
|
3
|
+
import { n as attached } from "../bind-CuzGytRf.js";
|
|
4
4
|
import { a as reloadAfter, r as isAsyncIterable } from "../stream-DDpvynSB.js";
|
|
5
|
-
import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-
|
|
5
|
+
import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-DL9Sqvb1.js";
|
|
6
6
|
import { TRPCError, isTrackedEnvelope } from "@trpc/server";
|
|
7
7
|
//#region src/trpc/create.ts
|
|
8
8
|
const PROBLEM = Symbol.for("permdock.problem");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as TokenVerifier, Tt as Snapshot, Yn as Decision } from "./policy-
|
|
1
|
+
import { Ft as TokenVerifier, Tt as Snapshot, Yn as Decision } from "./policy-IB6yxpC3.js";
|
|
2
2
|
import { f as Permission } from "./permissions-DttnqqxC.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
//#region src/react/types.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nr as Principal, et as AuthEvent } from "./policy-
|
|
1
|
+
import { Nr as Principal, et as AuthEvent } from "./policy-IB6yxpC3.js";
|
|
2
2
|
import { t as ClientNames } from "./clients-C7zLFuWT.js";
|
|
3
3
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
4
|
//#region src/supabase/claims.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cr as Actor, D as PolicyVocabulary, Nr as Principal, Yn as Decision, kr as Delegation, ln as PermDock } from "./policy-
|
|
1
|
+
import { Cr as Actor, D as PolicyVocabulary, Nr as Principal, Yn as Decision, kr as Delegation, ln as PermDock } from "./policy-IB6yxpC3.js";
|
|
2
2
|
import { f as Permission } from "./permissions-DttnqqxC.js";
|
|
3
3
|
//#region src/client/types.d.ts
|
|
4
4
|
type ClientStatus = "ready" | "pending" | "stale" | "server-only";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Cr as Actor, Ft as TokenVerifier, Nr as Principal, Nt as TokenFailureCause, Pr as Subject, ct as JwtClaims, et as AuthEvent, gt as MembershipSource } from "./policy-
|
|
2
|
-
import { f as ApprovalStore } from "./types-
|
|
1
|
+
import { Cr as Actor, Ft as TokenVerifier, Nr as Principal, Nt as TokenFailureCause, Pr as Subject, ct as JwtClaims, et as AuthEvent, gt as MembershipSource } from "./policy-IB6yxpC3.js";
|
|
2
|
+
import { f as ApprovalStore } from "./types-aqOHTHcp.js";
|
|
3
3
|
import { t as ClientNames } from "./clients-C7zLFuWT.js";
|
|
4
4
|
import { n as RevocationFeed } from "./revocations-Cy06JNx2.js";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as RoleThrough } from "./types-
|
|
2
|
-
import { o as SqlMembershipSource } from "./sources-
|
|
1
|
+
import { n as RoleThrough } from "./types-C97IskBw.js";
|
|
2
|
+
import { o as SqlMembershipSource } from "./sources-BdOYLw9j.js";
|
|
3
3
|
//#region src/cli/types.d.ts
|
|
4
4
|
type CollectConfig = {
|
|
5
5
|
readonly srcPath?: readonly string[];
|
|
@@ -468,6 +468,19 @@ type SupabaseHookConfig = {
|
|
|
468
468
|
readonly budget?: number;
|
|
469
469
|
/** Keep `permdock_authz_version` and write the `authz_ver` claim. Default `true`. */
|
|
470
470
|
readonly version?: boolean;
|
|
471
|
+
/**
|
|
472
|
+
* Write PostgREST wrappers for `subject_for`, `members_of` and
|
|
473
|
+
* `authz_version_for` into `schema` (default `public`), named
|
|
474
|
+
* `<prefix>subject_for` and so on (default prefix `permdock_`), for a
|
|
475
|
+
* backend that reaches Postgres through the Data API while the hook schema
|
|
476
|
+
* is not exposed. Each wrapper is `security definer`, revoked from
|
|
477
|
+
* `public`, `anon` and `authenticated`, and granted to `service_role`: the
|
|
478
|
+
* one place the hook grants to it. Pass the same setting to `postgrestSources`.
|
|
479
|
+
*/
|
|
480
|
+
readonly api?: {
|
|
481
|
+
readonly schema?: string;
|
|
482
|
+
readonly prefix?: string;
|
|
483
|
+
};
|
|
471
484
|
/** The `jwt_expiry` the printed `config.toml` block sets. Default 900. */
|
|
472
485
|
readonly jwtExpiry?: number;
|
|
473
486
|
/** Suspended users get empty claims. Default `rls.suspension`. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $n as ExplainedDecision, C as Policy, D as PolicyVocabulary, In as ArazzoPlan, Ln as ArazzoSimulateInput, Mr as Membership, Nr as Principal, Pr as Subject, Yn as Decision, cn as DeriveOptions, fn as SimulateOptions, ln as PermDock, mn as WhereResult, sn as DecideOptions, un as PermDockOptions } from "./policy-
|
|
1
|
+
import { $n as ExplainedDecision, C as Policy, D as PolicyVocabulary, In as ArazzoPlan, Ln as ArazzoSimulateInput, Mr as Membership, Nr as Principal, Pr as Subject, Yn as Decision, cn as DeriveOptions, fn as SimulateOptions, ln as PermDock, mn as WhereResult, sn as DecideOptions, un as PermDockOptions } from "./policy-IB6yxpC3.js";
|
|
2
2
|
import { f as Permission, m as PermissionTree } from "./permissions-DttnqqxC.js";
|
|
3
3
|
//#region src/pdp/types.d.ts
|
|
4
4
|
type RemotePdpAuth = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as PolicyVocabulary, ln as PermDock, rt as DecisionEvent } from "./policy-
|
|
1
|
+
import { D as PolicyVocabulary, ln as PermDock, rt as DecisionEvent } from "./policy-IB6yxpC3.js";
|
|
2
2
|
//#region src/otel/types.d.ts
|
|
3
3
|
declare const GENAI_SEMCONV_PIN = "1.37.0";
|
|
4
4
|
declare const GEN_AI_TOOL_NAME = "gen_ai.tool.name";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as Approver, Mr as Membership, Pr as Subject, dr as RelationGrantee, o as ApprovalStage, r as ApprovalMode } from "./policy-
|
|
1
|
+
import { G as Approver, Mr as Membership, Pr as Subject, dr as RelationGrantee, o as ApprovalStage, r as ApprovalMode } from "./policy-IB6yxpC3.js";
|
|
2
2
|
//#region src/approvals/types.d.ts
|
|
3
3
|
type ApprovalStatus = "pending" | "approved" | "rejected" | "expired";
|
|
4
4
|
type ApprovalApprovers = {
|
package/dist/unplugin/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as PermDockPluginOptions } from "../types-
|
|
1
|
+
import { a as PermDockPluginOptions } from "../types-DbjRN55U.js";
|
|
2
2
|
import { createUnplugin } from "unplugin";
|
|
3
3
|
//#region src/unplugin/index.d.ts
|
|
4
4
|
type CreateUnplugin = typeof createUnplugin<PermDockPluginOptions | undefined>;
|
package/dist/unplugin/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createCollectScheduler, r as report } from "../watch-
|
|
1
|
+
import { n as createCollectScheduler, r as report } from "../watch-DVBJ9cBq.js";
|
|
2
2
|
import { t as peerHint } from "../peer-BOr_kJE1.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
//#region src/unplugin/index.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as listArg, i as globalArgs, t as COMMAND_DESCRIPTIONS } from "./commands-
|
|
1
|
+
import { a as listArg, i as globalArgs, t as COMMAND_DESCRIPTIONS } from "./commands-BeaGNj_o.js";
|
|
2
2
|
import { defineCommand } from "citty";
|
|
3
3
|
//#region src/cli/commands/usage.ts
|
|
4
4
|
function usage(ctx) {
|
|
@@ -24,7 +24,7 @@ function usage(ctx) {
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
async run({ args: parsed, rawArgs }) {
|
|
27
|
-
const result = await (await import("./usage-
|
|
27
|
+
const result = await (await import("./usage-DorAJiU_.js")).runUsage({
|
|
28
28
|
cwd: ctx.cwd,
|
|
29
29
|
config: ctx.config,
|
|
30
30
|
ignore: listArg(rawArgs, "ignore"),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as getResource } from "./permissions-DVoF6dMt.js";
|
|
2
2
|
import { o as usageResult } from "./errors-CWfoNg9N.js";
|
|
3
3
|
import { a as USAGE_REPORT_SCHEMA } from "./version-BvacVTZR.js";
|
|
4
|
-
import { o as jsonSchemaOf } from "./catalog-doc-
|
|
4
|
+
import { o as jsonSchemaOf } from "./catalog-doc-DdGm82XT.js";
|
|
5
5
|
import { i as rel, r as listSourceFiles } from "./files-DWUN9PzI.js";
|
|
6
6
|
import { a as loadModule, n as asPolicy, o as pickNamed } from "./load-DhWEB9P1.js";
|
|
7
|
-
import { r as runCollect } from "./collect-
|
|
7
|
+
import { r as runCollect } from "./collect-DSTE3ml9.js";
|
|
8
8
|
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
9
9
|
import { dirname, resolve } from "node:path";
|
|
10
10
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ProblemDetails } from "./errors-
|
|
1
|
+
import { a as ProblemDetails } from "./errors-DPdqI50v.js";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
3
|
//#region src/core/validation-error.d.ts
|
|
4
4
|
/** The base of every Problem Details `type` URI; defined here so a validation error does not pull in the Problem Details builders. */
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Ft as TokenVerifier, Mr as Membership, Tt as Snapshot, Yn as Decision } from "../policy-
|
|
1
|
+
import { Ft as TokenVerifier, Mr as Membership, Tt as Snapshot, Yn as Decision } from "../policy-IB6yxpC3.js";
|
|
2
2
|
import { f as Permission } from "../permissions-DttnqqxC.js";
|
|
3
3
|
import { r as Role } from "../vocabulary-DA8a8zif.js";
|
|
4
|
-
import { n as requiredPlans } from "../problem-details-
|
|
5
|
-
import { i as describe } from "../describe-
|
|
4
|
+
import { n as requiredPlans } from "../problem-details-DX075l9V.js";
|
|
5
|
+
import { i as describe } from "../describe-DMYiCjJV.js";
|
|
6
6
|
import { t as PermissionBoundaryState } from "../boundary-BmHxVH1J.js";
|
|
7
7
|
import { t as approvalHeaders } from "../headers-Cf-zWvsO.js";
|
|
8
|
-
import { a as FilterResult, c as SubjectView, i as ClientStatus, l as TenantView, n as ApprovalState, o as PermissionSet, r as ClientPermDock, s as PermissionState, t as ApprovalHandle, u as UseRolesOptions } from "../types-
|
|
8
|
+
import { a as FilterResult, c as SubjectView, i as ClientStatus, l as TenantView, n as ApprovalState, o as PermissionSet, r as ClientPermDock, s as PermissionState, t as ApprovalHandle, u as UseRolesOptions } from "../types-CKNSyIf_.js";
|
|
9
9
|
import { ComputedRef, DefineComponent, MaybeRefOrGetter, Plugin } from "vue";
|
|
10
10
|
//#region src/vue/types.d.ts
|
|
11
11
|
type PermDockPluginOptions = {
|
package/dist/vue/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as requiredPlans } from "../problem-details-_AMOYz-w.js";
|
|
2
2
|
import { t as describe } from "../describe-B_gVZEVi.js";
|
|
3
3
|
import { t as approvalHeaders } from "../headers-BZSDieNT.js";
|
|
4
|
-
import { i as isPromiseLike } from "../store-options-
|
|
4
|
+
import { i as isPromiseLike } from "../store-options-ByhZq1jV.js";
|
|
5
5
|
import { a as protectedView, c as subjectView, i as permissionSet, l as tenantView, n as filterResult, o as rolesView, r as livePermDock, s as scopedTenant, t as approvalHandle } from "../views-Soe7bGSC.js";
|
|
6
6
|
import { n as boundaryFallback, t as boundaryDigest } from "../boundary-BM8a_P6E.js";
|
|
7
|
-
import { n as switchTenant, t as providerStore } from "../provider-store-
|
|
7
|
+
import { n as switchTenant, t as providerStore } from "../provider-store-Cfbvo4DE.js";
|
|
8
8
|
import { computed, defineComponent, effectScope, getCurrentScope, inject, isRef, onErrorCaptured, onScopeDispose, provide, shallowRef, toValue, watch } from "vue";
|
|
9
9
|
//#region src/vue/context.ts
|
|
10
10
|
const permDockKey = Symbol("permdock");
|