From a8c1779690de8380f28c736e8cecaa78bd4a7b44 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 11 Dec 2020 09:46:00 +0300 Subject: [PATCH] [#81] Clarify that attribute names must be unique All types of attribute keys must be unique and can't be repeated in the same entity. - Containers with duplicated attribute keys must not be accepted by InnerRing on creation. - Nodes with duplicated attribute keys can't be accepted to NetMap by InnerRing - Objects with duplicated attribute keys must be considered invalid and not accepted in PUT operations Signed-off-by: Stanislav Bogatyrev --- container/types.proto | 4 +++- netmap/types.proto | 5 ++++- object/types.proto | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/container/types.proto b/container/types.proto index d09d446..f412a28 100644 --- a/container/types.proto +++ b/container/types.proto @@ -31,7 +31,9 @@ message Container { // container. Container attributes are immutable. They are set at container // creation and can never be added or updated. // - // Key name must be a valid UTF-8 string. Value can't be empty. + // 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. // // There are some "well-known" attributes affecting system behaviour: // diff --git a/netmap/types.proto b/netmap/types.proto index d470bb5..3f819b1 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -179,7 +179,10 @@ message NodeInfo { // `Country`. repeated string parents = 3 [json_name = "parents"]; } - // Carries list of the NeoFS node attributes in a string key-value format. + // 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. repeated Attribute attributes = 3 [json_name = "attributes"]; // Represents the enumeration of various states of the NeoFS node. diff --git a/object/types.proto b/object/types.proto index 94c8538..3a94559 100644 --- a/object/types.proto +++ b/object/types.proto @@ -92,7 +92,9 @@ message Header { // `Attribute` is a user-defined Key-Value metadata pair attached to the // object. // - // Key name must be a valid UTF-8 string. Value can't be empty. + // Key name must be a 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. // // There are some "well-known" attributes starting with `__NEOFS__` prefix // that affect system behaviour: