auth: add community token service seam

This commit is contained in:
a.tolmachev
2026-05-03 18:26:03 +00:00
parent 18b23fcc0d
commit ffcce360fc
10 changed files with 329 additions and 10 deletions
+7
View File
@@ -109,6 +109,13 @@ impl ApiError {
}
}
pub(crate) fn forbidden_with_context(message: impl Into<String>, context: Value) -> Self {
Self::Forbidden {
message: message.into(),
context: Some(context),
}
}
fn status_code(&self) -> StatusCode {
match self {
Self::Unauthorized { .. } => StatusCode::UNAUTHORIZED,