Added ownership and app existence validation to the user app secrets routes.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user