diff --git a/Makefile b/Makefile index d66c98a..532d8b0 100644 --- a/Makefile +++ b/Makefile @@ -19,3 +19,9 @@ doc: --proto_path=.:/usr/local/include \ --doc_out=proto-docs/ $${f}/*.proto; \ done + +fmt: + @for f in `ls **/*.proto`; do \ + echo "⇒ Formatting $$f"; \ + clang-format -i $$f; \ + done diff --git a/accounting/service.proto b/accounting/service.proto index 6574404..ac988c9 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -21,7 +21,7 @@ service AccountingService { // - **OK** (0, SECTION_SUCCESS): // balance has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). - rpc Balance (BalanceRequest) returns (BalanceResponse); + rpc Balance(BalanceRequest) returns (BalanceResponse); } // BalanceRequest message @@ -51,7 +51,8 @@ message BalanceRequest { // BalanceResponse message message BalanceResponse { // The amount of funds in GAS token for the `OwnerID`'s account requested. - // Balance is given in the `Decimal` format to avoid precision issues with rounding. + // Balance is given in the `Decimal` format to avoid precision issues with + // rounding. message Body { // Amount of funds in GAS token for the requested account. Decimal balance = 1; diff --git a/accounting/types.proto b/accounting/types.proto index 205332e..eadf9a8 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -14,9 +14,9 @@ option csharp_namespace = "Neo.FileStorage.API.Accounting"; // description. message Decimal { // Number in the smallest Token fractions. - int64 value = 1 [json_name = "value"]; + int64 value = 1 [ json_name = "value" ]; // Precision value indicating how many smallest fractions can be in one // integer. - uint32 precision = 2 [json_name = "precision"]; + uint32 precision = 2 [ json_name = "precision" ]; } diff --git a/acl/types.proto b/acl/types.proto index 31a43d4..e9ea987 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -19,7 +19,8 @@ enum Role { // container or an inner ring node SYSTEM = 2; - // Others target rule is applied if sender is neither a user nor a system target + // Others target rule is applied if sender is neither a user nor a system + // target OTHERS = 3; } @@ -95,10 +96,10 @@ enum HeaderType { // Describes a single eACL rule. message EACLRecord { // NeoFS request Verb to match - Operation operation = 1 [json_name = "operation"]; + Operation operation = 1 [ json_name = "operation" ]; // Rule execution result. Either allows or denies access if filters match. - Action action = 2 [json_name = "action"]; + Action action = 2 [ json_name = "action" ]; // Filter to check particular properties of the request or the object. // @@ -132,32 +133,32 @@ message EACLRecord { // it's possible to take that information from the requested address. message Filter { // Define if Object or Request header will be used - HeaderType header_type = 1 [json_name = "headerType"]; + HeaderType header_type = 1 [ json_name = "headerType" ]; // Match operation type - MatchType match_type = 2 [json_name = "matchType"]; + MatchType match_type = 2 [ json_name = "matchType" ]; // Name of the Header to use - string key = 3 [json_name="key"]; + string key = 3 [ json_name = "key" ]; // Expected Header Value or pattern to match - string value = 4 [json_name="value"]; + string value = 4 [ json_name = "value" ]; } // List of filters to match and see if rule is applicable - repeated Filter filters = 3 [json_name="filters"]; + repeated Filter filters = 3 [ json_name = "filters" ]; // Target to apply ACL rule. Can be a subject's role class or a list of public // keys to match. message Target { // Target subject's role class - Role role = 1 [json_name="role"]; + Role role = 1 [ json_name = "role" ]; // List of public keys to identify target subject - repeated bytes keys = 2 [json_name="keys"]; + repeated bytes keys = 2 [ json_name = "keys" ]; } // List of target subjects to apply ACL rule to - repeated Target targets = 4 [json_name="targets"]; + repeated Target targets = 4 [ json_name = "targets" ]; } // Extended ACL rules table. A list of ACL rules defined additionally to Basic @@ -167,13 +168,13 @@ message EACLRecord { message EACLTable { // eACL format version. Effectively, the version of API library used to create // eACL Table. - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Identifier of the container that should use given access control rules - neo.fs.v2.refs.ContainerID container_id = 2 [json_name="containerID"]; + neo.fs.v2.refs.ContainerID container_id = 2 [ json_name = "containerID" ]; // List of Extended ACL rules - repeated EACLRecord records = 3 [json_name="records"]; + repeated EACLRecord records = 3 [ json_name = "records" ]; } // BearerToken allows to attach signed Extended ACL rules to the request in @@ -183,44 +184,44 @@ message EACLTable { // used in the similar use cases, like providing authorisation to externally // authenticated party. // -// BearerToken can be issued only by the container's owner and must be signed using -// the key associated with the container's `OwnerID`. +// BearerToken can be issued only by the container's owner and must be signed +// using the key associated with the container's `OwnerID`. message BearerToken { - // Bearer Token body structure contains Extended ACL table issued by the container - // owner with additional information preventing token abuse. + // Bearer Token body structure contains Extended ACL table issued by the + // container owner with additional information preventing token abuse. message Body { // Table of Extended ACL rules to use instead of the ones attached to the // container. If it contains `container_id` field, bearer token is only - // valid for this specific container. Otherwise, any container of the same owner - // is allowed. - EACLTable eacl_table = 1 [json_name="eaclTable"]; + // valid for this specific container. Otherwise, any container of the same + // owner is allowed. + EACLTable eacl_table = 1 [ json_name = "eaclTable" ]; // `OwnerID` defines to whom the token was issued. It must match the request // originator's `OwnerID`. If empty, any token bearer will be accepted. - neo.fs.v2.refs.OwnerID owner_id = 2 [json_name="ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ]; // Lifetime parameters of the token. Field names taken from // [rfc7519](https://tools.ietf.org/html/rfc7519). message TokenLifetime { // Expiration Epoch - uint64 exp = 1 [json_name="exp"]; + uint64 exp = 1 [ json_name = "exp" ]; // Not valid before Epoch - uint64 nbf = 2 [json_name="nbf"]; + uint64 nbf = 2 [ json_name = "nbf" ]; // Issued at Epoch - uint64 iat = 3 [json_name="iat"]; + uint64 iat = 3 [ json_name = "iat" ]; } // Token expiration and valid time period parameters - TokenLifetime lifetime = 3 [json_name="lifetime"]; + TokenLifetime lifetime = 3 [ json_name = "lifetime" ]; // AllowImpersonate flag to consider token signer as request owner. // If this field is true extended ACL table in token body isn't processed. - bool allow_impersonate = 4 [json_name="allowImpersonate"]; + bool allow_impersonate = 4 [ json_name = "allowImpersonate" ]; } // Bearer Token body - Body body = 1 [json_name="body"]; + Body body = 1 [ json_name = "body" ]; // Signature of BearerToken body - neo.fs.v2.refs.Signature signature = 2 [json_name="signature"]; + neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ]; } diff --git a/audit/types.proto b/audit/types.proto index c83260c..c5c19ec 100644 --- a/audit/types.proto +++ b/audit/types.proto @@ -12,48 +12,48 @@ import "refs/types.proto"; message DataAuditResult { // Data Audit Result format version. Effectively, the version of API library // used to report DataAuditResult structure. - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Epoch number when the Data Audit was conducted - fixed64 audit_epoch = 2 [json_name = "auditEpoch"]; + fixed64 audit_epoch = 2 [ json_name = "auditEpoch" ]; // Container under audit - neo.fs.v2.refs.ContainerID container_id = 3 [json_name = "containerID"]; + neo.fs.v2.refs.ContainerID container_id = 3 [ json_name = "containerID" ]; // Public key of the auditing InnerRing node in a binary format - bytes public_key = 4 [json_name = "publicKey"]; + bytes public_key = 4 [ json_name = "publicKey" ]; // Shows if Data Audit process was complete in time or if it was cancelled - bool complete = 5 [json_name = "complete"]; + bool complete = 5 [ json_name = "complete" ]; // Number of request done at PoR stage - uint32 requests = 6 [json_name = "requests"]; + uint32 requests = 6 [ json_name = "requests" ]; // Number of retries done at PoR stage - uint32 retries = 7 [json_name = "retries"]; + uint32 retries = 7 [ json_name = "retries" ]; // List of Storage Groups that passed audit PoR stage - repeated neo.fs.v2.refs.ObjectID pass_sg = 8 [json_name = "passSG"]; + repeated neo.fs.v2.refs.ObjectID pass_sg = 8 [ json_name = "passSG" ]; // List of Storage Groups that failed audit PoR stage - repeated neo.fs.v2.refs.ObjectID fail_sg = 9 [json_name = "failSG"]; + repeated neo.fs.v2.refs.ObjectID fail_sg = 9 [ json_name = "failSG" ]; - // Number of sampled objects under the audit placed in an optimal way according to - // the containers placement policy when checking PoP - uint32 hit = 10 [json_name = "hit"]; + // Number of sampled objects under the audit placed in an optimal way + // according to the containers placement policy when checking PoP + uint32 hit = 10 [ json_name = "hit" ]; - // Number of sampled objects under the audit placed in suboptimal way according to - // the containers placement policy, but still at a satisfactory level when - // checking PoP - uint32 miss = 11 [json_name = "miss"]; + // Number of sampled objects under the audit placed in suboptimal way + // according to the containers placement policy, but still at a satisfactory + // level when checking PoP + uint32 miss = 11 [ json_name = "miss" ]; // Number of sampled objects under the audit stored inconsistently with the // placement policy or not found at all when checking PoP - uint32 fail = 12 [json_name = "fail"]; + uint32 fail = 12 [ json_name = "fail" ]; // List of storage node public keys that passed at least one PDP - repeated bytes pass_nodes = 13 [json_name = "passNodes"]; + repeated bytes pass_nodes = 13 [ json_name = "passNodes" ]; // List of storage node public keys that failed at least one PDP - repeated bytes fail_nodes = 14 [json_name = "failNodes"]; + repeated bytes fail_nodes = 14 [ json_name = "failNodes" ]; } diff --git a/container/service.proto b/container/service.proto index 8c5f84e..fa45703 100644 --- a/container/service.proto +++ b/container/service.proto @@ -17,8 +17,8 @@ import "session/types.proto"; service ContainerService { // `Put` invokes `Container` smart contract's `Put` method and returns // response immediately. After a new block is issued in sidechain, request is - // verified by Inner Ring nodes. After one more block in sidechain, the container - // is added into smart contract storage. + // verified by Inner Ring nodes. After one more block in sidechain, the + // container is added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -28,8 +28,8 @@ service ContainerService { // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is - // verified by Inner Ring nodes. After one more block in sidechain, the container - // is added into smart contract storage. + // verified by Inner Ring nodes. After one more block in sidechain, the + // container is added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -56,8 +56,8 @@ service ContainerService { rpc List(ListRequest) returns (ListResponse); // Invokes 'SetEACL' method of 'Container` smart contract and returns response - // immediately. After one more block in sidechain, changes in an Extended ACL are - // added into smart contract storage. + // immediately. After one more block in sidechain, changes in an Extended ACL + // are added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -84,7 +84,8 @@ service ContainerService { // - **OK** (0, SECTION_SUCCESS): \ // estimation of used space has been successfully announced; // - Common failures (SECTION_FAILURE_COMMON). - rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceResponse); + rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) + returns (AnnounceUsedSpaceResponse); } // New NeoFS Container creation request @@ -146,7 +147,8 @@ message DeleteRequest { // Identifier of the container to delete from NeoFS neo.fs.v2.refs.ContainerID container_id = 1; - // `ContainerID` signed with the container owner's key according to RFC-6979. + // `ContainerID` signed with the container owner's key according to + // RFC-6979. neo.fs.v2.refs.SignatureRFC6979 signature = 2; } // Body of container delete request message. @@ -296,9 +298,9 @@ message SetExtendedACLRequest { // Set Extended ACL message SetExtendedACLResponse { // `SetExtendedACLResponse` has an empty body because the operation is - // asynchronous and the update should be reflected in `Container` smart contract's - // storage after next block is issued in sidechain. - message Body { } + // asynchronous and the update should be reflected in `Container` smart + // contract's storage after next block is issued in sidechain. + message Body {} // Body of set extended acl response message. Body body = 1; @@ -337,8 +339,8 @@ message GetExtendedACLRequest { // Get Extended ACL message GetExtendedACLResponse { // Get Extended ACL Response body can be empty if the requested container does - // not have Extended ACL Table attached or Extended ACL has not been allowed at - // the time of container creation. + // not have Extended ACL Table attached or Extended ACL has not been allowed + // at the time of container creation. message Body { // Extended ACL requested, if available neo.fs.v2.acl.EACLTable eacl = 1; @@ -401,7 +403,7 @@ message AnnounceUsedSpaceRequest { message AnnounceUsedSpaceResponse { // `AnnounceUsedSpaceResponse` has an empty body because announcements are // one way communication. - message Body { } + message Body {} // Body of announce used space response message. Body body = 1; diff --git a/container/types.proto b/container/types.proto index 5f7f76b..8b4a8a9 100644 --- a/container/types.proto +++ b/container/types.proto @@ -10,26 +10,26 @@ import "refs/types.proto"; // Container is a structure that defines object placement behaviour. Objects can // be stored only within containers. They define placement rule, attributes and -// access control information. An ID of a container is a 32 byte long SHA256 hash -// of stable-marshalled container message. +// access control information. An ID of a container is a 32 byte long SHA256 +// hash of stable-marshalled container message. message Container { // Container format version. Effectively, the version of API library used to // create the container. - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Identifier of the container owner - neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ]; // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s - bytes nonce = 3 [json_name = "nonce"]; + bytes nonce = 3 [ json_name = "nonce" ]; - // `BasicACL` contains access control rules for the owner, system and others groups, - // as well as permission bits for `BearerToken` and `Extended ACL` - uint32 basic_acl = 4 [json_name = "basicACL"]; + // `BasicACL` contains access control rules for the owner, system and others + // groups, as well as permission bits for `BearerToken` and `Extended ACL` + uint32 basic_acl = 4 [ json_name = "basicACL" ]; // `Attribute` is a user-defined Key-Value metadata pair attached to the - // container. Container attributes are immutable. They are set at the moment of - // container creation and can never be added or updated. + // container. Container attributes are immutable. They are set at the moment + // of 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 @@ -43,15 +43,16 @@ message Container { // NNS contract. // * [ __SYSTEM__ZONE ] \ // (`__NEOFS__ZONE` is deprecated) \ - // String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). Used as a TLD of a domain name in NNS - // contract. If no zone is specified, use default zone: `container`. + // String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). + // Used as a TLD of a domain name in NNS contract. If no zone is specified, + // use default zone: `container`. // * [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ // (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ - // Disables homomorphic hashing for the container if the value equals "true" string. - // Any other values are interpreted as missing attribute. Container could be - // accepted in a NeoFS network only if the global network hashing configuration - // value corresponds with that attribute's value. After container inclusion, network - // setting is ignored. + // Disables homomorphic hashing for the container if the value equals "true" + // string. Any other values are interpreted as missing attribute. Container + // could be accepted in a NeoFS network only if the global network hashing + // configuration value corresponds with that attribute's value. After + // container inclusion, network setting is ignored. // // And some well-known attributes used by applications only: // @@ -61,14 +62,15 @@ message Container { // User-defined local time of container creation in Unix Timestamp format message Attribute { // Attribute name key - string key = 1 [json_name = "key"]; + string key = 1 [ json_name = "key" ]; // Attribute value - string value = 2 [json_name = "value"]; + string value = 2 [ json_name = "value" ]; } // Attributes represent immutable container's meta data - repeated Attribute attributes = 5 [json_name = "attributes"]; + repeated Attribute attributes = 5 [ json_name = "attributes" ]; // Placement policy for the object inside the container - neo.fs.v2.netmap.PlacementPolicy placement_policy = 6 [json_name = "placementPolicy"]; + neo.fs.v2.netmap.PlacementPolicy placement_policy = 6 + [ json_name = "placementPolicy" ]; } diff --git a/lock/types.proto b/lock/types.proto index 52cbdea..2fdafa5 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -9,10 +9,11 @@ import "refs/types.proto"; // Lock objects protects a list of objects from being deleted. The lifetime of a // lock object is limited similar to regular objects in -// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) attribute. Lock object MUST have expiration epoch. -// It is impossible to delete a lock object via ObjectService.Delete RPC call. +// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) +// attribute. Lock object MUST have expiration epoch. It is impossible to delete +// a lock object via ObjectService.Delete RPC call. message Lock { // List of objects to lock. Must not be empty or carry empty IDs. // All members must be of the `REGULAR` type. - repeated neo.fs.v2.refs.ObjectID members = 1 [json_name = "members"]; + repeated neo.fs.v2.refs.ObjectID members = 1 [ json_name = "members" ]; } diff --git a/netmap/service.proto b/netmap/service.proto index 179a2c1..f5e7d9f 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -9,22 +9,23 @@ import "netmap/types.proto"; import "refs/types.proto"; import "session/types.proto"; -// `NetmapService` provides methods to work with `Network Map` and the information -// required to build it. The resulting `Network Map` is stored in sidechain -// `Netmap` smart contract, while related information can be obtained from other -// NeoFS nodes. +// `NetmapService` provides methods to work with `Network Map` and the +// information required to build it. The resulting `Network Map` is stored in +// sidechain `Netmap` smart contract, while related information can be obtained +// from other NeoFS nodes. service NetmapService { - // Get NodeInfo structure from the particular node directly. - // Node information can be taken from `Netmap` smart contract. In some cases, though, - // one may want to get recent information directly or to talk to the node not yet - // present in the `Network Map` to find out what API version can be used for - // further communication. This can be also used to check if a node is up and running. + // Get NodeInfo structure from the particular node directly. + // Node information can be taken from `Netmap` smart contract. In some cases, + // though, one may want to get recent information directly or to talk to the + // node not yet present in the `Network Map` to find out what API version can + // be used for further communication. This can be also used to check if a node + // is up and running. // // Statuses: // - **OK** (0, SECTION_SUCCESS): // information about the server has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). - rpc LocalNodeInfo (LocalNodeInfoRequest) returns (LocalNodeInfoResponse); + rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); // Read recent information about the NeoFS network. // @@ -32,7 +33,7 @@ service NetmapService { // - **OK** (0, SECTION_SUCCESS): // information about the current network state has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). - rpc NetworkInfo (NetworkInfoRequest) returns (NetworkInfoResponse); + rpc NetworkInfo(NetworkInfoRequest) returns (NetworkInfoResponse); // Returns network map snapshot of the current NeoFS epoch. // @@ -40,14 +41,13 @@ service NetmapService { // - **OK** (0, SECTION_SUCCESS): // information about the current network map has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). - rpc NetmapSnapshot (NetmapSnapshotRequest) returns (NetmapSnapshotResponse); + rpc NetmapSnapshot(NetmapSnapshotRequest) returns (NetmapSnapshotResponse); } // Get NodeInfo structure directly from a particular node message LocalNodeInfoRequest { // LocalNodeInfo request body is empty. - message Body { - } + message Body {} // Body of the LocalNodeInfo request message Body body = 1; @@ -86,81 +86,77 @@ message LocalNodeInfoResponse { // Get NetworkInfo structure with the network view from a particular node. message NetworkInfoRequest { - // NetworkInfo request body is empty. - message Body { - } - // Body of the NetworkInfo request message - Body body = 1; + // NetworkInfo request body is empty. + message Body {} + // Body of the NetworkInfo request message + Body body = 1; - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Response with NetworkInfo structure including current epoch and // sidechain magic number. message NetworkInfoResponse { - // Information about the network. - message Body { - // NetworkInfo structure with recent information. - NetworkInfo network_info = 1; - } - // Body of the NetworkInfo response message. - Body body = 1; + // Information about the network. + message Body { + // NetworkInfo structure with recent information. + NetworkInfo network_info = 1; + } + // Body of the NetworkInfo response message. + Body body = 1; - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect response execution. - neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Get netmap snapshot request message NetmapSnapshotRequest { - // Get netmap snapshot request body. - message Body { - } + // Get netmap snapshot request body. + message Body {} - // Body of get netmap snapshot request message. - Body body = 1; + // Body of get netmap snapshot request message. + Body body = 1; - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; - - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Response with current netmap snapshot message NetmapSnapshotResponse { - // Get netmap snapshot response body - message Body { - // Structure of the requested network map. - Netmap netmap = 1 [json_name = "netmap"]; - } + // Get netmap snapshot response body + message Body { + // Structure of the requested network map. + Netmap netmap = 1 [ json_name = "netmap" ]; + } - // Body of get netmap snapshot response message. - Body body = 1; + // Body of get netmap snapshot response message. + Body body = 1; - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect response execution. - neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/netmap/types.proto b/netmap/types.proto index 2d72c7e..a3c9c00 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -52,46 +52,46 @@ enum Clause { DISTINCT = 2; } -// This filter will return the subset of nodes from `NetworkMap` or another filter's -// results that will satisfy filter's conditions. +// This filter will return the subset of nodes from `NetworkMap` or another +// filter's results that will satisfy filter's conditions. message Filter { // Name of the filter or a reference to a named filter. '*' means // application to the whole unfiltered NetworkMap. At top level it's used as a // filter name. At lower levels it's considered to be a reference to another // named filter - string name = 1 [json_name = "name"]; + string name = 1 [ json_name = "name" ]; // Key to filter - string key = 2 [json_name = "key"]; + string key = 2 [ json_name = "key" ]; // Filtering operation - Operation op = 3 [json_name = "op"]; + Operation op = 3 [ json_name = "op" ]; // Value to match - string value = 4 [json_name = "value"]; + string value = 4 [ json_name = "value" ]; // List of inner filters. Top level operation will be applied to the whole // list. - repeated Filter filters = 5 [json_name = "filters"]; + repeated Filter filters = 5 [ json_name = "filters" ]; } // Selector chooses a number of nodes from the bucket taking the nearest nodes // to the provided `ContainerID` by hash distance. message Selector { // Selector name to reference in object placement section - string name = 1 [json_name = "name"]; + string name = 1 [ json_name = "name" ]; // How many nodes to select from the bucket - uint32 count = 2 [json_name = "count"]; + uint32 count = 2 [ json_name = "count" ]; // Selector modifier showing how to form a bucket - Clause clause = 3 [json_name = "clause"]; + Clause clause = 3 [ json_name = "clause" ]; // Bucket attribute to select from - string attribute = 4 [json_name = "attribute"]; + string attribute = 4 [ json_name = "attribute" ]; // Filter reference to select from - string filter = 5 [json_name = "filter"]; + string filter = 5 [ json_name = "filter" ]; } // Number of object replicas in a set of nodes from the defined selector. If no @@ -99,10 +99,10 @@ message Selector { // default. message Replica { // How many object replicas to put - uint32 count = 1 [json_name = "count"]; + uint32 count = 1 [ json_name = "count" ]; // Named selector bucket to put replicas - string selector = 2 [json_name = "selector"]; + string selector = 2 [ json_name = "selector" ]; } // Set of rules to select a subset of nodes from `NetworkMap` able to store @@ -111,29 +111,29 @@ message Replica { message PlacementPolicy { // Rules to set number of object replicas and place each one into a named // bucket - repeated Replica replicas = 1 [json_name = "replicas"]; + repeated Replica replicas = 1 [ json_name = "replicas" ]; // Container backup factor controls how deep NeoFS will search for nodes // alternatives to include into container's nodes subset - uint32 container_backup_factor = 2 [json_name = "containerBackupFactor"]; + uint32 container_backup_factor = 2 [ json_name = "containerBackupFactor" ]; // Set of Selectors to form the container's nodes subset - repeated Selector selectors = 3 [json_name = "selectors"]; + repeated Selector selectors = 3 [ json_name = "selectors" ]; // List of named filters to reference in selectors - repeated Filter filters = 4 [json_name = "filters"]; + repeated Filter filters = 4 [ json_name = "filters" ]; // Unique flag defines non-overlapping application for replicas - bool unique = 5 [json_name = "unique"]; + bool unique = 5 [ json_name = "unique" ]; } // NeoFS node description message NodeInfo { // Public key of the NeoFS node in a binary format - bytes public_key = 1 [json_name = "publicKey"]; + bytes public_key = 1 [ json_name = "publicKey" ]; // Ways to connect to a node - repeated string addresses = 2 [json_name = "addresses"]; + repeated string addresses = 2 [ json_name = "addresses" ]; // Administrator-defined Attributes of the NeoFS Storage Node. // @@ -141,15 +141,15 @@ message NodeInfo { // string. 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 - // one). A string representation of the chain of attributes in NeoFS Storage - // Node configuration uses ":" and "/" symbols, e.g.: + // have a parent attribute and a child attribute (except the first and the + // last one). A string representation of the chain of attributes in NeoFS + // Storage Node configuration uses ":" and "/" symbols, e.g.: // // `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` // - // Therefore the string attribute representation in the Node configuration must - // use "\:", "\/" and "\\" escaped symbols if any of them appears in an attribute's - // key or value. + // Therefore the string attribute representation in the Node configuration + // must use "\:", "\/" and "\\" escaped symbols if any of them appears in an + // attribute's key or value. // // Node's attributes are mostly used during Storage Policy evaluation to // calculate object's placement and find a set of nodes satisfying policy @@ -204,20 +204,20 @@ message NodeInfo { // corresponding section in NeoFS Technical Specification. message Attribute { // Key of the node attribute - string key = 1 [json_name = "key"]; + string key = 1 [ json_name = "key" ]; // Value of the node attribute - string value = 2 [json_name = "value"]; + string value = 2 [ json_name = "value" ]; // Parent keys, if any. For example for `City` it could be `Region` and // `Country`. - repeated string parents = 3 [json_name = "parents"]; + 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. - repeated Attribute attributes = 3 [json_name = "attributes"]; + repeated Attribute attributes = 3 [ json_name = "attributes" ]; // Represents the enumeration of various states of the NeoFS node. enum State { @@ -235,16 +235,16 @@ message NodeInfo { } // Carries state of the NeoFS node - State state = 4 [json_name = "state"]; + State state = 4 [ json_name = "state" ]; } // Network map structure message Netmap { - // Network map revision number. - uint64 epoch = 1 [json_name = "epoch"]; + // Network map revision number. + uint64 epoch = 1 [ json_name = "epoch" ]; - // Nodes presented in network. - repeated NodeInfo nodes = 2 [json_name = "nodes"]; + // Nodes presented in network. + repeated NodeInfo nodes = 2 [ json_name = "nodes" ]; } // NeoFS network configuration @@ -285,26 +285,27 @@ message NetworkConfig { // Value: little-endian integer. Default: 0. message Parameter { // Parameter key. UTF-8 encoded string - bytes key = 1 [json_name = "key"]; + bytes key = 1 [ json_name = "key" ]; // Parameter value - bytes value = 2 [json_name = "value"]; + bytes value = 2 [ json_name = "value" ]; } // List of parameter values - repeated Parameter parameters = 1 [json_name = "parameters"]; + repeated Parameter parameters = 1 [ json_name = "parameters" ]; } // Information about NeoFS network message NetworkInfo { - // Number of the current epoch in the NeoFS network - uint64 current_epoch = 1 [json_name = "currentEpoch"]; + // Number of the current epoch in the NeoFS network + uint64 current_epoch = 1 [ json_name = "currentEpoch" ]; - // Magic number of the sidechain of the NeoFS network - uint64 magic_number = 2 [json_name = "magicNumber"]; + // Magic number of the sidechain of the NeoFS network + uint64 magic_number = 2 [ json_name = "magicNumber" ]; - // MillisecondsPerBlock network parameter of the sidechain of the NeoFS network - int64 ms_per_block = 3 [json_name = "msPerBlock"]; + // MillisecondsPerBlock network parameter of the sidechain of the NeoFS + // network + int64 ms_per_block = 3 [ json_name = "msPerBlock" ]; - // NeoFS network configuration - NetworkConfig network_config = 4 [json_name = "networkConfig"]; + // NeoFS network configuration + NetworkConfig network_config = 4 [ json_name = "networkConfig" ]; } diff --git a/refs/types.proto b/refs/types.proto index 2f94dd2..ebc076f 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -11,9 +11,9 @@ option csharp_namespace = "Neo.FileStorage.API.Refs"; // `ContainerID` and `ObjectID` delimited by '/' character. message Address { // Container identifier - ContainerID container_id = 1 [json_name = "containerID"]; + ContainerID container_id = 1 [ json_name = "containerID" ]; // Object identifier - ObjectID object_id = 2 [json_name = "objectID"]; + ObjectID object_id = 2 [ json_name = "objectID" ]; } // NeoFS Object unique identifier. Objects are immutable and content-addressed. @@ -21,8 +21,8 @@ message Address { // // `ObjectID` is a 32 byte long // [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of -// the object's `header` field, which, in it's turn, contains the hash of the object's -// payload. +// the object's `header` field, which, in it's turn, contains the hash of the +// object's payload. // // String presentation is a // [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. @@ -34,7 +34,7 @@ message Address { // with/without paddings are accepted. message ObjectID { // Object identifier in a binary format - bytes value = 1 [json_name = "value"]; + bytes value = 1 [ json_name = "value" ]; } // NeoFS container identifier. Container structures are immutable and @@ -54,7 +54,7 @@ message ObjectID { // with/without paddings are accepted. message ContainerID { // Container identifier in a binary format. - bytes value = 1 [json_name = "value"]; + bytes value = 1 [ json_name = "value" ]; } // `OwnerID` is a derivative of a user's main public key. The transformation @@ -74,32 +74,34 @@ message ContainerID { // with/without paddings are accepted. message OwnerID { // Identifier of the container owner in a binary format - bytes value = 1 [json_name = "value"]; + bytes value = 1 [ json_name = "value" ]; } // API version used by a node. // // String presentation is a Semantic Versioning 2.0.0 compatible version string -// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor number. +// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor +// number. message Version { // Major API version - uint32 major = 1 [json_name = "major"]; + uint32 major = 1 [ json_name = "major" ]; // Minor API version - uint32 minor = 2 [json_name = "minor"]; + uint32 minor = 2 [ json_name = "minor" ]; } // Signature of something in NeoFS. message Signature { // Public key used for signing - bytes key = 1 [json_name = "key"]; + bytes key = 1 [ json_name = "key" ]; // Signature - bytes sign = 2 [json_name = "signature"]; + bytes sign = 2 [ json_name = "signature" ]; // Scheme contains digital signature scheme identifier - SignatureScheme scheme = 3 [json_name = "scheme"]; + SignatureScheme scheme = 3 [ json_name = "scheme" ]; } -// Signature scheme describes digital signing scheme used for (key, signature) pair. +// Signature scheme describes digital signing scheme used for (key, signature) +// pair. enum SignatureScheme { // ECDSA with SHA-512 hashing (FIPS 186-3) ECDSA_SHA512 = 0; @@ -115,9 +117,9 @@ enum SignatureScheme { // RFC 6979 signature. message SignatureRFC6979 { // Public key used for signing - bytes key = 1 [json_name = "key"]; + bytes key = 1 [ json_name = "key" ]; // Deterministic ECDSA with SHA-256 hashing - bytes sign = 2 [json_name = "signature"]; + bytes sign = 2 [ json_name = "signature" ]; } // Checksum algorithm type. @@ -141,8 +143,8 @@ enum ChecksumType { // Hex encoded string without `0x` prefix message Checksum { // Checksum algorithm type - ChecksumType type = 1 [json_name = "type"]; + ChecksumType type = 1 [ json_name = "type" ]; // Checksum itself - bytes sum = 2 [json_name = "sum"]; + bytes sum = 2 [ json_name = "sum" ]; } diff --git a/session/service.proto b/session/service.proto index dcda6c8..6e12147 100644 --- a/session/service.proto +++ b/session/service.proto @@ -19,7 +19,7 @@ service SessionService { // - **OK** (0, SECTION_SUCCESS): // session has been successfully opened; // - Common failures (SECTION_FAILURE_COMMON). - rpc Create (CreateRequest) returns (CreateResponse); + rpc Create(CreateRequest) returns (CreateResponse); } // Information necessary for opening a session. diff --git a/session/types.proto b/session/types.proto index 63e5ded..a878665 100644 --- a/session/types.proto +++ b/session/types.proto @@ -38,51 +38,51 @@ message ObjectSessionContext { RANGEHASH = 7; } // Type of request for which the token is issued - Verb verb = 1 [json_name = "verb"]; + Verb verb = 1 [ json_name = "verb" ]; // Carries objects involved in the object session. message Target { // Indicates which container the session is spread to. Field MUST be set // and correct. - refs.ContainerID container = 1 [json_name = "container"]; + refs.ContainerID container = 1 [ json_name = "container" ]; // Indicates which objects the session is spread to. Objects are expected // to be stored in the NeoFS container referenced by `container` field. // Each element MUST have correct format. - repeated refs.ObjectID objects = 2 [json_name = "objects"]; + repeated refs.ObjectID objects = 2 [ json_name = "objects" ]; } // Object session target. MUST be correctly formed and set. If `objects` // field is not empty, then the session applies only to these elements, // otherwise, to all objects from the specified container. - Target target = 2 [json_name = "target"]; + Target target = 2 [ json_name = "target" ]; } // Context information for Session Tokens related to ContainerService requests. message ContainerSessionContext { - // Container request verbs - enum Verb { - // Unknown verb - VERB_UNSPECIFIED = 0; + // Container request verbs + enum Verb { + // Unknown verb + VERB_UNSPECIFIED = 0; - // Refers to container.Put RPC call - PUT = 1; + // Refers to container.Put RPC call + PUT = 1; - // Refers to container.Delete RPC call - DELETE = 2; + // Refers to container.Delete RPC call + DELETE = 2; - // Refers to container.SetExtendedACL RPC call - SETEACL = 3; - } - // Type of request for which the token is issued - Verb verb = 1 [json_name = "verb"]; + // Refers to container.SetExtendedACL RPC call + SETEACL = 3; + } + // Type of request for which the token is issued + Verb verb = 1 [ json_name = "verb" ]; - // Spreads the action to all owner containers. - // If set, container_id field is ignored. - bool wildcard = 2 [json_name = "wildcard"]; + // Spreads the action to all owner containers. + // If set, container_id field is ignored. + bool wildcard = 2 [ json_name = "wildcard" ]; - // Particular container to which the action applies. - // Ignored if wildcard flag is set. - refs.ContainerID container_id = 3 [json_name = "containerID"]; + // Particular container to which the action applies. + // Ignored if wildcard flag is set. + refs.ContainerID container_id = 3 [ json_name = "containerID" ]; } // NeoFS Session Token. @@ -90,55 +90,55 @@ message SessionToken { // Session Token body message Body { // Token identifier is a valid UUIDv4 in binary form - bytes id = 1 [json_name = "id"]; + bytes id = 1 [ json_name = "id" ]; // Identifier of the session initiator - neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ]; // Lifetime parameters of the token. Field names taken from rfc7519. message TokenLifetime { // Expiration Epoch - uint64 exp = 1 [json_name = "exp"]; + uint64 exp = 1 [ json_name = "exp" ]; // Not valid before Epoch - uint64 nbf = 2 [json_name = "nbf"]; + uint64 nbf = 2 [ json_name = "nbf" ]; // Issued at Epoch - uint64 iat = 3 [json_name = "iat"]; + uint64 iat = 3 [ json_name = "iat" ]; } // Lifetime of the session - TokenLifetime lifetime = 3 [json_name = "lifetime"]; + TokenLifetime lifetime = 3 [ json_name = "lifetime" ]; // Public key used in session - bytes session_key = 4 [json_name = "sessionKey"]; + bytes session_key = 4 [ json_name = "sessionKey" ]; // Session Context information oneof context { // ObjectService session context - ObjectSessionContext object = 5 [json_name = "object"]; + ObjectSessionContext object = 5 [ json_name = "object" ]; // ContainerService session context - ContainerSessionContext container = 6 [json_name = "container"]; + ContainerSessionContext container = 6 [ json_name = "container" ]; } } // Session Token contains the proof of trust between peers to be attached in // requests for further verification. Please see corresponding section of // NeoFS Technical Specification for details. - Body body = 1 [json_name = "body"]; + Body body = 1 [ json_name = "body" ]; // Signature of `SessionToken` information - neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; + neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ]; } -// Extended headers for Request/Response. They may contain any user-defined headers -// to be interpreted on application level. +// Extended headers for Request/Response. They may contain any user-defined +// headers to be interpreted on application level. // -// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or -// Responses with duplicated header names or headers with empty values will be -// considered invalid. +// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests +// or Responses with duplicated header names or headers with empty values will +// be considered invalid. // -// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix that -// affect system behaviour: +// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` +// is deprecated) prefix that affect system behaviour: // // * [ __SYSTEM__NETMAP_EPOCH ] \ // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ @@ -149,88 +149,90 @@ message SessionToken { // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // If object can't be found using current epoch's netmap, this header limits // how many past epochs the node can look up through. The `value` is string -// encoded `uint64` in decimal presentation. If set to '0' or not set, only the -// current epoch will be used. +// encoded `uint64` in decimal presentation. If set to '0' or not set, only +// the current epoch will be used. message XHeader { // Key of the X-Header - string key = 1 [json_name = "key"]; + string key = 1 [ json_name = "key" ]; // Value of the X-Header - string value = 2 [json_name = "value"]; + string value = 2 [ json_name = "value" ]; } // Meta information attached to the request. When forwarded between peers, // request meta headers are folded in matryoshka style. message RequestMetaHeader { // Peer's API version used - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Peer's local epoch number. Set to 0 if unknown. - uint64 epoch = 2 [json_name = "epoch"]; + uint64 epoch = 2 [ json_name = "epoch" ]; // Maximum number of intermediate nodes in the request route - uint32 ttl = 3 [json_name = "ttl"]; + uint32 ttl = 3 [ json_name = "ttl" ]; // Request X-Headers - repeated XHeader x_headers = 4 [json_name = "xHeaders"]; + repeated XHeader x_headers = 4 [ json_name = "xHeaders" ]; // Session token within which the request is sent - SessionToken session_token = 5 [json_name = "sessionToken"]; + SessionToken session_token = 5 [ json_name = "sessionToken" ]; // `BearerToken` with eACL overrides for the request - neo.fs.v2.acl.BearerToken bearer_token = 6 [json_name = "bearerToken"]; + neo.fs.v2.acl.BearerToken bearer_token = 6 [ json_name = "bearerToken" ]; // `RequestMetaHeader` of the origin request - RequestMetaHeader origin = 7 [json_name = "origin"]; + RequestMetaHeader origin = 7 [ json_name = "origin" ]; // NeoFS network magic. Must match the value for the network // that the server belongs to. - uint64 magic_number = 8 [json_name = "magicNumber"]; + uint64 magic_number = 8 [ json_name = "magicNumber" ]; } // Information about the response message ResponseMetaHeader { // Peer's API version used - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Peer's local epoch number - uint64 epoch = 2 [json_name = "epoch"]; + uint64 epoch = 2 [ json_name = "epoch" ]; // Maximum number of intermediate nodes in the request route - uint32 ttl = 3 [json_name = "ttl"]; + uint32 ttl = 3 [ json_name = "ttl" ]; // Response X-Headers - repeated XHeader x_headers = 4 [json_name = "xHeaders"]; + repeated XHeader x_headers = 4 [ json_name = "xHeaders" ]; // `ResponseMetaHeader` of the origin request - ResponseMetaHeader origin = 5 [json_name = "origin"]; + ResponseMetaHeader origin = 5 [ json_name = "origin" ]; // Status return - neo.fs.v2.status.Status status = 6 [json_name = "status"]; + neo.fs.v2.status.Status status = 6 [ json_name = "status" ]; } // Verification info for the request signed by all intermediate nodes. message RequestVerificationHeader { // Request Body signature. Should be generated once by the request initiator. - neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"]; + neo.fs.v2.refs.Signature body_signature = 1 [ json_name = "bodySignature" ]; // Request Meta signature is added and signed by each intermediate node - neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"]; + neo.fs.v2.refs.Signature meta_signature = 2 [ json_name = "metaSignature" ]; // Signature of previous hops - neo.fs.v2.refs.Signature origin_signature = 3 [json_name = "originSignature"]; + neo.fs.v2.refs.Signature origin_signature = 3 + [ json_name = "originSignature" ]; // Chain of previous hops signatures - RequestVerificationHeader origin = 4 [json_name = "origin"]; + RequestVerificationHeader origin = 4 [ json_name = "origin" ]; } // Verification info for the response signed by all intermediate nodes message ResponseVerificationHeader { // Response Body signature. Should be generated once by an answering node. - neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"]; + neo.fs.v2.refs.Signature body_signature = 1 [ json_name = "bodySignature" ]; // Response Meta signature is added and signed by each intermediate node - neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"]; + neo.fs.v2.refs.Signature meta_signature = 2 [ json_name = "metaSignature" ]; // Signature of previous hops - neo.fs.v2.refs.Signature origin_signature = 3 [json_name = "originSignature"]; + neo.fs.v2.refs.Signature origin_signature = 3 + [ json_name = "originSignature" ]; // Chain of previous hops signatures - ResponseVerificationHeader origin = 4 [json_name = "origin"]; + ResponseVerificationHeader origin = 4 [ json_name = "origin" ]; } diff --git a/status/types.proto b/status/types.proto index 34134a4..60dfd94 100644 --- a/status/types.proto +++ b/status/types.proto @@ -33,113 +33,113 @@ option csharp_namespace = "Neo.FileStorage.API.Status"; // should not expect) useful information in the message. Field `details` // should make the return more detailed. message Status { - // The status code - uint32 code = 1; + // The status code + uint32 code = 1; - // Developer-facing error message - string message = 2; + // Developer-facing error message + string message = 2; - // Return detail. It contains additional information that can be used to - // analyze the response. Each code defines a set of details that can be - // attached to a status. Client should not handle details that are not - // covered by the code. - message Detail { - // Detail ID. The identifier is required to determine the binary format - // of the detail and how to decode it. - uint32 id = 1; + // Return detail. It contains additional information that can be used to + // analyze the response. Each code defines a set of details that can be + // attached to a status. Client should not handle details that are not + // covered by the code. + message Detail { + // Detail ID. The identifier is required to determine the binary format + // of the detail and how to decode it. + uint32 id = 1; - // Binary status detail. Must follow the format associated with ID. - // The possibility of missing a value must be explicitly allowed. - bytes value = 2; - } + // Binary status detail. Must follow the format associated with ID. + // The possibility of missing a value must be explicitly allowed. + bytes value = 2; + } - // Data detailing the outcome of the operation. Must be unique by ID. - repeated Detail details = 3; + // Data detailing the outcome of the operation. Must be unique by ID. + repeated Detail details = 3; } // Section identifiers. enum Section { - // Successful return codes. - SECTION_SUCCESS = 0; + // Successful return codes. + SECTION_SUCCESS = 0; - // Failure codes regardless of the operation. - SECTION_FAILURE_COMMON = 1; + // Failure codes regardless of the operation. + SECTION_FAILURE_COMMON = 1; - // Object service-specific errors. - SECTION_OBJECT = 2; + // Object service-specific errors. + SECTION_OBJECT = 2; - // Container service-specific errors. - SECTION_CONTAINER = 3; + // Container service-specific errors. + SECTION_CONTAINER = 3; - // Session service-specific errors. - SECTION_SESSION = 4; + // Session service-specific errors. + SECTION_SESSION = 4; } // Section of NeoFS successful return codes. enum Success { - // [**0**] Default success. Not detailed. - // If the server cannot match successful outcome to the code, it should - // use this code. - OK = 0; + // [**0**] Default success. Not detailed. + // If the server cannot match successful outcome to the code, it should + // use this code. + OK = 0; } // Section of failed statuses independent of the operation. enum CommonFail { - // [**1024**] Internal server error, default failure. Not detailed. - // If the server cannot match failed outcome to the code, it should - // use this code. - INTERNAL = 0; + // [**1024**] Internal server error, default failure. Not detailed. + // If the server cannot match failed outcome to the code, it should + // use this code. + INTERNAL = 0; - // [**1025**] Wrong magic of the NeoFS network. - // Details: - // - [**0**] Magic number of the served NeoFS network (big-endian 64-bit - // unsigned integer). - WRONG_MAGIC_NUMBER = 1; + // [**1025**] Wrong magic of the NeoFS network. + // Details: + // - [**0**] Magic number of the served NeoFS network (big-endian 64-bit + // unsigned integer). + WRONG_MAGIC_NUMBER = 1; - // [**1026**] Signature verification failure. - SIGNATURE_VERIFICATION_FAIL = 2; + // [**1026**] Signature verification failure. + SIGNATURE_VERIFICATION_FAIL = 2; - // [**1027**] Node is under maintenance. - NODE_UNDER_MAINTENANCE = 3; + // [**1027**] Node is under maintenance. + NODE_UNDER_MAINTENANCE = 3; } // Section of statuses for object-related operations. enum Object { - // [**2048**] Access denied by ACL. - // Details: - // - [**0**] Human-readable description (UTF-8 encoded string). - ACCESS_DENIED = 0; + // [**2048**] Access denied by ACL. + // Details: + // - [**0**] Human-readable description (UTF-8 encoded string). + ACCESS_DENIED = 0; - // [**2049**] Object not found. - OBJECT_NOT_FOUND = 1; + // [**2049**] Object not found. + OBJECT_NOT_FOUND = 1; - // [**2050**] Operation rejected by the object lock. - LOCKED = 2; + // [**2050**] Operation rejected by the object lock. + LOCKED = 2; - // [**2051**] Locking an object with a non-REGULAR type rejected. - LOCK_NON_REGULAR_OBJECT = 3; + // [**2051**] Locking an object with a non-REGULAR type rejected. + LOCK_NON_REGULAR_OBJECT = 3; - // [**2052**] Object has been marked deleted. - OBJECT_ALREADY_REMOVED = 4; + // [**2052**] Object has been marked deleted. + OBJECT_ALREADY_REMOVED = 4; - // [**2053**] Invalid range has been requested for an object. - OUT_OF_RANGE = 5; + // [**2053**] Invalid range has been requested for an object. + OUT_OF_RANGE = 5; } // Section of statuses for container-related operations. enum Container { - // [**3072**] Container not found. - CONTAINER_NOT_FOUND = 0; + // [**3072**] Container not found. + CONTAINER_NOT_FOUND = 0; - // [**3073**] eACL table not found. - EACL_NOT_FOUND = 1; + // [**3073**] eACL table not found. + EACL_NOT_FOUND = 1; } // Section of statuses for session-related operations. enum Session { - // [**4096**] Token not found. - TOKEN_NOT_FOUND = 0; + // [**4096**] Token not found. + TOKEN_NOT_FOUND = 0; - // [**4097**] Token has expired. - TOKEN_EXPIRED = 1; + // [**4097**] Token has expired. + TOKEN_EXPIRED = 1; } diff --git a/tombstone/types.proto b/tombstone/types.proto index aa44a45..6547958 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -10,17 +10,18 @@ import "refs/types.proto"; // Tombstone keeps record of deleted objects for a few epochs until they are // purged from the NeoFS network. message Tombstone { - // Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone - // creator depending on the current NeoFS network settings. A tombstone object - // must have the same expiration epoch value in `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) + // Last NeoFS epoch number of the tombstone lifetime. It's set by the + // tombstone creator depending on the current NeoFS network settings. A + // tombstone object must have the same expiration epoch value in + // `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) // attribute. Otherwise, the tombstone will be rejected by a storage node. - uint64 expiration_epoch = 1 [json_name = "expirationEpoch"]; + uint64 expiration_epoch = 1 [ json_name = "expirationEpoch" ]; // 16 byte UUID used to identify the split object hierarchy parts. Must be // unique inside a container. All objects participating in the split must // have the same `split_id` value. - bytes split_id = 2 [json_name = "splitID"]; + bytes split_id = 2 [ json_name = "splitID" ]; // List of objects to be deleted. - repeated neo.fs.v2.refs.ObjectID members = 3 [json_name = "members"]; + repeated neo.fs.v2.refs.ObjectID members = 3 [ json_name = "members" ]; }