Storage: use static access rules (#52334)

* Storage: use static access rules

* Storage: use static access rules

* Storage: add tests
This commit is contained in:
Artur Wierzbicki
2022-07-17 22:41:54 +04:00
committed by GitHub
parent e6a5b9ee7f
commit 6188526e1d
8 changed files with 319 additions and 52 deletions
+4 -1
View File
@@ -37,7 +37,7 @@ func ProvideHTTPService(store StorageService) HTTPStorageService {
func UploadErrorToStatusCode(err error) int {
switch {
case errors.Is(err, ErrUploadFeatureDisabled):
case errors.Is(err, ErrStorageNotFound):
return 404
case errors.Is(err, ErrUnsupportedStorage):
@@ -49,6 +49,9 @@ func UploadErrorToStatusCode(err error) int {
case errors.Is(err, ErrFileAlreadyExists):
return 400
case errors.Is(err, ErrAccessDenied):
return 403
default:
return 500
}