-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthentication.proto
80 lines (71 loc) · 1.58 KB
/
authentication.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
syntax = "proto3";
package begonia.org.sdk;
option go_package = "github.com/begonia-org/go-sdk/api/v1";
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "user.proto";
import "begonia/api/v1/options.proto";
message LoginAPIRequest{
string auth=1;
int64 seed=2;
bool is_keep_login=3 [json_name="is_keep_login"];
}
message LogoutAPIRequest{
}
message LogoutAPIResponse{
}
message LoginAPIResponse{
Users user=1;
string token=2;
}
message AccountAPIRequest{
repeated string uids=1;
}
message AccountAPIResponse{
repeated Users users=1;
}
message UserAuth{
string account=1 [json_name="account"];
string password=2 [json_name="password"];
}
message RegsiterAPIRequest{
// string username=1;
// string password=2;
string auth=1;
map<string, string> ext = 3 [json_name="ext"];
}
message RegsiterAPIResponse{
string msg=1;
}
message AuthLogAPIRequest{
string token=1;
}
message AuthSeed{
int64 seed=1;
string key=2;
}
// 加密种子
message AuthLogAPIResponse{
string msg=1;
string timestamp=2;
}
service AuthService{
// option (.begonia.api.v1.auth_reqiured)=true;
option (.begonia.api.v1.http_response)="begonia.api.v1.HttpResponse";
rpc Login (LoginAPIRequest) returns (LoginAPIResponse) {
option (google.api.http) = {
post: "/api/v1/auth/login"
body: "*"
};
}
rpc Logout (LogoutAPIRequest) returns (LogoutAPIResponse) {
option (google.api.http) = {
delete: "/api/v1/auth/logout"
};
}
rpc AuthSeed (AuthLogAPIRequest) returns (AuthLogAPIResponse) {
option (google.api.http) = {
get: "/api/v1/auth/log/{token}"
};
}
}