Trait CrudAuth

Source
pub trait CrudAuth {
    // Required methods
    fn clap_auth(&self, app: Command) -> Command;
    fn clap_matches(
        &mut self,
        args: &ArgMatches,
        app: &mut Command,
        settings: &Config,
    );
    fn auth_header(&self) -> (String, String);
    fn error_help_message(&self) -> String;
}
Expand description

Authification module for Crud. Import an implementation of this trait to manage authification. TODO: Add some examples

Required Methods§

Source

fn clap_auth(&self, app: Command) -> Command

Create the arguments for the CLI. For examples, it can create the --login, --password arguments.

Source

fn clap_matches( &mut self, args: &ArgMatches, app: &mut Command, settings: &Config, )

Process the arguments created by [clap_auth] function.

Source

fn auth_header(&self) -> (String, String)

Create an authentification header as a pair (name,valeur)

Source

fn error_help_message(&self) -> String

The helpmessage displayed when the user is unauthorized.

Implementors§