Loading...
Loading...
Authorization and other preconditions as compile-time proofs in TypeScript, with the gdp-ts library (Ghosts of Departed Proofs). Use when adding, changing or reviewing authorization, entitlement or ownership checks in a TypeScript codebase that uses gdp-ts (imports of `name`, `Named`, `Proof` or `defineProof`), when adopting the pattern in a codebase, or when fixing type errors that mention `Named<...>` or proof types.
npx skill4agent add rauchg/gdp-ts gdp-tsname(viewer.id, projectId, async (user, project) => ...)proofs/UserIsProjectAdmin<U, P>nullproject: Named<P, ProjectId>_proof: UserIsProjectAdmin<U, P>proofs/defineProofinterface X<...> extends Proof<"X", [...]> {}async function x(...named): Promise<X<...> | null>TokenUnlocksUrl<H>PlanIncludesPasswordProtection<P>name(...)nullasNamedproofs/defineProofproofs/Namedname()mistakes.ts// @ts-expect-error| File | Read it when |
|---|---|
| Adding a proof, a policy or a sensitive function, or adopting the pattern. Six steps: brand ids, trusted modules, policies as unions, sensitive functions, naming in the handler, lint rules. |
| Reusing proofs, weaker-from-stronger proofs, proofs that carry evidence, preconditions that are not about users. |
| A type error mentions |
| Judging what the types do and do not guarantee (forging, stale proofs, older TypeScript). |
| Deciding how much to prove. |
@gdp-ts/core| Export | What it is |
|---|---|
| A value of type |
| Gives one to three values fresh names, scoped to |
| Evidence that fact |
| Returns a |
| The |
| The names of a tuple of |
| Import | What it is |
|---|---|
| |
| |
| The rules themselves ( |
proofs**/proofs/**strictasanyfalseallowAssertions**/lib/ids.tsproofImportsfilesprove{ kind }defineProofprovename{ value }