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)]
|
||||
pub struct CliEnvironment {
|
||||
result_attributes: Value,
|
||||
user: Option<String>,
|
||||
auth_id: Option<String>,
|
||||
}
|
||||
|
||||
impl CliEnvironment {
|
||||
@ -28,11 +28,11 @@ impl RpcEnvironment for CliEnvironment {
|
||||
RpcEnvironmentType::CLI
|
||||
}
|
||||
|
||||
fn set_user(&mut self, user: Option<String>) {
|
||||
self.user = user;
|
||||
fn set_auth_id(&mut self, auth_id: Option<String>) {
|
||||
self.auth_id = auth_id;
|
||||
}
|
||||
|
||||
fn get_user(&self) -> Option<String> {
|
||||
self.user.clone()
|
||||
fn get_auth_id(&self) -> Option<String> {
|
||||
self.auth_id.clone()
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,11 @@ pub trait RpcEnvironment: std::any::Any + AsAny + Send {
|
||||
/// The environment type
|
||||
fn env_type(&self) -> RpcEnvironmentType;
|
||||
|
||||
/// Set user name
|
||||
fn set_user(&mut self, user: Option<String>);
|
||||
/// Set authentication id
|
||||
fn set_auth_id(&mut self, user: Option<String>);
|
||||
|
||||
/// Get user name
|
||||
fn get_user(&self) -> Option<String>;
|
||||
/// Get authentication id
|
||||
fn get_auth_id(&self) -> Option<String>;
|
||||
|
||||
/// 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>) {
|
||||
|
Loading…
Reference in New Issue
Block a user