Fix Registry: Changing the type of an existing account from user to group panics

This commit is contained in:
Maurus Decimus
2026-06-28 19:10:00 +02:00
parent 7e7e254328
commit 5f58fdb92b
2 changed files with 9 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If
- OIDC: `ECDSA` private key support for `SEC1` format.
- PostgreSQL: Include error chain in error messages.
- Prometheus: event counters are exported with incorrect metric names.
- Registry: Changing the type of an existing account from `user` to `group` panics.
## [0.16.11] - 2026-06-25

View File

@@ -245,7 +245,14 @@ pub(crate) async fn validate_account(
true
}
_ => unreachable!(),
(Account::User(_), AccountUpdate::Update(Account::Group(_)))
| (Account::Group(_), AccountUpdate::Update(Account::User(_))) => {
return Ok(Err(SetError::invalid_properties()
.with_property(Property::Type)
.with_description(
"Cannot change the type of an existing account.",
)));
}
};
let mut result = if validate_permissions {