hivectl: extend --password to forge; clarify matrix M_USER_IN_USE asymmetry (#663 / argus)

This commit is contained in:
damocles 2026-05-30 21:55:25 +02:00 committed by Mara
commit 97797cf790
3 changed files with 100 additions and 13 deletions

View file

@ -289,6 +289,12 @@ pub async fn ensure_user_for(
/// web clients afterwards (#663); for headless agent re-provisioning
/// the caller can pass [`random_password`] to keep the existing
/// throwaway behaviour.
///
/// **Not idempotent** (unlike [`forge::provision_user_token`]): the
/// matrix UIAA `/register` endpoint returns `M_USER_IN_USE` (HTTP 400)
/// on second call for the same localpart. Callers re-running this for
/// a known-existing matrix user should expect a hard error from this
/// fn and route to a password-reset path instead.
pub async fn provision_user_token(
client: &reqwest::Client,
name: &str,