router change made one level of rpcenv mut superfluous
Created via `cargo fix`. see commit 47acc8dc8f68ed2c5db69b1678b479e05b0a3194 from proxmox-rs Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -30,7 +30,7 @@ use pbs_config::domains;
|
||||
/// List configured OpenId realms
|
||||
pub fn list_openid_realms(
|
||||
_param: Value,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<OpenIdRealmConfig>, Error> {
|
||||
let (config, digest) = domains::config()?;
|
||||
|
||||
@ -132,7 +132,7 @@ pub fn delete_openid_realm(
|
||||
/// Read the OpenID realm configuration
|
||||
pub fn read_openid_realm(
|
||||
realm: String,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<OpenIdRealmConfig, Error> {
|
||||
let (domains, digest) = domains::config()?;
|
||||
|
||||
|
@ -38,7 +38,7 @@ const WEBAUTHN_ROUTER: Router = Router::new()
|
||||
)]
|
||||
/// Get the TFA configuration.
|
||||
pub fn get_webauthn_config(
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Option<WebauthnConfig>, Error> {
|
||||
let (config, digest) = match tfa::webauthn_config()? {
|
||||
Some(c) => c,
|
||||
|
@ -519,7 +519,7 @@ fn modify_cfg_for_api(id: &str, ty: &str, data: &Value) -> PluginConfig {
|
||||
},
|
||||
)]
|
||||
/// List ACME challenge plugins.
|
||||
pub fn list_plugins(mut rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<PluginConfig>, Error> {
|
||||
pub fn list_plugins(rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<PluginConfig>, Error> {
|
||||
let (plugins, digest) = plugin::config()?;
|
||||
rpcenv["digest"] = hex::encode(&digest).into();
|
||||
Ok(plugins
|
||||
@ -541,7 +541,7 @@ pub fn list_plugins(mut rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<PluginCon
|
||||
returns: { type: PluginConfig },
|
||||
)]
|
||||
/// List ACME challenge plugins.
|
||||
pub fn get_plugin(id: String, mut rpcenv: &mut dyn RpcEnvironment) -> Result<PluginConfig, Error> {
|
||||
pub fn get_plugin(id: String, rpcenv: &mut dyn RpcEnvironment) -> Result<PluginConfig, Error> {
|
||||
let (plugins, digest) = plugin::config()?;
|
||||
rpcenv["digest"] = hex::encode(&digest).into();
|
||||
|
||||
|
@ -80,7 +80,7 @@ pub fn create_changer(config: ScsiTapeChanger) -> Result<(), Error> {
|
||||
pub fn get_config(
|
||||
name: String,
|
||||
_param: Value,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<ScsiTapeChanger, Error> {
|
||||
let (config, digest) = pbs_config::drive::config()?;
|
||||
|
||||
@ -110,7 +110,7 @@ pub fn get_config(
|
||||
/// List changers
|
||||
pub fn list_changers(
|
||||
_param: Value,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<ScsiTapeChanger>, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
let user_info = CachedUserInfo::new()?;
|
||||
|
@ -44,7 +44,7 @@ use crate::server::jobstate;
|
||||
/// List all datastores
|
||||
pub fn list_datastores(
|
||||
_param: Value,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<DataStoreConfig>, Error> {
|
||||
let (config, digest) = pbs_config::datastore::config()?;
|
||||
|
||||
@ -144,7 +144,7 @@ pub fn create_datastore(
|
||||
/// Read a datastore configuration.
|
||||
pub fn read_datastore(
|
||||
name: String,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<DataStoreConfig, Error> {
|
||||
let (config, digest) = pbs_config::datastore::config()?;
|
||||
|
||||
|
@ -80,7 +80,7 @@ pub fn create_drive(config: LtoTapeDrive) -> Result<(), Error> {
|
||||
pub fn get_config(
|
||||
name: String,
|
||||
_param: Value,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<LtoTapeDrive, Error> {
|
||||
let (config, digest) = pbs_config::drive::config()?;
|
||||
|
||||
@ -110,7 +110,7 @@ pub fn get_config(
|
||||
/// List drives
|
||||
pub fn list_drives(
|
||||
_param: Value,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<LtoTapeDrive>, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
let user_info = CachedUserInfo::new()?;
|
||||
|
@ -56,7 +56,7 @@ pub fn create_pool(config: MediaPoolConfig) -> Result<(), Error> {
|
||||
},
|
||||
)]
|
||||
/// List media pools
|
||||
pub fn list_pools(mut rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<MediaPoolConfig>, Error> {
|
||||
pub fn list_pools(rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<MediaPoolConfig>, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
let user_info = CachedUserInfo::new()?;
|
||||
|
||||
|
@ -37,7 +37,7 @@ use pbs_config::CachedUserInfo;
|
||||
pub fn list_remotes(
|
||||
_param: Value,
|
||||
_info: &ApiMethod,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<RemoteWithoutPassword>, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
let user_info = CachedUserInfo::new()?;
|
||||
@ -120,7 +120,7 @@ pub fn create_remote(name: String, config: RemoteConfig, password: String) -> Re
|
||||
pub fn read_remote(
|
||||
name: String,
|
||||
_info: &ApiMethod,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<RemoteWithoutPassword, Error> {
|
||||
let (config, digest) = pbs_config::remote::config()?;
|
||||
let data: RemoteWithoutPassword = config.lookup("remote", &name)?;
|
||||
|
@ -81,7 +81,7 @@ pub fn check_sync_job_modify_access(
|
||||
/// List all sync jobs
|
||||
pub fn list_sync_jobs(
|
||||
_param: Value,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<SyncJobConfig>, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
let user_info = CachedUserInfo::new()?;
|
||||
@ -158,10 +158,7 @@ pub fn create_sync_job(
|
||||
},
|
||||
)]
|
||||
/// Read a sync job configuration.
|
||||
pub fn read_sync_job(
|
||||
id: String,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<SyncJobConfig, Error> {
|
||||
pub fn read_sync_job(id: String, rpcenv: &mut dyn RpcEnvironment) -> Result<SyncJobConfig, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
let user_info = CachedUserInfo::new()?;
|
||||
|
||||
|
@ -30,7 +30,7 @@ use pbs_config::CachedUserInfo;
|
||||
/// List all tape backup jobs
|
||||
pub fn list_tape_backup_jobs(
|
||||
_param: Value,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<TapeBackupJobConfig>, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
let user_info = CachedUserInfo::new()?;
|
||||
@ -104,7 +104,7 @@ pub fn create_tape_backup_job(
|
||||
/// Read a tape backup job configuration.
|
||||
pub fn read_tape_backup_job(
|
||||
id: String,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<TapeBackupJobConfig, Error> {
|
||||
let (config, digest) = pbs_config::tape_job::config()?;
|
||||
|
||||
|
@ -35,7 +35,7 @@ use pbs_config::tape_encryption_keys::{
|
||||
pub fn list_keys(
|
||||
_param: Value,
|
||||
_info: &ApiMethod,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<KeyInfo>, Error> {
|
||||
let (key_map, digest) = load_key_configs()?;
|
||||
|
||||
|
@ -28,7 +28,7 @@ use pbs_api_types::{
|
||||
pub fn list_traffic_controls(
|
||||
_param: Value,
|
||||
_info: &ApiMethod,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<TrafficControlRule>, Error> {
|
||||
let (config, digest) = pbs_config::traffic_control::config()?;
|
||||
|
||||
@ -91,7 +91,7 @@ pub fn create_traffic_control(config: TrafficControlRule) -> Result<(), Error> {
|
||||
pub fn read_traffic_control(
|
||||
name: String,
|
||||
_info: &ApiMethod,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<TrafficControlRule, Error> {
|
||||
let (config, digest) = pbs_config::traffic_control::config()?;
|
||||
let data: TrafficControlRule = config.lookup("rule", &name)?;
|
||||
|
@ -31,7 +31,7 @@ use pbs_config::CachedUserInfo;
|
||||
/// List all verification jobs
|
||||
pub fn list_verification_jobs(
|
||||
_param: Value,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Vec<VerificationJobConfig>, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
let user_info = CachedUserInfo::new()?;
|
||||
@ -120,7 +120,7 @@ pub fn create_verification_job(
|
||||
/// Read a verification job configuration.
|
||||
pub fn read_verification_job(
|
||||
id: String,
|
||||
mut rpcenv: &mut dyn RpcEnvironment,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<VerificationJobConfig, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
let user_info = CachedUserInfo::new()?;
|
||||
|
Reference in New Issue
Block a user