2024-07-14 12:25:30 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
option go_package = ".;proto";
|
|
|
|
|
|
|
|
package proto;
|
|
|
|
|
|
|
|
service Auth {
|
|
|
|
rpc Authenticate(AuthRequest) returns (AuthReply) {}
|
2024-07-15 12:04:03 +00:00
|
|
|
rpc EnsurePermGranted(CheckPermRequest) returns (CheckPermResponse) {}
|
|
|
|
rpc EnsureUserPermGranted(CheckUserPermRequest) returns (CheckUserPermResponse) {}
|
2024-07-30 10:31:26 +00:00
|
|
|
rpc ListUserFriends(ListUserRelativeRequest) returns (ListUserRelativeResponse) {}
|
|
|
|
rpc ListUserBlocklist(ListUserRelativeRequest) returns (ListUserRelativeResponse) {}
|
2024-07-14 12:25:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message UserInfo {
|
|
|
|
uint64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
string nick = 3;
|
|
|
|
string email = 4;
|
|
|
|
string avatar = 5;
|
|
|
|
string banner = 6;
|
|
|
|
optional string description = 7;
|
2024-08-24 15:59:14 +00:00
|
|
|
optional uint64 affiliated_to = 8;
|
|
|
|
optional uint64 automated_by = 9;
|
2024-07-14 12:25:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message AuthInfo {
|
|
|
|
UserInfo info = 1;
|
|
|
|
bytes permissions = 2;
|
|
|
|
uint64 ticket_id = 3;
|
|
|
|
optional string new_access_token = 4;
|
|
|
|
optional string new_refresh_token = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message AuthRequest {
|
|
|
|
string access_token = 1;
|
|
|
|
optional string refresh_token = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message AuthReply {
|
|
|
|
bool is_valid = 1;
|
|
|
|
optional AuthInfo info = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CheckPermRequest {
|
|
|
|
string token = 1;
|
|
|
|
string key = 2;
|
|
|
|
bytes value = 3;
|
|
|
|
}
|
|
|
|
|
2024-07-15 12:04:03 +00:00
|
|
|
message CheckPermResponse {
|
|
|
|
bool is_valid = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CheckUserPermRequest {
|
|
|
|
uint64 user_id = 1;
|
|
|
|
uint64 other_id = 2;
|
|
|
|
string key = 3;
|
|
|
|
bytes value = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CheckUserPermResponse {
|
2024-07-14 12:25:30 +00:00
|
|
|
bool is_valid = 1;
|
2024-07-30 10:31:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message SimpleUserInfo {
|
2024-08-24 15:59:14 +00:00
|
|
|
uint64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
string nick = 3;
|
|
|
|
optional uint64 affiliated_to = 8;
|
|
|
|
optional uint64 automated_by = 9;
|
2024-07-30 10:31:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ListUserRelativeRequest {
|
2024-08-24 15:59:14 +00:00
|
|
|
uint64 user_id = 1;
|
|
|
|
bool is_related = 2;
|
2024-07-30 10:31:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ListUserRelativeResponse {
|
2024-08-24 15:59:14 +00:00
|
|
|
repeated SimpleUserInfo data = 1;
|
2024-07-30 10:31:26 +00:00
|
|
|
}
|