LDAP: Generate valid credentialId when there are password changes

This commit is contained in:
Maurus Decimus
2026-04-28 15:32:00 +02:00
parent c0c889b7fb
commit c3366a91e7
2 changed files with 18 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If
- Allow HTTP to be used for configuring the server.
## Fixed
- LDAP: Generate valid `credentialId` when there are password changes.
- TLS: Disable cipher suited option disables wrong ciphers.
- DNS Updater:
- BunnyDNS: Use subdomain as name of record instead of FQDN.

View File

@@ -39,8 +39,10 @@ impl UserAccount {
}) {
credential.secret = password;
} else {
let credential_id = self.next_credential_id().into();
self.credentials
.push(Credential::Password(PasswordCredential {
credential_id,
secret: password,
..Default::default()
}));
@@ -86,6 +88,21 @@ impl UserAccount {
self.into_password_credential()
.map(|credential| credential.secret)
}
pub fn next_credential_id(&self) -> u64 {
self.credentials
.0
.values()
.map(|credential| match credential {
Credential::Password(credential) => credential.credential_id.id() + 1,
Credential::AppPassword(credential_properties)
| Credential::ApiKey(credential_properties) => {
credential_properties.credential_id.id() + 1
}
})
.max()
.unwrap_or_default()
}
}
impl Credential {