pub struct MachineIdentity {
pub principal: String,
pub realm: String,
pub keytab: PathBuf,
}Expand description
The machine’s AD identity, discovered from its keytab.
The keytab is the ground truth for what this device can authenticate as —
more reliable than deriving HOSTNAME$ from the hostname, which drifts
(renames, >15-char truncation, case).
Fields§
§principal: Stringe.g. WORKSTATION1$@EXAMPLE.COM
realm: Stringe.g. EXAMPLE.COM
keytab: PathBufImplementations§
Source§impl MachineIdentity
impl MachineIdentity
Sourcepub fn discover(tools: &Tools, keytab: impl Into<PathBuf>) -> Result<Self>
pub fn discover(tools: &Tools, keytab: impl Into<PathBuf>) -> Result<Self>
Read the keytab and pick the first machine (NAME$@REALM) principal.
Needs read access to the keytab — i.e. root for /etc/krb5.keytab.
On a host joined to multiple realms, use Self::discover_in_realm to
choose which one.
Sourcepub fn discover_in_realm(
tools: &Tools,
keytab: impl Into<PathBuf>,
realm: &str,
) -> Result<Self>
pub fn discover_in_realm( tools: &Tools, keytab: impl Into<PathBuf>, realm: &str, ) -> Result<Self>
Like Self::discover, but pick the machine principal whose realm
matches realm (case-insensitive) — for hosts joined to more than one
AD realm. Errors with Error::NoMachinePrincipalForRealm if none match.
Trait Implementations§
Source§impl Clone for MachineIdentity
impl Clone for MachineIdentity
Source§fn clone(&self) -> MachineIdentity
fn clone(&self) -> MachineIdentity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MachineIdentity
impl Debug for MachineIdentity
Auto Trait Implementations§
impl Freeze for MachineIdentity
impl RefUnwindSafe for MachineIdentity
impl Send for MachineIdentity
impl Sync for MachineIdentity
impl Unpin for MachineIdentity
impl UnsafeUnpin for MachineIdentity
impl UnwindSafe for MachineIdentity
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