serve
Audience: operators running Aperture as a long-lived service.
aperture serve [options]
serve hand-wires the full dependency graph (storage → engine → service → HTTP handler) and boots a net/http server exposing the HTTP + Twirp API and
the admin UI. It shuts down gracefully on SIGINT / SIGTERM, draining
in-flight requests within a 10-second window. This is the same fully-wired facade
the mutation CLI commands build — the server just puts it behind a listener and
an authenticator.
bin/aperture serve --addr :8080
aperture serving on :8080
Press Ctrl-C to trigger a graceful shutdown (shutting down...).
What the flags control
--addr— the TCP address to listen on (default:8080).--seed/--store— the model to serve, exactly as elsewhere (see Global options). With no--store, the server runs against an in-memory model seeded from--seedor the embedded example.--auth— the authenticator adapter that maps each request to a principal:dev(the default — the bearer token is the principal id, no external IdP),oidc, orparsec. It overrides theAPERTURE_AUTH_MODEenv var. Because the default isdev,serveruns with no external identity provider out of the box;oidcandparsecare opt-in.--enforce-membership— defence-in-depth: deny any decision whose principal is not a member of the active account before grants are consulted. This lets a single shared role (manager, analyst, …) be reused across accounts without one account’s grants leaking to another’s members. Also settable viaAPERTURE_ENFORCE_MEMBERSHIP.
Under serve, the facade is wired with everything the other surfaces expect: the
admin gate, delegation and impersonation mutators, the append-only audit trail,
the rules engine over a storage-backed rule source, and the object providers
declared in the seed’s providers: section. A rule saved through the admin UI
takes effect on the next decision with no separate rule store.
Full flags: serve.
Related
- Global options —
--seed/--store. - mcp — the read-only stdio surface, for MCP clients rather than HTTP.
- Command-Line Reference — the generated flag table.