Skip to content

Commit

Permalink
feat(tiphereth): add RegisterUser
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Mar 11, 2024
1 parent d85e3a3 commit 1279631
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proto/librarian/sephirah/v1/sephirah.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ service LibrarianSephirahService {
// `Tiphereth` `Porter` Get access_token of another user with allowed privilege
rpc GainUserPrivilege(GainUserPrivilegeRequest) returns (GainUserPrivilegeResponse);

// `Tiphereth` Self register as a new normal user
rpc RegisterUser(RegisterUserRequest) returns (RegisterUserResponse);
// `Tiphereth` `Normal` Client should register device after the first login
// and store the device_id locally.
// The server could add extra limits to non-registered device
Expand Down
23 changes: 23 additions & 0 deletions proto/librarian/sephirah/v1/tiphereth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ message GainUserPrivilegeResponse {
string access_token = 1;
}

message RegisterUserRequest {
string username = 1;
string password = 2;
message Captcha {
string id = 1;
string value = 2;
}
optional Captcha captcha = 3;
}

message RegisterUserResponse {
message ImageCaptcha {
string id = 1;
bytes image = 2;
}
oneof stage {
// If captcha required
ImageCaptcha captcha = 1;
// If register success
string refresh_token = 2;
}
}

message RegisterDeviceRequest {
DeviceInfo device_info = 1;
}
Expand Down

0 comments on commit 1279631

Please sign in to comment.