实现WAF部分功能

This commit is contained in:
GoEdgeLab
2020-10-08 11:11:29 +08:00
parent 0b50f7beec
commit 5d6e7bd28d
12 changed files with 1215 additions and 38 deletions

View File

@@ -363,6 +363,62 @@ func (x *FindHTTPFirewallRuleGroupConfigResponse) GetFirewallRuleGroupJSON() []b
return nil
}
// 修改分组的规则集
type UpdateHTTPFirewallRuleGroupSetsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FirewallRuleGroupId int64 `protobuf:"varint,1,opt,name=firewallRuleGroupId,proto3" json:"firewallRuleGroupId,omitempty"`
FirewallRuleSetsJSON []byte `protobuf:"bytes,2,opt,name=firewallRuleSetsJSON,proto3" json:"firewallRuleSetsJSON,omitempty"`
}
func (x *UpdateHTTPFirewallRuleGroupSetsRequest) Reset() {
*x = UpdateHTTPFirewallRuleGroupSetsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_firewall_rule_group_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPFirewallRuleGroupSetsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPFirewallRuleGroupSetsRequest) ProtoMessage() {}
func (x *UpdateHTTPFirewallRuleGroupSetsRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_http_firewall_rule_group_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateHTTPFirewallRuleGroupSetsRequest.ProtoReflect.Descriptor instead.
func (*UpdateHTTPFirewallRuleGroupSetsRequest) Descriptor() ([]byte, []int) {
return file_service_http_firewall_rule_group_proto_rawDescGZIP(), []int{6}
}
func (x *UpdateHTTPFirewallRuleGroupSetsRequest) GetFirewallRuleGroupId() int64 {
if x != nil {
return x.FirewallRuleGroupId
}
return 0
}
func (x *UpdateHTTPFirewallRuleGroupSetsRequest) GetFirewallRuleSetsJSON() []byte {
if x != nil {
return x.FirewallRuleSetsJSON
}
return nil
}
var File_service_http_firewall_rule_group_proto protoreflect.FileDescriptor
var file_service_http_firewall_rule_group_proto_rawDesc = []byte{
@@ -411,37 +467,52 @@ var file_service_http_firewall_rule_group_proto_rawDesc = []byte{
0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x15, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52,
0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x15, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x32, 0xcc, 0x03, 0x0a, 0x1c, 0x48, 0x54,
0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72,
0x6f, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x1f, 0x75, 0x70,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x8e, 0x01, 0x0a, 0x26, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c,
0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x73, 0x4f, 0x6e, 0x12, 0x2a, 0x2e,
0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72,
0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x73,
0x4f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52,
0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12,
0x6e, 0x0a, 0x1b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72,
0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x26,
0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69,
0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75,
0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x5b, 0x0a, 0x1b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72,
0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x26,
0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x13, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c,
0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x13, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47,
0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x14, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61,
0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x66, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75,
0x6c, 0x65, 0x53, 0x65, 0x74, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x32, 0xb1, 0x04, 0x0a, 0x1c, 0x48,
0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47,
0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x1f, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c,
0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x73, 0x4f, 0x6e, 0x12, 0x2a,
0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69,
0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x7a, 0x0a, 0x1f,
0x66, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c,
0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
0x2a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72,
0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x62,
0x2e, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c,
0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49,
0x73, 0x4f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e,
0x52, 0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
0x12, 0x6e, 0x0a, 0x1b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69,
0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12,
0x26, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46,
0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52,
0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x5b, 0x0a, 0x1b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69,
0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12,
0x26, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46,
0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x7a, 0x0a,
0x1f, 0x66, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c,
0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x12, 0x2a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69,
0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70,
0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61,
0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x1f, 0x75, 0x70, 0x64,
0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65, 0x77, 0x61, 0x6c, 0x6c, 0x52,
0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x74, 0x73, 0x12, 0x2a, 0x2e, 0x70,
0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x46, 0x69, 0x72, 0x65,
0x77, 0x61, 0x6c, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x74,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50,
0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -456,7 +527,7 @@ func file_service_http_firewall_rule_group_proto_rawDescGZIP() []byte {
return file_service_http_firewall_rule_group_proto_rawDescData
}
var file_service_http_firewall_rule_group_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_service_http_firewall_rule_group_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_service_http_firewall_rule_group_proto_goTypes = []interface{}{
(*UpdateHTTPFirewallRuleGroupIsOnRequest)(nil), // 0: pb.UpdateHTTPFirewallRuleGroupIsOnRequest
(*CreateHTTPFirewallRuleGroupRequest)(nil), // 1: pb.CreateHTTPFirewallRuleGroupRequest
@@ -464,19 +535,22 @@ var file_service_http_firewall_rule_group_proto_goTypes = []interface{}{
(*UpdateHTTPFirewallRuleGroupRequest)(nil), // 3: pb.UpdateHTTPFirewallRuleGroupRequest
(*FindHTTPFirewallRuleGroupConfigRequest)(nil), // 4: pb.FindHTTPFirewallRuleGroupConfigRequest
(*FindHTTPFirewallRuleGroupConfigResponse)(nil), // 5: pb.FindHTTPFirewallRuleGroupConfigResponse
(*RPCUpdateSuccess)(nil), // 6: pb.RPCUpdateSuccess
(*UpdateHTTPFirewallRuleGroupSetsRequest)(nil), // 6: pb.UpdateHTTPFirewallRuleGroupSetsRequest
(*RPCUpdateSuccess)(nil), // 7: pb.RPCUpdateSuccess
}
var file_service_http_firewall_rule_group_proto_depIdxs = []int32{
0, // 0: pb.HTTPFirewallRuleGroupService.updateHTTPFirewallRuleGroupIsOn:input_type -> pb.UpdateHTTPFirewallRuleGroupIsOnRequest
1, // 1: pb.HTTPFirewallRuleGroupService.createHTTPFirewallRuleGroup:input_type -> pb.CreateHTTPFirewallRuleGroupRequest
3, // 2: pb.HTTPFirewallRuleGroupService.updateHTTPFirewallRuleGroup:input_type -> pb.UpdateHTTPFirewallRuleGroupRequest
4, // 3: pb.HTTPFirewallRuleGroupService.findHTTPFirewallRuleGroupConfig:input_type -> pb.FindHTTPFirewallRuleGroupConfigRequest
6, // 4: pb.HTTPFirewallRuleGroupService.updateHTTPFirewallRuleGroupIsOn:output_type -> pb.RPCUpdateSuccess
2, // 5: pb.HTTPFirewallRuleGroupService.createHTTPFirewallRuleGroup:output_type -> pb.CreateHTTPFirewallRuleGroupResponse
6, // 6: pb.HTTPFirewallRuleGroupService.updateHTTPFirewallRuleGroup:output_type -> pb.RPCUpdateSuccess
5, // 7: pb.HTTPFirewallRuleGroupService.findHTTPFirewallRuleGroupConfig:output_type -> pb.FindHTTPFirewallRuleGroupConfigResponse
4, // [4:8] is the sub-list for method output_type
0, // [0:4] is the sub-list for method input_type
6, // 4: pb.HTTPFirewallRuleGroupService.updateHTTPFirewallRuleGroupSets:input_type -> pb.UpdateHTTPFirewallRuleGroupSetsRequest
7, // 5: pb.HTTPFirewallRuleGroupService.updateHTTPFirewallRuleGroupIsOn:output_type -> pb.RPCUpdateSuccess
2, // 6: pb.HTTPFirewallRuleGroupService.createHTTPFirewallRuleGroup:output_type -> pb.CreateHTTPFirewallRuleGroupResponse
7, // 7: pb.HTTPFirewallRuleGroupService.updateHTTPFirewallRuleGroup:output_type -> pb.RPCUpdateSuccess
5, // 8: pb.HTTPFirewallRuleGroupService.findHTTPFirewallRuleGroupConfig:output_type -> pb.FindHTTPFirewallRuleGroupConfigResponse
7, // 9: pb.HTTPFirewallRuleGroupService.updateHTTPFirewallRuleGroupSets:output_type -> pb.RPCUpdateSuccess
5, // [5:10] is the sub-list for method output_type
0, // [0:5] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
@@ -561,6 +635,18 @@ func file_service_http_firewall_rule_group_proto_init() {
return nil
}
}
file_service_http_firewall_rule_group_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPFirewallRuleGroupSetsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -568,7 +654,7 @@ func file_service_http_firewall_rule_group_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_http_firewall_rule_group_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
@@ -602,6 +688,8 @@ type HTTPFirewallRuleGroupServiceClient interface {
UpdateHTTPFirewallRuleGroup(ctx context.Context, in *UpdateHTTPFirewallRuleGroupRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error)
// 获取分组配置
FindHTTPFirewallRuleGroupConfig(ctx context.Context, in *FindHTTPFirewallRuleGroupConfigRequest, opts ...grpc.CallOption) (*FindHTTPFirewallRuleGroupConfigResponse, error)
// 修改分组的规则集
UpdateHTTPFirewallRuleGroupSets(ctx context.Context, in *UpdateHTTPFirewallRuleGroupSetsRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error)
}
type hTTPFirewallRuleGroupServiceClient struct {
@@ -648,6 +736,15 @@ func (c *hTTPFirewallRuleGroupServiceClient) FindHTTPFirewallRuleGroupConfig(ctx
return out, nil
}
func (c *hTTPFirewallRuleGroupServiceClient) UpdateHTTPFirewallRuleGroupSets(ctx context.Context, in *UpdateHTTPFirewallRuleGroupSetsRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) {
out := new(RPCUpdateSuccess)
err := c.cc.Invoke(ctx, "/pb.HTTPFirewallRuleGroupService/updateHTTPFirewallRuleGroupSets", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HTTPFirewallRuleGroupServiceServer is the server API for HTTPFirewallRuleGroupService service.
type HTTPFirewallRuleGroupServiceServer interface {
// 设置是否启用分组
@@ -658,6 +755,8 @@ type HTTPFirewallRuleGroupServiceServer interface {
UpdateHTTPFirewallRuleGroup(context.Context, *UpdateHTTPFirewallRuleGroupRequest) (*RPCUpdateSuccess, error)
// 获取分组配置
FindHTTPFirewallRuleGroupConfig(context.Context, *FindHTTPFirewallRuleGroupConfigRequest) (*FindHTTPFirewallRuleGroupConfigResponse, error)
// 修改分组的规则集
UpdateHTTPFirewallRuleGroupSets(context.Context, *UpdateHTTPFirewallRuleGroupSetsRequest) (*RPCUpdateSuccess, error)
}
// UnimplementedHTTPFirewallRuleGroupServiceServer can be embedded to have forward compatible implementations.
@@ -676,6 +775,9 @@ func (*UnimplementedHTTPFirewallRuleGroupServiceServer) UpdateHTTPFirewallRuleGr
func (*UnimplementedHTTPFirewallRuleGroupServiceServer) FindHTTPFirewallRuleGroupConfig(context.Context, *FindHTTPFirewallRuleGroupConfigRequest) (*FindHTTPFirewallRuleGroupConfigResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindHTTPFirewallRuleGroupConfig not implemented")
}
func (*UnimplementedHTTPFirewallRuleGroupServiceServer) UpdateHTTPFirewallRuleGroupSets(context.Context, *UpdateHTTPFirewallRuleGroupSetsRequest) (*RPCUpdateSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPFirewallRuleGroupSets not implemented")
}
func RegisterHTTPFirewallRuleGroupServiceServer(s *grpc.Server, srv HTTPFirewallRuleGroupServiceServer) {
s.RegisterService(&_HTTPFirewallRuleGroupService_serviceDesc, srv)
@@ -753,6 +855,24 @@ func _HTTPFirewallRuleGroupService_FindHTTPFirewallRuleGroupConfig_Handler(srv i
return interceptor(ctx, in, info, handler)
}
func _HTTPFirewallRuleGroupService_UpdateHTTPFirewallRuleGroupSets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateHTTPFirewallRuleGroupSetsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HTTPFirewallRuleGroupServiceServer).UpdateHTTPFirewallRuleGroupSets(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.HTTPFirewallRuleGroupService/UpdateHTTPFirewallRuleGroupSets",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HTTPFirewallRuleGroupServiceServer).UpdateHTTPFirewallRuleGroupSets(ctx, req.(*UpdateHTTPFirewallRuleGroupSetsRequest))
}
return interceptor(ctx, in, info, handler)
}
var _HTTPFirewallRuleGroupService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.HTTPFirewallRuleGroupService",
HandlerType: (*HTTPFirewallRuleGroupServiceServer)(nil),
@@ -773,6 +893,10 @@ var _HTTPFirewallRuleGroupService_serviceDesc = grpc.ServiceDesc{
MethodName: "findHTTPFirewallRuleGroupConfig",
Handler: _HTTPFirewallRuleGroupService_FindHTTPFirewallRuleGroupConfig_Handler,
},
{
MethodName: "updateHTTPFirewallRuleGroupSets",
Handler: _HTTPFirewallRuleGroupService_UpdateHTTPFirewallRuleGroupSets_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_http_firewall_rule_group.proto",