- update: schema now sets the skills column to prevent a crash

- update: frontend to only pass the session id
- update: launcher to pass the session correctly
- update: validate session response now returns the session id and user id to the requester
- update: auth client based on session id instead of a jwt token
This commit is contained in:
2025-03-08 13:47:53 -05:00
parent b6f2d3f456
commit 8ba8fce20b
13 changed files with 151 additions and 79 deletions

View File

@@ -5,74 +5,76 @@ package auth;
import "common.proto";
service AuthService {
rpc Login(LoginRequest) returns (LoginResponse);
rpc Logout(LogoutRequest) returns (common.Empty);
rpc ValidateToken(ValidateTokenRequest) returns (ValidateTokenResponse);
rpc ValidateSession(ValidateSessionRequest) returns (ValidateSessionResponse);
rpc RefreshSession(ValidateSessionRequest) returns (ValidateSessionResponse);
rpc Register (RegisterRequest) returns (RegisterResponse);
rpc RequestPasswordReset (PasswordResetRequest) returns (PasswordResetResponse);
rpc ResetPassword (ResetPasswordRequest) returns (ResetPasswordResponse);
rpc Login(LoginRequest) returns (LoginResponse);
rpc Logout(LogoutRequest) returns (common.Empty);
rpc ValidateToken(ValidateTokenRequest) returns (ValidateTokenResponse);
rpc ValidateSession(ValidateSessionRequest) returns (ValidateSessionResponse);
rpc RefreshSession(ValidateSessionRequest) returns (ValidateSessionResponse);
rpc Register (RegisterRequest) returns (RegisterResponse);
rpc RequestPasswordReset (PasswordResetRequest) returns (PasswordResetResponse);
rpc ResetPassword (ResetPasswordRequest) returns (ResetPasswordResponse);
}
message LoginRequest {
string username = 1;
string password = 2;
string ip_address = 3;
string username = 1;
string password = 2;
string ip_address = 3;
}
message LoginResponse {
string token = 1;
string user_id = 2;
string session_id = 3;
string token = 1;
string user_id = 2;
string session_id = 3;
}
message LogoutRequest {
string session_id = 1;
string session_id = 1;
}
message ValidateTokenRequest {
string token = 1;
string token = 1;
}
message ValidateTokenResponse {
bool valid = 1;
string user_id = 2;
string session_id = 3;
bool valid = 1;
string user_id = 2;
string session_id = 3;
}
message ValidateSessionRequest {
string session_id = 1;
string session_id = 1;
}
message ValidateSessionResponse {
bool valid = 1;
bool valid = 1;
string session_id = 2;
string user_id = 3;
}
message RegisterRequest {
string username = 1;
string email = 2;
string password = 3;
string username = 1;
string email = 2;
string password = 3;
}
message RegisterResponse {
int32 user_id = 1;
string message = 2;
int32 user_id = 1;
string message = 2;
}
message PasswordResetRequest {
string email = 1;
string email = 1;
}
message PasswordResetResponse {
string message = 1;
string message = 1;
}
message ResetPasswordRequest {
string reset_token = 1;
string new_password = 2;
string reset_token = 1;
string new_password = 2;
}
message ResetPasswordResponse {
string message = 1;
string message = 1;
}

View File

@@ -62,6 +62,10 @@ message Location {
int32 spawn_id = 4;
}
message Skill {
int32 id = 1;
}
message Character {
string character_id = 1; // Unique ID for the character
string name = 2; // Name of the character
@@ -78,6 +82,6 @@ message CharacterFull {
Location position = 3; // Character's position
Looks looks = 4; // Character's Looks
Stats stats = 5; // Character's stats
repeated int32 skills = 6; // Character's skills
repeated Skill skills = 6; // Character's skills
repeated Item items = 7; // Character inventory
}