1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//! ## Crud no auth
//!
//! Authentification trait implementation for [crud-api](../crud-api): no authentification.
//!

use clap::{ArgMatches, Command};
use config::Config;
use crud_auth::CrudAuth;

#[derive(Default, Debug)]
pub struct Auth {}

impl CrudAuth for Auth {
  fn clap_auth(&self, app: Command) -> Command {
    app
  }

  fn clap_matches(&mut self, _matches: &ArgMatches, _app: &mut Command, _settings: &Config) {}

  fn auth_header(&self) -> (String, String) {
    ("".to_string(), "".to_string())
  }

  fn error_help_message(&self) -> String {
    "".to_string()
  }
}

#[cfg(test)]
mod tests {
  #[test]
  fn it_works() {
    let result = 2 + 2;
    assert_eq!(result, 4);
  }
}