[#426] cmd/neofs-node: Refactor object service pipeline set up

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-15 12:12:49 +03:00 committed by Leonard Lyubich
parent 980b774af2
commit 534ce03421

View file

@ -298,9 +298,31 @@ func initObjectService(c *cfg) {
deletesvcV2.WithKeyStorage(keyStorage), deletesvcV2.WithKeyStorage(keyStorage),
) )
objectGRPC.RegisterObjectServiceServer(c.cfgGRPC.server, // build service pipeline
objectTransportGRPC.New( // grpc | acl | signature | response | split
acl.New(
splitSvc := objectService.NewTransportSplitter(
c.cfgGRPC.maxChunkSize,
c.cfgGRPC.maxAddrAmount,
&objectSvc{
put: sPutV2,
search: sSearchV2,
get: sGetV2,
delete: sDeleteV2,
},
)
respSvc := objectService.NewResponseService(
splitSvc,
c.respSvc,
)
signSvc := objectService.NewSignService(
c.key,
respSvc,
)
aclSvc := acl.New(
acl.WithSenderClassifier( acl.WithSenderClassifier(
acl.NewSenderClassifier( acl.NewSenderClassifier(
c.log, c.log,
@ -311,24 +333,7 @@ func initObjectService(c *cfg) {
acl.WithContainerSource( acl.WithContainerSource(
c.cfgObject.cnrStorage, c.cfgObject.cnrStorage,
), ),
acl.WithNextService( acl.WithNextService(signSvc),
objectService.NewSignService(
c.key,
objectService.NewResponseService(
objectService.NewTransportSplitter(
c.cfgGRPC.maxChunkSize,
c.cfgGRPC.maxAddrAmount,
&objectSvc{
put: sPutV2,
search: sSearchV2,
get: sGetV2,
delete: sDeleteV2,
},
),
c.respSvc,
),
),
),
acl.WithLocalStorage(ls), acl.WithLocalStorage(ls),
acl.WithEACLValidatorOptions( acl.WithEACLValidatorOptions(
eacl.WithEACLStorage(newCachedEACLStorage(&morphEACLStorage{ eacl.WithEACLStorage(newCachedEACLStorage(&morphEACLStorage{
@ -337,8 +342,10 @@ func initObjectService(c *cfg) {
eacl.WithLogger(c.log), eacl.WithLogger(c.log),
), ),
acl.WithNetmapState(c.cfgNetmap.state), acl.WithNetmapState(c.cfgNetmap.state),
), )
),
objectGRPC.RegisterObjectServiceServer(c.cfgGRPC.server,
objectTransportGRPC.New(aclSvc),
) )
} }