permdock 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +327 -1
- package/dist/a2a/index.d.ts +169 -0
- package/dist/a2a/index.js +232 -0
- package/dist/adapter-context-mlWsVGGg.js +23 -0
- package/dist/ai-sdk/index.d.ts +95 -0
- package/dist/ai-sdk/index.js +154 -0
- package/dist/approval-required-TzNB9oQA.js +6 -0
- package/dist/approvals/index.d.ts +3 -0
- package/dist/approvals/index.js +5 -0
- package/dist/approvals-DbYAuNkG.js +224 -0
- package/dist/approvers-DT4AVyIg.js +52 -0
- package/dist/arazzo-BAgw9ap6.js +70 -0
- package/dist/arazzo-cmvX2jDe.js +54 -0
- package/dist/authzen/index.d.ts +39 -0
- package/dist/authzen/index.js +302 -0
- package/dist/better-auth/index.d.ts +109 -0
- package/dist/better-auth/index.js +344 -0
- package/dist/better-supabase/index.d.ts +206 -0
- package/dist/better-supabase/index.js +620 -0
- package/dist/bind-CVy3Espv.d.ts +25 -0
- package/dist/bind-VnYn2HKq.js +97 -0
- package/dist/boundary-BM8a_P6E.js +13 -0
- package/dist/boundary-BmHxVH1J.d.ts +15 -0
- package/dist/budget-JqcRqyhK.d.ts +11 -0
- package/dist/budget-NbEtbJC_.js +11 -0
- package/dist/canonical-json-DemiK4Vp.js +26 -0
- package/dist/capability-4qPdO9gk.js +173 -0
- package/dist/capability-Dq43tT1u.d.ts +99 -0
- package/dist/catalog/index.d.ts +12 -0
- package/dist/catalog/index.js +2 -0
- package/dist/catalog-BjZSovXQ.js +2 -0
- package/dist/catalog-doc-Dsc9y7sd.js +309 -0
- package/dist/catalog-h2tlKFkq.js +48 -0
- package/dist/catalog-path-CnI0XTFK.js +12 -0
- package/dist/catalog-z8q6bi_r.js +55 -0
- package/dist/claude-agent/index.d.ts +72 -0
- package/dist/claude-agent/index.js +77 -0
- package/dist/clerk/index.d.ts +65 -0
- package/dist/clerk/index.js +301 -0
- package/dist/cli/bin.d.ts +1 -0
- package/dist/cli/bin.js +20 -0
- package/dist/cli/index.d.ts +46 -0
- package/dist/cli/index.js +5 -0
- package/dist/clients-C7zLFuWT.d.ts +12 -0
- package/dist/clients-DjU5ABMy.js +23 -0
- package/dist/cloud/index.d.ts +90 -0
- package/dist/cloud/index.js +404 -0
- package/dist/cloud-BGhHS-lY.js +50 -0
- package/dist/cloud-Bo3e9Ak3.js +118 -0
- package/dist/collect-DDDv_ESs.js +502 -0
- package/dist/collect-DLlujdHC.js +83 -0
- package/dist/collect-rG2IQ3t0.js +2 -0
- package/dist/commands-DWOrSQic.js +97 -0
- package/dist/compact-y6vfu2_f.js +19 -0
- package/dist/compare-pfyVnBjE.js +12 -0
- package/dist/compile/index.d.ts +3 -0
- package/dist/compile/index.js +2 -0
- package/dist/compile-Ba4blROR.js +613 -0
- package/dist/compile-CNnl6uIt.d.ts +94 -0
- package/dist/config-BJiM-xAm.js +157 -0
- package/dist/config-Bn00Z3ks.js +36 -0
- package/dist/config-report-Dw_JcUqT.js +44 -0
- package/dist/connection-CU8MQxRi.js +194 -0
- package/dist/context-Ttp0ekMT.js +82 -0
- package/dist/convex/index.d.ts +45 -0
- package/dist/convex/index.js +65 -0
- package/dist/create-BWyx3jua.d.ts +245 -0
- package/dist/create-CPhDL6qx.js +253 -0
- package/dist/credential-8P81ff4u.js +306 -0
- package/dist/delegation-D8pUEuce.js +103 -0
- package/dist/describe-B_gVZEVi.js +94 -0
- package/dist/describe-PdoqESvg.d.ts +36 -0
- package/dist/diff-B8Tunc3o.js +451 -0
- package/dist/diff-CzqLxZ77.js +48 -0
- package/dist/digest-B3kc_PgQ.d.ts +19 -0
- package/dist/digest-BI-6aa6d.js +27 -0
- package/dist/doctor-WpvG6p4k.js +1194 -0
- package/dist/doctor-collect-ByfYlNv1.js +664 -0
- package/dist/doctor-rOr-4ZfS.js +53 -0
- package/dist/drizzle/index.d.ts +73 -0
- package/dist/drizzle/index.js +160 -0
- package/dist/duration-xK2jGFVc.js +25 -0
- package/dist/elysia/index.d.ts +49 -0
- package/dist/elysia/index.js +59 -0
- package/dist/errors-CWfoNg9N.js +47 -0
- package/dist/errors-Cz5zn0mW.js +123 -0
- package/dist/errors-DAqevpNk.d.ts +125 -0
- package/dist/errors-DRnGZHzF.js +30 -0
- package/dist/evaluation-items-CfCCejQd.js +40 -0
- package/dist/evaluations-tz6D9A2G.js +461 -0
- package/dist/eve/index.d.ts +86 -0
- package/dist/eve/index.js +176 -0
- package/dist/expiry-BoBJ8Tvc.js +7 -0
- package/dist/express/index.d.ts +23 -0
- package/dist/express/index.js +78 -0
- package/dist/fastify/index.d.ts +33 -0
- package/dist/fastify/index.js +92 -0
- package/dist/fields-BMl1RxoX.js +26 -0
- package/dist/files-DWUN9PzI.js +125 -0
- package/dist/fixtures-ht28Cplr.js +67 -0
- package/dist/freeze-CrU8nQeX.js +60 -0
- package/dist/from-snapshot-C3sHpZNS.js +569 -0
- package/dist/generate-CH7ThJ14.js +173 -0
- package/dist/grantee-Cv5Sogfv.js +602 -0
- package/dist/graph-sql-B-dsAT6j.d.ts +29 -0
- package/dist/headers-BZSDieNT.js +6 -0
- package/dist/headers-Cf-zWvsO.d.ts +6 -0
- package/dist/helpers-H_KARDVC.js +421 -0
- package/dist/hono/index.d.ts +48 -0
- package/dist/hono/index.js +99 -0
- package/dist/hosted-DJQw46hn.js +266 -0
- package/dist/http-BIhmLfCc.js +95 -0
- package/dist/http-DPuDaChb.d.ts +13 -0
- package/dist/http-SO7qGttf.js +44 -0
- package/dist/ids-DC4V4CFu.js +18 -0
- package/dist/index-A0YNL8jZ.d.ts +177 -0
- package/dist/index-CtE07CBF.d.ts +6 -0
- package/dist/index-D3vbkoSI.d.ts +483 -0
- package/dist/index-D6_cSa1z.d.ts +201 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +26 -0
- package/dist/instance-options-BK_rNOSC.d.ts +11 -0
- package/dist/instance-options-Dhhcnm3y.js +22 -0
- package/dist/json-schema-BsAflUGW.js +106 -0
- package/dist/jwt/index.d.ts +91 -0
- package/dist/jwt/index.js +590 -0
- package/dist/kernel-GSQnMz3O.js +208 -0
- package/dist/kysely/index.d.ts +78 -0
- package/dist/kysely/index.js +129 -0
- package/dist/live-options-H2eG8dfJ.js +60 -0
- package/dist/load-DhWEB9P1.js +75 -0
- package/dist/load-DwJUafYN.js +2 -0
- package/dist/load-jose-BL6LH4bL.js +11 -0
- package/dist/lru-8q4WZjBV.js +28 -0
- package/dist/manifest-iaoBXHKc.js +783 -0
- package/dist/manifest-uDS9y5de.d.ts +206 -0
- package/dist/map-AcxK9o_D.js +147 -0
- package/dist/map-claims-Z4QZOiFF.js +369 -0
- package/dist/map-error-pgUWNNtG.js +23 -0
- package/dist/markers-B0hYLvMD.js +60 -0
- package/dist/may-use-DndQ5tQ-.js +77 -0
- package/dist/mcp/index.d.ts +159 -0
- package/dist/mcp/index.js +603 -0
- package/dist/nest/index.d.ts +75 -0
- package/dist/nest/index.js +261 -0
- package/dist/next/client.d.ts +23 -0
- package/dist/next/client.js +33 -0
- package/dist/next/index.d.ts +93 -0
- package/dist/next/index.js +180 -0
- package/dist/next/plugin.d.ts +14 -0
- package/dist/next/plugin.js +33 -0
- package/dist/node/index.d.ts +24 -0
- package/dist/node/index.js +34 -0
- package/dist/openai/index.d.ts +62 -0
- package/dist/openai/index.js +92 -0
- package/dist/openapi/index.d.ts +176 -0
- package/dist/openapi/index.js +3 -0
- package/dist/openapi-Bbg4wGVL.js +164 -0
- package/dist/openapi-BqRBvAng.js +538 -0
- package/dist/openapi-CqqEbHsL.js +250 -0
- package/dist/openapi-import-cmwetbzw.js +5959 -0
- package/dist/openapi-schema--ARjyfQr.js +6902 -0
- package/dist/orpc/index.d.ts +51 -0
- package/dist/orpc/index.js +145 -0
- package/dist/otel/index.d.ts +13 -0
- package/dist/otel/index.js +202 -0
- package/dist/package-root-zGkxO3oN.js +30 -0
- package/dist/parse-BuyjxhZV.js +53 -0
- package/dist/parse-local-manifest-BkGQNzAh.d.ts +10 -0
- package/dist/parse-local-manifest-BrMozJCo.js +36 -0
- package/dist/pdp/index.d.ts +22 -0
- package/dist/pdp/index.js +682 -0
- package/dist/peer-BOr_kJE1.js +31 -0
- package/dist/permdock-CzqXjCpU.js +3471 -0
- package/dist/permissions-CDgvKG5L.d.ts +52 -0
- package/dist/permissions-CpZrivYv.js +142 -0
- package/dist/permissions-DVoF6dMt.js +662 -0
- package/dist/permissions-DttnqqxC.d.ts +214 -0
- package/dist/pins-8ILTftC9.js +12 -0
- package/dist/policy-CFZAr_Al.d.ts +2252 -0
- package/dist/policy-D8UFyERw.d.ts +20 -0
- package/dist/policy-xyWg7QdR.js +1122 -0
- package/dist/powersync-A8x_Yyvh.js +2 -0
- package/dist/powersync-C7kLglqX.js +540 -0
- package/dist/powersync-yW1UUFzp.js +62 -0
- package/dist/prisma/index.d.ts +136 -0
- package/dist/prisma/index.js +455 -0
- package/dist/problem-B43ztKIm.js +191 -0
- package/dist/problem-details-CkL50EEf.d.ts +7 -0
- package/dist/problem-details-_AMOYz-w.js +144 -0
- package/dist/prompt-CXYhLfsS.js +32 -0
- package/dist/protected-CNsMzrVd.d.ts +27 -0
- package/dist/protected-Cs6kTaHo.js +100 -0
- package/dist/protected-bZs6rbT1.d.ts +40 -0
- package/dist/provider-Cjr62YMV.d.ts +6 -0
- package/dist/provider-DLzpb2Xz.js +52 -0
- package/dist/provider-store-DNyC1y48.js +43 -0
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.js +7 -0
- package/dist/react/provider-client.d.ts +2 -0
- package/dist/react/provider-client.js +3 -0
- package/dist/react-native/index.d.ts +198 -0
- package/dist/react-native/index.js +696 -0
- package/dist/refs-KYb4ntaz.js +91 -0
- package/dist/relations-cjOL01hZ.js +505 -0
- package/dist/replay-BsOyTrdV.js +28 -0
- package/dist/replay-sqBGMnNs.d.ts +5 -0
- package/dist/resource-ref-CaS9yVPi.js +20 -0
- package/dist/revocations-Bhr0aMIC.js +27 -0
- package/dist/revocations-Cy06JNx2.d.ts +21 -0
- package/dist/rls-BMNydpHk.js +2521 -0
- package/dist/rls-CEvs64Kj.js +238 -0
- package/dist/rls-fields-BMasREhR.js +3502 -0
- package/dist/rls-graph-pc9fuXYm.js +435 -0
- package/dist/rls-import-D8F7j35Q.js +943 -0
- package/dist/rls-migrate-7wikfrVI.js +367 -0
- package/dist/rls-ownership-B5Lkq62W.js +843 -0
- package/dist/rls-shared-aOQ4hGTO.js +493 -0
- package/dist/rls-verify-D8B7dOTh.js +745 -0
- package/dist/row-check-Dt35czLy.d.ts +40 -0
- package/dist/rpc-DOK54_CS.js +89 -0
- package/dist/run-YXCJDNYk.js +174 -0
- package/dist/runtime-CB8gQFvS.js +11 -0
- package/dist/saas-Bj_FFkjN.js +1203 -0
- package/dist/schema-D3MnDMxa.js +300 -0
- package/dist/scim/index.d.ts +2 -0
- package/dist/scim/index.js +2 -0
- package/dist/scim-BFGBBAqR.js +1445 -0
- package/dist/scopes-CVdPrWN-.js +239 -0
- package/dist/server/index.d.ts +134 -0
- package/dist/server/index.js +11 -0
- package/dist/server-DlZ28Oz5.js +268 -0
- package/dist/sha256-BO0swRXL.js +150 -0
- package/dist/shared-DRu8VFVM.js +123 -0
- package/dist/sink-Bd9PSyfq.js +141 -0
- package/dist/sink-Gs6TTVa-.d.ts +104 -0
- package/dist/skills-Biq5uup3.js +192 -0
- package/dist/skills-JaymNCdK.js +56 -0
- package/dist/snapshot-Enxd0n-s.js +975 -0
- package/dist/snapshot-cache-D6jLelln.js +44 -0
- package/dist/snapshot-cache-DwQH8ufx.d.ts +45 -0
- package/dist/solid/index.d.ts +93 -0
- package/dist/solid/index.js +188 -0
- package/dist/sources-B0UvrJ21.js +534 -0
- package/dist/sources-BcJgw0lt.d.ts +192 -0
- package/dist/sql-xdg5f4Fi.js +27 -0
- package/dist/src-CSbUiozF.js +568 -0
- package/dist/ssf/index.d.ts +4 -0
- package/dist/ssf/index.js +596 -0
- package/dist/store-DMAWwAJV.js +371 -0
- package/dist/store-D_pjn91-.d.ts +36 -0
- package/dist/store-options-yO0V6gRn.js +716 -0
- package/dist/stores-4_sqiOA1.js +87 -0
- package/dist/stores-DVR5NHLE.d.ts +52 -0
- package/dist/stream-DDpvynSB.js +66 -0
- package/dist/stream-DlvG2hs-.d.ts +12 -0
- package/dist/style-CTm1AXDT.js +22 -0
- package/dist/subject-C6dLxqHU.js +24 -0
- package/dist/subject-settings-BwBmCdTR.js +128 -0
- package/dist/supabase/index.d.ts +183 -0
- package/dist/supabase/index.js +5 -0
- package/dist/supabase/middleware.d.ts +82 -0
- package/dist/supabase/middleware.js +102 -0
- package/dist/supabase-CwafwxxF.js +83 -0
- package/dist/supabase-DTBaC20O.js +774 -0
- package/dist/supabase-config-Bs44dare.js +472 -0
- package/dist/supabase-hook-BuxLQLpU.js +1814 -0
- package/dist/supabase-hook-D5qVd_D8.js +2 -0
- package/dist/supautils-DYZnzRWV.js +91 -0
- package/dist/svelte/PermissionBoundary.svelte +37 -0
- package/dist/svelte/Protected.svelte +40 -0
- package/dist/svelte/index.d.ts +13 -0
- package/dist/svelte/index.js +107 -0
- package/dist/svelte/runtime.d.ts +7 -0
- package/dist/svelte/runtime.js +4 -0
- package/dist/svelte/source.d.ts +13 -0
- package/dist/svelte/source.js +11 -0
- package/dist/terminal/index.d.ts +163 -0
- package/dist/terminal/index.js +833 -0
- package/dist/testing/index.d.ts +745 -0
- package/dist/testing/index.js +3672 -0
- package/dist/testing/saas/index.d.ts +194 -0
- package/dist/testing/saas/index.js +3 -0
- package/dist/testing/saas/permissions.d.ts +2 -0
- package/dist/testing/saas/permissions.js +2 -0
- package/dist/text-diff-BdkkYSbi.js +15 -0
- package/dist/thenable-okc2xDsj.js +10 -0
- package/dist/timeout-D51niuQP.js +8 -0
- package/dist/token-CIWxJOCh.js +50 -0
- package/dist/trpc/index.d.ts +61 -0
- package/dist/trpc/index.js +122 -0
- package/dist/types-9AWO9EGt.d.ts +197 -0
- package/dist/types-BPxgszlT.d.ts +550 -0
- package/dist/types-BVyImy5I.d.ts +120 -0
- package/dist/types-Bvc4oWT6.d.ts +9 -0
- package/dist/types-C3s9xVJG.d.ts +48 -0
- package/dist/types-Dnemwd77.d.ts +183 -0
- package/dist/types-kxznc7cn.d.ts +52 -0
- package/dist/types-vKyAMtcX.d.ts +157 -0
- package/dist/types-vNSDF7Dq.d.ts +66 -0
- package/dist/types-yF5LmQVD.d.ts +306 -0
- package/dist/unplugin/index.d.ts +7 -0
- package/dist/unplugin/index.js +31 -0
- package/dist/usage-D07N9QJ3.js +42 -0
- package/dist/usage-D82l1CwK.js +2 -0
- package/dist/usage-DG1oeCca.js +693 -0
- package/dist/validation-error-CnjZ4t92.js +33 -0
- package/dist/validation-error-CtF23SrC.d.ts +26 -0
- package/dist/validity-uOp8UpYn.js +245 -0
- package/dist/verifier-BxBo6I44.js +466 -0
- package/dist/version-BvacVTZR.js +17 -0
- package/dist/views-Soe7bGSC.js +95 -0
- package/dist/vocabulary-DA8a8zif.d.ts +56 -0
- package/dist/vue/index.d.ts +79 -0
- package/dist/vue/index.js +196 -0
- package/dist/watch-Etoa_Mvr.js +2 -0
- package/dist/watch-UihESpsJ.js +128 -0
- package/dist/webmcp/index.d.ts +75 -0
- package/dist/webmcp/index.js +307 -0
- package/package.json +450 -5
- package/rulesets/permdock.yaml +29 -0
- package/schemas/approval-request-v1.json +175 -0
- package/schemas/catalog-v1.json +535 -0
- package/schemas/openapi/oas-3.1.json +1298 -0
- package/schemas/openapi/oas-3.2.json +1516 -0
- package/schemas/openapi/overlay-1.1.json +79 -0
- package/schemas/supabase-claims-v1.json +144 -0
- package/schemas/supabase-manifest-v1.json +361 -0
- package/skills/permdock/SKILL.md +66 -0
- package/skills/permdock-agents/SKILL.md +77 -0
- package/skills/permdock-agents/references/runtimes.md +213 -0
- package/skills/permdock-approvals/SKILL.md +80 -0
- package/skills/permdock-approvals/references/stores-and-resume.md +94 -0
- package/skills/permdock-audit/SKILL.md +67 -0
- package/skills/permdock-credentials/SKILL.md +55 -0
- package/skills/permdock-credentials/references/tokens-keys-links.md +132 -0
- package/skills/permdock-data/SKILL.md +57 -0
- package/skills/permdock-data/references/queries-and-rls.md +62 -0
- package/skills/permdock-data/references/relationships.md +67 -0
- package/skills/permdock-tenancy/SKILL.md +80 -0
- package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +89 -0
- package/skills/permdock-wire/SKILL.md +116 -0
- package/skills/permdock-wire/references/adapters.md +492 -0
- package/skills/permdock-wire/references/policy-options.md +45 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Mr as Membership, Pr as Subject, Pt as TokenSigner, Yn as Decision, bt as RelationSource, ln as PermDock } from "./policy-CFZAr_Al.js";
|
|
2
|
+
import { f as Permission, m as PermissionTree } from "./permissions-DttnqqxC.js";
|
|
3
|
+
import { a as ApprovalListFilter, c as ApprovalRequest, f as ApprovalStore, i as ApprovalInspectResult, m as ApprovalVerdict, o as ApprovalListQuery, r as ApprovalCancelMeta, s as ApprovalPage } from "./types-vKyAMtcX.js";
|
|
4
|
+
//#region src/approvals/errors.d.ts
|
|
5
|
+
type ApprovalErrorCode = "approval-not-found" | "approval-not-pending" | "approval-expired" | "approver-unauthenticated" | "approver-is-actor" | "approver-is-principal" | "approver-not-eligible" | "approver-repeated";
|
|
6
|
+
declare class ApprovalError extends Error {
|
|
7
|
+
override readonly name: "ApprovalError";
|
|
8
|
+
readonly code: ApprovalErrorCode;
|
|
9
|
+
constructor(code: ApprovalErrorCode, message: string);
|
|
10
|
+
}
|
|
11
|
+
/** Matches by `name` and `code`, so an error from another copy of the module still maps. */
|
|
12
|
+
declare function isApprovalError(value: unknown): value is ApprovalError;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/approvals/handler.d.ts
|
|
15
|
+
type ApprovalsHandlerOptions = {
|
|
16
|
+
readonly subject: (request: Request) => Subject | null | undefined | Promise<Subject | null | undefined>;
|
|
17
|
+
/** Refuse the principal even on grants that set `approval: { distinct: false }`. */
|
|
18
|
+
readonly requireDistinctApprover?: boolean;
|
|
19
|
+
readonly signer?: TokenSigner;
|
|
20
|
+
readonly audience?: string | readonly string[];
|
|
21
|
+
/** Where `relation()` approvers are read, by the request's resource id; without it they match nobody. */
|
|
22
|
+
readonly relations?: RelationSource;
|
|
23
|
+
/** The policy's permission tree, for `through` links and `includes` on relation approvers. */
|
|
24
|
+
readonly permissions?: PermissionTree;
|
|
25
|
+
/**
|
|
26
|
+
* The approver's own instance in the request's tenant, for
|
|
27
|
+
* `holder(permission)` approvers (custom roles included when the instance
|
|
28
|
+
* reads a `RoleSource`). Without it, or when it throws, they match nobody.
|
|
29
|
+
*/
|
|
30
|
+
readonly permdockFor?: (approver: Subject, request: ApprovalRequest) => PermDock | Promise<PermDock>;
|
|
31
|
+
};
|
|
32
|
+
declare function approvalsHandler(store: ApprovalStore, options: ApprovalsHandlerOptions): (request: Request) => Promise<Response>;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/approvals/relations.d.ts
|
|
35
|
+
type ApproverRelationsOptions = {
|
|
36
|
+
/** The object graph relation approvers are read from; without it they match nobody. */
|
|
37
|
+
readonly relations?: RelationSource;
|
|
38
|
+
/** The permission tree the policy declares; needed to follow `through` links and `includes`. */
|
|
39
|
+
readonly permissions?: PermissionTree;
|
|
40
|
+
readonly now?: Date;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The relation approvers of `request` that `subject` holds on its resource,
|
|
44
|
+
* keyed by `approverRelationKey`, for `ApprovalVerdict.relations`. Reads go
|
|
45
|
+
* through `relations` by the request's resource id; a request without an id,
|
|
46
|
+
* a missing source or a read that fails holds nothing.
|
|
47
|
+
*/
|
|
48
|
+
declare function approverRelations(request: ApprovalRequest, subject: Subject, options: ApproverRelationsOptions): Promise<readonly string[]>;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/approvals/helpers.d.ts
|
|
51
|
+
declare function summariseSubject(subject: Subject): ApprovalRequest["subject"];
|
|
52
|
+
declare function requestApproval(store: ApprovalStore, decision: Extract<Decision, {
|
|
53
|
+
readonly outcome: "approval-required";
|
|
54
|
+
}>, meta: {
|
|
55
|
+
readonly permission: Permission | {
|
|
56
|
+
readonly key: string;
|
|
57
|
+
readonly scope: string;
|
|
58
|
+
readonly resource: string;
|
|
59
|
+
};
|
|
60
|
+
readonly resource?: {
|
|
61
|
+
readonly type: string;
|
|
62
|
+
readonly id?: string;
|
|
63
|
+
};
|
|
64
|
+
readonly subject: Subject;
|
|
65
|
+
readonly membership?: Membership;
|
|
66
|
+
readonly adapter?: string;
|
|
67
|
+
readonly ttl?: number;
|
|
68
|
+
readonly now?: Date;
|
|
69
|
+
readonly detail?: string;
|
|
70
|
+
}): Promise<ApprovalRequest>;
|
|
71
|
+
/**
|
|
72
|
+
* Checks `verdict.by` and resolves the request. Relation approvers are read
|
|
73
|
+
* through `options.relations` unless `verdict.relations` is already set.
|
|
74
|
+
*/
|
|
75
|
+
declare function resolveApproval(store: ApprovalStore, token: string, verdict: ApprovalVerdict, options?: ApproverRelationsOptions & {
|
|
76
|
+
readonly requireDistinctApprover?: boolean;
|
|
77
|
+
readonly permdockFor?: ApprovalsHandlerOptions["permdockFor"];
|
|
78
|
+
}): Promise<ApprovalRequest>;
|
|
79
|
+
declare function vouchApproval(store: ApprovalStore, token: string, verdict: {
|
|
80
|
+
readonly status: "approved" | "rejected";
|
|
81
|
+
readonly by: Subject;
|
|
82
|
+
readonly rule: string;
|
|
83
|
+
readonly note?: string;
|
|
84
|
+
}): Promise<ApprovalRequest>;
|
|
85
|
+
declare function inspectApproval(store: ApprovalStore, token: string, now?: Date): Promise<ApprovalInspectResult>;
|
|
86
|
+
/** Inspects `token` and, when it is approved, consumes it so it resumes once. */
|
|
87
|
+
declare function consumeApproval(store: ApprovalStore, token: string, now?: Date): Promise<ApprovalInspectResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Applies a resume token to a decision. The token only matters when the
|
|
90
|
+
* decision is `approval-required` and the token is the one this call was
|
|
91
|
+
* issued; otherwise a new approval is requested. A matching token is consumed
|
|
92
|
+
* unless `consume` is `false`, so an approval resumes exactly one call. Under
|
|
93
|
+
* `staleOn: 'resource-change'`, a token issued for an earlier version of the
|
|
94
|
+
* same row denies with `stale-approval`; the next call without it asks again.
|
|
95
|
+
*/
|
|
96
|
+
declare function resumeDecision(input: {
|
|
97
|
+
readonly decision: Decision;
|
|
98
|
+
readonly permission: Permission | {
|
|
99
|
+
readonly key: string;
|
|
100
|
+
readonly scope: string;
|
|
101
|
+
readonly resource: string;
|
|
102
|
+
};
|
|
103
|
+
readonly subject: Subject;
|
|
104
|
+
readonly store: ApprovalStore | undefined;
|
|
105
|
+
readonly resource: {
|
|
106
|
+
readonly type: string;
|
|
107
|
+
readonly id?: string;
|
|
108
|
+
};
|
|
109
|
+
readonly adapter: string;
|
|
110
|
+
readonly token: string | undefined;
|
|
111
|
+
/** `false` for checks that do not run the action, such as the decision endpoint. */
|
|
112
|
+
readonly consume?: boolean;
|
|
113
|
+
readonly now?: Date;
|
|
114
|
+
/**
|
|
115
|
+
* How long a request this call opens stays open, in milliseconds; absent
|
|
116
|
+
* means the store's `ttl`, else `DEFAULT_APPROVAL_TTL_MS`. The grant's
|
|
117
|
+
* `approval.ttl` still caps it.
|
|
118
|
+
*/
|
|
119
|
+
readonly ttl?: number;
|
|
120
|
+
}): Promise<Decision>;
|
|
121
|
+
declare function cancelApprovals(store: ApprovalStore, filter: ApprovalListFilter, meta: ApprovalCancelMeta): Promise<number>;
|
|
122
|
+
declare function readApprovalHeader(headers: Headers | {
|
|
123
|
+
readonly get: (name: string) => string | null;
|
|
124
|
+
}): string | undefined;
|
|
125
|
+
declare function resumeFromHeader(store: ApprovalStore, headers: Headers | {
|
|
126
|
+
readonly get: (name: string) => string | null;
|
|
127
|
+
}, now?: Date): Promise<ApprovalInspectResult>;
|
|
128
|
+
/**
|
|
129
|
+
* The token to resume `decision` with when the caller carries none: the
|
|
130
|
+
* decision's own token when the store holds an approved or rejected request
|
|
131
|
+
* for it, so `resumeDecision` resumes (or denies) the call without the
|
|
132
|
+
* caller passing the token back. The token already binds permission,
|
|
133
|
+
* resource (or the call's data when there is no row id), subject and actor.
|
|
134
|
+
* A pending request counts only with `denyPending: true`, which makes the
|
|
135
|
+
* call deny with `approval-pending` instead of asking again. `undefined` when
|
|
136
|
+
* the decision needs no approval, there is no store, or the store has no
|
|
137
|
+
* unexpired request for the token; a store that throws counts as none.
|
|
138
|
+
*/
|
|
139
|
+
declare function storedApprovalToken(store: ApprovalStore | undefined, decision: Decision, options?: {
|
|
140
|
+
readonly denyPending?: boolean;
|
|
141
|
+
readonly now?: Date;
|
|
142
|
+
}): Promise<string | undefined>;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/approvals/page.d.ts
|
|
145
|
+
/** The page size of a query: `limit` within 1 to 200, 50 when absent. */
|
|
146
|
+
declare function approvalPageSize(limit: number | undefined): number;
|
|
147
|
+
/** Where a page starts: the `(createdAt, token)` of the last request before it. */
|
|
148
|
+
type ApprovalCursorPosition = readonly [createdAt: string, token: string];
|
|
149
|
+
/** The `next` cursor after `request`, for a store that pages in its own query. */
|
|
150
|
+
declare function encodeApprovalCursor(request: ApprovalRequest): string;
|
|
151
|
+
/** The `(createdAt, token)` position a `next` cursor names, or `null` for one that does not parse. */
|
|
152
|
+
declare function decodeApprovalCursor(cursor: string): ApprovalCursorPosition | null;
|
|
153
|
+
/**
|
|
154
|
+
* Pages already-filtered requests in `(createdAt, token)` order, as the
|
|
155
|
+
* built-in stores do: `limit` within 1 to 200 (50 when absent), `cursor` from
|
|
156
|
+
* the previous page's `next`, and no items for a cursor that does not parse.
|
|
157
|
+
* A custom `ApprovalStore` that filters in memory returns it from `list`.
|
|
158
|
+
*/
|
|
159
|
+
declare function pageApprovals(matching: readonly ApprovalRequest[], query: ApprovalListQuery): ApprovalPage;
|
|
160
|
+
/** Every matching request of `store`, following `next` until the last page (at most 1000 pages of 200). */
|
|
161
|
+
declare function listAllApprovals(store: ApprovalStore, filter: ApprovalListFilter): Promise<ApprovalRequest[]>;
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/approvals/permissions.d.ts
|
|
164
|
+
/**
|
|
165
|
+
* The `holder(permission)` approvers of `request` that `approver` holds, for
|
|
166
|
+
* `ApprovalVerdict.permissions`: each permission key the approver's own
|
|
167
|
+
* instance grants without a row. `approver` must be an instance for the
|
|
168
|
+
* approving principal in the request's tenant; for any other tenant, or an
|
|
169
|
+
* anonymous instance, it holds nothing. A check that throws holds nothing.
|
|
170
|
+
*/
|
|
171
|
+
declare function approverPermissions(request: ApprovalRequest, approver: PermDock): readonly string[];
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/approvals/store.d.ts
|
|
174
|
+
/**
|
|
175
|
+
* Refuses `by` as an approver of `request`, or returns the index of the
|
|
176
|
+
* stage the approval counts for (`undefined` without `stages`). Eligibility
|
|
177
|
+
* is `approvers.by` or, under `stages`, the first incomplete stage
|
|
178
|
+
* (`sequential`) or any incomplete stage (`all`); `approvers.escalation.to`
|
|
179
|
+
* is eligible too once the request has waited `escalation.after`. A
|
|
180
|
+
* principal who already approved is refused, so one person never completes
|
|
181
|
+
* two stages. `relations` are the relation approvers `by` holds on the
|
|
182
|
+
* request's resource (see `ApprovalVerdict.relations`).
|
|
183
|
+
*/
|
|
184
|
+
declare function assertApprover(request: ApprovalRequest, by: Subject, requireDistinctApprover: boolean, now?: Date, relations?: readonly string[], permissions?: readonly string[]): number | undefined;
|
|
185
|
+
/**
|
|
186
|
+
* The request after `verdict`, for a store to persist: a rejection resolves
|
|
187
|
+
* it; an approval is appended to `approvals` and resolves it once there are
|
|
188
|
+
* `approvers.quorum` (default 1). Throws an `ApprovalError` when the request
|
|
189
|
+
* is not pending, has expired or `verdict.by` may not approve it. Stores
|
|
190
|
+
* should write the result only when the stored row is still pending with the
|
|
191
|
+
* same number of approvals, so two approvers racing both count.
|
|
192
|
+
*/
|
|
193
|
+
declare function applyApprovalVerdict(request: ApprovalRequest, verdict: ApprovalVerdict, now?: Date): ApprovalRequest;
|
|
194
|
+
type MemoryApprovalStore = ApprovalStore & {
|
|
195
|
+
readonly ttl: number;
|
|
196
|
+
};
|
|
197
|
+
declare function memoryApprovalStore(options?: {
|
|
198
|
+
readonly ttl?: number;
|
|
199
|
+
}): MemoryApprovalStore;
|
|
200
|
+
//#endregion
|
|
201
|
+
export { ApproverRelationsOptions as C, ApprovalError as D, approvalsHandler as E, ApprovalErrorCode as O, vouchApproval as S, ApprovalsHandlerOptions as T, resolveApproval as _, approverPermissions as a, storedApprovalToken as b, decodeApprovalCursor as c, pageApprovals as d, cancelApprovals as f, requestApproval as g, readApprovalHeader as h, memoryApprovalStore as i, isApprovalError as k, encodeApprovalCursor as l, inspectApproval as m, applyApprovalVerdict as n, ApprovalCursorPosition as o, consumeApproval as p, assertApprover as r, approvalPageSize as s, MemoryApprovalStore as t, listAllApprovals as u, resumeDecision as v, approverRelations as w, summariseSubject as x, resumeFromHeader as y };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { $ as AccessEvent, $n as ExplainedDecision, $t as CredentialPrincipal, A as RoleOptions, An as RoleChangeOptions, Ar as GnapAccess, At as SnapshotSource, B as normalizeApproval, Bn as simulateArazzo, Br as MemberOfParent, Bt as memoryMembershipSource, C as Policy, Cn as mergeHostedGrants, Cr as Actor, Ct as SettingsSource, Dn as WhoCan, Dr as CustomRole, Dt as SnapshotGrant, E as PolicyScopes, En as HoldingVia, Er as Binding, Et as SnapshotAssignable, F as SupportConsent, Fn as ArazzoFinding, Fr as VerifiedClaims, Ft as TokenVerifier, G as Approver, Gn as ApprovalPolicyValidation, Gr as SqlFunctionArg, Gt as WireDenial, H as role, Hn as ApprovalPolicy, Hr as RelatedCondition, Ht as memorySettings, I as ValidateMode, In as ArazzoPlan, Ir as Condition, It as VerificationFailure, J as UserApprover, Jn as ApprovalRequiredDecision, Jr as isCondition, Jt as CredentialKind, K as ApproverInput, Kn as memoryApprovalPolicies, Kr as SqlFunctionCondition, Kt as Credential, L as allow, Ln as ArazzoSimulateInput, Lr as ConditionRef, Lt as VerifiedToken, M as SeparationConflict, Mn as ActivateInput, Mr as Membership, Mt as TenantSettings, N as SubjectOf, Nn as breakGlass, Nr as Principal, Nt as TokenFailureCause, O as PrincipalOf, On as RoleChange, Or as CustomRoleGrant, Ot as SnapshotNotEntitled, P as SupportAccessOptions, Pn as supportAccess, Pr as Subject, Pt as TokenSigner, Q as user, Qn as DeniedDecision, Qt as CredentialPolicyViolation, R as definePolicy, Rn as ArazzoStepResult, Rr as ConditionValue, Rt as WhereCompiler, S as MembershipFixture, Sn as memoryPolicySource, Sr as ScopeNames, St as RoleSourceFactory, T as PolicyOAuthScope, Tn as Holder, Tr as AuthorizationDetail, Tt as Snapshot, U as separationConflicts, Un as ApprovalPolicyProblem, Ur as RelatedHop, Ut as memorySnapshotSource, V as normalizeAssurance, Vn as APPROVAL_POLICY_UNAVAILABLE, Vt as memoryRoleSource, W as AnyOfApprover, Wn as ApprovalPolicySource, Wr as RestrictedAncestors, Wt as WireDecision, X as anyOf, Xn as Denial, Xr as isConditionRef, Xt as CredentialPermissionInput, Y as allOf, Yn as Decision, Yr as isConditionDate, Yt as CredentialPermission, Z as holder, Zn as DenialReason, Zr as isSqlFunctionField, Zt as CredentialPolicy, _ as GrantLimit, _n as HostedGrantDropReason, _r as plan, _t as RelationChain, a as ApprovalRequirement, an as decideCredential, ar as Trace, at as DecisionSink, b as GrantValidity, bn as PolicySource, br as Scope, bt as RelationSource, c as BreakGlassOptions, cn as DeriveOptions, cr as Grantee, d as ClosureContext, dn as RowPair, dr as RelationGrantee, dt as LimitStore, en as CredentialRequest, er as GrantedDecision, et as AuthEvent, f as ClosureGrantFn, fn as SimulateOptions, fr as actor, ft as LocalCustomRoleTable, g as GrantCondition, gn as HostedGrant, gr as inherit, gt as MembershipSource, h as Grant, hn as createPermDock, hr as authenticated, ht as MembershipEvent, i as ApprovalOption, in as credentialSubject, ir as Quota, it as DecisionProvider, j as RoleScope, jn as RoleChangeTarget, jt as SubjectResolver, k as RoleBinding, kn as RoleChangeDecision, kr as Delegation, kt as SnapshotScope, l as BreakGlassRequirements, ln as PermDock, lr as GranteeInput, lt as LimitConsumeInput, m as DelegationTarget, mn as WhereResult, mr as assurance, mt as MemberEntry, n as ApprovalEscalation, nn as credentialDelegation, nr as MatchedGrant, nt as CredentialVerifier, o as ApprovalStage, on as parseCredential, or as TraceSkip, ot as DirectoryEvent, p as DelegationInput, pn as SnapshotOptions, pr as anyone, pt as LocalSnapshotManifest, q as PermissionApprover, qn as validateApprovalPolicy, qr as hasConditionOp, qt as CredentialDecision, r as ApprovalMode, rn as credentialPolicyViolation, rr as Obligation, rt as DecisionEvent, s as AssuranceRequirement, sn as DecideOptions, sr as TraceSkipReason, st as EntitlementSource, t as ActivationOption, tn as DecideCredentialOptions, tr as LimitDetail, tt as CredentialEvent, u as BreakGlassSpec, un as PermDockOptions, ur as InheritGrantee, ut as LimitRemaining, v as GrantOptions, vn as HostedGrantDropped, vr as relation, vt as RelationGroup, w as PolicyDelegation, wn as parsePolicyDocument, wr as Assurance, wt as SinkEvent, x as HostedGrantRef, xn as isPortableCondition, xr as ScopeDeclaration, xt as RoleSource, y as GrantScope, yn as PolicyDocument, yr as PolicyScopesInput, yt as RelationHolder, z as deny, zn as arazzoFindings, zr as MemberOfCondition, zt as memoryEntitlementSource } from "./policy-CFZAr_Al.js";
|
|
2
|
+
import { A as listPermissions, C as ResourceRelationInput, D as formerKeys, E as findPermission, M as resource, O as getResource, S as ResourceRelation, T as definePermissions, _ as ResourceLevel, a as EdgeGroup, b as ResourceOptions, c as EdgeRelation, d as MetaValue, f as Permission, g as ResourceInit, h as PrincipalRelation, i as DefinePermissionsOptions, j as mergePermissions, k as isPermission, l as FieldRelation, m as PermissionTree, n as ActionMeta, o as EdgeGroups, p as PermissionKind, r as ComputedRelation, s as EdgeMatch, v as ResourceLink, w as ResourceRestricted, x as ResourceParent, y as ResourceNode } from "./permissions-DttnqqxC.js";
|
|
3
|
+
import { a as RoleTree, c as defineRoles, d as isRole, f as listPlans, i as RoleMeta, l as findRole, n as PlanTree, o as Vocabulary, p as listRoles, r as Role, s as definePlans, t as Plan, u as isPlan } from "./vocabulary-DA8a8zif.js";
|
|
4
|
+
import { A as countHolders, B as MemoryEdge, C as mayAccess, D as fromStripeEntitlements, E as StripeEntitlementsClient, F as context, G as CustomRoleRename, H as memoryRelations, I as principal, J as customRoleClaim, K as CustomRoleValidation, L as emptySnapshot, M as sqlFunction, N as opaque, O as claimsFirst, P as requiresApproval, R as fromSnapshot, S as permittedIds, T as memoryLimitStore, U as CustomRoleDrop, V as MemoryRelationsData, W as CustomRoleDropReason, X as validateCustomRole, Y as resolveCustomRole, _ as CustomRoleReader, a as toCsvRow, b as PermittedIdsOptions, c as OcsfAuthorizeSession, d as parseDuration, f as crud, g as snapshotFor, h as SnapshotForOptions, i as CSV_COLUMNS, j as isExternallyManaged, k as composeMemberships, l as accessToOcsf, m as writable, n as delegatedPermissions, o as OCSF_VERSION, p as readable, q as ResolvedCustomRole, r as catalogFingerprint, s as OcsfAccountChange, t as coveredByDelegation, u as toOcsf, v as CustomRoleSourceOptions, w as localSnapshotManifest, x as mayUse, y as customRoleSource, z as parseSnapshot } from "./index-D3vbkoSI.js";
|
|
5
|
+
import { n as PermDockValidationError } from "./validation-error-CtF23SrC.js";
|
|
6
|
+
import { n as requiredPlans } from "./problem-details-CkL50EEf.js";
|
|
7
|
+
import { a as ProblemDetails, i as PermDockRevokedError, n as PermDockApprovalRequiredError, o as RevokedCode, r as PermDockDeniedError } from "./errors-DAqevpNk.js";
|
|
8
|
+
import { t as InstanceOptions } from "./instance-options-BK_rNOSC.js";
|
|
9
|
+
import { t as ClientNames } from "./clients-C7zLFuWT.js";
|
|
10
|
+
import { a as CloudEvent, c as MemorySinkOptions, d as credentialEvent, f as membershipEvent, h as toCloudEvent, i as CatalogFindingCode, l as SignDecisionBatchOptions, m as signDecisionBatch, n as CatalogEventData, o as CloudEventType, p as memorySink, r as CatalogFinding, s as MemorySink, t as CLOUD_EVENT_TYPES, u as accessEvent } from "./sink-Gs6TTVa-.js";
|
|
11
|
+
import { i as memoryRevocationFeed, n as RevocationFeed, r as RevocationListener, t as RevocationEvent } from "./revocations-Cy06JNx2.js";
|
|
12
|
+
import { i as describe, n as DescribeMessages, r as DescribeOptions, t as DecisionDescription } from "./describe-PdoqESvg.js";
|
|
13
|
+
import { n as parsePermDockDigest, t as PermDockDigest } from "./digest-B3kc_PgQ.js";
|
|
14
|
+
import { t as parseLocalSnapshotManifest } from "./parse-local-manifest-BkGQNzAh.js";
|
|
15
|
+
import { a as LinkPolicyViolation, c as capabilitySubject, d as signCapability, i as LinkPolicy, l as linkPolicyViolation, n as CapabilityInput, o as LinkPrincipal, r as CapabilityRedeemer, s as SignCapabilityOptions, t as Capability, u as parseCapability } from "./capability-Dq43tT1u.js";
|
|
16
|
+
export { APPROVAL_POLICY_UNAVAILABLE, type AccessEvent, type ActionMeta, type ActivateInput, type ActivationOption, type Actor, type AnyOfApprover, type ApprovalEscalation, type ApprovalMode, type ApprovalOption, type ApprovalPolicy, type ApprovalPolicyProblem, type ApprovalPolicySource, type ApprovalPolicyValidation, type ApprovalRequiredDecision, type ApprovalRequirement, type ApprovalStage, type Approver, type ApproverInput, type ArazzoFinding, type ArazzoPlan, type ArazzoSimulateInput, type ArazzoStepResult, type Assurance, type AssuranceRequirement, type AuthEvent, type AuthorizationDetail, type Binding, type BreakGlassOptions, type BreakGlassRequirements, type BreakGlassSpec, CLOUD_EVENT_TYPES, CSV_COLUMNS, type Capability, type CapabilityInput, type CapabilityRedeemer, type CatalogEventData, type CatalogFinding, type CatalogFindingCode, type ClientNames, type ClosureContext, type ClosureGrantFn, type CloudEvent, type CloudEventType, type ComputedRelation, type Condition, type ConditionRef, type ConditionValue, type Credential, type CredentialDecision, type CredentialEvent, type CredentialKind, type CredentialPermission, type CredentialPermissionInput, type CredentialPolicy, type CredentialPolicyViolation, type CredentialPrincipal, type CredentialRequest, type CredentialVerifier, type CustomRole, type CustomRoleDrop, type CustomRoleDropReason, type CustomRoleGrant, type CustomRoleReader, type CustomRoleRename, type CustomRoleSourceOptions, type CustomRoleValidation, type DecideCredentialOptions, type DecideOptions, type Decision, type DecisionDescription, type DecisionEvent, type DecisionProvider, type DecisionSink, type DefinePermissionsOptions, type Delegation, type DelegationInput, type DelegationTarget, type Denial, type DenialReason, type DeniedDecision, type DeriveOptions, type DescribeMessages, type DescribeOptions, type DirectoryEvent, type EdgeGroup, type EdgeGroups, type EdgeMatch, type EdgeRelation, type EntitlementSource, type ExplainedDecision, type FieldRelation, type GnapAccess, type Grant, type GrantCondition, type GrantLimit, type GrantOptions, type GrantScope, type GrantValidity, type GrantedDecision, type Grantee, type GranteeInput, type Holder, type HoldingVia, type HostedGrant, type HostedGrantDropReason, type HostedGrantDropped, type HostedGrantRef, type InheritGrantee, type InstanceOptions, type LimitConsumeInput, type LimitDetail, type LimitRemaining, type LimitStore, type LinkPolicy, type LinkPolicyViolation, type LinkPrincipal, type LocalCustomRoleTable, type LocalSnapshotManifest, type MatchedGrant, type MemberEntry, type MemberOfCondition, type MemberOfParent, type Membership, type MembershipEvent, type MembershipFixture, type MembershipSource, type MemoryEdge, type MemoryRelationsData, type MemorySink, type MemorySinkOptions, type MetaValue, OCSF_VERSION, type Obligation, type OcsfAccountChange, type OcsfAuthorizeSession, type PermDock, PermDockApprovalRequiredError, PermDockDeniedError, type PermDockDigest, type PermDockOptions, PermDockRevokedError, PermDockValidationError, type Permission, type PermissionApprover, type PermissionKind, type PermissionTree, type PermittedIdsOptions, type Plan, type PlanTree, type Policy, type PolicyDelegation, type PolicyDocument, type PolicyOAuthScope, type PolicyScopes, type PolicyScopesInput, type PolicySource, type Principal, type PrincipalOf, type PrincipalRelation, type ProblemDetails, type Quota, type RelatedCondition, type RelatedHop, type RelationChain, type RelationGrantee, type RelationGroup, type RelationHolder, type RelationSource, type ResolvedCustomRole, type ResourceInit, type ResourceLevel, type ResourceLink, type ResourceNode, type ResourceOptions, type ResourceParent, type ResourceRelation, type ResourceRelationInput, type ResourceRestricted, type RestrictedAncestors, type RevocationEvent, type RevocationFeed, type RevocationListener, type RevokedCode, type Role, type RoleBinding, type RoleChange, type RoleChangeDecision, type RoleChangeOptions, type RoleChangeTarget, type RoleMeta, type RoleOptions, type RoleScope, type RoleSource, type RoleSourceFactory, type RoleTree, type RowPair, type Scope, type ScopeDeclaration, type ScopeNames, type SeparationConflict, type SettingsSource, type SignCapabilityOptions, type SignDecisionBatchOptions, type SimulateOptions, type SinkEvent, type Snapshot, type SnapshotAssignable, type SnapshotForOptions, type SnapshotGrant, type SnapshotNotEntitled, type SnapshotOptions, type SnapshotScope, type SnapshotSource, type SqlFunctionArg, type SqlFunctionCondition, type StripeEntitlementsClient, type Subject, type SubjectOf, type SubjectResolver, type SupportAccessOptions, type SupportConsent, type TenantSettings, type TokenFailureCause, type TokenSigner, type TokenVerifier, type Trace, type TraceSkip, type TraceSkipReason, type UserApprover, type ValidateMode, type VerificationFailure, type VerifiedClaims, type VerifiedToken, type Vocabulary, type WhereCompiler, type WhereResult, type WhoCan, type WireDecision, type WireDenial, accessEvent, accessToOcsf, actor, allOf, allow, anyOf, anyone, arazzoFindings, assurance, authenticated, breakGlass, capabilitySubject, catalogFingerprint, claimsFirst, composeMemberships, context, countHolders, coveredByDelegation, createPermDock, credentialDelegation, credentialEvent, credentialPolicyViolation, credentialSubject, crud, customRoleClaim, customRoleSource, decideCredential, definePermissions, definePlans, definePolicy, defineRoles, delegatedPermissions, deny, describe, emptySnapshot, findPermission, findRole, formerKeys, fromSnapshot, fromStripeEntitlements, getResource, hasConditionOp, holder, inherit, isCondition, isConditionDate, isConditionRef, isExternallyManaged, isPermission, isPlan, isPortableCondition, isRole, isSqlFunctionField, linkPolicyViolation, listPermissions, listPlans, listRoles, localSnapshotManifest, mayAccess, mayUse, membershipEvent, memoryApprovalPolicies, memoryEntitlementSource, memoryLimitStore, memoryMembershipSource, memoryPolicySource, memoryRelations, memoryRevocationFeed, memoryRoleSource, memorySettings, memorySink, memorySnapshotSource, mergeHostedGrants, mergePermissions, normalizeApproval, normalizeAssurance, opaque, parseCapability, parseCredential, parseDuration, parseLocalSnapshotManifest, parsePermDockDigest, parsePolicyDocument, parseSnapshot, permittedIds, plan, principal, readable, relation, requiredPlans, requiresApproval, resolveCustomRole, resource, role, separationConflicts, signCapability, signDecisionBatch, simulateArazzo, snapshotFor, sqlFunction, supportAccess, toCloudEvent, toCsvRow, toOcsf, user, validateApprovalPolicy, validateCustomRole, writable };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { _ as listPermissions, a as formerKeys, b as resource, c as getResource, i as findPermission, n as definePermissions, p as isPermission, v as mergePermissions } from "./permissions-DVoF6dMt.js";
|
|
2
|
+
import { a as hasConditionOp, c as isConditionRef, l as isSqlFunctionField, o as isCondition, r as principal, s as isConditionDate, t as context } from "./refs-KYb4ntaz.js";
|
|
3
|
+
import { S as opaque, _ as memoryLimitStore, a as definePolicy, d as normalizeApproval, f as normalizeAssurance, h as separationConflicts, m as role, o as deny, t as allow } from "./policy-xyWg7QdR.js";
|
|
4
|
+
import { _ as memoryRoleSource, a as accessToOcsf, b as sqlFunction, c as readable, d as customRoleSource, f as mayAccess, g as memoryMembershipSource, h as memoryEntitlementSource, i as OCSF_VERSION, l as writable, m as fromStripeEntitlements, n as CSV_COLUMNS, o as toOcsf, p as localSnapshotManifest, r as toCsvRow, s as crud, t as catalogFingerprint, u as snapshotFor, v as memorySettings, y as memorySnapshotSource } from "./src-CSbUiozF.js";
|
|
5
|
+
import { a as holder, l as user, n as anyOf, t as allOf } from "./approvers-DT4AVyIg.js";
|
|
6
|
+
import { n as PermDockValidationError } from "./validation-error-CnjZ4t92.js";
|
|
7
|
+
import { r as requiredPlans } from "./problem-details-_AMOYz-w.js";
|
|
8
|
+
import { t as describe } from "./describe-B_gVZEVi.js";
|
|
9
|
+
import { r as parsePermDockDigest } from "./digest-BI-6aa6d.js";
|
|
10
|
+
import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "./errors-Cz5zn0mW.js";
|
|
11
|
+
import { t as memoryRevocationFeed } from "./revocations-Bhr0aMIC.js";
|
|
12
|
+
import { f as simulateArazzo, n as parseSnapshot, u as arazzoFindings } from "./snapshot-Enxd0n-s.js";
|
|
13
|
+
import { t as parseDuration } from "./duration-xK2jGFVc.js";
|
|
14
|
+
import { C as isPlan, E as listRoles, S as findRole, T as listPlans, a as authenticated, b as definePlans, c as inherit, f as plan, i as assurance, n as anyone, p as relation, t as actor, w as isRole, x as defineRoles } from "./grantee-Cv5Sogfv.js";
|
|
15
|
+
import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
|
|
16
|
+
import { i as parsePolicyDocument, n as memoryPolicySource, r as mergeHostedGrants, t as isPortableCondition } from "./hosted-DJQw46hn.js";
|
|
17
|
+
import { C as countHolders, D as memoryApprovalPolicies, O as validateApprovalPolicy, S as composeMemberships, T as APPROVAL_POLICY_UNAVAILABLE, b as validateCustomRole, d as breakGlass, f as supportAccess, h as customRoleClaim, t as createPermDock, w as isExternallyManaged, x as claimsFirst, y as resolveCustomRole } from "./permdock-CzqXjCpU.js";
|
|
18
|
+
import { t as memoryRelations } from "./relations-cjOL01hZ.js";
|
|
19
|
+
import { r as delegatedPermissions, t as coveredByDelegation } from "./delegation-D8pUEuce.js";
|
|
20
|
+
import { n as fromSnapshot, t as emptySnapshot } from "./from-snapshot-C3sHpZNS.js";
|
|
21
|
+
import { t as parseLocalSnapshotManifest } from "./parse-local-manifest-BrMozJCo.js";
|
|
22
|
+
import { n as permittedIds, t as mayUse } from "./may-use-DndQ5tQ-.js";
|
|
23
|
+
import { a as memorySink, i as membershipEvent, n as accessEvent, o as signDecisionBatch, r as credentialEvent, s as toCloudEvent, t as CLOUD_EVENT_TYPES } from "./sink-Bd9PSyfq.js";
|
|
24
|
+
import { c as signCapability, i as linkPolicyViolation, o as parseCapability, t as capabilitySubject } from "./capability-4qPdO9gk.js";
|
|
25
|
+
import { a as decideCredential, n as credentialPolicyViolation, o as parseCredential, r as credentialSubject, t as credentialDelegation } from "./credential-8P81ff4u.js";
|
|
26
|
+
export { APPROVAL_POLICY_UNAVAILABLE, CLOUD_EVENT_TYPES, CSV_COLUMNS, OCSF_VERSION, PermDockApprovalRequiredError, PermDockDeniedError, PermDockRevokedError, PermDockValidationError, accessEvent, accessToOcsf, actor, allOf, allow, anyOf, anyone, arazzoFindings, assurance, authenticated, breakGlass, capabilitySubject, catalogFingerprint, claimsFirst, composeMemberships, context, countHolders, coveredByDelegation, createPermDock, credentialDelegation, credentialEvent, credentialPolicyViolation, credentialSubject, crud, customRoleClaim, customRoleSource, decideCredential, definePermissions, definePlans, definePolicy, defineRoles, delegatedPermissions, deny, describe, emptySnapshot, findPermission, findRole, formerKeys, fromSnapshot, fromStripeEntitlements, getResource, hasConditionOp, holder, inherit, isCondition, isConditionDate, isConditionRef, isExternallyManaged, isPermission, isPlan, isPortableCondition, isRole, isSqlFunctionField, linkPolicyViolation, listPermissions, listPlans, listRoles, localSnapshotManifest, mayAccess, mayUse, membershipEvent, memoryApprovalPolicies, memoryEntitlementSource, memoryLimitStore, memoryMembershipSource, memoryPolicySource, memoryRelations, memoryRevocationFeed, memoryRoleSource, memorySettings, memorySink, memorySnapshotSource, mergeHostedGrants, mergePermissions, normalizeApproval, normalizeAssurance, opaque, parseCapability, parseCredential, parseDuration, parseLocalSnapshotManifest, parsePermDockDigest, parsePolicyDocument, parseSnapshot, permittedIds, plan, principal, readable, relation, requiredPlans, requiresApproval, resolveCustomRole, resource, role, separationConflicts, signCapability, signDecisionBatch, simulateArazzo, snapshotFor, sqlFunction, supportAccess, toCloudEvent, toCsvRow, toOcsf, user, validateApprovalPolicy, validateCustomRole, writable };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { un as PermDockOptions } from "./policy-CFZAr_Al.js";
|
|
2
|
+
//#region src/core/instance-options.d.ts
|
|
3
|
+
type InstanceKey = "memberships" | "relations" | "entitlements" | "customRoles" | "policies" | "approvalPolicies" | "sink" | "limits";
|
|
4
|
+
/**
|
|
5
|
+
* The data sources an adapter passes through to every instance it creates.
|
|
6
|
+
* Each adapter's options type extends this, so a source added to core
|
|
7
|
+
* reaches every adapter without a per-adapter change.
|
|
8
|
+
*/
|
|
9
|
+
type InstanceOptions = Pick<PermDockOptions, InstanceKey>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { InstanceOptions as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/core/instance-options.ts
|
|
2
|
+
const INSTANCE_KEYS = {
|
|
3
|
+
memberships: true,
|
|
4
|
+
relations: true,
|
|
5
|
+
entitlements: true,
|
|
6
|
+
customRoles: true,
|
|
7
|
+
policies: true,
|
|
8
|
+
approvalPolicies: true,
|
|
9
|
+
sink: true,
|
|
10
|
+
limits: true
|
|
11
|
+
};
|
|
12
|
+
/** The `InstanceOptions` set on `options`, without the adapter's own keys. */
|
|
13
|
+
function instanceOptions(options) {
|
|
14
|
+
const picked = {};
|
|
15
|
+
for (const key of Object.keys(INSTANCE_KEYS)) {
|
|
16
|
+
const name = key;
|
|
17
|
+
if (options[name] !== void 0) picked[name] = options[name];
|
|
18
|
+
}
|
|
19
|
+
return picked;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { instanceOptions as t };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region src/core/json-schema.ts
|
|
2
|
+
function issue(issues, path, message) {
|
|
3
|
+
issues.push({
|
|
4
|
+
message,
|
|
5
|
+
path: [...path]
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
function isRecord(value) {
|
|
9
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A plain-data copy built from own enumerable keys, so `__proto__` stays an
|
|
13
|
+
* ordinary key and nothing the input inherits is read. Anything JSON cannot
|
|
14
|
+
* carry is an issue.
|
|
15
|
+
*/
|
|
16
|
+
function copyJson(value, path, issues, ancestors) {
|
|
17
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return value;
|
|
18
|
+
if (typeof value === "number") {
|
|
19
|
+
if (!Number.isFinite(value)) issue(issues, path, "Expected a finite number");
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
if (typeof value !== "object") {
|
|
23
|
+
issue(issues, path, `Expected JSON, got ${typeof value}`);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (ancestors.has(value)) {
|
|
27
|
+
issue(issues, path, "Expected JSON, got a cycle");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
ancestors.add(value);
|
|
31
|
+
try {
|
|
32
|
+
if (Array.isArray(value)) return value.map((item, index) => copyJson(item, [...path, index], issues, ancestors));
|
|
33
|
+
const proto = Object.getPrototypeOf(value);
|
|
34
|
+
if (proto !== Object.prototype && proto !== null) {
|
|
35
|
+
issue(issues, path, "Expected a plain object");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
return Object.fromEntries(Object.keys(value).map((key) => [key, copyJson(Reflect.get(value, key), [...path, key], issues, ancestors)]));
|
|
39
|
+
} finally {
|
|
40
|
+
ancestors.delete(value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function typeMatches(type, value) {
|
|
44
|
+
switch (type) {
|
|
45
|
+
case "object": return isRecord(value);
|
|
46
|
+
case "array": return Array.isArray(value);
|
|
47
|
+
case "string": return typeof value === "string";
|
|
48
|
+
case "boolean": return typeof value === "boolean";
|
|
49
|
+
case "integer": return Number.isInteger(value);
|
|
50
|
+
default: return type;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const DEF_REF = /^#\/\$defs\/([^/]+)$/u;
|
|
54
|
+
function resolveRef(root, ref) {
|
|
55
|
+
const name = DEF_REF.exec(ref)?.[1];
|
|
56
|
+
const target = name !== void 0 && root.$defs !== void 0 && Object.hasOwn(root.$defs, name) ? root.$defs[name] : void 0;
|
|
57
|
+
if (target === void 0) throw new TypeError(`Unsupported or unknown $ref ${ref}`);
|
|
58
|
+
return target;
|
|
59
|
+
}
|
|
60
|
+
/** Validates a `copyJson` result against `node`, reading `$ref` targets from `root`. */
|
|
61
|
+
function checkSchema(node, value, path, issues, root = node) {
|
|
62
|
+
if (node.$ref !== void 0) {
|
|
63
|
+
checkSchema(resolveRef(root, node.$ref), value, path, issues, root);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if ("const" in node && value !== node.const) {
|
|
67
|
+
issue(issues, path, `Expected ${JSON.stringify(node.const)}`);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (node.enum !== void 0 && !node.enum.includes(value)) {
|
|
71
|
+
issue(issues, path, `Expected one of ${node.enum.map((item) => JSON.stringify(item)).join(", ")}`);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (node.type !== void 0 && !typeMatches(node.type, value)) {
|
|
75
|
+
issue(issues, path, `Expected ${node.type}`);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (node.pattern !== void 0 && typeof value === "string" && !new RegExp(node.pattern, "u").test(value)) issue(issues, path, `Expected a string matching ${node.pattern}`);
|
|
79
|
+
if (node.minimum !== void 0 && typeof value === "number" && value < node.minimum) issue(issues, path, `Expected at least ${String(node.minimum)}`);
|
|
80
|
+
if (node.oneOf !== void 0) {
|
|
81
|
+
if (node.oneOf.filter((option) => {
|
|
82
|
+
const scratch = [];
|
|
83
|
+
checkSchema(option, value, path, scratch, root);
|
|
84
|
+
return scratch.length === 0;
|
|
85
|
+
}).length !== 1) issue(issues, path, "Expected exactly one matching form");
|
|
86
|
+
}
|
|
87
|
+
if (Array.isArray(value)) {
|
|
88
|
+
if (node.minItems !== void 0 && value.length < node.minItems) issue(issues, path, `Expected at least ${String(node.minItems)} items`);
|
|
89
|
+
if (node.uniqueItems === true && new Set(value.map((item) => JSON.stringify(item))).size !== value.length) issue(issues, path, "Expected unique items");
|
|
90
|
+
if (node.items !== void 0) for (const [index, item] of value.entries()) checkSchema(node.items, item, [...path, index], issues, root);
|
|
91
|
+
}
|
|
92
|
+
if (!isRecord(value)) return;
|
|
93
|
+
for (const key of node.required ?? []) if (!Object.hasOwn(value, key)) issue(issues, [...path, key], "Required");
|
|
94
|
+
const properties = node.properties ?? {};
|
|
95
|
+
for (const key of Object.keys(value)) {
|
|
96
|
+
if (Object.hasOwn(properties, key)) {
|
|
97
|
+
const child = properties[key];
|
|
98
|
+
if (child !== void 0) checkSchema(child, value[key], [...path, key], issues, root);
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (node.additionalProperties === false) issue(issues, [...path, key], "Unexpected property");
|
|
102
|
+
else if (node.additionalProperties !== void 0) checkSchema(node.additionalProperties, value[key], [...path, key], issues, root);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { copyJson as n, checkSchema as t };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Ft as TokenVerifier, Nr as Principal, Nt as TokenFailureCause, Pr as Subject, Pt as TokenSigner, ct as JwtClaims, et as AuthEvent } from "../policy-CFZAr_Al.js";
|
|
2
|
+
import { a as JsonWebKeySet, c as JwtJwks, d as MappedSubject, g as ReplayStore, i as JoseTokenVerifierOptions, l as JwtPrincipal, n as DpopProofResult, o as JwtAlgorithm, r as JoseTokenSignerOptions, s as JwtClaimPaths, t as DiscoveryInput, u as JwtSubjectOptions } from "../types-9AWO9EGt.js";
|
|
3
|
+
import { i as LinkPolicy, o as LinkPrincipal, t as Capability } from "../capability-Dq43tT1u.js";
|
|
4
|
+
import { t as memoryReplayStore } from "../replay-sqBGMnNs.js";
|
|
5
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
|
+
//#region src/jwt/capability.d.ts
|
|
7
|
+
/** `on('auth')` causes: a verification failure, or one of the three capability checks. */
|
|
8
|
+
type CapabilityFailureCause = TokenFailureCause | "capability-revoked" | "capability-replayed" | "redeemer-mismatch" | "link-policy";
|
|
9
|
+
type CapabilitySubjectOptions = Omit<JoseTokenVerifierOptions, "typ" | "issuer" | "audience" | "profile"> & {
|
|
10
|
+
/** The issuer the capability was signed by (`iss`); required. */
|
|
11
|
+
readonly issuer: string;
|
|
12
|
+
/** The application the capability was signed for (`aud`); required. */
|
|
13
|
+
readonly audience: string | readonly string[];
|
|
14
|
+
readonly verifier?: TokenVerifier;
|
|
15
|
+
/**
|
|
16
|
+
* The link policies of the scope instances the linked resource sits in
|
|
17
|
+
* (its tenant, its customer); every one must hold. A throw denies.
|
|
18
|
+
*/
|
|
19
|
+
readonly linkPolicy?: (capability: Capability) => LinkPolicy | readonly LinkPolicy[] | undefined | Promise<LinkPolicy | readonly LinkPolicy[] | undefined>;
|
|
20
|
+
/** `true` when the application revoked the link id (`sub`); a throw denies. */
|
|
21
|
+
readonly revoked?: (id: string) => boolean | Promise<boolean>;
|
|
22
|
+
/** Claims the `jti` of a one-time capability; a one-time capability without it is refused. */
|
|
23
|
+
readonly replay?: ReplayStore;
|
|
24
|
+
/** The request's own verified subject, checked against the capability's `redeemer`. */
|
|
25
|
+
readonly viewer?: Subject;
|
|
26
|
+
readonly onAuth?: (event: AuthEvent) => void;
|
|
27
|
+
readonly requestId?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Resolves a `permdock-capability+jwt` into the `link` subject it acts as.
|
|
31
|
+
* Every failure (signature, `typ`, `iss`, `aud`, expiry, a malformed claim,
|
|
32
|
+
* a revoked link, a replayed one-time token, a redeemer the viewer does not
|
|
33
|
+
* satisfy, a throwing store) is the anonymous subject, never a throw.
|
|
34
|
+
*/
|
|
35
|
+
export declare function subjectFromCapability(token: string | undefined | null, options: CapabilitySubjectOptions): Promise<Subject<LinkPrincipal> | Subject>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/jwt/ci-oidc.d.ts
|
|
38
|
+
type CiOidcProvider = "github" | "gitlab" | "buildkite";
|
|
39
|
+
type CiOidcSubjectOptions = Omit<JoseTokenVerifierOptions, "typ" | "issuer" | "audience" | "discovery" | "profile"> & {
|
|
40
|
+
readonly provider: CiOidcProvider;
|
|
41
|
+
/** The audience the job requested the token for; required. */
|
|
42
|
+
readonly audience: string | readonly string[];
|
|
43
|
+
/**
|
|
44
|
+
* A self-managed GitLab or GitHub Enterprise Server issuer. Its keys come
|
|
45
|
+
* from OpenID discovery unless `jwks` is set.
|
|
46
|
+
*/
|
|
47
|
+
readonly issuer?: string;
|
|
48
|
+
/** Validates the verified claims; a failure or a Promise is the anonymous subject. */
|
|
49
|
+
readonly schema?: StandardSchemaV1;
|
|
50
|
+
readonly verifier?: TokenVerifier;
|
|
51
|
+
readonly onAuth?: (event: AuthEvent) => void;
|
|
52
|
+
readonly requestId?: string;
|
|
53
|
+
};
|
|
54
|
+
/** A CI job: never a user. `ref` is a full ref (`refs/heads/main`, `refs/tags/v1`). */
|
|
55
|
+
type CiOidcPrincipal = Principal & {
|
|
56
|
+
readonly kind: "workload";
|
|
57
|
+
readonly issuer: string;
|
|
58
|
+
readonly provider: CiOidcProvider;
|
|
59
|
+
readonly repository?: string;
|
|
60
|
+
readonly ref?: string;
|
|
61
|
+
readonly environment?: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Resolves a CI provider's OIDC token (GitHub Actions, GitLab CI, Buildkite)
|
|
65
|
+
* into a `workload` principal whose id is `sub`. Every failure (signature,
|
|
66
|
+
* issuer, audience, expiry, a missing `sub`, the `schema`) is the anonymous
|
|
67
|
+
* subject, never a throw and never a user.
|
|
68
|
+
*/
|
|
69
|
+
export declare function subjectFromCiOidc(token: string | undefined | null, options: CiOidcSubjectOptions): Promise<Subject<CiOidcPrincipal> | Subject>;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/jwt/dpop.d.ts
|
|
72
|
+
type DpopProofOptions = {
|
|
73
|
+
/** Rejects a proof whose `jti` this key already used within the 60-second window. */
|
|
74
|
+
readonly replay?: ReplayStore;
|
|
75
|
+
};
|
|
76
|
+
export declare function verifyDpopProof(request: Request, claims: JwtClaims, accessToken?: string, options?: DpopProofOptions): Promise<DpopProofResult>;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/jwt/introspection.d.ts
|
|
79
|
+
export declare function subjectFromIntrospection(response: unknown, options?: JwtSubjectOptions): MappedSubject;
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/jwt/signer.d.ts
|
|
82
|
+
export declare function joseTokenSigner(options: JoseTokenSignerOptions): TokenSigner;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/jwt/subject.d.ts
|
|
85
|
+
export declare function subjectFromJwt(token: string | undefined | null, options: JwtSubjectOptions, request?: Request): Promise<MappedSubject>;
|
|
86
|
+
export declare function createJwtSubjectResolver(options: JwtSubjectOptions): (token: string | undefined | null, request?: Request) => Promise<MappedSubject>;
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/jwt/verifier.d.ts
|
|
89
|
+
export declare function joseTokenVerifier(options: JoseTokenVerifierOptions): TokenVerifier;
|
|
90
|
+
//#endregion
|
|
91
|
+
export { type CapabilityFailureCause, type CapabilitySubjectOptions, type CiOidcPrincipal, type CiOidcProvider, type CiOidcSubjectOptions, type DiscoveryInput, type DpopProofOptions, type DpopProofResult, type JoseTokenSignerOptions, type JoseTokenVerifierOptions, type JsonWebKeySet, type JwtAlgorithm, type JwtClaimPaths, type JwtJwks, type JwtPrincipal, type JwtSubjectOptions, type MappedSubject, type ReplayStore, memoryReplayStore };
|