feat: add PATCH /federation/me/also-known-as endpoint
Some checks failed
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (push) Has been cancelled

Adds alsoKnownAs column to users table (migration 013), reads it in
the AP actor JSON, and exposes PATCH /federation/me/also-known-as to
set or clear it. Required pre-condition for broadcast_move.
This commit is contained in:
2026-05-28 01:59:35 +02:00
parent 23a8444b5c
commit 1ad02e0806
8 changed files with 92 additions and 11 deletions

View File

@@ -126,3 +126,17 @@ pub async fn post_move_account(
.map_err(ApiError::from)?;
Ok(StatusCode::NO_CONTENT)
}
#[derive(Deserialize)]
pub struct AlsoKnownAsBody {
pub also_known_as: Option<String>,
}
pub async fn patch_also_known_as(
Deps(d): Deps<FederationManagementDeps>,
AuthUser(uid): AuthUser,
Json(body): Json<AlsoKnownAsBody>,
) -> Result<StatusCode, ApiError> {
d.users.set_also_known_as(&uid, body.also_known_as).await?;
Ok(StatusCode::NO_CONTENT)
}