forked from TrueCloudLab/frostfs-node
[#125] services/eacl: Use latest object header keys
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
8d931b81a6
commit
b48a4ede02
1 changed files with 6 additions and 9 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
||||
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/acl"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object/acl/eacl"
|
||||
)
|
||||
|
@ -44,31 +45,27 @@ func headersFromObject(obj *object.Object) []eacl.Header {
|
|||
|
||||
for ; obj != nil; obj = obj.GetParent() {
|
||||
res = append(res,
|
||||
// object ID
|
||||
&sysObjHdr{
|
||||
k: objectSDK.HdrSysNameID,
|
||||
v: idValue(obj.GetID()),
|
||||
},
|
||||
// container ID
|
||||
&sysObjHdr{
|
||||
k: objectSDK.HdrSysNameCID,
|
||||
k: acl.FilterObjectContainerID,
|
||||
v: cidValue(obj.GetContainerID()),
|
||||
},
|
||||
// owner ID
|
||||
&sysObjHdr{
|
||||
k: objectSDK.HdrSysNameOwnerID,
|
||||
k: acl.FilterObjectOwnerID,
|
||||
v: ownerIDValue(obj.GetOwnerID()),
|
||||
},
|
||||
// creation epoch
|
||||
&sysObjHdr{
|
||||
k: objectSDK.HdrSysNameCreatedEpoch,
|
||||
k: acl.FilterObjectCreationEpoch,
|
||||
v: u64Value(obj.GetCreationEpoch()),
|
||||
},
|
||||
// payload size
|
||||
&sysObjHdr{
|
||||
k: objectSDK.HdrSysNamePayloadLength,
|
||||
k: acl.FilterObjectPayloadLength,
|
||||
v: u64Value(obj.GetPayloadSize()),
|
||||
},
|
||||
// TODO: add others fields after neofs-api#84
|
||||
)
|
||||
|
||||
attrs := obj.GetAttributes()
|
||||
|
|
Loading…
Reference in a new issue