mirror of
				https://github.com/nitnelave/lldap.git
				synced 2023-04-12 14:25:13 +00:00 
			
		
		
		
	cargo fmt
This commit is contained in:
		
							parent
							
								
									0b5348d3ea
								
							
						
					
					
						commit
						1b9017a92f
					
				| @ -1,5 +1,5 @@ | ||||
| use serde::{Deserialize, Serialize}; | ||||
| use chrono::prelude::*; | ||||
| use serde::{Deserialize, Serialize}; | ||||
| use std::collections::HashSet; | ||||
| 
 | ||||
| #[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)] | ||||
| @ -33,7 +33,6 @@ pub struct User { | ||||
|     pub ssh_pub_key: Option<String>, | ||||
|     pub wireguard_pub_key: Option<String>, | ||||
|     pub creation_date: chrono::NaiveDateTime, | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| impl Default for User { | ||||
|  | ||||
| @ -240,7 +240,10 @@ impl BackendHandler for SqlBackendHandler { | ||||
|                 request.first_name.map(Into::into).unwrap_or(Value::Null), | ||||
|                 request.last_name.map(Into::into).unwrap_or(Value::Null), | ||||
|                 request.ssh_pub_key.map(Into::into).unwrap_or(Value::Null), | ||||
|                 request.wireguard_pub_key.map(Into::into).unwrap_or(Value::Null), | ||||
|                 request | ||||
|                     .wireguard_pub_key | ||||
|                     .map(Into::into) | ||||
|                     .unwrap_or(Value::Null), | ||||
|                 chrono::Utc::now().naive_utc().into(), | ||||
|                 password_hash.into(), | ||||
|             ]) | ||||
|  | ||||
| @ -76,7 +76,10 @@ fn get_attribute(user: &User, attribute: &str) -> Result<Vec<String>> { | ||||
|             .clone() | ||||
|             .unwrap_or_else(|| user.user_id.clone())]), | ||||
|         "sshPubKey" => Ok(vec![user.ssh_pub_key.clone().unwrap_or("".to_string())]), | ||||
|         "wireguardPubKey" => Ok(vec![user.wireguard_pub_key.clone().unwrap_or("".to_string())]), | ||||
|         "wireguardPubKey" => Ok(vec![user | ||||
|             .wireguard_pub_key | ||||
|             .clone() | ||||
|             .unwrap_or("".to_string())]), | ||||
|         _ => bail!("Unsupported attribute: {}", attribute), | ||||
|     } | ||||
| } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 jermz
						jermz