Added ownership and app existence validation to the user app secrets routes.

This commit is contained in:
2026-10-09 12:11:42 +02:00
parent 381c229bd4
commit e68f103c29
11 changed files with 129 additions and 37 deletions
+13
View File
@@ -56,9 +56,22 @@ impl IntoResponse for AppError {
tracing::warn!("user app ownership conflict");
return error_response(StatusCode::CONFLICT, "User app belongs to another user");
}
Self::Repository(RepositoryError::NotFound {
relation: ReferenceRelation::User,
}) => {
return error_response(StatusCode::NOT_FOUND, "User cannot be found");
}
Self::Repository(RepositoryError::NotFound {
relation: ReferenceRelation::UserApp,
}) => {
return error_response(StatusCode::NOT_FOUND, "User app cannot be found");
}
Self::Repository(RepositoryError::OwnershipConflict { relation }) => {
tracing::error!(%relation, "unhandled ownership conflict");
}
Self::Repository(RepositoryError::NotFound { relation }) => {
tracing::error!(%relation, "unhandled not found");
}
Self::Repository(RepositoryError::ReferenceViolation {
relation: ReferenceRelation::User,
kind: ReferenceViolationKind::Missing,