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

This commit is contained in:
刘祥超
2021-02-06 17:37:27 +08:00
parent 310872f1d6
commit 6b2cbc2939
12 changed files with 1529 additions and 32 deletions

View File

@@ -35,12 +35,13 @@ type CreateIPItemRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` // IP列表ID
IpFrom string `protobuf:"bytes,2,opt,name=ipFrom,proto3" json:"ipFrom,omitempty"` // 开始IP
IpTo string `protobuf:"bytes,3,opt,name=ipTo,proto3" json:"ipTo,omitempty"` // 结束IP可选
ExpiredAt int64 `protobuf:"varint,4,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` // 过期时间戳(可选)
Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"` // 加入理由(可选)
Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` // 类型
IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` // IP列表ID
IpFrom string `protobuf:"bytes,2,opt,name=ipFrom,proto3" json:"ipFrom,omitempty"` // 开始IP
IpTo string `protobuf:"bytes,3,opt,name=ipTo,proto3" json:"ipTo,omitempty"` // 结束IP可选
ExpiredAt int64 `protobuf:"varint,4,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` // 过期时间戳(可选)
Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"` // 加入理由(可选)
Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` // 类型
EventLevel string `protobuf:"bytes,7,opt,name=eventLevel,proto3" json:"eventLevel,omitempty"` // 级别
}
func (x *CreateIPItemRequest) Reset() {
@@ -117,6 +118,13 @@ func (x *CreateIPItemRequest) GetType() string {
return ""
}
func (x *CreateIPItemRequest) GetEventLevel() string {
if x != nil {
return x.EventLevel
}
return ""
}
type CreateIPItemResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -170,12 +178,13 @@ type UpdateIPItemRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IpItemId int64 `protobuf:"varint,1,opt,name=ipItemId,proto3" json:"ipItemId,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"`
ExpiredAt int64 `protobuf:"varint,4,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"`
Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"`
Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` // 类型
IpItemId int64 `protobuf:"varint,1,opt,name=ipItemId,proto3" json:"ipItemId,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"`
ExpiredAt int64 `protobuf:"varint,4,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"`
Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"`
Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` // 类型
EventLevel string `protobuf:"bytes,7,opt,name=eventLevel,proto3" json:"eventLevel,omitempty"` // 级别
}
func (x *UpdateIPItemRequest) Reset() {
@@ -252,6 +261,13 @@ func (x *UpdateIPItemRequest) GetType() string {
return ""
}
func (x *UpdateIPItemRequest) GetEventLevel() string {
if x != nil {
return x.EventLevel
}
return ""
}
// 删除IP
type DeleteIPItemRequest struct {
state protoimpl.MessageState
@@ -665,7 +681,7 @@ var file_service_ip_item_proto_rawDesc = []byte{
0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 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, 0x22, 0xa7, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49,
0x74, 0x6f, 0x22, 0xc7, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49,
0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70,
0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70,
0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d,
@@ -675,11 +691,13 @@ var file_service_ip_item_proto_rawDesc = []byte{
0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74,
0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x32, 0x0a, 0x14,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a,
0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x32, 0x0a, 0x14,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64,
0x22, 0xa7, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65,
0x22, 0xc7, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65,
0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x49, 0x74,
0x65, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x49, 0x74,
0x65, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x02,
@@ -689,7 +707,9 @@ var file_service_ip_item_proto_rawDesc = []byte{
0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16,
0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x31, 0x0a, 0x13, 0x44, 0x65,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x76,
0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x65, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x31, 0x0a, 0x13, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0x3b, 0x0a,