From 51ebd079745703f1f563f5355f8dfbb95c9d2d62 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 17 Feb 2019 11:59:18 +0100 Subject: [PATCH] src/api_schema/router.rs: add docu for RpcEnvironmentType --- src/api_schema/router.rs | 14 ++++++++++---- src/bin/proxmox-backup-api.rs | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/api_schema/router.rs b/src/api_schema/router.rs index e4c61bd7..60d00e4c 100644 --- a/src/api_schema/router.rs +++ b/src/api_schema/router.rs @@ -32,14 +32,20 @@ pub trait RpcEnvironment { fn get_user(&self) -> Option; } + +/// Environment Type +/// +/// We use this to enumerate the different environment types. Some methods +/// needs to do different things when started from the command line interface, +/// or when executed from a privileged server running as root. #[derive(PartialEq, Copy, Clone)] pub enum RpcEnvironmentType { - /// command started from command line + /// Command started from command line CLI, - /// access from public acessable server + /// Access from public accessible server PUBLIC, - /// ... access from priviledged server (run as root) - PRIVILEDGED, + /// Access from privileged server (run as root) + PRIVILEGED, } #[derive(Debug, Fail)] diff --git a/src/bin/proxmox-backup-api.rs b/src/bin/proxmox-backup-api.rs index 22e35b2e..e9953d77 100644 --- a/src/bin/proxmox-backup-api.rs +++ b/src/bin/proxmox-backup-api.rs @@ -50,7 +50,7 @@ fn run() -> Result<(), Error> { } let config = ApiConfig::new( - env!("PROXMOX_JSDIR"), &ROUTER, RpcEnvironmentType::PRIVILEDGED); + env!("PROXMOX_JSDIR"), &ROUTER, RpcEnvironmentType::PRIVILEGED); let rest_server = RestServer::new(config);