From 12e7b5f16b5dbdbcddd4d0d9fd44aa20615e9cb9 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 13 Aug 2020 16:39:10 +0300 Subject: [PATCH] Remove proto files from the repo --- prepare.sh | 12 +- v2/accounting/service.proto | 75 ------- v2/acl/types.proto | 106 ---------- v2/container/service.proto | 285 ------------------------- v2/container/types.proto | 40 ---- v2/netmap/types.proto | 92 -------- v2/object/service.proto | 407 ------------------------------------ v2/object/types.proto | 85 -------- v2/refs/types.proto | 32 --- v2/service/meta.proto | 129 ------------ v2/service/verify.proto | 40 ---- v2/session/service.proto | 59 ------ v2/storagegroup/types.proto | 30 --- 13 files changed, 8 insertions(+), 1384 deletions(-) delete mode 100644 v2/accounting/service.proto delete mode 100644 v2/acl/types.proto delete mode 100644 v2/container/service.proto delete mode 100644 v2/container/types.proto delete mode 100644 v2/netmap/types.proto delete mode 100644 v2/object/service.proto delete mode 100644 v2/object/types.proto delete mode 100644 v2/refs/types.proto delete mode 100644 v2/service/meta.proto delete mode 100644 v2/service/verify.proto delete mode 100644 v2/session/service.proto delete mode 100644 v2/storagegroup/types.proto diff --git a/prepare.sh b/prepare.sh index e9cfb223..5962123f 100755 --- a/prepare.sh +++ b/prepare.sh @@ -18,15 +18,19 @@ for file in $ARGS; do dir=$(dirname $file) cp -r $dir $API_GO_PATH/$prefix done -cd $API_GO_PATH/$prefix # MODIFY FILES +cd $API_GO_PATH/$prefix for file in $ARGS; do - sed -i "s/import\ \"\(.*\)\";/import\ \"$prefix\/\1\";/" $file + sed -i "s/import\ \"\(.*\)\";/import\ \"$prefix\/\1\";/" $file done +cd $API_GO_PATH # COMPILE make protoc -# REMOVE PROTO FILES -# TO BE DONE AS NEOFS-API WILL BE STABLE +# REMOVE PROTO DEFINITIONS +ARGS=$(find ./ -name '*.proto' -not -path './vendor/*') +for file in $ARGS; do + rm $file +done diff --git a/v2/accounting/service.proto b/v2/accounting/service.proto deleted file mode 100644 index 35d55a70..00000000 --- a/v2/accounting/service.proto +++ /dev/null @@ -1,75 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.accounting; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting"; -option csharp_namespace = "NeoFS.API.Accounting"; - -import "v2/refs/types.proto"; -import "v2/service/meta.proto"; -import "v2/service/verify.proto"; - -// The service provides methods for obtaining information -// about the account balance in NeoFS system. -service Accounting { - // Returns the amount of funds for the requested NeoFS account. - rpc Balance (BalanceRequest) returns (BalanceResponse); -} - -// Message defines the request body of Balance method. -// -// To indicate the account for which the balance is requested, it's identifier -// is used. -// -// To gain access to the requested information, the request body must be formed -// according to the requirements from the system specification. -message BalanceRequest { - message Body { - // Carries user identifier in NeoFS system for which the balance - // is requested. - neo.fs.v2.refs.OwnerID owner_id = 1; - } - - // Body of the balance 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -// Decimal represents the decimal numbers. -message Decimal { - // value carries number value. - int64 value = 1; - - // precision carries value precision. - uint32 precision = 2; -} - -// Message defines the response body of Balance method. -// -// The amount of funds is calculated in decimal numbers. -message BalanceResponse { - message Body { - // Carries the amount of funds on the account. - Decimal balance = 1; - } - - // Body of the balance response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} diff --git a/v2/acl/types.proto b/v2/acl/types.proto deleted file mode 100644 index a0a4c0bd..00000000 --- a/v2/acl/types.proto +++ /dev/null @@ -1,106 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.acl; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl"; -option csharp_namespace = "NeoFS.API.Acl"; - -import "v2/refs/types.proto"; - -// Target of the access control rule in access control list. -enum Target { - // Unknown target, default value. - UNKNOWN = 0; - - // User target rule is applied if sender is the owner of the container. - USER = 1; - - // System target rule is applied if sender is the storage node within the - // container or inner ring node. - SYSTEM = 2; - - // Others target rule is applied if sender is not user or system target. - OTHERS = 3; -} - -// EACLRecord groups information about extended ACL rule. -message EACLRecord { - // Operation is an enumeration of operation types. - enum Operation { - OPERATION_UNKNOWN = 0; - GET = 1; - HEAD = 2; - PUT = 3; - DELETE = 4; - SEARCH = 5; - GETRANGE = 6; - GETRANGEHASH = 7; - } - - // Operation carries type of operation. - Operation operation = 1 [json_name = "Operation"]; - - // Action is an enumeration of EACL actions. - enum Action { - ACTION_UNKNOWN = 0; - ALLOW = 1; - DENY = 2; - } - - // Action carries ACL target action. - Action action = 2 [json_name = "Action"]; - - // FilterInfo groups information about filter. - message FilterInfo { - // Header is an enumeration of filtering header types. - enum Header { - HEADER_UNKNOWN = 0; - REQUEST = 1; - OBJECT = 2; - } - - // Header carries type of header. - Header header = 1 [json_name = "HeaderType"]; - - // MatchType is an enumeration of match types. - enum MatchType { - MATCH_UNKNOWN = 0; - STRING_EQUAL = 1; - STRING_NOT_EQUAL = 2; - } - - // MatchType carries type of match. - MatchType match_type = 2 [json_name = "MatchType"]; - - // header_name carries name of filtering header. - string header_name = 3 [json_name="Name"]; - - // header_val carries value of filtering header. - string header_val = 4 [json_name="Value"]; - } - - // filters carries set of filters. - repeated FilterInfo filters = 3 [json_name="Filters"]; - - // TargetInfo groups information about extended ACL target. - message TargetInfo { - // target carries target of ACL rule. - Target target = 1 [json_name="Role"]; - - // key_list carries public keys of ACL target. - repeated bytes key_list = 2 [json_name="Keys"]; - } - - // targets carries information about extended ACL target list. - repeated TargetInfo targets = 4 [json_name="Targets"]; -} - -// EACLRecord carries the information about extended ACL rules. -message EACLTable { - // Carries identifier of the container that should use given - // access control rules. - neo.fs.v2.refs.ContainerID container_id = 1 [json_name="ContainerID"]; - - // Records carries list of extended ACL rule records. - repeated EACLRecord records = 2 [json_name="Records"]; -} diff --git a/v2/container/service.proto b/v2/container/service.proto deleted file mode 100644 index 3d6c9c2e..00000000 --- a/v2/container/service.proto +++ /dev/null @@ -1,285 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.container; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container"; -option csharp_namespace = "NeoFS.API.Container"; - -import "v2/acl/types.proto"; -import "v2/container/types.proto"; -import "v2/refs/types.proto"; -import "v2/service/meta.proto"; -import "v2/service/verify.proto"; - -// Service provides API to access container smart-contract in morph chain -// via NeoFS node. -service Service { - // Put invokes 'Put' method in container smart-contract and returns - // response immediately. After new block in morph chain, request is verified - // by inner ring nodes. After one more block in morph chain, container - // added into smart-contract storage. - rpc Put(PutRequest) returns (PutResponse); - - // Delete invokes 'Delete' method in container smart-contract and returns - // response immediately. After new block in morph chain, request is verified - // by inner ring nodes. After one more block in morph chain, container - // removed from smart-contract storage. - rpc Delete(DeleteRequest) returns (DeleteResponse); - - // Get returns container from container smart-contract storage. - rpc Get(GetRequest) returns (GetResponse); - - // List returns all owner's containers from container smart-contract - // storage. - rpc List(ListRequest) returns (ListResponse); - - // SetExtendedACL invokes 'SetEACL' method in container smart-contract and - // returns response immediately. After new block in morph chain, - // Extended ACL added into smart-contract storage. - rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); - - // GetExtendedACL returns Extended ACL table and signature from container - // smart-contract storage. - rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); -} - -message PutRequest { - message Body { - // Container to create in NeoFS. - neo.fs.v2.container.Container container = 1; - - // Public Key of container owner. It can be public key of the owner - // or it can be public key that bound in neofs.id smart-contract. - bytes public_key = 2; - - // Signature of stable-marshalled container according to RFC-6979. - bytes signature = 3; - } - - // Body of container put 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message PutResponse { - message Body { - // container_id carries identifier of the new container. - neo.fs.v2.refs.ContainerID container_id = 1; - } - - // Body of container put response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message DeleteRequest { - message Body { - // container_id carries identifier of the container to delete - // from NeoFS. - neo.fs.v2.refs.ContainerID container_id = 1; - - // Signature of container id according to RFC-6979. - bytes signature = 2; - } - - // Body of container delete 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -// DeleteResponse is empty because delete operation is asynchronous and done -// via consensus in inner ring nodes -message DeleteResponse { - message Body {} - - // Body of container delete response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message GetRequest { - message Body { - // container_id carries identifier of the container to get. - neo.fs.v2.refs.ContainerID container_id = 1; - } - - // Body of container get 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message GetResponse { - message Body { - // Container that has been requested. - neo.fs.v2.container.Container container = 1; - } - - // Body of container get response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message ListRequest { - message Body { - // owner_id carries identifier of the container owner. - neo.fs.v2.refs.OwnerID owner_id = 1; - } - - // Body of list containers 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message ListResponse { - message Body { - // ContainerIDs carries list of identifiers of the containers that belong to the owner. - repeated refs.ContainerID container_ids = 1; - } - - // Body of list containers response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message SetExtendedACLRequest { - message Body { - // Extended ACL to set for the container. - neo.fs.v2.acl.EACLTable eacl = 1; - - // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes signature = 2; - } - - // Body of set extended acl 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message SetExtendedACLResponse { - message Body { } - - // Body of set extended acl response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message GetExtendedACLRequest { - message Body { - // container_id carries identifier of the container that has Extended ACL. - neo.fs.v2.refs.ContainerID container_id = 1; - } - - // Body of get extended acl 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message GetExtendedACLResponse { - message Body { - // Extended ACL that has been requested if it was set up. - neo.fs.v2.acl.EACLTable eacl = 1; - - // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes signature = 2; - } - - // Body of get extended acl response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} diff --git a/v2/container/types.proto b/v2/container/types.proto deleted file mode 100644 index aa9fb2cc..00000000 --- a/v2/container/types.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.container; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container"; -option csharp_namespace = "NeoFS.API.Container"; - -import "v2/netmap/types.proto"; -import "v2/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. ID of the container is a 32 byte long -// SHA256 hash of stable-marshalled container message. -message Container { - // OwnerID carries identifier of the container owner. - neo.fs.v2.refs.OwnerID owner_id = 1; - - // Nonce is a 16 byte UUID, used to avoid collisions of container id. - bytes nonce = 2; - - // BasicACL contains access control rules for owner, system, others groups and - // permission bits for bearer token and Extended ACL. - uint32 basic_acl = 3; - - // Attribute is a key-value pair of strings. - message Attribute { - // Key of immutable container attribute. - string key = 1; - - // Value of immutable container attribute. - string value = 2; - } - - // Attributes define any immutable characteristics of container. - repeated Attribute attributes = 4; - - // Rules define storage policy for the object inside the container. - neo.fs.v2.netmap.PlacementRule rules = 5; -} diff --git a/v2/netmap/types.proto b/v2/netmap/types.proto deleted file mode 100644 index 0807cf42..00000000 --- a/v2/netmap/types.proto +++ /dev/null @@ -1,92 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.netmap; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap"; -option csharp_namespace = "NeoFS.API.Netmap"; - -message PlacementRule { - uint32 repl_factor = 1; - - message SFGroup { - message Filter { - string key = 1; - - message SimpleFilters { - repeated SimpleFilter filters = 1; - } - - message SimpleFilter { - enum Operation { - NP = 0; - EQ = 1; - NE = 2; - GT = 3; - GE = 4; - LT = 5; - LE = 6; - OR = 7; - AND = 8; - } - - Operation op = 1; - - oneof args { - string value = 2; - SimpleFilters f_args = 3; - } - } - - SimpleFilter f = 2; - } - - repeated Filter filters = 1; - - message Selector { - uint32 count = 1; - string key = 2; - } - - repeated Selector selectors = 2; - - repeated uint32 exclude = 3; - } - - repeated SFGroup sf_groups = 2; -} - -// Groups the information about the NeoFS node. -message NodeInfo { - // Carries network address of the NeoFS node. - string address = 1; - - // Carries public key of the NeoFS node in a binary format. - bytes public_key = 2; - - // Groups attributes of the NeoFS node. - message Attribute { - // Carries string key to the node attribute. - string key = 1; - - // Carries string value of the node attribute. - string value = 2; - } - - // Carries list of the NeoFS node attributes in a string key-value format. - repeated Attribute attributes = 3; - - // Represents the enumeration of various states of the NeoFS node. - enum State { - // Undefined state. - UNKNOWN = 0; - - // Active state in the network. - ONLINE = 1; - - // Network unavailable state. - OFFLINE = 2; - } - - // Carries state of the NeoFS node. - State state = 4; -} \ No newline at end of file diff --git a/v2/object/service.proto b/v2/object/service.proto deleted file mode 100644 index 28051e3c..00000000 --- a/v2/object/service.proto +++ /dev/null @@ -1,407 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.object; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object"; -option csharp_namespace = "NeoFS.API.Object"; - -import "v2/object/types.proto"; -import "v2/refs/types.proto"; -import "v2/service/meta.proto"; -import "v2/service/verify.proto"; - -// Object service provides API for manipulating with the object. -service Service { - // Get the object from container. Response uses gRPC stream. First response - // message carry object of requested address. Chunk messages are parts of - // the object's payload if it is needed. All messages except first carry - // chunks. Requested object can be restored by concatenation of object - // message payload and all chunks keeping receiving order. - rpc Get(GetRequest) returns (stream GetResponse); - - // Put the object into container. Request uses gRPC stream. First message - // SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD - // BE set. Session token SHOULD BE obtained before put operation (see - // session package). Chunk messages considered by server as part of object - // payload. All messages except first SHOULD BE chunks. Chunk messages - // SHOULD BE sent in direct order of fragmentation. - rpc Put(stream PutRequest) returns (PutResponse); - - // Delete the object from a container - rpc Delete(DeleteRequest) returns (DeleteResponse); - - // Head returns the object without data payload. Object in the - // response has system header only. If full headers flag is set, extended - // headers are also present. - rpc Head(HeadRequest) returns (HeadResponse); - - // Search objects in container. Version of query language format SHOULD BE - // set to 1. Search query represented in serialized format (see query - // package). - rpc Search(SearchRequest) returns (stream SearchResponse); - - // GetRange of data payload. Range is a pair (offset, length). - // Requested range can be restored by concatenation of all chunks - // keeping receiving order. - rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); - - // GetRangeHash returns homomorphic hash of object payload range after XOR - // operation. Ranges are set of pairs (offset, length). Hashes order in - // response corresponds to ranges order in request. Homomorphic hash is - // calculated for XORed data. - rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); -} - -message GetRequest { - message Body { - // Address of the requested object. - neo.fs.v2.refs.Address address = 1; - - // Carries the raw option flag of the request. - // Raw request is sent to receive only the objects - // that are physically stored on the server. - bool raw = 2; - } - // Body of get object 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message GetResponse { - message Body { - // Initialization parameters of the object got from NeoFS. - message Init { - // Object ID - neo.fs.v2.refs.ObjectID object_id = 1; - // Object signature - neo.fs.v2.service.Signature signature =2; - // Object header. - Header header = 3; - } - // Carries the single message of the response stream. - oneof object_part { - // Initialization parameters of the object stream. - Init init =1; - // Part of the object payload. - bytes chunk = 2; - } - } - // Body of get object response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message PutRequest { - message Body { - // Groups initialization parameters of object placement in NeoFS. - message Init { - // Object ID, where available - neo.fs.v2.refs.ObjectID object_id = 1; - // Object signature, were available - neo.fs.v2.service.Signature signature =2; - // Header of the object to save in the system. - Header header = 3; - // Number of the object copies to store within the RPC call. - // Default zero value is processed according to the - // container placement rules. - uint32 copies_number = 4; - } - - // Carries the single part of the query stream. - oneof object_part { - // Carries the initialization parameters of the object stream. - Init init = 1; - // Carries part of the object payload. - bytes chunk = 2; - } - } - // Body of put object 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message PutResponse { - message Body { - // Carries identifier of the saved object. - // It is used to access an object in the container. - neo.fs.v2.refs.ObjectID object_id = 1; - } - // Body of put object response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message DeleteRequest { - message Body { - // Carries the address of the object to be deleted. - neo.fs.v2.refs.Address address = 1; - // Carries identifier the object owner. - neo.fs.v2.refs.OwnerID owner_id = 2; - } - // Body of delete object 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -// DeleteResponse is empty because we cannot guarantee permanent object removal -// in distributed system. -message DeleteResponse { - message Body { } - - // Body of delete object response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message HeadRequest { - message Body { - // Address of the object with the requested header. - neo.fs.v2.refs.Address address = 1; - // Return only minimal header subset - bool main_only = 2; - // Carries the raw option flag of the request. - // Raw request is sent to receive only the headers of the objects - // that are physically stored on the server. - bool raw = 3; - } - // Body of head object 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message HeadResponse { - message Body { - message ShortHeader { - // Object format version. - neo.fs.v2.service.Version version = 1; - // Epoch when the object was created - uint64 creation_epoch = 2; - // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3; - // Type of the object payload content - ObjectType object_type = 4; - // Size of payload in bytes. - // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown - uint64 payload_length = 5; - } - // Carries the requested object header or it's part - oneof head{ - Header header = 1; - ShortHeader short_header = 2; - } - } - // Body of head object response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message SearchRequest { - message Body { - // Carries search container identifier. - neo.fs.v2.refs.ContainerID container_id = 1; - - message Query { - uint32 version = 1; - - message Filter { - enum MatchType { - MATCH_UNKNOWN = 0; - STRING_EQUAL = 1; - } - - MatchType match_type = 1; - - string name = 2; - - string value = 3; - } - - repeated Filter filters = 2; - } - - Query query = 2; - } - - // Body of search object 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message SearchResponse { - message Body { - // Carries list of object identifiers that match the search query. - repeated neo.fs.v2.refs.ObjectID id_list = 1; - } - - // Body of search object response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -// Range groups the parameters of object payload range. -message Range { - // Carries the offset of the range from the object payload start. - uint64 offset = 1; - - // Carries the length of the object payload range. - uint64 length = 2; -} - -message GetRangeRequest { - message Body { - // Address carries address of the object that contains the requested payload range. - neo.fs.v2.refs.Address address = 1; - - // Range carries the parameters of the requested payload range. - Range range = 2; - } - - // Body of get range object 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message GetRangeResponse { - message Body { - // Carries part of the object payload. - bytes chunk = 1; - } - - // Body of get range object response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - -message GetRangeHashRequest { - message Body { - // Carries address of the object that contains the requested payload range. - neo.fs.v2.refs.Address address = 1; - - // Carries the list of object payload range to calculate homomorphic hash. - repeated Range ranges = 2; - - // Carries binary salt to XOR object payload ranges before hash calculation. - bytes salt = 3; - } - - // Body of get range hash object 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -message GetRangeHashResponse { - message Body { - // Carries list of homomorphic hashes in a binary format. - repeated bytes hash_list = 1; - } - - // Body of get range hash object response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} - diff --git a/v2/object/types.proto b/v2/object/types.proto deleted file mode 100644 index 2881f0fa..00000000 --- a/v2/object/types.proto +++ /dev/null @@ -1,85 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.object; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object"; -option csharp_namespace = "NeoFS.API.Object"; - -import "v2/refs/types.proto"; -import "v2/service/meta.proto"; -import "v2/service/verify.proto"; - -// Type of the object payload content -enum ObjectType { - // Just a normal object - REGULAR = 0; - // Used internally to identify deleted objects - TOMBSTONE = 1; - // Identifies that the object holds StorageGroup information - STORAGE_GROUP = 2; -} - -message Header { - // Object's container - neo.fs.v2.refs.ContainerID container_id = 1; - // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 2; - // Epoch when the object was created - uint64 creation_epoch = 3; - // Object format version. - // Effectively the version of API library used to create particular object - neo.fs.v2.service.Version version = 4; - // Size of payload in bytes. - // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown - uint64 payload_length = 5; - // Hash of payload bytes - bytes payload_hash = 6; - ObjectType object_type = 7; - // Homomorphic hash of the object payload. - bytes homomorphic_hash = 8; - // Session token, if it was used during Object creation. - // Need it to verify integrity and authenticity out of Request scope. - neo.fs.v2.service.SessionToken session_token = 9; - - // Attribute groups the user-defined Key-Value pairs attached to the object - message Attribute { - // string key to the object attribute - string key = 1; - // string value of the object attribute - string value = 2; - } - repeated Attribute attributes = 10; - - // Information about spawning the objects through a payload splitting. - message Split { - // Identifier of the origin object. - // Parent and children objects must be within the same container. - // Parent object_id is known only to the minor child. - neo.fs.v2.refs.ObjectID parent = 1; - // Previous carries identifier of the left split neighbor. - neo.fs.v2.refs.ObjectID previous = 2; - // `signature` field of the parent object. Used to reconstruct parent. - neo.fs.v2.service.Signature parent_signature = 3; - // `header` field of the parent object. Used to reconstruct parent. - Header parent_header = 4; - // Children carries list of identifiers of the objects generated by splitting the current. - repeated neo.fs.v2.refs.ObjectID children = 5; - } - // Position of the object in the split hierarchy. - Split split = 11; -} - -// Object structure. -message Object { - // Object's unique identifier. - // Object is content-addressed. It means id will change if header or payload - // changes. It's calculated as a hash of header field, which contains hash of - // object's payload - neo.fs.v2.refs.ObjectID object_id = 1; - // Signed object_id - neo.fs.v2.service.Signature signature = 2; - // Object metadata headers - Header header = 3; - // Payload bytes. - bytes payload = 4; -} diff --git a/v2/refs/types.proto b/v2/refs/types.proto deleted file mode 100644 index eab1044f..00000000 --- a/v2/refs/types.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.refs; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs"; -option csharp_namespace = "NeoFS.API.Refs"; - -// Address of object (container id + object id) -message Address { - // container_id carries container identifier. - ContainerID container_id = 1; - // object_id carries object identifier. - ObjectID object_id = 2; -} - -// NeoFS object identifier. -message ObjectID { - // value carries the object identifier in a binary format. - bytes value = 1; -} - -// NeoFS container identifier. -message ContainerID { - // value carries the container identifier in a binary format. - bytes value = 1; -} - -// OwnerID group information about the owner of the NeoFS container. -message OwnerID { - // value carries the identifier of the container owner in a binary format. - bytes value = 1; -} \ No newline at end of file diff --git a/v2/service/meta.proto b/v2/service/meta.proto deleted file mode 100644 index 203e7ce8..00000000 --- a/v2/service/meta.proto +++ /dev/null @@ -1,129 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.service; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service"; -option csharp_namespace = "NeoFS.API.Service"; - -import "v2/acl/types.proto"; -import "v2/refs/types.proto"; -import "v2/service/verify.proto"; - -message XHeader { - // Key of the X-Header. - string key = 1; - // Value of the X-Header. - string value = 2; -} - -// Represents API version used by node. -message Version { - // Major API version. - uint32 major = 1; - // Minor API version. - uint32 minor = 2; -} - -// Lifetime parameters of the token. Filed names taken from rfc7519. -message TokenLifetime { - // Expiration Epoch - uint64 exp = 1; - // Not valid before Epoch - uint64 nbf = 2; - // Issued at Epoch - uint64 iat = 3; -} - -// NeoFS session token. -message SessionToken { - message Body { - // ID is a token identifier. valid UUIDv4 represented in bytes - bytes id = 1; - // OwnerID carries identifier of the session initiator. - neo.fs.v2.refs.OwnerID owner_id = 2; - // Verb is an enumeration of session request types - enum Verb { - // Refers to object.Put RPC call - OBJECT_PUT = 0; - // Refers to object.Get RPC call - OBJECT_GET = 1; - // Refers to object.Head RPC call - OBJECT_HEAD = 2; - // Refers to object.Search RPC call - OBJECT_SEARCH = 3; - // Refers to object.Delete RPC call - OBJECT_DELETE = 4; - // Refers to object.GetRange RPC call - OBJECT_RANGE = 5; - // Refers to object.GetRangeHash RPC call - OBJECT_RANGEHASH = 6; - } - // Verb is a type of request for which the token is issued - Verb verb = 3; - // Lifetime is a lifetime of the session - TokenLifetime lifetime = 4; - // SessionKey is a public key of session key - bytes session_key = 5; - // Carries context of the session. - oneof context { - // object_address represents the object session context. - neo.fs.v2.refs.Address object_address = 6; - } - } - // Session Token body - Body token = 1; - - // Signature is a signature of session token information - Signature signature = 2; -} - -// BearerToken has information about request ACL rules with limited lifetime -message BearerToken { - message Body { - // EACLTable carries table of extended ACL rules - neo.fs.v2.acl.EACLTable eacl_table = 1; - // OwnerID carries identifier of the token owner - neo.fs.v2.refs.OwnerID owner_id = 2; - // Token expiration and valid time period parameters - TokenLifetime lifetime = 3; - } - // Bearer Token body - Body token = 1; - - // Signature of BearerToken body - Signature signature = 2; -} - -// Information about the request -message RequestMetaHeader { - // Client API version. - Version version = 1; - // Client local epoch number. Set to 0 if unknown. - uint64 epoch = 2; - // Maximum number of nodes in the request route. - uint32 ttl = 3; - // Request X-Headers. - repeated XHeader x_headers = 4; - // Token is a token of the session within which the request is sent - SessionToken token = 5; - // Bearer is a Bearer token of the request - BearerToken bearer = 6; - - // RequestMetaHeader of the origin request. - RequestMetaHeader origin = 7; -} - -// Information about the response -message ResponseMetaHeader { - // Server API version. - Version version = 1; - // Server local epoch number. - uint64 epoch = 2; - // Maximum number of nodes in the response route. - uint32 ttl = 3; - // Response X-Headers. - repeated XHeader x_headers = 4; - - // Carries response meta header of the origin response. - ResponseMetaHeader origin = 5; -} diff --git a/v2/service/verify.proto b/v2/service/verify.proto deleted file mode 100644 index 0b9b87c9..00000000 --- a/v2/service/verify.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.service; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service"; -option csharp_namespace = "NeoFS.API.Service"; - -// Signature of something in NeoFS -message Signature { - // Public key used for signing. - bytes key = 1; - // Signature - bytes sign = 2; -} - -// Verification info for request signed by all intermediate nodes -message RequestVerificationHeader { - // Request Body signature. Should be generated once by request initiator. - Signature body_signature = 1; - // Request Meta signature is added and signed by any intermediate node - Signature meta_signature = 2; - // Sign previous hops - Signature origin_signature = 3; - - // Chain of previous hops signatures - RequestVerificationHeader origin = 4; -} - -// Verification info for response signed by all intermediate nodes -message ResponseVerificationHeader { - // Response Body signature. Should be generated once by answering node. - Signature body_signature = 1; - // Response Meta signature is added and signed by any intermediate node - Signature meta_signature = 2; - // Sign previous hops - Signature origin_signature = 3; - - // Chain of previous hops signatures - ResponseVerificationHeader origin = 4; -} diff --git a/v2/session/service.proto b/v2/session/service.proto deleted file mode 100644 index 39650cfa..00000000 --- a/v2/session/service.proto +++ /dev/null @@ -1,59 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.session; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session"; -option csharp_namespace = "NeoFS.API.Session"; - -import "v2/refs/types.proto"; -import "v2/service/meta.proto"; -import "v2/service/verify.proto"; - -service Session { - // Create opens new session between the client and the server. - rpc Create (CreateRequest) returns (CreateResponse); -} - -// CreateRequest carries an information necessary for opening a session. -message CreateRequest { - message Body { - // Carries an identifier of a session initiator. - neo.fs.v2.refs.OwnerID owner_id = 1; - - // Carries a lifetime of the session. - neo.fs.v2.service.TokenLifetime lifetime = 2; - } - - // Body of create session token 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.service.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.service.RequestVerificationHeader verify_header = 3; -} - -// CreateResponse carries an information about the opened session. -message CreateResponse { - message Body { - // id carries an identifier of session token. - bytes id = 1; - - // session_key carries a session public key. - bytes session_key = 2; - } - - // Body of create session token response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.service.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.service.ResponseVerificationHeader verify_header = 3; -} diff --git a/v2/storagegroup/types.proto b/v2/storagegroup/types.proto deleted file mode 100644 index 5086621a..00000000 --- a/v2/storagegroup/types.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.storagegroup; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/storagegroup"; -option csharp_namespace = "NeoFS.API.StorageGroup"; - -import "v2/refs/types.proto"; - -// StorageGroup groups the information about the NeoFS storage group. -// The storage group consists of objects from single container. -message StorageGroup { - // validation_data_size carries the total size of the payloads of the storage - // group members. - uint64 validation_data_size = 1; - - // validation_hash carries homomorphic hash from the concatenation of the - // payloads of the storage group members - // The order of concatenation is the same as the order of the members in the - // Members field. - bytes validation_hash = 2; - - // expiration_epoch carries last NeoFS epoch number of the storage group - // lifetime. - uint64 expiration_epoch = 3; - - // Members carries the list of identifiers of the object storage group members. - // The list is strictly ordered. - repeated neo.fs.v2.refs.ObjectID members = 4; -}