From 6fe6005e717a60c2b3b2689359a5e9b170b506a7 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 2 Oct 2020 14:41:29 +0300 Subject: [PATCH] [#66] Check basic ACL in object service pipeline Signed-off-by: Alex Vanin --- cmd/neofs-node/object.go | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/cmd/neofs-node/object.go b/cmd/neofs-node/object.go index e205c75bb..e449cb92c 100644 --- a/cmd/neofs-node/object.go +++ b/cmd/neofs-node/object.go @@ -13,6 +13,7 @@ import ( "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/localstore" objectTransportGRPC "github.com/nspcc-dev/neofs-node/pkg/network/transport/object/grpc" objectService "github.com/nspcc-dev/neofs-node/pkg/services/object" + "github.com/nspcc-dev/neofs-node/pkg/services/object/acl" deletesvc "github.com/nspcc-dev/neofs-node/pkg/services/object/delete" deletesvcV2 "github.com/nspcc-dev/neofs-node/pkg/services/object/delete/v2" getsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/get" @@ -254,20 +255,27 @@ func initObjectService(c *cfg) { objectGRPC.RegisterObjectServiceServer(c.cfgGRPC.server, objectTransportGRPC.New( - objectService.NewSignService( - c.key, - objectService.NewTransportSplitter( - c.cfgGRPC.maxChunkSize, - c.cfgGRPC.maxAddrAmount, - &objectSvc{ - put: sPutV2, - search: sSearchV2, - head: sHeadV2, - rng: sRangeV2, - get: sGetV2, - rngHash: sRangeHashV2, - delete: sDeleteV2, - }, + acl.NewBasicChecker( + acl.NewSenderClassifier( + c.cfgNetmap.wrapper, + c.cfgNetmap.wrapper, + ), + c.cfgObject.cnrStorage, + objectService.NewSignService( + c.key, + objectService.NewTransportSplitter( + c.cfgGRPC.maxChunkSize, + c.cfgGRPC.maxAddrAmount, + &objectSvc{ + put: sPutV2, + search: sSearchV2, + head: sHeadV2, + rng: sRangeV2, + get: sGetV2, + rngHash: sRangeHashV2, + delete: sDeleteV2, + }, + ), ), ), ),