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.

69 lines
1.1 KiB

1 year ago
1 year ago
1 year ago
1 year ago
  1. syntax = "proto3";
  2. package users;
  3. option go_package = "git.chrishayward.xyz/x/users/proto";
  4. service Users {
  5. rpc Register (RegisterRequest) returns (RegisterResponse) {}
  6. rpc Login (LoginRequest) returns (LoginResponse) {}
  7. rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse) {}
  8. rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) {}
  9. rpc ResetPassword (ResetPasswordReqeust) returns (ResetPasswordResponse) {}
  10. }
  11. message UserForm {
  12. string email = 1;
  13. optional string password = 2;
  14. optional string password_again = 3;
  15. }
  16. message UserToken {
  17. string token = 1;
  18. optional int64 expires = 2;
  19. }
  20. message UserInfo {
  21. int64 id = 1;
  22. }
  23. message RegisterRequest {
  24. UserForm form = 1;
  25. }
  26. message RegisterResponse {
  27. }
  28. message LoginRequest {
  29. UserForm form = 1;
  30. }
  31. message LoginResponse {
  32. UserToken token = 1;
  33. }
  34. message AuthorizeRequest {
  35. string secret = 1;
  36. UserToken token = 2;
  37. }
  38. message AuthorizeResponse {
  39. UserInfo user = 1;
  40. }
  41. message ChangePasswordRequest {
  42. UserForm form = 1;
  43. }
  44. message ChangePasswordResponse {
  45. }
  46. message ResetPasswordReqeust {
  47. UserForm form = 1;
  48. }
  49. message ResetPasswordResponse {
  50. }