@@ -107,6 +107,31 @@ Domain objects use shared metadata: stable server-generated IDs, human-readable
107107names, creation timestamps, and labels. Crate-level details live in
108108` crates/openshell-core/README.md ` .
109109
110+ ## Interceptors
111+
112+ Gateway interceptors are an optional operation-review boundary for deployments
113+ that need organization-specific controls outside the gateway binary. They are
114+ disabled unless configured in gateway TOML. At startup, the gateway connects to
115+ each configured gRPC or Unix-socket service, calls ` Describe ` , validates the
116+ returned manifest, applies any local narrowing overrides, and builds a
117+ deterministically ordered review plan. Invalid manifests or unreachable
118+ interceptors fail gateway startup.
119+
120+ Handlers call the interceptor runtime only after authentication and basic
121+ request validation. The covered write paths are sandbox create and provider
122+ attach/detach, provider and provider-profile writes, policy/config updates, and
123+ the driver-facing sandbox create shape before compute-driver validation. The
124+ runtime supports ` pre_request ` , ` modify_object ` , ` validate_object ` ,
125+ ` validate_driver ` , and ` post_commit ` phases. Modification phases are available
126+ only where the gateway owns explicit protobuf-to-JSON round-trip adapters;
127+ validation phases may deny but cannot patch.
128+
129+ Provider credentials are treated as secret-bearing fields. Review payloads
130+ redact credential values, and patches that read or write provider credential
131+ paths are rejected before they can modify persisted state. Interceptor denials
132+ and security-relevant failures are visible through structured tracing, gateway
133+ OCSF finding events, and metrics.
134+
110135## Persistence
111136
112137The gateway persistence layer is a protobuf object store. Domain services store
@@ -150,6 +175,11 @@ This keeps the gateway data model portable across storage backends and leaves
150175room for future stores that can provide the same object, label, version, and
151176scope semantics.
152177
178+ User-supplied labels are validated with Kubernetes label-value limits at API
179+ boundaries. Trusted gateway extensions, such as interceptors, may attach longer
180+ stored metadata values when those values are not projected to compute-platform
181+ labels.
182+
153183The SQLite adapter tightens the on-disk database file to mode ` 0o600 ` on every
154184connect so that provider API keys, SSH session tokens, and sandbox metadata are
155185not readable by other local users on shared hosts. The same restriction is
@@ -422,6 +452,11 @@ Driver implementation settings live in the TOML driver tables. See
422452` docs/reference/gateway-config.mdx ` for worked per-driver examples and RFC
4234530003 for the full schema.
424454
455+ Gateway interceptors are configured under
456+ ` [[openshell.gateway.interceptors]] ` . They do not inherit into driver tables.
457+ Interceptor service manifests are validated at startup before the gateway
458+ accepts traffic.
459+
425460` database_url ` is env-only and rejected when present in the file
426461(` OPENSHELL_DB_URL ` / ` --db-url ` ).
427462
0 commit comments