vetis-compio 0.1.1

Very Tiny Server with compio runtime
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[cfg(feature = "auth")]
mod auth_tests {
    use crate::config::server::host::path::auth::{Algorithm, BasicAuthConfig};

    #[test]
    fn test_auth_config() -> Result<(), Box<dyn std::error::Error>> {
        let auth_config = BasicAuthConfig::builder()
            .algorithm(Algorithm::BCrypt)
            .htpasswd(Some("src/tests/files/.htpasswd".to_string()))
            .build()?;
        assert_eq!(auth_config.algorithm(), &Algorithm::BCrypt);
        assert_eq!(auth_config.htpasswd(), &Some("src/tests/files/.htpasswd".to_string()));
        Ok(())
    }
}