-
Notifications
You must be signed in to change notification settings - Fork 166
/
auth.proto
61 lines (46 loc) · 1.37 KB
/
auth.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
syntax = "proto3";
package grpc;
import "google/protobuf/empty.proto";
// AuthService is the service providing the auth interface.
service AuthService {
// GetUser tries to authenticate a user.
rpc GetUser(GetUserRequest) returns (AuthResponse) {}
// GetSuperuser checks if a user is a superuser.
rpc GetSuperuser(GetSuperuserRequest) returns (AuthResponse) {}
// CheckAcl checks user's authorization for the given topic.
rpc CheckAcl(CheckAclRequest) returns (AuthResponse) {}
// GetName retrieves the name of the backend.
rpc GetName(google.protobuf.Empty) returns (NameResponse) {}
// Halt signals the backend to halt.
rpc Halt(google.protobuf.Empty) returns (google.protobuf.Empty) {}
}
message GetUserRequest {
// Username.
string username = 1;
// Plain text password.
string password = 2;
// The client connection's id.
string clientid = 3;
}
message GetSuperuserRequest {
// Username.
string username = 1;
}
message CheckAclRequest {
// Username.
string username = 1;
// Topic to be checked for.
string topic = 2;
// The client connection's id.
string clientid = 3;
// Topic access.
int32 acc = 4;
}
message AuthResponse {
// If the user is authorized/authenticated.
bool ok = 1;
}
message NameResponse {
// The name of the gRPC backend.
string name = 1;
}