auth.proto 708 B

12345678910111213141516171819202122232425262728293031323334353637
  1. syntax = "proto3";
  2. package pb;
  3. import "google/api/annotations.proto";
  4. import "user.proto";
  5. message AuthStatusRequest {
  6. }
  7. message AuthAuthenticateRequest {
  8. string username = 1;
  9. string password = 2;
  10. }
  11. service AuthService {
  12. rpc Status (AuthStatusRequest) returns (AuthStatusResponse) {
  13. option (google.api.http) = {
  14. get: "/api/v1/auth/status"
  15. //body: "*"
  16. };}
  17. rpc Authenticate (AuthAuthenticateRequest) returns (AuthAuthenticateResponse) {
  18. option (google.api.http) = {
  19. post: "/api/v1/auth/authenticate"
  20. body: "*"
  21. };}
  22. }
  23. message AuthStatusResponse {
  24. UserResponse.User user = 1;
  25. bool is_root = 2;
  26. }
  27. message AuthAuthenticateResponse {
  28. string token = 1;
  29. }