manta_server/service/
mod.rs

1//! Business logic layer — orchestrates backend calls and enforces
2//! domain rules for every resource type exposed by the CLI and HTTP
3//! server.
4//!
5//! # Position in the layering
6//!
7//! Sits between [`crate::server`] (HTTP handlers) and
8//! [`crate::backend_dispatcher`] (CSM / OCHAMI dispatch). Per
9//! `CLAUDE.md`'s boundary rule, handlers MUST only call functions in
10//! this module; they never reach the backend dispatcher directly. The
11//! service layer in turn calls backend trait methods on the
12//! [`InfraContext`]'s `backend` field, which routes to the active
13//! [`crate::dispatcher::StaticBackendDispatcher`] variant.
14//!
15//! [`InfraContext`]: crate::server::common::app_context::InfraContext
16//!
17//! # Conventions
18//!
19//! - Every public async function takes a `&InfraContext<'_>` and a
20//!   `token: &str` so authorization can run before any backend call.
21//! - All fallible paths return
22//!   [`manta_backend_dispatcher::error::Error`]; the handler layer
23//!   maps these to HTTP responses through `to_handler_error`.
24//! - Authorization helpers in [`authorization`] are called from every
25//!   function that takes a node, group, or session name from the
26//!   caller — including read-only endpoints, so listings can't leak
27//!   resources the caller couldn't have queried directly.
28//!
29//! # Module map
30//!
31//! - Cross-cutting: [`authorization`], [`infra_backend`], [`analysis`],
32//!   [`sat_groups`], [`node_ops`], [`ims_ops`].
33//! - Per-resource: [`auth`], [`boot_parameters`], [`configuration`],
34//!   [`group`], [`hardware`], [`image`], [`kernel_parameters`],
35//!   [`node`], [`node_details`], [`power`], [`redfish`], [`session`],
36//!   [`template`].
37//! - Composite operations: [`cluster`], [`ephemeral_env`], [`migrate`],
38//!   [`hw_cluster`] (the last is a subdirectory module).
39
40pub mod analysis;
41pub mod auth;
42pub mod authorization;
43pub mod boot_parameters;
44pub mod cluster;
45pub mod configuration;
46pub mod console;
47pub mod ephemeral_env;
48pub mod group;
49pub mod hardware;
50pub mod hw_cluster;
51pub mod image;
52pub mod ims_ops;
53pub mod infra_backend;
54pub mod kernel_parameters;
55pub mod migrate;
56pub mod node;
57pub mod node_details;
58pub mod node_ops;
59pub mod power;
60pub mod redfish;
61pub mod sat_file;
62pub mod sat_groups;
63pub mod session;
64pub mod template;