feat(services/autumn): authenticate the user on upload
feat(services/autumn): file size limits on upload chore: add database migrations for new autumn things
This commit is contained in:
@@ -74,6 +74,9 @@ impl IntoResponse for Error {
|
||||
ErrorType::FailedValidation { .. } => StatusCode::BAD_REQUEST,
|
||||
|
||||
ErrorType::ProxyError => StatusCode::BAD_REQUEST,
|
||||
ErrorType::FileTooSmall => StatusCode::UNPROCESSABLE_ENTITY,
|
||||
ErrorType::FileTooLarge { .. } => StatusCode::UNPROCESSABLE_ENTITY,
|
||||
ErrorType::FileTypeNotAllowed => StatusCode::BAD_REQUEST,
|
||||
};
|
||||
|
||||
(status, Json(&self)).into_response()
|
||||
|
||||
@@ -156,6 +156,11 @@ pub enum ErrorType {
|
||||
|
||||
// ? Micro-service errors
|
||||
ProxyError,
|
||||
FileTooSmall,
|
||||
FileTooLarge {
|
||||
max: usize,
|
||||
},
|
||||
FileTypeNotAllowed,
|
||||
|
||||
// ? Legacy errors
|
||||
VosoUnavailable,
|
||||
|
||||
@@ -80,6 +80,9 @@ impl<'r> Responder<'r, 'static> for Error {
|
||||
ErrorType::FailedValidation { .. } => Status::BadRequest,
|
||||
|
||||
ErrorType::ProxyError => Status::BadRequest,
|
||||
ErrorType::FileTooSmall => Status::UnprocessableEntity,
|
||||
ErrorType::FileTooLarge { .. } => Status::UnprocessableEntity,
|
||||
ErrorType::FileTypeNotAllowed => Status::BadRequest,
|
||||
};
|
||||
|
||||
// Serialize the error data structure into JSON.
|
||||
|
||||
Reference in New Issue
Block a user