diff --git a/api/handler/list.go b/api/handler/list.go index e1060300..5fd6247a 100644 --- a/api/handler/list.go +++ b/api/handler/list.go @@ -5,9 +5,7 @@ import ( "strconv" "time" - sdk "github.com/nspcc-dev/cdn-neofs-sdk" "github.com/nspcc-dev/neofs-api-go/pkg/owner" - "github.com/nspcc-dev/neofs-api-go/pkg/token" "github.com/nspcc-dev/neofs-s3-gate/api" "github.com/nspcc-dev/neofs-s3-gate/api/layer" "go.uber.org/zap" @@ -29,27 +27,10 @@ func (h *handler) ListBucketsHandler(w http.ResponseWriter, r *http.Request) { var ( err error own = owner.NewID() - tkn *token.BearerToken res *ListBucketsResponse rid = api.GetRequestID(r.Context()) ) - if tkn, err = sdk.BearerToken(r.Context()); err != nil { - h.log.Error("something went wrong", - zap.String("request_id", rid), - zap.Error(err)) - - api.WriteErrorResponse(r.Context(), w, api.Error{ - Code: api.GetAPIError(api.ErrInternalError).Code, - Description: err.Error(), - HTTPStatusCode: http.StatusInternalServerError, - }, r.URL) - - return - } - - own = tkn.Issuer() - list, err := h.obj.ListBuckets(r.Context()) if err != nil { h.log.Error("something went wrong", diff --git a/api/handler/put.go b/api/handler/put.go index 835aa28d..c65dcee4 100644 --- a/api/handler/put.go +++ b/api/handler/put.go @@ -30,20 +30,6 @@ func (h *handler) PutObjectHandler(w http.ResponseWriter, r *http.Request) { HTTPStatusCode: http.StatusBadRequest, }, r.URL) - return - } else if _, err = h.obj.GetObjectInfo(r.Context(), bkt, obj); err == nil { - h.log.Error("object exists", - zap.String("request_id", rid), - zap.String("bucket_name", bkt), - zap.String("object_name", obj), - zap.Error(err)) - - api.WriteErrorResponse(r.Context(), w, api.Error{ - Code: api.GetAPIError(api.ErrMethodNotAllowed).Code, - Description: "Object: " + bkt + "#" + obj + " already exists", - HTTPStatusCode: http.StatusBadRequest, - }, r.URL) - return }