[#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),
)
objectGRPC.RegisterObjectServiceServer(c.cfgGRPC.server,
objectTransportGRPC.New(
acl.New(
// build service pipeline
// grpc | acl | signature | response | split
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.NewSenderClassifier(
c.log,
@ -311,24 +333,7 @@ func initObjectService(c *cfg) {
acl.WithContainerSource(
c.cfgObject.cnrStorage,
),
acl.WithNextService(
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.WithNextService(signSvc),
acl.WithLocalStorage(ls),
acl.WithEACLValidatorOptions(
eacl.WithEACLStorage(newCachedEACLStorage(&morphEACLStorage{
@ -337,8 +342,10 @@ func initObjectService(c *cfg) {
eacl.WithLogger(c.log),
),
acl.WithNetmapState(c.cfgNetmap.state),
),
),
)
objectGRPC.RegisterObjectServiceServer(c.cfgGRPC.server,
objectTransportGRPC.New(aclSvc),
)
}