Skip to main content

Crate omnigraph_server

Crate omnigraph_server 

Source

Re-exports§

pub use graph_id::GraphId;
pub use identity::AuthSource;
pub use identity::GraphKey;
pub use identity::ResolvedActor;
pub use identity::Scope;
pub use identity::TenantId;
pub use registry::GraphHandle;
pub use registry::GraphRegistry;
pub use registry::InsertError;
pub use registry::RegistryLookup;
pub use registry::RegistrySnapshot;
pub use auth::AWS_SECRET_ENV;
pub use auth::EnvOrFileTokenSource;
pub use auth::TokenSource;
pub use auth::resolve_token_source;

Modules§

api
HTTP wire DTOs. The types and their engine-result -> DTO mappings live in the shared omnigraph-api-types crate (RFC-009 Phase 2) so the CLI and server share one definition; re-exported here so every omnigraph_server::api::* path (handlers, the OpenApi schema list, CLI imports) keeps resolving unchanged. Only query_catalog_entry stays — it maps the server’s runtime StoredQuery (not a wire type) into the shared QueryCatalogEntry DTO.
auth
Bearer token sources.
graph_id
GraphId — registry-level identity for a graph in multi-graph mode (MR-668).
identity
Identity types for the multi-graph server (MR-668) + forward-compatible shapes for Cloud mode (RFC 0003) and OAuth provider (RFC 0004).
policy
queries
Stored-query registry.
registry
GraphRegistry — the multi-graph routing substrate (MR-668).
workload
Per-actor admission control for the HTTP server (MR-686 §VII.A).

Structs§

ApiDoc
ApiError
AppState
GraphRouting
Runtime routing for the server (RFC-011 cluster-only). Every deployment serves cluster routes (/graphs/{graph_id}/...) backed by a registry of N graphs (N ≥ 1). The single-graph convenience constructors build a one-graph registry keyed by default; the cluster boot path builds an N-graph registry. There is no longer a flat-route mode.
GraphStartupConfig
One graph’s startup-time configuration: id, opened URI, optional per-graph policy source. Constructed by load_server_settings in multi mode; consumed by serve’s parallel open loop.
PolicyCompiler
PolicyConfig
PolicyDecision
PolicyEngine
PolicyRequest
What a caller wants to do, sans identity. Actor identity flows through a separate actor_id: &str parameter on PolicyEngine::authorize / PolicyChecker::check — encoding the architectural invariant that actor identity is server-authoritative and must not be supplied by the same code path that supplies the requested action. In the HTTP layer, the bearer-token middleware resolves the actor and passes it independently; clients cannot smuggle identity inside this struct.
PolicyTestConfig
ServerConfig

Enums§

PolicyAction
PolicyExpectation
PolicyResourceKind
Which Cedar entity an action’s policies apply to. Internal to omnigraph-policy — drives the compile_policy_source template and the request-time resource UID construction.
PolicySource
Where a Cedar policy bundle comes from at startup. Cluster-local files are used during config application; inline digest-verified catalog content is used for serving, where the catalog may live on object storage and the server must not re-read mutable state after the snapshot.
ServerConfigMode
What load_server_settings produces. RFC-011 cluster-only: the server always boots from a cluster’s applied revision into a multi-graph deployment (N ≥ 1 graphs).
ServerRuntimeState
MR-723 server runtime state, classified from the three-state matrix of (bearer tokens configured) × (policy file configured) at startup.

Functions§

build_app
classify_server_runtime_state
Compute the ServerRuntimeState from the configured inputs. Pulled out as a pure function so the matrix is unit-testable without standing up the full server.
init_tracing
load_server_settings
RFC-011 cluster-only boot: the server serves exclusively from a cluster’s applied revision (--cluster <dir | s3://…>). The legacy omnigraph.yaml / --target / positional-URI single-graph boot paths were removed — a deployment serves from exactly one source.
open_multi_graph_state
Parallel open of every graph in the startup config, with bounded concurrency (buffer_unordered(4)). Graph-specific open failures quarantine that graph; startup succeeds as long as at least one graph opens.
serve
served_openapi
The canonical served OpenAPI shape (RFC-011 cluster-only): the static ApiDoc with every protected path nested under /graphs/{graph_id}/… and cluster_-prefixed operation ids. /healthz and /graphs stay flat. This is the single source of nesting — both the runtime server_openapi handler and the committed openapi.json derive from it, so the published spec can never describe routes the server does not serve. The handler additionally strips security in open mode; the committed spec retains it.