Skip to content
Snippets Groups Projects
Commit b31d53b1 authored by ale's avatar ale
Browse files

Use defaults when public_key_attr/private_key_attr are unset

parent bb1e782a
No related branches found
No related tags found
No related merge requests found
......@@ -43,11 +43,16 @@ func (c *LDAPQueryConfig) Valid() error {
}
c.scope = s
}
// Since two different daemons use this code, with separate
// configs, and one of them does not need one of these
// attributes, it's more practical to set defaults rather than
// complain if values are unset.
if c.PublicKeyAttr == "" {
return errors.New("empty public_key_attr")
c.PublicKeyAttr = "userPublicKey"
}
if c.PrivateKeyAttr == "" {
return errors.New("empty public_key_attr")
c.PrivateKeyAttr = "userEncryptedKey"
}
return nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment