pub struct EnrollService {
pub listen: SocketAddr,
/* private fields */
}Fields§
§listen: SocketAddrImplementations§
Source§impl EnrollService
impl EnrollService
pub fn start( config: &EnrollConfig, ) -> Result<(Arc<Self>, UnboundedReceiver<EnrollEvent>), EnrollmentError>
Sourcepub fn handle_enroll(&self, body: &[u8], peer: IpAddr) -> HttpReply
pub fn handle_enroll(&self, body: &[u8], peer: IpAddr) -> HttpReply
Public enroll request body -> reply. Errors are generic towards the caller.
Sourcepub async fn handle_build(&self, body: &[u8], peer: IpAddr) -> HttpReply
pub async fn handle_build(&self, body: &[u8], peer: IpAddr) -> HttpReply
POST /v1/build: a node-signed request to build and sign a configured recipe.
Checks, in order: shape, clock window, replay, node signature (enrolled identity key),
status/capability policy (build), then forwards to the build host with a bearer the
node never sees. Failures towards the node are generic.
Sourcepub async fn handle_node_call(&self, body: &[u8], peer: IpAddr) -> HttpReply
pub async fn handle_node_call(&self, body: &[u8], peer: IpAddr) -> HttpReply
POST /v1/node-call: a node-signed mail/task operation. Same gate as builds (shape, clock,
replay, signature, status policy for the operation’s capability), then forwarded to the
server’s control API with a bearer only C2 holds. The server re-checks its own ledger.
Sourcepub fn handle_operator(
&self,
method: &str,
path: &str,
body: &[u8],
) -> HttpReply
pub fn handle_operator( &self, method: &str, path: &str, body: &[u8], ) -> HttpReply
Operator endpoints under /v1/enroll/... (the caller has checked the bearer).
Sourcepub fn callhome_allowed(&self, node_id: &str) -> bool
pub fn callhome_allowed(&self, node_id: &str) -> bool
Is this node enrolled and allowed to connect (neutral, member, trusted)?
Sourcepub fn allows(&self, node_id: &str, capability: &str) -> Option<bool>
pub fn allows(&self, node_id: &str, capability: &str) -> Option<bool>
Policy decision for an enrolled node: its current status must hold capability.
Sourcepub fn reload_policy(&self) -> Result<(), String>
pub fn reload_policy(&self) -> Result<(), String>
Re-read the policy file. On any error the previous policy stays in force.
Sourcepub fn nodes_without(&self, capability: &str) -> Vec<String>
pub fn nodes_without(&self, capability: &str) -> Vec<String>
Enrolled nodes whose current status no longer holds capability.