Move all service types to types.proto

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-08-18 14:13:16 +03:00 committed by Alex Vanin
parent 1647242397
commit a78b8a1ea5
9 changed files with 86 additions and 117 deletions

View file

@ -6,8 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accoun
option csharp_namespace = "NeoFS.API.v2.Accounting"; option csharp_namespace = "NeoFS.API.v2.Accounting";
import "refs/types.proto"; import "refs/types.proto";
import "service/meta.proto"; import "service/types.proto";
import "service/verify.proto";
// The service provides methods for obtaining information // The service provides methods for obtaining information
// about the account balance in NeoFS system. // about the account balance in NeoFS system.

View file

@ -8,8 +8,7 @@ option csharp_namespace = "NeoFS.API.v2.Container";
import "acl/types.proto"; import "acl/types.proto";
import "container/types.proto"; import "container/types.proto";
import "refs/types.proto"; import "refs/types.proto";
import "service/meta.proto"; import "service/types.proto";
import "service/verify.proto";
// ContainerService provides API to access container smart-contract in morph chain // ContainerService provides API to access container smart-contract in morph chain
// via NeoFS node. // via NeoFS node.

View file

@ -7,7 +7,7 @@ option csharp_namespace = "NeoFS.API.v2.Container";
import "netmap/types.proto"; import "netmap/types.proto";
import "refs/types.proto"; import "refs/types.proto";
import "service/meta.proto"; import "service/types.proto";
// Container is a structure that defines object placement behaviour. Objects // Container is a structure that defines object placement behaviour. Objects
// can be stored only within containers. They define placement rule, attributes // can be stored only within containers. They define placement rule, attributes

View file

