crud_auth_no_auth/
lib.rs

1//! ## Crud no auth
2//!
3//! Authentification trait implementation for [crud-api](../crud-api): no authentification.
4//!
5
6use clap::{ArgMatches, Command};
7use config::Config;
8use crud_auth::CrudAuth;
9
10#[derive(Default, Debug)]
11pub struct Auth {}
12
13impl CrudAuth for Auth {
14  fn clap_auth(&self, app: Command) -> Command {
15    app
16  }
17
18  fn clap_matches(&mut self, _matches: &ArgMatches, _app: &mut Command, _settings: &Config) {}
19
20  fn auth_header(&self) -> (String, String) {
21    ("".to_string(), "".to_string())
22  }
23
24  fn error_help_message(&self) -> String {
25    "".to_string()
26  }
27}
28
29#[cfg(test)]
30mod tests {
31  #[test]
32  fn it_works() {
33    let result = 2 + 2;
34    assert_eq!(result, 4);
35  }
36}