增加IP级别和WAF动作相关接口和配置

This commit is contained in:
GoEdgeLab
2021-02-06 17:37:27 +08:00
parent 1b9ec59db4
commit 662ee4b4a7
12 changed files with 1529 additions and 32 deletions

View File

@@ -30,15 +30,17 @@ type IPItem struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IpFrom string `protobuf:"bytes,2,opt,name=ipFrom,proto3" json:"ipFrom,omitempty"`
IpTo string `protobuf:"bytes,3,opt,name=ipTo,proto3" json:"ipTo,omitempty"`
Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
ExpiredAt int64 `protobuf:"varint,5,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"`
Reason string `protobuf:"bytes,6,opt,name=reason,proto3" json:"reason,omitempty"`
ListId int64 `protobuf:"varint,7,opt,name=listId,proto3" json:"listId,omitempty"`
IsDeleted bool `protobuf:"varint,8,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Type string `protobuf:"bytes,9,opt,name=type,proto3" json:"type,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IpFrom string `protobuf:"bytes,2,opt,name=ipFrom,proto3" json:"ipFrom,omitempty"`
IpTo string `protobuf:"bytes,3,opt,name=ipTo,proto3" json:"ipTo,omitempty"`
Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
ExpiredAt int64 `protobuf:"varint,5,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"`
Reason string `protobuf:"bytes,6,opt,name=reason,proto3" json:"reason,omitempty"`
ListId int64 `protobuf:"varint,7,opt,name=listId,proto3" json:"listId,omitempty"`
IsDeleted bool `protobuf:"varint,8,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Type string `protobuf:"bytes,9,opt,name=type,proto3" json:"type,omitempty"`
EventLevel string `protobuf:"bytes,10,opt,name=eventLevel,proto3" json:"eventLevel,omitempty"` // 级别
ListType string `protobuf:"bytes,11,opt,name=listType,proto3" json:"listType,omitempty"` // 所在名单类型加此字段是为了快速定位IP的性质
}
func (x *IPItem) Reset() {
@@ -136,12 +138,26 @@ func (x *IPItem) GetType() string {
return ""
}
func (x *IPItem) GetEventLevel() string {
if x != nil {
return x.EventLevel
}
return ""
}
func (x *IPItem) GetListType() string {
if x != nil {
return x.ListType
}
return ""
}
var File_models_model_ip_item_proto protoreflect.FileDescriptor
var file_models_model_ip_item_proto_rawDesc = []byte{
0x0a, 0x1a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69,
0x70, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62,
0x22, 0xde, 0x01, 0x0a, 0x06, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x22, 0x9a, 0x02, 0x0a, 0x06, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69,
0x70, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x70, 0x46,
0x72, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x70, 0x54, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28,
@@ -155,8 +171,11 @@ var file_models_model_ip_item_proto_rawDesc = []byte{
0x1c, 0x0a, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01,
0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70,
0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65,
0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (