api.proto 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // +bili:type=service
  2. // Code generated by warden.
  3. syntax = "proto3";
  4. package passport.service.identify.v1;
  5. option go_package = "v1";
  6. option (gogoproto.goproto_stringer_all) = false;
  7. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  8. // CookieReq request param for rpc CookieInfo
  9. message GetCookieInfoReq {
  10. // all user cookie of HTTP request
  11. // example: 'SESSDATA=DEE4597D836A5A9DA29DFC1AB1EFFDEB;sid=exampleSID'
  12. string cookie = 1;
  13. }
  14. // CookieReply reply val for rpc CookieInfo
  15. message GetCookieInfoReply {
  16. // 用户是否登录
  17. bool is_login = 1 [(gogoproto.jsontag) = "is_login"];
  18. // user mid
  19. int64 mid = 2 [(gogoproto.jsontag) = "mid"];
  20. // cookie csrf
  21. // when token reqest this field is empty
  22. string csrf = 3 [(gogoproto.jsontag) = "csrfToken"];
  23. // expire time(unix timestamp)
  24. int32 expires = 4 [(gogoproto.jsontag) = "expires"];
  25. }
  26. // TokenReq request param for rpc TokenInfo
  27. message GetTokenInfoReq {
  28. // user access token
  29. string token = 1 [(gogoproto.moretags) = "form:\"access_key\" validate:\"required\""];
  30. // buvid
  31. string buvid = 2 [(gogoproto.moretags) = "form:\"buvid\""];
  32. }
  33. // TokenReply reply val for rpc TokenInfo
  34. message GetTokenInfoReply {
  35. // 用户是否登录
  36. bool is_login = 1 [(gogoproto.jsontag) = "is_login"];
  37. // user mid
  38. int64 mid = 2 [(gogoproto.jsontag) = "mid"];
  39. // cookie csrf
  40. // when token reqest this field is empty
  41. string csrf = 3 [(gogoproto.jsontag) = "csrfToken"];
  42. // expire time(unix timestamp)
  43. int32 expires = 4 [(gogoproto.jsontag) = "expires"];
  44. }
  45. service Identify {
  46. // CookieInfo identify info by cookie.
  47. rpc GetCookieInfo (GetCookieInfoReq) returns (GetCookieInfoReply);
  48. // TokenInfo identify info by token.
  49. rpc GetTokenInfo (GetTokenInfoReq) returns (GetTokenInfoReply);
  50. }