mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-09 17:49:10 +00:00
rpcenv: rename user to auth_id
since it does no longer store just a userid, but potentially an API token identifier as well Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
7d34e6f3a4
commit
51f5acea22
@ -6,7 +6,7 @@ use crate::api::{RpcEnvironment, RpcEnvironmentType};
|
|||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct CliEnvironment {
|
pub struct CliEnvironment {
|
||||||
result_attributes: Value,
|
result_attributes: Value,
|
||||||
user: Option<String>,
|
auth_id: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CliEnvironment {
|
impl CliEnvironment {
|
||||||
@ -28,11 +28,11 @@ impl RpcEnvironment for CliEnvironment {
|
|||||||
RpcEnvironmentType::CLI
|
RpcEnvironmentType::CLI
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_user(&mut self, user: Option<String>) {
|
fn set_auth_id(&mut self, auth_id: Option<String>) {
|
||||||
self.user = user;
|
self.auth_id = auth_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_user(&self) -> Option<String> {
|
fn get_auth_id(&self) -> Option<String> {
|
||||||
self.user.clone()
|
self.auth_id.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,11 @@ pub trait RpcEnvironment: std::any::Any + AsAny + Send {
|
|||||||
/// The environment type
|
/// The environment type
|
||||||
fn env_type(&self) -> RpcEnvironmentType;
|
fn env_type(&self) -> RpcEnvironmentType;
|
||||||
|
|
||||||
/// Set user name
|
/// Set authentication id
|
||||||
fn set_user(&mut self, user: Option<String>);
|
fn set_auth_id(&mut self, user: Option<String>);
|
||||||
|
|
||||||
/// Get user name
|
/// Get authentication id
|
||||||
fn get_user(&self) -> Option<String>;
|
fn get_auth_id(&self) -> Option<String>;
|
||||||
|
|
||||||
/// Set the client IP, should be re-set if a proxied connection was detected
|
/// Set the client IP, should be re-set if a proxied connection was detected
|
||||||
fn set_client_ip(&mut self, _client_ip: Option<std::net::SocketAddr>) {
|
fn set_client_ip(&mut self, _client_ip: Option<std::net::SocketAddr>) {
|
||||||
|
Loading…
Reference in New Issue
Block a user