pub struct LoginKeyRef { /* private fields */ }Expand description
Reference to an SSH login key stored in a secret provider.
Unlike LoginKey, this struct doesn’t contain the actual private key,
but rather a reference to where the key can be retrieved from a secret provider.
§Example
use regent_sdk::hosts::privilege::LoginKeyRef;
use regent_sdk::secrets::SecretReference;
let key_ref = SecretReference::from("ssh_key_path", Some("files".to_string()));
let login_key_ref = LoginKeyRef::from("admin".to_string(), key_ref);
assert_eq!(login_key_ref.username(), "admin");Implementations§
Source§impl LoginKeyRef
impl LoginKeyRef
Sourcepub fn from(username: String, key: SecretReference) -> Self
pub fn from(username: String, key: SecretReference) -> Self
Create a new login key reference from username and secret reference.
§Example
use regent_sdk::hosts::privilege::LoginKeyRef;
use regent_sdk::secrets::SecretReference;
let key_ref = SecretReference::from("my_ssh_key", Some("vault".to_string()));
let login_key_ref = LoginKeyRef::from("admin".to_string(), key_ref);Sourcepub fn key_ref(&self) -> &SecretReference
pub fn key_ref(&self) -> &SecretReference
Get the secret reference for the SSH key.
Trait Implementations§
Source§impl Clone for LoginKeyRef
impl Clone for LoginKeyRef
Source§impl Debug for LoginKeyRef
impl Debug for LoginKeyRef
Source§impl<'de> Deserialize<'de> for LoginKeyRef
impl<'de> Deserialize<'de> for LoginKeyRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LoginKeyRef
impl RefUnwindSafe for LoginKeyRef
impl Send for LoginKeyRef
impl Sync for LoginKeyRef
impl Unpin for LoginKeyRef
impl UnsafeUnpin for LoginKeyRef
impl UnwindSafe for LoginKeyRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more