2022-08-05 19:09:19 +00:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/go-openapi/runtime/middleware"
|
|
|
|
"github.com/nspcc-dev/neofs-rest-gw/gen/restapi/operations"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
allOrigins = "*"
|
|
|
|
allowMethods = "PUT, DELETE"
|
2022-10-06 14:40:14 +00:00
|
|
|
allowHeaders = "X-Bearer-For-All-Users, X-Bearer-Lifetime, X-Bearer-Owner-Id, X-Bearer-Signature, X-Bearer-Signature-Key, Content-Type, Authorization"
|
2022-08-05 19:09:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (a *API) OptionsAuth(operations.OptionsAuthParams) middleware.Responder {
|
|
|
|
return operations.NewOptionsAuthOK().
|
|
|
|
WithAccessControlAllowOrigin(allOrigins).
|
|
|
|
WithAccessControlAllowHeaders(allowHeaders)
|
|
|
|
}
|
|
|
|
|
2022-10-06 14:40:14 +00:00
|
|
|
func (a *API) OptionsAuthBearer(operations.OptionsAuthBearerParams) middleware.Responder {
|
|
|
|
return operations.NewOptionsAuthBearerOK().
|
|
|
|
WithAccessControlAllowOrigin(allOrigins).
|
|
|
|
WithAccessControlAllowHeaders(allowHeaders)
|
|
|
|
}
|
|
|
|
|
2022-08-05 19:09:19 +00:00
|
|
|
func (a *API) OptionsObjectSearch(operations.OptionsObjectsSearchParams) middleware.Responder {
|
|
|
|
return operations.NewOptionsObjectsSearchOK().
|
|
|
|
WithAccessControlAllowOrigin(allOrigins).
|
|
|
|
WithAccessControlAllowHeaders(allowHeaders)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *API) OptionsObjectsPut(operations.OptionsObjectsPutParams) middleware.Responder {
|
|
|
|
return operations.NewOptionsObjectsPutOK().
|
|
|
|
WithAccessControlAllowOrigin(allOrigins).
|
|
|
|
WithAccessControlAllowHeaders(allowHeaders).
|
|
|
|
WithAccessControlAllowMethods(allowMethods)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *API) OptionsObjectsGetDelete(operations.OptionsObjectsGetDeleteParams) middleware.Responder {
|
|
|
|
return operations.NewOptionsObjectsGetDeleteOK().
|
|
|
|
WithAccessControlAllowOrigin(allOrigins).
|
|
|
|
WithAccessControlAllowHeaders(allowHeaders).
|
|
|
|
WithAccessControlAllowMethods(allowMethods)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *API) OptionsContainersPutList(operations.OptionsContainersPutListParams) middleware.Responder {
|
|
|
|
return operations.NewOptionsContainersPutListOK().
|
|
|
|
WithAccessControlAllowOrigin(allOrigins).
|
|
|
|
WithAccessControlAllowHeaders(allowHeaders).
|
|
|
|
WithAccessControlAllowMethods(allowMethods)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *API) OptionsContainersGetDelete(operations.OptionsContainersGetDeleteParams) middleware.Responder {
|
|
|
|
return operations.NewOptionsContainersGetDeleteOK().
|
|
|
|
WithAccessControlAllowOrigin(allOrigins).
|
|
|
|
WithAccessControlAllowHeaders(allowHeaders).
|
|
|
|
WithAccessControlAllowMethods(allowMethods)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *API) OptionsContainersEACL(operations.OptionsContainersEACLParams) middleware.Responder {
|
|
|
|
return operations.NewOptionsContainersEACLOK().
|
|
|
|
WithAccessControlAllowOrigin(allOrigins).
|
|
|
|
WithAccessControlAllowHeaders(allowHeaders).
|
|
|
|
WithAccessControlAllowMethods(allowMethods)
|
|
|
|
}
|