Auth
The Auth modules define Kit's object-capability authority tokens. Programs receive root authority from the runtime, derive narrower tokens, and pass those tokens to functions that need file, network, process, or concurrency access.
Authority constructors are protected outside test blocks, including through imported package
code. Application code should derive authority from env.root with
Auth.* helpers instead of constructing tokens directly.
Authority Hierarchy
RootAuth
+-- FileAuth
| +-- FileReadAuth
| +-- FileWriteAuth
+-- NetAuth
| +-- TCPAuth
| | +-- TCPConnectAuth
| | +-- TCPListenAuth
| +-- UDPAuth
| +-- DNSAuth
+-- ProcessAuth
+-- ConcurrencyAuth
+-- ActorAuth
+-- ChannelAuth
+-- ParallelAuth
Auth.Root
Auth.File
import Auth.File.{file-auth, file-read-auth}
main = fn(env: Env) =>
file = file-auth env.root
read = file-read-auth file
Auth.Net
TCPAuth can be further narrowed
with tcp-connect-auth or tcp-listen-auth.
Auth.Process
Auth.Concurrency
Testing
Test blocks may construct mock authority tokens directly so capability-aware wrappers can be tested without granting real process-wide authority. Outside tests, direct constructors are rejected; use the derivation helpers above and pass the resulting tokens explicitly.