Skip to content

Commit

Permalink
Merge pull request #323 from nspcc-dev/zero-byte
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov authored Feb 22, 2025
2 parents c273a01 + 6e48b7d commit db4c6ed
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
3 changes: 2 additions & 1 deletion container/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ message Container {
//
// Key name must be a container-unique valid UTF-8 string. Value can't be
// empty. Containers with duplicated attribute names or attributes with empty
// values will be considered invalid.
// values will be considered invalid. Zero byte is also forbidden in UTF-8
// strings.
//
// There are some "well-known" attributes affecting system behaviour:
//
Expand Down
10 changes: 5 additions & 5 deletions netmap/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ message NodeInfo {
// Administrator-defined Attributes of the NeoFS Storage Node.
//
// `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8
// string. Value can't be empty.
// string (without zero bytes that are forbidden). Value can't be empty.
//
// Attributes can be constructed into a chain of attributes: any attribute can
// have a parent attribute and a child attribute (except the first and the last
Expand Down Expand Up @@ -236,9 +236,9 @@ message NodeInfo {
repeated string parents = 3 [json_name = "parents"];
}
// Carries list of the NeoFS node attributes in a key-value form. Key name
// must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo
// structures with duplicated attribute names or attributes with empty values
// will be considered invalid.
// must be a node-unique valid UTF-8 string (without zero bytes). Value can't
// be empty. NodeInfo structures with duplicated attribute names or
// attributes with empty values will be considered invalid.
repeated Attribute attributes = 3 [json_name = "attributes"];

// Represents the enumeration of various states of the NeoFS node.
Expand Down Expand Up @@ -313,7 +313,7 @@ message NetworkConfig {
// Fee paid for withdrawal of funds paid by the account owner.
// Value: little-endian integer. Default: 0.
message Parameter {
// Parameter key. UTF-8 encoded string
// Parameter key. UTF-8 encoded string (with no zero bytes).
bytes key = 1 [json_name = "key"];

// Parameter value
Expand Down
3 changes: 2 additions & 1 deletion object/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ message Header {
//
// Key name must be an object-unique valid UTF-8 string. Value can't be empty.
// Objects with duplicated attribute names or attributes with empty values
// will be considered invalid.
// will be considered invalid. Keys and values can't contain zero bytes as
// well.
//
// There are some "well-known" attributes starting with `__NEOFS__` prefix
// that affect system behaviour:
Expand Down
3 changes: 2 additions & 1 deletion proto-docs/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,8 @@ container creation and can never be added or updated.

Key name must be a container-unique valid UTF-8 string. Value can't be
empty. Containers with duplicated attribute names or attributes with empty
values will be considered invalid.
values will be considered invalid. Zero byte is also forbidden in UTF-8
strings.

There are some "well-known" attributes affecting system behaviour:

Expand Down
6 changes: 3 additions & 3 deletions proto-docs/netmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ System parameters:

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [bytes](#bytes) | | Parameter key. UTF-8 encoded string |
| key | [bytes](#bytes) | | Parameter key. UTF-8 encoded string (with no zero bytes). |
| value | [bytes](#bytes) | | Parameter value |


Expand Down Expand Up @@ -370,7 +370,7 @@ NeoFS node description
| ----- | ---- | ----- | ----------- |
| public_key | [bytes](#bytes) | | Public key of the NeoFS node in a binary format |
| addresses | [string](#string) | repeated | Ways to connect to a node |
| attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a key-value form. Key name must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo structures with duplicated attribute names or attributes with empty values will be considered invalid. |
| attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a key-value form. Key name must be a node-unique valid UTF-8 string (without zero bytes). Value can't be empty. NodeInfo structures with duplicated attribute names or attributes with empty values will be considered invalid. |
| state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the NeoFS node |


Expand All @@ -380,7 +380,7 @@ NeoFS node description
Administrator-defined Attributes of the NeoFS Storage Node.

`Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8
string. Value can't be empty.
string (without zero bytes that are forbidden). Value can't be empty.

Attributes can be constructed into a chain of attributes: any attribute can
have a parent attribute and a child attribute (except the first and the last
Expand Down
5 changes: 3 additions & 2 deletions proto-docs/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ Object Search request body
| 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 first filter's key MUST be 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). If additional attributes are requested, then the first filter key (see filters above) MUST be the first requested attribute. '$Object:containerID' and '$Object:objectID' attributes are prohibited. |
| 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). If additional attributes are requested, then the first filter's key (see filters above) MUST be the first requested attribute. '$Object:containerID' and '$Object:objectID' attributes are prohibited. |


<a name="neo.fs.v2.object.SearchV2Response"></a>
Expand Down Expand Up @@ -920,7 +920,8 @@ object.

Key name must be an object-unique valid UTF-8 string. Value can't be empty.
Objects with duplicated attribute names or attributes with empty values
will be considered invalid.
will be considered invalid. Keys and values can't contain zero bytes as
well.

There are some "well-known" attributes starting with `__NEOFS__` prefix
that affect system behaviour:
Expand Down

0 comments on commit db4c6ed

Please sign in to comment.