soma_integrations/lib.rs
1// Render per-item feature-requirement badges when rustdoc runs on nightly with
2// `--cfg docsrs` (docs.rs posture; locally via `cargo xtask doc --docsrs-cfg`).
3// Inert under the stable CI doc gate: stable rustdoc never sets `docsrs`.
4#![cfg_attr(docsrs, feature(doc_auto_cfg))]
5//! Product adapters connecting `soma-application`'s transport-neutral ports
6//! to Soma's shared engines (plan section 3.20).
7//!
8//! This is intentionally an outer-layer crate: it is the one place allowed to
9//! see both `soma-application` ports and concrete shared engines
10//! (`soma-gateway`, `soma-codemode`, and — once wired — `soma-openapi`) in
11//! the same dependency graph. `apps/soma` constructs these adapters; it must
12//! not contain their implementation logic.
13//!
14//! Modules:
15//! [`gateway`] — [`GatewayPort`](soma_application::GatewayPort) implementation over `soma-gateway`'s `GatewayManager`.
16//! [`gateway_auth`] — bridges `soma-auth`'s upstream OAuth runtime into `soma-gateway`'s generic OAuth traits (`oauth` feature).
17//! [`auth`] — Soma's product auth default mapping (env prefix, scopes, cookie name) (`auth` feature).
18//! [`codemode`] — [`CodeModePort`](soma_application::CodeModePort) implementation over `soma-codemode`.
19//!
20//! `protected_routes`/`protected_routes_proxy` (bearer-token auth, scope
21//! authorization, and gateway-subset dispatch for protected MCP routes)
22//! lived here briefly behind a `protected-http` feature but were moved to
23//! `soma-runtime` as a PR 19 review fix: they need both `AppState`
24//! (`soma-runtime`) and `soma-mcp`'s `McpState`, and depending on either
25//! from this crate inverted plan section 3.20's target dependency shape
26//! (below) and contradicted this crate's own `gateway.rs`, which documents
27//! taking the gateway manager directly rather than depending on
28//! `soma-runtime` for that reason.
29//!
30//! Not yet implemented here (see `soma-architecture-refactor-plan-v3.md` PR 11
31//! notes on the bead for this slice): `OpenApiPort` has no product adapter —
32//! `soma_application::OpenApiExecuteRequest` has no spec/label field and no
33//! `soma_openapi::registry::OpenApiRegistry` is constructed anywhere in the
34//! runtime yet, so a real adapter would require inventing an unspecified wire
35//! shape rather than moving or wiring existing, tested behavior.
36
37pub mod gateway;
38
39#[cfg(feature = "auth")]
40pub mod auth;
41#[cfg(feature = "oauth")]
42pub mod gateway_auth;
43
44pub mod codemode;
45
46pub use codemode::CodeModeApplicationPort;
47pub use gateway::GatewayApplicationPort;