@ -7,8 +7,7 @@ option csharp_namespace = "NeoFS.API.v2.Object";
import "object/types.proto"; import "object/types.proto";
import "refs/types.proto"; import "refs/types.proto";
import "service/meta.proto"; import "service/types.proto";
import "service/verify.proto";
// Object service provides API for manipulating with the object. // Object service provides API for manipulating with the object.
service ObjectService { service ObjectService {

View file

@ -6,8 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object";
option csharp_namespace = "NeoFS.API.v2.Object"; option csharp_namespace = "NeoFS.API.v2.Object";
import "refs/types.proto"; import "refs/types.proto";
import "service/meta.proto"; import "service/types.proto";
import "service/verify.proto";
// Type of the object payload content // Type of the object payload content
enum ObjectType { enum ObjectType {

View file

@ -3,37 +3,32 @@
## Table of Contents ## Table of Contents
- [service/meta.proto](#service/meta.proto) - [service/types.proto](#service/types.proto)
- Messages - Messages
- [BearerToken](#neo.fs.v2.service.BearerToken) - [BearerToken](#neo.fs.v2.service.BearerToken)
- [BearerToken.Body](#neo.fs.v2.service.BearerToken.Body) - [BearerToken.Body](#neo.fs.v2.service.BearerToken.Body)
- [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext) - [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext)
- [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) - [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader)
- [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader)
- [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) - [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader)
- [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader)
- [SessionToken](#neo.fs.v2.service.SessionToken) - [SessionToken](#neo.fs.v2.service.SessionToken)
- [SessionToken.Body](#neo.fs.v2.service.SessionToken.Body) - [SessionToken.Body](#neo.fs.v2.service.SessionToken.Body)
- [Signature](#neo.fs.v2.service.Signature)
- [TokenLifetime](#neo.fs.v2.service.TokenLifetime) - [TokenLifetime](#neo.fs.v2.service.TokenLifetime)
- [Version](#neo.fs.v2.service.Version) - [Version](#neo.fs.v2.service.Version)
- [XHeader](#neo.fs.v2.service.XHeader) - [XHeader](#neo.fs.v2.service.XHeader)
- [service/verify.proto](#service/verify.proto)
- Messages
- [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader)
- [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader)
- [Signature](#neo.fs.v2.service.Signature)
- [Scalar Value Types](#scalar-value-types) - [Scalar Value Types](#scalar-value-types)
<a name="service/meta.proto"></a> <a name="service/types.proto"></a>
<p align="right"><a href="#top">Top</a></p> <p align="right"><a href="#top">Top</a></p>
## service/meta.proto ## service/types.proto
<!-- end services --> <!-- end services -->
@ -93,6 +88,20 @@ Information about the request
| origin | [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | RequestMetaHeader of the origin request. | | origin | [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | RequestMetaHeader of the origin request. |
<a name="neo.fs.v2.service.RequestVerificationHeader"></a>
### Message RequestVerificationHeader
Verification info for request signed by all intermediate nodes
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Body signature. Should be generated once by request initiator. |
| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Meta signature is added and signed by any intermediate node |
| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops |
| origin | [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Chain of previous hops signatures |
<a name="neo.fs.v2.service.ResponseMetaHeader"></a> <a name="neo.fs.v2.service.ResponseMetaHeader"></a>
### Message ResponseMetaHeader ### Message ResponseMetaHeader
@ -108,6 +117,20 @@ Information about the response
| origin | [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta header of the origin response. | | origin | [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta header of the origin response. |
<a name="neo.fs.v2.service.ResponseVerificationHeader"></a>
### Message ResponseVerificationHeader
Verification info for response signed by all intermediate nodes
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Body signature. Should be generated once by answering node. |
| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Meta signature is added and signed by any intermediate node |
| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops |
| origin | [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Chain of previous hops signatures |
<a name="neo.fs.v2.service.SessionToken"></a> <a name="neo.fs.v2.service.SessionToken"></a>
### Message SessionToken ### Message SessionToken
@ -135,6 +158,18 @@ Session token body
| object | [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext) | | ObjectService session context. | | object | [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext) | | ObjectService session context. |
<a name="neo.fs.v2.service.Signature"></a>
### Message Signature
Signature of something in NeoFS
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [bytes](#bytes) | | Public key used for signing. |
| sign | [bytes](#bytes) | | Signature |
<a name="neo.fs.v2.service.TokenLifetime"></a> <a name="neo.fs.v2.service.TokenLifetime"></a>
### Message TokenLifetime ### Message TokenLifetime
@ -195,60 +230,6 @@ Object request verbs
<a name="service/verify.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## service/verify.proto
<!-- end services -->
<a name="neo.fs.v2.service.RequestVerificationHeader"></a>
### Message RequestVerificationHeader
Verification info for request signed by all intermediate nodes
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Body signature. Should be generated once by request initiator. |
| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Meta signature is added and signed by any intermediate node |
| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops |
| origin | [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Chain of previous hops signatures |
<a name="neo.fs.v2.service.ResponseVerificationHeader"></a>
### Message ResponseVerificationHeader
Verification info for response signed by all intermediate nodes
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Body signature. Should be generated once by answering node. |
| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Meta signature is added and signed by any intermediate node |
| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops |
| origin | [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Chain of previous hops signatures |
<a name="neo.fs.v2.service.Signature"></a>
### Message Signature
Signature of something in NeoFS
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [bytes](#bytes) | | Public key used for signing. |
| sign | [bytes](#bytes) | | Signature |
<!-- end messages -->
<!-- end enums -->
## Scalar Value Types ## Scalar Value Types
| .proto Type | Notes | C++ Type | Java Type | Python Type | | .proto Type | Notes | C++ Type | Java Type | Python Type |

View file

@ -7,7 +7,6 @@ option csharp_namespace = "NeoFS.API.v2.Service";
import "acl/types.proto"; import "acl/types.proto";
import "refs/types.proto"; import "refs/types.proto";
import "service/verify.proto";
// Extended headers for Request/Response // Extended headers for Request/Response
message XHeader { message XHeader {
@ -164,3 +163,37 @@ message ResponseMetaHeader {
// Carries response meta header of the origin response. // Carries response meta header of the origin response.
ResponseMetaHeader origin = 5; ResponseMetaHeader origin = 5;
} }
// 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;
}

View file

@ -1,40 +0,0 @@
syntax = "proto3";
package neo.fs.v2.service;
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service/grpc;service";
option csharp_namespace = "NeoFS.API.v2.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;
}

View file

@ -6,8 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session";
option csharp_namespace = "NeoFS.API.v2.Session"; option csharp_namespace = "NeoFS.API.v2.Session";
import "refs/types.proto"; import "refs/types.proto";
import "service/meta.proto"; import "service/types.proto";
import "service/verify.proto";
// Create Session record on Node side // Create Session record on Node side
service SessionService { service SessionService {