auth.proto 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. syntax = "proto3";
  2. package passport.service.auth;
  3. option go_package = "model";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. // AuthReply auth reply
  6. message AuthReply {
  7. // if cookie or token in life time, login is true
  8. // else login is false and mid csrf expires is empty
  9. bool Login = 1 [(gogoproto.jsontag) = "login"];
  10. // user identify id
  11. int64 Mid = 2 [(gogoproto.jsontag) = "mid"];
  12. // use cookie request this field will return
  13. // use token request ignore this field
  14. string CSRF = 3 [(gogoproto.jsontag) = "csrf_token"];
  15. // expiration date
  16. // unix timestamp
  17. int64 Expires = 4 [(gogoproto.jsontag) = "expires"];
  18. }
  19. message Cookie {
  20. int64 Mid = 1 [(gogoproto.jsontag) = "mid"];
  21. string Session = 2 [(gogoproto.jsontag) = "session"];
  22. string CSRF = 3 [(gogoproto.jsontag) = "csrf"];
  23. int64 Type = 4 [(gogoproto.jsontag) = "type"];
  24. int64 Expires = 5 [(gogoproto.jsontag) = "expires"];
  25. }
  26. message Token {
  27. int64 Mid = 1 [(gogoproto.jsontag) = "mid"];
  28. int32 AppID = 2 [(gogoproto.jsontag) = "appid"];
  29. string Token = 3 [(gogoproto.jsontag) = "token"];
  30. int64 Type = 4 [(gogoproto.jsontag) = "type"];
  31. int64 Expires = 5 [(gogoproto.jsontag) = "expires"];
  32. }
  33. message Refresh {
  34. int64 Mid = 1 [(gogoproto.jsontag) = "mid"];
  35. int32 AppID = 2 [(gogoproto.jsontag) = "appid"];
  36. string Refresh = 3 [(gogoproto.jsontag) = "refresh"];
  37. string Token = 4 [(gogoproto.jsontag) = "token"];
  38. int64 Expires = 5 [(gogoproto.jsontag) = "expires"];
  39. }