diff --git a/pkg/services/object/acl/eacl/v2/headers.go b/pkg/services/object/acl/eacl/v2/headers.go index 9c3dd27a..ea8408ae 100644 --- a/pkg/services/object/acl/eacl/v2/headers.go +++ b/pkg/services/object/acl/eacl/v2/headers.go @@ -14,7 +14,6 @@ import ( objectSDKAddress "github.com/nspcc-dev/neofs-sdk-go/object/address" objectSDKID "github.com/nspcc-dev/neofs-sdk-go/object/id" "github.com/nspcc-dev/neofs-sdk-go/owner" - sessionSDK "github.com/nspcc-dev/neofs-sdk-go/session" ) type Option func(*cfg) @@ -84,15 +83,7 @@ func (h headerSource) HeadersOfType(typ eaclSDK.FilterHeaderType) ([]eaclSDK.Hea } func requestHeaders(msg xHeaderSource) []eaclSDK.Header { - xHdrs := msg.GetXHeaders() - - res := make([]eaclSDK.Header, 0, len(xHdrs)) - - for i := range xHdrs { - res = append(res, sessionSDK.NewXHeaderFromV2(&xHdrs[i])) - } - - return res + return msg.GetXHeaders() } func (h *cfg) objectHeaders() ([]eaclSDK.Header, error) { diff --git a/pkg/services/object/acl/eacl/v2/xheader.go b/pkg/services/object/acl/eacl/v2/xheader.go index 62364e81..d25a25f8 100644 --- a/pkg/services/object/acl/eacl/v2/xheader.go +++ b/pkg/services/object/acl/eacl/v2/xheader.go @@ -2,10 +2,12 @@ package v2 import ( "github.com/nspcc-dev/neofs-api-go/v2/session" + eaclSDK "github.com/nspcc-dev/neofs-sdk-go/eacl" + sessionSDK "github.com/nspcc-dev/neofs-sdk-go/session" ) type xHeaderSource interface { - GetXHeaders() []session.XHeader + GetXHeaders() []eaclSDK.Header } type requestXHeaderSource struct { @@ -18,7 +20,7 @@ type responseXHeaderSource struct { req Request } -func (s requestXHeaderSource) GetXHeaders() []session.XHeader { +func (s requestXHeaderSource) GetXHeaders() []eaclSDK.Header { ln := 0 xHdrs := make([][]session.XHeader, 0) @@ -30,18 +32,18 @@ func (s requestXHeaderSource) GetXHeaders() []session.XHeader { xHdrs = append(xHdrs, x) } - res := make([]session.XHeader, 0, ln) + res := make([]eaclSDK.Header, 0, ln) for i := range xHdrs { for j := range xHdrs[i] { - res = append(res, xHdrs[i][j]) + res = append(res, sessionSDK.NewXHeaderFromV2(&xHdrs[i][j])) } } return res } -func (s responseXHeaderSource) GetXHeaders() []session.XHeader { +func (s responseXHeaderSource) GetXHeaders() []eaclSDK.Header { ln := 0 xHdrs := make([][]session.XHeader, 0) @@ -53,11 +55,11 @@ func (s responseXHeaderSource) GetXHeaders() []session.XHeader { xHdrs = append(xHdrs, x) } - res := make([]session.XHeader, 0, ln) + res := make([]eaclSDK.Header, 0, ln) for i := range xHdrs { for j := range xHdrs[i] { - res = append(res, xHdrs[i][j]) + res = append(res, sessionSDK.NewXHeaderFromV2(&xHdrs[i][j])) } }