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

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
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 ResetPassword (ResetPasswordRequest) returns (ResetPasswordResponse) {}
  9. rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) {}
  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 ResetPasswordRequest {
  42. UserForm form = 1;
  43. }
  44. message ResetPasswordResponse {
  45. UserToken token = 1;
  46. }
  47. message ChangePasswordRequest {
  48. UserToken token = 1;
  49. UserForm form = 2;
  50. }
  51. message ChangePasswordResponse {
  52. }