rbac from the server used in the client from now on

This commit is contained in:
Priec
2026-07-09 22:34:40 +02:00
parent 1fe8e3e241
commit 025e03ee16
3 changed files with 109 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import "common.proto";
service AuthService {
rpc Register(RegisterRequest) returns (AuthResponse);
rpc Login(LoginRequest) returns (LoginResponse);
rpc GetAuthorization(GetAuthorizationRequest) returns (AuthorizationSnapshot);
}
message RegisterRequest {
@@ -36,4 +37,17 @@ message LoginResponse {
string user_id = 4; // User's UUID in string format
string role = 5; // User's role
string username = 6;
AuthorizationSnapshot authorization = 7;
}
message GetAuthorizationRequest {}
message Permission {
string resource = 1;
string action = 2;
}
message AuthorizationSnapshot {
string role = 1;
repeated Permission permissions = 2;
}