feat: add user proto
This commit is contained in:
@@ -3,7 +3,7 @@ syntax = "proto3";
|
||||
package slug;
|
||||
|
||||
option go_package = "./gen";
|
||||
|
||||
import "user.proto";
|
||||
service EventService {
|
||||
rpc Subscribe(stream Client) returns (stream Controller);
|
||||
}
|
||||
@@ -12,6 +12,7 @@ enum EventType {
|
||||
AUTHENTICATION = 0;
|
||||
SLUG_CHANGE = 1;
|
||||
SLUG_CHANGE_RESPONSE = 2;
|
||||
GET_SESSIONS = 3;
|
||||
}
|
||||
|
||||
message Controller {
|
||||
@@ -19,6 +20,7 @@ message Controller {
|
||||
|
||||
oneof payload {
|
||||
SlugChangeEvent slug_event = 11;
|
||||
GetSessionsEvent get_sessions_event = 12;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +30,7 @@ message Client {
|
||||
oneof payload {
|
||||
Authentication auth_event = 10;
|
||||
SlugChangeEventResponse slug_event_response = 11;
|
||||
GetSessionsResponse get_sessions_event = 12;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,3 +48,7 @@ message SlugChangeEventResponse {
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message GetSessionsEvent {
|
||||
string identity = 1;
|
||||
}
|
||||
44
proto/user.proto
Normal file
44
proto/user.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slug;
|
||||
|
||||
option go_package = "./gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service UserService {
|
||||
rpc Check(CheckRequest) returns (CheckResponse);
|
||||
}
|
||||
|
||||
service UserSessions {
|
||||
rpc GetSession(GetSessionRequest) returns (GetSessionsResponse);
|
||||
}
|
||||
|
||||
enum AuthorizationResponse {
|
||||
MESSAGE_TYPE_AUTHORIZED= 0;
|
||||
MESSAGE_TYPE_UNAUTHORIZED = 1;
|
||||
}
|
||||
|
||||
message CheckRequest {
|
||||
string auth_token = 1;
|
||||
}
|
||||
|
||||
message CheckResponse {
|
||||
AuthorizationResponse response = 1;
|
||||
}
|
||||
|
||||
message GetSessionRequest {
|
||||
string identity = 1;
|
||||
}
|
||||
|
||||
message GetSessionsResponse {
|
||||
repeated Detail details = 1;
|
||||
}
|
||||
|
||||
message Detail {
|
||||
string forwarding_type = 1;
|
||||
string slug = 2;
|
||||
string user_id = 3;
|
||||
bool active = 4;
|
||||
google.protobuf.Timestamp started_at = 5;
|
||||
}
|
||||
Reference in New Issue
Block a user