[#1] Add route to delete container

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-04-13 11:41:04 +03:00 committed by Alex Vanin
parent 066656ac48
commit 63fdb08f14
12 changed files with 637 additions and 96 deletions

View file

@ -68,6 +68,7 @@ func (a *API) Configure(api *operations.NeofsRestGwAPI) http.Handler {
api.PutContainerHandler = operations.PutContainerHandlerFunc(a.PutContainers)
api.GetContainerHandler = operations.GetContainerHandlerFunc(a.GetContainer)
api.DeleteContainerHandler = operations.DeleteContainerHandlerFunc(a.DeleteContainer)
api.BearerAuthAuth = func(s string) (*models.Principal, error) {
if !strings.HasPrefix(s, BearerPrefix) {
@ -99,7 +100,7 @@ func (a *API) setupGlobalMiddleware(handler http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
requestID := uuid.NewString()
a.log.Info("request", zap.String("remote", r.RemoteAddr),
zap.String("method", r.Method), zap.String("uri", r.RequestURI),
zap.String("method", r.Method), zap.String("url", r.URL.String()),
zap.String("id", requestID))
ctx := context.WithValue(r.Context(), ContextKeyRequestID, requestID)