aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-23 18:19:33 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-23 18:19:33 +0200
commit262eabdca97cad30d230b54c4d6793478641b32f (patch)
tree96ce2efcffc04747c191b5b62307b45ae7af16e4 /src/config.rs
parent53881fdb21a3bcde82055bcf758032cabd76b864 (diff)
downloadaerogramme-262eabdca97cad30d230b54c4d6793478641b32f.tar.gz
aerogramme-262eabdca97cad30d230b54c4d6793478641b32f.zip
First impl of LDAP login
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs
index ab40824..b77288b 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -41,8 +41,16 @@ pub struct LoginStaticUser {
pub struct LoginLdapConfig {
pub ldap_server: String,
- pub search_dn: String,
+ #[serde(default)]
+ pub pre_bind_on_login: bool,
+ pub bind_dn: Option<String>,
+ pub bind_password: Option<String>,
+
+ pub search_base: String,
pub username_attr: String,
+ #[serde(default = "default_mail_attr")]
+ pub mail_attr: String,
+
pub aws_access_key_id_attr: String,
pub aws_secret_access_key_attr: String,
pub user_secret_attr: String,
@@ -62,3 +70,7 @@ pub fn read_config(config_file: PathBuf) -> Result<Config> {
Ok(toml::from_str(&config)?)
}
+
+fn default_mail_attr() -> String {
+ "mail".into()
+}