[#346] s3-gw: Reuse single `neofs.NeoFS` in application

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/KirillovDenis/bugfix/681-fix_acl_parsing
Leonard Lyubich 2022-03-02 17:31:54 +03:00 committed by LeL
parent 1517b5c638
commit 0cbe09d211
2 changed files with 3 additions and 6 deletions

View File

@ -158,15 +158,12 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
NotificationController: nc,
}
var n neofs.NeoFS
n.SetConnectionPool(conns)
// prepare object layer
obj = layer.NewLayer(l, &layerNeoFS{&n}, layerCfg)
obj = layer.NewLayer(l, &layerNeoFS{&neoFS}, layerCfg)
// prepare auth center
ctr = auth.New(&neofs.AuthmateNeoFS{
NeoFS: n,
NeoFS: &neoFS,
}, key, getAccessBoxCacheConfig(v, l))
handlerOptions := getHandlerOptions(v, l)

View File

@ -512,7 +512,7 @@ func (x *NeoFS) DeleteObject(ctx context.Context, prm layer.PrmObjectDelete) err
// AuthmateNeoFS is a mediator which implements authmate.NeoFS through NeoFS.
type AuthmateNeoFS struct {
NeoFS
*NeoFS
}
func (x *AuthmateNeoFS) CreateContainer(ctx context.Context, prm authmate.PrmContainerCreate) (*cid.ID, error) {