[#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,47 +298,54 @@ 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(
acl.WithSenderClassifier( splitSvc := objectService.NewTransportSplitter(
acl.NewSenderClassifier( c.cfgGRPC.maxChunkSize,
c.log, c.cfgGRPC.maxAddrAmount,
c.cfgNetmap.wrapper, &objectSvc{
c.cfgNetmap.wrapper, put: sPutV2,
), search: sSearchV2,
), get: sGetV2,
acl.WithContainerSource( delete: sDeleteV2,
c.cfgObject.cnrStorage, },
), )
acl.WithNextService(
objectService.NewSignService( respSvc := objectService.NewResponseService(
c.key, splitSvc,
objectService.NewResponseService( c.respSvc,
objectService.NewTransportSplitter( )
c.cfgGRPC.maxChunkSize,
c.cfgGRPC.maxAddrAmount, signSvc := objectService.NewSignService(
&objectSvc{ c.key,
put: sPutV2, respSvc,
search: sSearchV2, )
get: sGetV2,
delete: sDeleteV2, aclSvc := acl.New(
}, acl.WithSenderClassifier(
), acl.NewSenderClassifier(
c.respSvc, c.log,
), c.cfgNetmap.wrapper,
), c.cfgNetmap.wrapper,
),
acl.WithLocalStorage(ls),
acl.WithEACLValidatorOptions(
eacl.WithEACLStorage(newCachedEACLStorage(&morphEACLStorage{
w: c.cfgObject.cnrClient,
})),
eacl.WithLogger(c.log),
),
acl.WithNetmapState(c.cfgNetmap.state),
), ),
), ),
acl.WithContainerSource(
c.cfgObject.cnrStorage,
),
acl.WithNextService(signSvc),
acl.WithLocalStorage(ls),
acl.WithEACLValidatorOptions(
eacl.WithEACLStorage(newCachedEACLStorage(&morphEACLStorage{
w: c.cfgObject.cnrClient,
})),
eacl.WithLogger(c.log),
),
acl.WithNetmapState(c.cfgNetmap.state),
)
objectGRPC.RegisterObjectServiceServer(c.cfgGRPC.server,
objectTransportGRPC.New(aclSvc),
) )
} }