[#39] Makefile: Add fmt target

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-02-28 18:53:04 +03:00
parent 188f580e46
commit 4c68d92468
15 changed files with 379 additions and 364 deletions

View file

@ -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

View file

@ -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;

View file

@ -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" ];
}

View file

@ -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" ];
}

View file

@ -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" ];
}

View file

@ -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;

View file

@ -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" ];
}

View file

@ -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" ];
}

View file

@ -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.
// 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;
@ -87,8 +87,7 @@ message LocalNodeInfoResponse {
// Get NetworkInfo structure with the network view from a particular node.
message NetworkInfoRequest {
// NetworkInfo request body is empty.
message Body {
}
message Body {}
// Body of the NetworkInfo request message
Body body = 1;
@ -126,8 +125,7 @@ message NetworkInfoResponse {
// Get netmap snapshot request
message NetmapSnapshotRequest {
// Get netmap snapshot request body.
message Body {
}
message Body {}
// Body of get netmap snapshot request message.
Body body = 1;
@ -140,7 +138,6 @@ message NetmapSnapshotRequest {
// 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
@ -148,7 +145,7 @@ message NetmapSnapshotResponse {
// Get netmap snapshot response body
message Body {
// Structure of the requested network map.
Netmap netmap = 1 [json_name = "netmap"];
Netmap netmap = 1 [ json_name = "netmap" ];
}
// Body of get netmap snapshot response message.
@ -162,5 +159,4 @@ message NetmapSnapshotResponse {
// authenticate the nodes of the message route and check the correctness of
// transmission.
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
}

View file

@ -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"];
uint64 epoch = 1 [ json_name = "epoch" ];
// Nodes presented in network.
repeated NodeInfo nodes = 2 [json_name = "nodes"];
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"];
uint64 current_epoch = 1 [ json_name = "currentEpoch" ];
// Magic number of the sidechain of the NeoFS network
uint64 magic_number = 2 [json_name = "magicNumber"];
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"];
NetworkConfig network_config = 4 [ json_name = "networkConfig" ];
}

View file

@ -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" ];
}

View file

@ -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.

View file

@ -38,23 +38,23 @@ 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.
@ -74,15 +74,15 @@ message ContainerSessionContext {
SETEACL = 3;
}
// Type of request for which the token is issued
Verb verb = 1 [json_name = "verb"];
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"];
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"];
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" ];
}

View file

@ -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" ];
}