pub struct Conversation {
    pub username: String,
    pub password: String,
    pub log: Vec<LogEntry>,
}
Expand description

Non-interactive implementation of ConversationHandler

When a PAM module asks for a non-secret string, username will be returned and when a secret string is asked for, password will be returned.

All info and error messages will be recorded in log.

Limitations

This is enough to handle many authentication flows non-interactively, but flows with two-factor-authentication and things like chauthok() will most definitely fail.

Please also note that UTF-8 encoding is assumed for both username and password, so this handler may fail to authenticate on legacy non-UTF-8 systems when one of the strings contains non-ASCII characters.

Fields

username: String

The username to use

password: String

The password to use

log: Vec<LogEntry>

All received info/error messages

Implementations

Creates a new CLI conversation handler

If username isn’t manually set to a non-empty string, it will be automatically set to the Contexts default username on context initialization.

Creatse a new CLI conversation handler with preset credentials

Clears the error/info log

Lists only errors from the log

Lists only info messages from the log

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Called by Context directly after taking ownership of the handler. Read more

Obtains a string whilst echoing text (e.g. username) Read more

Obtains a string without echoing any text (e.g. password) Read more

Displays some text.

Displays an error message.

Obtains a yes/no answer (Linux specific). Read more

Exchanges binary data (Linux specific, experimental). Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.