Skip to content

Commit db4c6ed

Browse files
authored
Merge pull request #323 from nspcc-dev/zero-byte
2 parents c273a01 + 6e48b7d commit db4c6ed

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

container/types.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ message Container {
3333
//
3434
// Key name must be a container-unique valid UTF-8 string. Value can't be
3535
// empty. Containers with duplicated attribute names or attributes with empty
36-
// values will be considered invalid.
36+
// values will be considered invalid. Zero byte is also forbidden in UTF-8
37+
// strings.
3738
//
3839
// There are some "well-known" attributes affecting system behaviour:
3940
//

netmap/types.proto

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ message NodeInfo {
143143
// Administrator-defined Attributes of the NeoFS Storage Node.
144144
//
145145
// `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8
146-
// string. Value can't be empty.
146+
// string (without zero bytes that are forbidden). Value can't be empty.
147147
//
148148
// Attributes can be constructed into a chain of attributes: any attribute can
149149
// have a parent attribute and a child attribute (except the first and the last
@@ -236,9 +236,9 @@ message NodeInfo {
236236
repeated string parents = 3 [json_name = "parents"];
237237
}
238238
// Carries list of the NeoFS node attributes in a key-value form. Key name
239-
// must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo
240-
// structures with duplicated attribute names or attributes with empty values
241-
// will be considered invalid.
239+
// must be a node-unique valid UTF-8 string (without zero bytes). Value can't
240+
// be empty. NodeInfo structures with duplicated attribute names or
241+
// attributes with empty values will be considered invalid.
242242
repeated Attribute attributes = 3 [json_name = "attributes"];
243243

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

319319
// Parameter value

object/types.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ message Header {
201201
//
202202
// Key name must be an object-unique valid UTF-8 string. Value can't be empty.
203203
// Objects with duplicated attribute names or attributes with empty values
204-
// will be considered invalid.
204+
// will be considered invalid. Keys and values can't contain zero bytes as
205+
// well.
205206
//
206207
// There are some "well-known" attributes starting with `__NEOFS__` prefix
207208
// that affect system behaviour:

proto-docs/container.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ container creation and can never be added or updated.
586586

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

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

proto-docs/netmap.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ System parameters:
342342

343343
| Field | Type | Label | Description |
344344
| ----- | ---- | ----- | ----------- |
345-
| key | [bytes](#bytes) | | Parameter key. UTF-8 encoded string |
345+
| key | [bytes](#bytes) | | Parameter key. UTF-8 encoded string (with no zero bytes). |
346346
| value | [bytes](#bytes) | | Parameter value |
347347

348348

@@ -370,7 +370,7 @@ NeoFS node description
370370
| ----- | ---- | ----- | ----------- |
371371
| public_key | [bytes](#bytes) | | Public key of the NeoFS node in a binary format |
372372
| addresses | [string](#string) | repeated | Ways to connect to a node |
373-
| 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. |
373+
| 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. |
374374
| state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the NeoFS node |
375375

376376

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

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

385385
Attributes can be constructed into a chain of attributes: any attribute can
386386
have a parent attribute and a child attribute (except the first and the last

proto-docs/object.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ Object Search request body
837837
| 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. |
838838
| cursor | [string](#string) | | Cursor to continue search. Can be omitted or empty for the new search. |
839839
| count | [uint32](#uint32) | | Limits the number of responses to the specified number. Can't be more than 1000. |
840-
| 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. |
840+
| 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. |
841841

842842

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

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

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

0 commit comments

Comments
 (0)