F+Foldkit Plus
HomeLearnPackagesComponentsPrimitivesDemosBlogGitHub ↗

Guard

Guides

foldkit-guard

  • Overview
  • Attaching guards to an Entity
  • Serving reads
  • Serving writes
  • Checking a server at startup
  • Who is asking
  • What the client may do
  • Who the client is: Me
  • When a rule refuses
  • Sync
  • Agents
  • Uploads
  • Lower level: asking the Policy yourself
  • Limits

How Guard works

  • Overview
  • Write your first guard set
  • How a request is decided in two steps
  • What safety bugs Guard prevents
  • Real scenarios you can model today
  • How Guard, Expressions, and Laws act like a constraint solver
  • Where the boundary sits: authority vs. validity, and limits

API

  • foldkit-guard
  • foldkit-guard/server
  • foldkit-guard/drizzle
  • foldkit-guard/agent
  • foldkit-guard/sync
  • foldkit-guard/media
  • foldkit-guard/check

Open source, MIT
Foldkit 0.170 · Effect 4

Guard / foldkit-guard/check

GuardCheck

namespace · packages/guard/src/check.ts:140

const GuardCheck = { policy }

Members

GuardCheck.policy#

function · packages/guard/src/check.ts:71

policy<E extends AnyEntity>(
  entity: E,
  member: keyof NoInfer<E>['members'] & string,
): PolicyCheck<E['schema']['Encoded']>

Check whether row Update is reachable and implies Read of the named member, on a valid row.

Previousfoldkit-guard/check

On this page

  • policy

Edit on GitHub ↗

This site is a Foldkit Plus application, rendered at build time with foldkit-ssr. Its source

FoldkitEffectGitHub

Menu

HomeLearnPackagesComponentsPrimitivesDemosBlogGitHub ↗

Guard

Guides

foldkit-guard
  • Overview
  • Attaching guards to an Entity
  • Serving reads
  • Serving writes
  • Checking a server at startup
  • Who is asking
  • What the client may do
  • Who the client is: Me
  • When a rule refuses
  • Sync
  • Agents
  • Uploads
  • Lower level: asking the Policy yourself
  • Limits
How Guard works
  • Overview
  • Write your first guard set
  • How a request is decided in two steps
  • What safety bugs Guard prevents
  • Real scenarios you can model today
  • How Guard, Expressions, and Laws act like a constraint solver
  • Where the boundary sits: authority vs. validity, and limits

API

  • foldkit-guard
  • foldkit-guard/server
  • foldkit-guard/drizzle
  • foldkit-guard/agent
  • foldkit-guard/sync
  • foldkit-guard/media
  • foldkit-guard/check

Open source, MIT
Foldkit 0.170 · Effect 4