From abed8a915631534df876e3b79edfbc6d67eef798 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 10 Nov 2020 13:43:25 +0300 Subject: [PATCH] [#191] v2: Add ObjectID filters for ACL and Object packages Signed-off-by: Alex Vanin --- pkg/acl/eacl/filter.go | 3 +++ pkg/object/search.go | 3 +++ v2/acl/filters.go | 3 +++ v2/object/filters.go | 3 +++ 4 files changed, 12 insertions(+) diff --git a/pkg/acl/eacl/filter.go b/pkg/acl/eacl/filter.go index 1771b955..7608f3f9 100644 --- a/pkg/acl/eacl/filter.go +++ b/pkg/acl/eacl/filter.go @@ -29,6 +29,7 @@ type filterKeyType int const ( _ filterKeyType = iota fKeyObjVersion + fKeyObjID fKeyObjContainerID fKeyObjOwnerID fKeyObjCreationEpoch @@ -74,6 +75,8 @@ func (k filterKey) String() string { return k.str case fKeyObjVersion: return v2acl.FilterObjectVersion + case fKeyObjID: + return v2acl.FilterObjectID case fKeyObjContainerID: return v2acl.FilterObjectContainerID case fKeyObjOwnerID: diff --git a/pkg/object/search.go b/pkg/object/search.go index 167f21fb..d2cb8497 100644 --- a/pkg/object/search.go +++ b/pkg/object/search.go @@ -61,6 +61,7 @@ type SearchFilters []SearchFilter const ( _ filterKeyType = iota fKeyVersion + fKeyObjectID fKeyContainerID fKeyOwnerID fKeyCreationEpoch @@ -80,6 +81,8 @@ func (k filterKey) String() string { return k.str case fKeyVersion: return v2object.FilterHeaderVersion + case fKeyObjectID: + return v2object.FilterHeaderObjectID case fKeyContainerID: return v2object.FilterHeaderContainerID case fKeyOwnerID: diff --git a/v2/acl/filters.go b/v2/acl/filters.go index 8b73f420..461d2b94 100644 --- a/v2/acl/filters.go +++ b/v2/acl/filters.go @@ -7,6 +7,9 @@ const ( // FilterObjectVersion is a filter key to "version" field of the object header. FilterObjectVersion = ObjectFilterPrefix + "version" + // FilterObjectID is a filter key to "object_id" field of the object. + FilterObjectID = ObjectFilterPrefix + "objectID" + // FilterObjectContainerID is a filter key to "container_id" field of the object header. FilterObjectContainerID = ObjectFilterPrefix + "containerID" diff --git a/v2/object/filters.go b/v2/object/filters.go index a5f548fd..e0e750a0 100644 --- a/v2/object/filters.go +++ b/v2/object/filters.go @@ -7,6 +7,9 @@ const ( // FilterHeaderVersion is a filter key to "version" field of the object header. FilterHeaderVersion = ReservedFilterPrefix + "version" + // FilterHeaderObjectID is a filter key to "object_id" field of the object. + FilterHeaderObjectID = ReservedFilterPrefix + "objectID" + // FilterHeaderContainerID is a filter key to "container_id" field of the object header. FilterHeaderContainerID = ReservedFilterPrefix + "containerID"