39 lines
923 B
Protocol Buffer
39 lines
923 B
Protocol Buffer
|
syntax = "proto3";
|
||
|
|
||
|
package auth;
|
||
|
|
||
|
option go_package = "yash.sso.v1;ssov1";
|
||
|
|
||
|
service Auth {
|
||
|
rpc Register (RegisterRequest) returns (RegisterResponse);
|
||
|
rpc Login (LoginRequest) returns (LoginResponse);
|
||
|
rpc IsAdmin (IsAdminRequest) returns (IsAdminResponse);
|
||
|
}
|
||
|
|
||
|
message RegisterRequest {
|
||
|
string email = 1; // Email of the user to register
|
||
|
string password = 2; // User ID of the registered user
|
||
|
}
|
||
|
|
||
|
message RegisterResponse {
|
||
|
int64 user_id = 1; // User ID of the registered user.
|
||
|
}
|
||
|
|
||
|
message LoginRequest {
|
||
|
string email = 1; // Email of the user to login.
|
||
|
string password = 2; // Password of the user to login.
|
||
|
int32 app_id = 3; // ID of the app to login to.
|
||
|
}
|
||
|
|
||
|
message LoginResponse {
|
||
|
string token = 1; // Auth token of the logged in user.
|
||
|
}
|
||
|
|
||
|
message IsAdminRequest {
|
||
|
int64 user_id = 1; // User ID to validate
|
||
|
}
|
||
|
|
||
|
message IsAdminResponse {
|
||
|
bool is_admin = 1; // Indicates whether the user is an admin.
|
||
|
}
|