api.proto 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. syntax = "proto3";
  2. package live.riskcontrol.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. // GetForbiddenReq
  6. message GetForbiddenReq {
  7. int64 uid = 1 [(gogoproto.moretags) = 'form:"uid" validate:"required"'];
  8. string uri = 2 [(gogoproto.moretags) = 'form:"uri" validate:"required"'];
  9. string ip = 3 [(gogoproto.moretags) = 'form:"ip" validate:"required"'];
  10. string method = 4 [(gogoproto.moretags) = 'form:"method" validate:"required"'];
  11. map<string,string> header = 5 [(gogoproto.moretags) = 'form:"header" validate:"required"'];
  12. string body = 6 [(gogoproto.moretags) = 'form:"body" validate:"required"'];
  13. }
  14. // GetForbiddenReply
  15. message GetForbiddenReply {
  16. enum ForbiddenRes {
  17. PASS = 0;
  18. FORBIDDEN = 1;
  19. DOUBT = 2;
  20. }
  21. ForbiddenRes is_forbidden = 1 [(gogoproto.jsontag) = "is_forbidden"];
  22. bool is_cache = 2 [(gogoproto.jsontag) = "is_cache"];
  23. string reason = 3 [(gogoproto.jsontag) = "reason"];
  24. }
  25. service IsForbidden {
  26. rpc GetForbidden(GetForbiddenReq) returns (GetForbiddenReply);
  27. }