From e74ff7c15a770570ae8318399de1b8c35fc8f384 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 10 Jan 2022 10:49:30 +0300 Subject: [PATCH] [#1062] node/object: Change the sequence of servers In previous implementation ACL server was the 1st (except metric server in some cases) server in pipeline of Object service servers. This led to the fact that errors of this handler could not be reduced to status responses. Nest object ACL server into signature and response servers to support common response format. Signed-off-by: Leonard Lyubich --- cmd/neofs-node/object.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cmd/neofs-node/object.go b/cmd/neofs-node/object.go index c4181c4c6..59abcd465 100644 --- a/cmd/neofs-node/object.go +++ b/cmd/neofs-node/object.go @@ -352,16 +352,6 @@ func initObjectService(c *cfg) { }, ) - respSvc := objectService.NewResponseService( - splitSvc, - c.respSvc, - ) - - signSvc := objectService.NewSignService( - &c.key.PrivateKey, - respSvc, - ) - aclSvc := acl.New( acl.WithSenderClassifier( acl.NewSenderClassifier( @@ -373,7 +363,7 @@ func initObjectService(c *cfg) { acl.WithContainerSource( c.cfgObject.cnrSource, ), - acl.WithNextService(signSvc), + acl.WithNextService(splitSvc), acl.WithLocalStorage(ls), acl.WithEACLValidatorOptions( eacl.WithEACLSource(c.cfgObject.eaclSource), @@ -382,9 +372,19 @@ func initObjectService(c *cfg) { acl.WithNetmapState(c.cfgNetmap.state), ) - var firstSvc objectService.ServiceServer = aclSvc + respSvc := objectService.NewResponseService( + aclSvc, + c.respSvc, + ) + + signSvc := objectService.NewSignService( + &c.key.PrivateKey, + respSvc, + ) + + var firstSvc objectService.ServiceServer = signSvc if c.metricsCollector != nil { - firstSvc = objectService.NewMetricCollector(aclSvc, c.metricsCollector) + firstSvc = objectService.NewMetricCollector(signSvc, c.metricsCollector) } server := objectTransportGRPC.New(firstSvc)