Commit b31d53b1 authored by ale's avatar ale

Use defaults when public_key_attr/private_key_attr are unset

parent bb1e782a
Pipeline #793 passed with stages
in 47 seconds
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment