api.proto 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // 此服务为账号内部服务,禁止所有外部服务调用
  2. // 账号外部业务请使用identify service
  3. syntax = "proto3";
  4. package passport.service.auth.v1;
  5. option go_package = "v1";
  6. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  7. // GetCookieInfoReq request param for rpc CookieInfo
  8. message GetCookieInfoReq {
  9. // all user cookie of HTTP request
  10. // example: 'SESSDATA=DEE4597D836A5A9DA29DFC1AB1EFFDEB;sid=exampleSID'
  11. string cookie = 1;
  12. }
  13. // GetCookieInfoReply reply val for rpc CookieInfo
  14. message GetCookieInfoReply {
  15. // 用户是否登录
  16. bool is_login = 1 [(gogoproto.jsontag) = "is_login"];
  17. // user mid
  18. int64 mid = 2 [(gogoproto.jsontag) = "mid"];
  19. // cookie csrf
  20. // when token reqest this field is empty
  21. string csrf = 3 [(gogoproto.jsontag) = "csrfToken"];
  22. // expire time(unix timestamp)
  23. int64 expires = 4 [(gogoproto.jsontag) = "expires"];
  24. }
  25. // GetTokenInfoReq request param for rpc TokenInfo
  26. message GetTokenInfoReq {
  27. // user access token
  28. string token = 1;
  29. }
  30. // GetTokenInfoReply reply val for rpc TokenInfo
  31. message GetTokenInfoReply {
  32. // 用户是否登录
  33. bool is_login = 1 [(gogoproto.jsontag) = "is_login"];
  34. // user mid
  35. int64 mid = 2 [(gogoproto.jsontag) = "mid"];
  36. // cookie csrf
  37. // when token reqest this field is empty
  38. string csrf = 3 [(gogoproto.jsontag) = "csrfToken"];
  39. // expire time(unix timestamp)
  40. int64 expires = 4 [(gogoproto.jsontag) = "expires"];
  41. }
  42. service Auth {
  43. // GetCookieInfo verify user info by cookie.
  44. rpc GetCookieInfo (GetCookieInfoReq) returns (GetCookieInfoReply);
  45. // GetTokenInfo verify user info by token.
  46. rpc GetTokenInfo (GetTokenInfoReq) returns (GetTokenInfoReply);
  47. }