pws reset

This commit is contained in:
Priec
2026-08-11 08:40:49 +02:00
parent 8ddabf78f6
commit 71106a04cb
20 changed files with 323 additions and 136 deletions

View File

@@ -7,8 +7,8 @@ import "common.proto";
service AuthService {
rpc Register(RegisterRequest) returns (AuthResponse);
rpc Login(LoginRequest) returns (LoginResponse);
// Claims a bootstrap account that has never had a password set.
rpc SetInitialPassword(SetInitialPasswordRequest) returns (AuthResponse);
// Changes the authenticated user's password after verifying the current one.
rpc ChangePassword(ChangePasswordRequest) returns (PasswordOperationResponse);
rpc GetAuthorization(GetAuthorizationRequest) returns (AuthorizationSnapshot);
rpc SetTimezone(SetTimezoneRequest) returns (UserPreferences);
@@ -26,6 +26,8 @@ service AuthService {
// User administration.
rpc AssignUserRole(AssignUserRoleRequest) returns (UserSummary);
// Resets a lower-ranked user's password.
rpc ResetUserPassword(ResetUserPasswordRequest) returns (PasswordOperationResponse);
rpc ListUsers(ListUsersRequest) returns (ListUsersResponse);
}
@@ -45,12 +47,14 @@ message AuthResponse {
string role = 4; // Always 'guest' for a self-registration
}
message SetInitialPasswordRequest {
string username = 1;
string password = 2;
string password_confirmation = 3;
message ChangePasswordRequest {
string current_password = 1;
string new_password = 2;
string new_password_confirmation = 3;
}
message PasswordOperationResponse {}
message LoginRequest {
string identifier = 1; // Can be username or email
string password = 2;
@@ -175,6 +179,12 @@ message AssignUserRoleRequest {
string role = 2;
}
message ResetUserPasswordRequest {
string username = 1;
string new_password = 2;
string new_password_confirmation = 3;
}
message UserSummary {
string id = 1;
string username = 2;