Skip to main content

SystemAccounts

Struct SystemAccounts 

Source
pub struct SystemAccounts { /* private fields */ }
Expand description

The operating system’s accounts: who may sign in is who the OS lets sign in, narrowed by SystemAccountsConfig::min_uid and SystemAccountsConfig::groups.

Read only: accounts are managed with the OS’s own tools. Every call blocks on the OS (PAM may sleep seconds after a wrong password), so a host calls it from a blocking thread.

Implementations§

Source§

impl SystemAccounts

Source

pub fn builder() -> SystemAccountsBuilder

Options for the OS’s accounts, each at its default.

Source

pub fn new(config: SystemAccountsConfig) -> Result<Self, ProviderError>

The provider these options describe.

§Errors

As SystemAccountsBuilder::build.

Source

pub fn config(&self) -> &SystemAccountsConfig

The options in force.

Trait Implementations§

Source§

impl Authenticator for SystemAccounts

Source§

fn authenticate(&self, attempt: Attempt) -> Result<Verdict, ProviderError>

A name the OS does not have, or these options do not admit, is Unknown; a wrong password, or a disabled, locked or expired account, is Invalid; success names the account by: "id" (the uid, or the SID on Windows).

Source§

fn describe(&self) -> Result<Description, ProviderError>

What this authenticator is and what it takes. Defaults to nothing said.
Source§

impl Debug for SystemAccounts

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Directory for SystemAccounts

Source§

fn lookup(&self, lookup: Lookup) -> Result<Option<Person>, ProviderError>

By id (uid, or SID on Windows) or name; a disabled or unadmitted account is None.

Source§

fn describe(&self) -> Result<Description, ProviderError>

What this directory is. Defaults to nothing said.
Source§

impl ProviderDecl for SystemAccounts

Source§

const KINDS: &'static [&'static str]

The name of every kind this provider serves, so a library can declare them at compile time.
Source§

fn provider(host: Host, alloc: Alloc) -> Result<ProviderParts, ValueError>

Builds this provider’s descriptor, its tables and its configuration schema, once. host is what the library was loaded by; alloc is what the schema is built through.
Source§

impl TryFrom<Described<SystemAccountsConfig>> for SystemAccounts

Source§

type Error = ProviderError

The type returned in the event of a conversion error.
Source§

fn try_from( config: Described<SystemAccountsConfig>, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SystemAccountsConfig> for SystemAccounts

Source§

type Error = ProviderError

The type returned in the event of a conversion error.
Source§

fn try_from(config: SystemAccountsConfig) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.