-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathwrapper.proto
More file actions
113 lines (90 loc) · 2.82 KB
/
wrapper.proto
File metadata and controls
113 lines (90 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
* @license
* Copyright 2019-2020 CERN and copyright holders of ALICE O2.
* See http://alice-o2.web.cern.ch/copyright for details of the copyright holders.
* All rights not expressly granted are reserved.
*
* This software is distributed under the terms of the GNU General Public
* License v3 (GPL Version 3), copied verbatim in the file "COPYING".
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/
syntax = "proto3";
package webui.tokenization;
// ======================================
// SERVICES
// ======================================
// Central System service handling duplex communication with wrapper client
service CentralSystem {
rpc ClientStream(stream Payload) returns (stream Payload);
}
// Peer2Peer service handling HTTP-like requests between wrapper clients
service Peer2Peer {
rpc Fetch (HttpLikeRequest) returns (HttpLikeResponse);
}
// ======================================
// MESSAGES
// ======================================
// Simulates an empty message because protobuffer doesn't support void
message EmptyMessage {}
// Message with token and target address binded to it
message Token {
string token = 1;
string targetAddress = 2;
ConnectionDirection connectionDirection = 3;
}
// Stream message that can contain one of specific messages
message Payload {
// Message event type
MessageEvent event = 1;
// Data related to specific event type
oneof data {
EmptyMessage emptyMessage = 2;
Token payload = 3;
}
}
// http method enum
enum HttpMethod {
HTTP_METHOD_UNSPECIFIED = 0;
GET = 1;
POST = 2;
PUT = 3;
PATCH = 4;
DELETE = 5;
HEAD = 6;
OPTIONS = 7;
}
message HttpLikeRequest {
HttpMethod method = 1; // GET/POST/...
string path = 2; // request path e.g. "/orders/add"
map<string,string> headers = 3; // "content-type": "application/json"
bytes body = 4; // body (e.g. JSON)
}
message HttpLikeResponse {
int32 status = 1;
map<string,string> headers = 2;
bytes body = 3;
}
// ======================================
// ENUMS
// ======================================
enum MessageEvent {
// Default value, represents an empty event
MESSAGE_EVENT_EMPTY = 0;
// New token message type, contains a new token and target address
MESSAGE_EVENT_NEW_TOKEN = 1;
// Revoke token message type, contains a token to be revoked
MESSAGE_EVENT_REVOKE_TOKEN = 2;
}
enum ConnectionDirection {
// Unspecified direction
UNSPECIFIED = 0;
// Direction from client to server
SENDING = 1;
// Direction from server to client
RECEIVING = 2;
// Duplex connection, both sending and receiving
DUPLEX = 3;
}