-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.proto
60 lines (45 loc) · 1.08 KB
/
app.proto
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
syntax = "proto3";
package appProto;
option go_package = ".;appProto";
import "google/protobuf/empty.proto";
service App {
rpc GetTokenStatus(TokenIDRequest) returns (TokenStatus) {}
rpc WatchTokenOperation(google.protobuf.Empty) returns (stream TokenOperation) {}
rpc RefreshToken(RefreshTokenRequest) returns (AccessToken) {}
rpc DestroyToken(RefreshTokenRequest) returns (google.protobuf.Empty) {}
rpc GetUserInfo(UserIDRequest) returns (UserInfo) {}
}
message TokenIDRequest {
uint64 id = 1;
}
message UserIDRequest {
uint64 id = 1;
}
message RefreshTokenRequest {
string Token = 1;
}
message TokenStatus {
bool valid = 1;
}
message UserOperationID {
uint64 uid = 1;
uint64 operation_id = 2;
}
message CanceledToken {
uint64 id = 1;
int64 valid_before = 2;
}
message TokenOperation {
repeated UserOperationID user_operation = 1;
repeated CanceledToken canceled_token = 2;
}
message AccessToken {
string access_token = 1;
string payload = 2;
}
message UserInfo {
uint64 uid = 1;
string name = 2;
string avatar_url = 3;
repeated string groups = 4;
}