auth.proto 758 B

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