Documentation
¶
Overview ¶
Command core is OpenFief's core service (docs/DESIGN.md D-2): the system of record. It migrates the database, stores the built-in sleeve kinds and sleeves, runs the River revaluation workers (D-36) and serves the read API (D-6, D-50) to the owner's scripts, which present script tokens (D-27). It also issues, lists and revokes those tokens.
Usage:
OPENFIEF_DSN=postgres://... core [serve] [flags] OPENFIEF_DSN=postgres://... core migrate OPENFIEF_DSN=postgres://... core token issue --name NAME [--ttl 720h] OPENFIEF_DSN=postgres://... core token list OPENFIEF_DSN=postgres://... core token revoke ID OPENFIEF_DSN=postgres://... core connector bind --instance NAME --account ID OPENFIEF_DSN=postgres://... core connector sync --instance NAME [--mode opening|transactions] OPENFIEF_DSN=postgres://... core enroll-link [--host localhost:8080] [--ttl 15m] OPENFIEF_DSN=postgres://... core check balances [--all] core init-credentials
`token issue` prints the new token's secret once, on stdout, and nowhere else; it is the break-glass way to a script token, which the owner otherwise creates from a logged-in session. `enroll-link` prints a one-time link for creating a passkey on a host (D-60), localhost by default: the way in for the first passkey. `check balances` writes the owner's balance check (D-200, criterion 1) as JSON on stdout, for `openfief check balances`, which runs it through Kubernetes exec with the owner's kubeconfig; it logs only that the check ran, with counts.
`init-credentials` is the install's one-shot Job (D-216), run from this image with its own ServiceAccount, which may only create Secrets: it makes SpiceDB's preshared key and its database role's password, each only if its Secret is missing, and never reads, changes or rotates one. It needs no database and logs Secret names and "created" or "kept", never a value.
Next to the read API, serve offers view plugins the AuthService (proto/openfief/identity/v1): passkey login and registration, sessions, script tokens and enrollment links. OPENFIEF_AUTH_ORIGINS lists the origins the owner's browser may use, separated by commas, and enroll-link refuses a link for any other (D-126); --session-idle and --session-max bound sessions; --demo-sessions issues read-only sessions without credentials on a demo database. The service logs internal IDs and counts only: never an amount, a holding, a token or its hash.
In a Kubernetes cluster, serve also syncs the running connector instances on a schedule (D-49), presenting a TokenRequest token of its own ServiceAccount whose audience is the instance (D-59). connector bind lets an instance write to an account; connector sync syncs one instance now and needs the cluster too. Outside a cluster serve doesn't sync.
serve and the connector commands trace their requests, connector calls, queries, revaluation jobs and syncs with OpenTelemetry when the standard variables name an OTLP endpoint (OTEL_EXPORTER_OTLP_ENDPOINT and its kin, docs/guides/tracing.md); without one nothing is recorded or sent. Spans name operations only: never an amount, a holding, an account number, a token or a query's arguments.
Source Files
¶
- attention.go
- auditoutbox.go
- auth.go
- authz.go
- authzkey.go
- authzmonitor.go
- bondlots.go
- cashcheckpoints.go
- checkbalances.go
- checkledger.go
- config.go
- connectors.go
- core.go
- dbtimeouts.go
- frontdoor.go
- grants.go
- initcredentials.go
- main.go
- maintainer.go
- marketdata.go
- model.go
- modelrouter.go
- onboarding.go
- pluginaudit.go
- pricechecks.go
- serve.go
- settings.go
- syncs.go
- token.go
- tracing.go
- transfers.go
- uploads.go
- valuationattention.go
- viewgrants.go