You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.2 KiB
70 lines
1.2 KiB
syntax = "proto3";
|
|
|
|
package users;
|
|
|
|
option go_package = "git.chrishayward.xyz/x/users/proto";
|
|
|
|
service Users {
|
|
rpc Register (RegisterRequest) returns (RegisterResponse) {}
|
|
rpc Login (LoginRequest) returns (LoginResponse) {}
|
|
rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse) {}
|
|
rpc ResetPassword (ResetPasswordRequest) returns (ResetPasswordResponse) {}
|
|
rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) {}
|
|
}
|
|
|
|
message UserForm {
|
|
string email = 1;
|
|
optional string password = 2;
|
|
optional string password_again = 3;
|
|
}
|
|
|
|
message UserToken {
|
|
string token = 1;
|
|
optional int64 expires = 2;
|
|
}
|
|
|
|
message UserInfo {
|
|
int64 id = 1;
|
|
}
|
|
|
|
message RegisterRequest {
|
|
UserForm form = 1;
|
|
}
|
|
|
|
message RegisterResponse {
|
|
|
|
}
|
|
|
|
message LoginRequest {
|
|
UserForm form = 1;
|
|
}
|
|
|
|
message LoginResponse {
|
|
UserToken token = 1;
|
|
}
|
|
|
|
message AuthorizeRequest {
|
|
string secret = 1;
|
|
UserToken token = 2;
|
|
}
|
|
|
|
message AuthorizeResponse {
|
|
UserInfo user = 1;
|
|
}
|
|
|
|
message ResetPasswordRequest {
|
|
UserForm form = 1;
|
|
}
|
|
|
|
message ResetPasswordResponse {
|
|
UserToken token = 1;
|
|
}
|
|
|
|
message ChangePasswordRequest {
|
|
UserToken token = 1;
|
|
UserForm form = 2;
|
|
}
|
|
|
|
message ChangePasswordResponse {
|
|
|
|
}
|