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§
Sourcefn clap_auth(&self, app: Command) -> Command
fn clap_auth(&self, app: Command) -> Command
Create the arguments for the CLI.
For examples, it can create the --login, --password arguments.
Sourcefn clap_matches(
&mut self,
args: &ArgMatches,
app: &mut Command,
settings: &Config,
)
fn clap_matches( &mut self, args: &ArgMatches, app: &mut Command, settings: &Config, )
Process the arguments created by [clap_auth] function.
Sourcefn auth_header(&self) -> (String, String)
fn auth_header(&self) -> (String, String)
Create an authentification header as a pair (name,valeur)
Sourcefn error_help_message(&self) -> String
fn error_help_message(&self) -> String
The helpmessage displayed when the user is unauthorized.