Auth / Auth and Guard
Keep keys, fresh lookups, and hosts aligned
- Share one principal key: Pass
Policy.keytoAuthServer.resolverso client subject checks (Me.keyandAuthServer.answered) match server identity. - Look up fresh principals: Load
Userfrom your database per request bysubjectIdinstead of trusting login-time claims that miss role revocations. - Use the right host resolver: Pair
serveFetchwithpageReader(requests: 'navigation') usingAuthServer.host, and userequests: 'browser'for WebSocket sync hosts (documentHost) where browsers omit custom CSRF headers. - Validate at startup: Run
GuardServer.validate(Policy, ...)at boot so an unguarded Source fails immediately.
Next
- See the full auth and guard example app in
examples/auth. - Read the
foldkit-authREADME for session resolvers,believing(), and CSRF options. - Read the
foldkit-guardREADME for row rules, write rules, andmayflags.