Skip to content

Commit

Permalink
object: Prohibit to filter out or request CID and OID in SearchV2
Browse files Browse the repository at this point in the history
Container ID is a request field while the object ID a resulting item's
one.

Closes #318. Closes #319.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Feb 18, 2025
1 parent 00bfea0 commit 819d651
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
6 changes: 4 additions & 2 deletions object/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ message SearchV2Request {

// List of search expressions. Limited to 8. If additional attributes are
// requested (see attributes below) then the search expression MUST use
// the first requested attribute.
// the first requested attribute. '$Object:containerID' and
// '$Object:objectID' filters are prohibited.
repeated SearchFilter filters = 3;

// Cursor to continue search. Can be omitted or empty for the new search.
Expand All @@ -565,7 +566,8 @@ message SearchV2Request {
// List of attribute names (including special ones as defined by
// SearchFilter key) to include into the reply. Limited to 8, these
// attributes also affect result ordering (result is ordered by attributes
// and then by OID).
// and then by OID). '$Object:containerID' and '$Object:objectID'
// attributes are prohibited.
repeated string attributes = 6;
}
// Body of search object request message.
Expand Down
11 changes: 7 additions & 4 deletions object/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ enum MatchType {
//
// * $Object:version \
// version
// * $Object:objectID \
// object_id
// * $Object:containerID \
// container_id
// * $Object:ownerID \
// owner_id
// * $Object:creationEpoch \
Expand Down Expand Up @@ -121,6 +117,13 @@ enum MatchType {
// Returns only objects physically stored in the system. This filter is
// activated if the `key` exists, disregarding the value and matcher type.
//
// Following filters are deprecated:
//
// * $Object:objectID \
// object_id
// * $Object:containerID \
// container_id
//
// Note: using filters with a key with prefix `$Object:` and match type
// `NOT_PRESENT `is not recommended since this is not a cross-version approach.
// Behavior when processing this kind of filters is undefined.
Expand Down
15 changes: 9 additions & 6 deletions proto-docs/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,10 @@ Object Search request body
| ----- | ---- | ----- | ----------- |
| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Container where the search is being performed. |
| version | [uint32](#uint32) | | Version of the Query Language used. |
| filters | [SearchFilter](#neo.fs.v2.object.SearchFilter) | repeated | List of search expressions. Limited to 8. If additional attributes are requested (see attributes below) then the search expression MUST use the first requested attribute. |
| filters | [SearchFilter](#neo.fs.v2.object.SearchFilter) | repeated | List of search expressions. Limited to 8. If additional attributes are requested (see attributes below) then the search expression MUST use the first requested attribute. '$Object:containerID' and '$Object:objectID' filters are prohibited. |
| cursor | [string](#string) | | Cursor to continue search. Can be omitted or empty for the new search. |
| count | [uint32](#uint32) | | Limits the number of responses to the specified number. Can't be more than 1000. |
| attributes | [string](#string) | repeated | List of attribute names (including special ones as defined by SearchFilter key) to include into the reply. Limited to 8, these attributes also affect result ordering (result is ordered by attributes and then by OID). |
| attributes | [string](#string) | repeated | List of attribute names (including special ones as defined by SearchFilter key) to include into the reply. Limited to 8, these attributes also affect result ordering (result is ordered by attributes and then by OID). '$Object:containerID' and '$Object:objectID' attributes are prohibited. |


<a name="neo.fs.v2.object.SearchV2Response"></a>
Expand Down Expand Up @@ -1025,10 +1025,6 @@ prefix to the name. Here is the list of fields available via this prefix:

* $Object:version \
version
* $Object:objectID \
object_id
* $Object:containerID \
container_id
* $Object:ownerID \
owner_id
* $Object:creationEpoch \
Expand Down Expand Up @@ -1064,6 +1060,13 @@ properties:
Returns only objects physically stored in the system. This filter is
activated if the `key` exists, disregarding the value and matcher type.

Following filters are deprecated:

* $Object:objectID \
object_id
* $Object:containerID \
container_id

Note: using filters with a key with prefix `$Object:` and match type
`NOT_PRESENT `is not recommended since this is not a cross-version approach.
Behavior when processing this kind of filters is undefined.
Expand Down

0 comments on commit 819d651

Please sign in to comment.