HTTP Header中支持设置非标Header

This commit is contained in:
GoEdgeLab
2023-05-19 19:52:22 +08:00
parent 5a5a1ec8f2
commit 10c2478ec0
4 changed files with 234 additions and 82 deletions

View File

@@ -2875,6 +2875,15 @@
],
"isDeprecated": false
},
{
"name": "updateHTTPHeaderPolicyNonStandardHeaders",
"requestMessageName": "UpdateHTTPHeaderPolicyNonStandardHeadersRequest",
"responseMessageName": "RPCSuccess",
"code": "rpc updateHTTPHeaderPolicyNonStandardHeaders(UpdateHTTPHeaderPolicyNonStandardHeadersRequest) returns (RPCSuccess);",
"doc": "修改非标的Headers",
"roles": [],
"isDeprecated": false
},
{
"name": "updateHTTPHeaderPolicyCORS",
"requestMessageName": "UpdateHTTPHeaderPolicyCORSRequest",
@@ -5627,7 +5636,9 @@
"responseMessageName": "RPCSuccess",
"code": "rpc copyNodeActionsToNodeGroup(CopyNodeActionsToNodeGroupRequest) returns (RPCSuccess);",
"doc": "复制动作设置到分组",
"roles": [],
"roles": [
"admin"
],
"isDeprecated": false
},
{
@@ -5636,7 +5647,9 @@
"responseMessageName": "RPCSuccess",
"code": "rpc copyNodeActionsToNodeCluster(CopyNodeActionsToNodeClusterRequest) returns (RPCSuccess);",
"doc": "复制动作设置到集群",
"roles": [],
"roles": [
"admin"
],
"isDeprecated": false
}
],
@@ -21392,6 +21405,11 @@
"code": "message UpdateHTTPHeaderPolicyDeletingHeadersRequest {\n\tint64 httpHeaderPolicyId = 1;\n\trepeated string headerNames = 2;\n}",
"doc": "修改删除的Headers"
},
{
"name": "UpdateHTTPHeaderPolicyNonStandardHeadersRequest",
"code": "message UpdateHTTPHeaderPolicyNonStandardHeadersRequest {\n\tint64 httpHeaderPolicyId = 1; // Header策略ID\n\trepeated string headerNames = 2; // 非标Header名称列表\n}",
"doc": "修改非标的Headers"
},
{
"name": "UpdateHTTPHeaderPolicyReplacingHeadersRequest",
"code": "message UpdateHTTPHeaderPolicyReplacingHeadersRequest {\n\tint64 httpHeaderPolicyId = 1;\n\tbytes headersJSON = 2;\n}",

View File

@@ -546,6 +546,62 @@ func (x *UpdateHTTPHeaderPolicyCORSRequest) GetCorsJSON() []byte {
return nil
}
// 修改非标的Headers
type UpdateHTTPHeaderPolicyNonStandardHeadersRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
HttpHeaderPolicyId int64 `protobuf:"varint,1,opt,name=httpHeaderPolicyId,proto3" json:"httpHeaderPolicyId,omitempty"` // Header策略ID
HeaderNames []string `protobuf:"bytes,2,rep,name=headerNames,proto3" json:"headerNames,omitempty"` // 非标Header名称列表
}
func (x *UpdateHTTPHeaderPolicyNonStandardHeadersRequest) Reset() {
*x = UpdateHTTPHeaderPolicyNonStandardHeadersRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_http_header_policy_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateHTTPHeaderPolicyNonStandardHeadersRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateHTTPHeaderPolicyNonStandardHeadersRequest) ProtoMessage() {}
func (x *UpdateHTTPHeaderPolicyNonStandardHeadersRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_http_header_policy_proto_msgTypes[10]
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 UpdateHTTPHeaderPolicyNonStandardHeadersRequest.ProtoReflect.Descriptor instead.
func (*UpdateHTTPHeaderPolicyNonStandardHeadersRequest) Descriptor() ([]byte, []int) {
return file_service_http_header_policy_proto_rawDescGZIP(), []int{10}
}
func (x *UpdateHTTPHeaderPolicyNonStandardHeadersRequest) GetHttpHeaderPolicyId() int64 {
if x != nil {
return x.HttpHeaderPolicyId
}
return 0
}
func (x *UpdateHTTPHeaderPolicyNonStandardHeadersRequest) GetHeaderNames() []string {
if x != nil {
return x.HeaderNames
}
return nil
}
var File_service_http_header_policy_proto protoreflect.FileDescriptor
var file_service_http_header_policy_proto_rawDesc = []byte{
@@ -619,63 +675,78 @@ var file_service_http_header_policy_proto_rawDesc = []byte{
0x69, 0x63, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x68, 0x74, 0x74,
0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x12,
0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x08, 0x63, 0x6f, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x32, 0xe3, 0x06, 0x0a, 0x17,
0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x21, 0x66, 0x69, 0x6e, 0x64,
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2c, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54,
0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x70, 0x62,
0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54, 0x50,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x63, 0x72,
0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f,
0x6c, 0x69, 0x63, 0x79, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c,
0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x23, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x73, 0x12, 0x2e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54,
0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x64,
0x64, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x67, 0x0a, 0x24, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x74, 0x74,
0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x2e, 0x70, 0x62, 0x2e,
0x0c, 0x52, 0x08, 0x63, 0x6f, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x83, 0x01, 0x0a, 0x2f,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61,
0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62,
0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x67, 0x0a, 0x24, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x69, 0x6c,
0x65, 0x72, 0x73, 0x12, 0x2f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48,
0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41,
0x64, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63,
0x63, 0x65, 0x73, 0x73, 0x12, 0x6b, 0x0a, 0x26, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54,
0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65,
0x70, 0x6c, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x31,
0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63,
0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x2e, 0x0a, 0x12, 0x68, 0x74, 0x74, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c,
0x69, 0x63, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x68, 0x74, 0x74,
0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, 0x12,
0x20, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02,
0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65,
0x73, 0x32, 0xd4, 0x07, 0x0a, 0x17, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x80, 0x01,
0x0a, 0x21, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54,
0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x12, 0x2c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f,
0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x2d, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x5f, 0x0a, 0x16, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61,
0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x65, 0x0a, 0x23, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48,
0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x64, 0x64, 0x69, 0x6e,
0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x2e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f,
0x6c, 0x69, 0x63, 0x79, 0x41, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50,
0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x67, 0x0a, 0x24, 0x75, 0x70, 0x64, 0x61,
0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73,
0x12, 0x2f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x74, 0x74,
0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73,
0x73, 0x12, 0x69, 0x0a, 0x25, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48,
0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x30, 0x2e, 0x70, 0x62, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70,
0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x53, 0x0a, 0x1a,
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x4f, 0x52, 0x53, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x4f, 0x52, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73,
0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x73, 0x12, 0x67, 0x0a, 0x24, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48,
0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x64, 0x64, 0x69, 0x6e,
0x67, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x2e, 0x70, 0x62, 0x2e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x41, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x69, 0x6c,
0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e,
0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x6b, 0x0a, 0x26, 0x75, 0x70,
0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f,
0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61,
0x64, 0x65, 0x72, 0x73, 0x12, 0x31, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x69, 0x0a, 0x25, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63,
0x79, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73,
0x12, 0x30, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x6f, 0x0a, 0x28, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x6f, 0x6e, 0x53,
0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x33,
0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4e, 0x6f, 0x6e, 0x53, 0x74, 0x61,
0x6e, 0x64, 0x61, 0x72, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63,
0x65, 0x73, 0x73, 0x12, 0x53, 0x0a, 0x1a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54,
0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x4f, 0x52,
0x53, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54,
0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x4f, 0x52,
0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50,
0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -690,19 +761,20 @@ func file_service_http_header_policy_proto_rawDescGZIP() []byte {
return file_service_http_header_policy_proto_rawDescData
}
var file_service_http_header_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_service_http_header_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_service_http_header_policy_proto_goTypes = []interface{}{
(*FindEnabledHTTPHeaderPolicyConfigRequest)(nil), // 0: pb.FindEnabledHTTPHeaderPolicyConfigRequest
(*FindEnabledHTTPHeaderPolicyConfigResponse)(nil), // 1: pb.FindEnabledHTTPHeaderPolicyConfigResponse
(*CreateHTTPHeaderPolicyRequest)(nil), // 2: pb.CreateHTTPHeaderPolicyRequest
(*CreateHTTPHeaderPolicyResponse)(nil), // 3: pb.CreateHTTPHeaderPolicyResponse
(*UpdateHTTPHeaderPolicyAddingHeadersRequest)(nil), // 4: pb.UpdateHTTPHeaderPolicyAddingHeadersRequest
(*UpdateHTTPHeaderPolicySettingHeadersRequest)(nil), // 5: pb.UpdateHTTPHeaderPolicySettingHeadersRequest
(*UpdateHTTPHeaderPolicyAddingTrailersRequest)(nil), // 6: pb.UpdateHTTPHeaderPolicyAddingTrailersRequest
(*UpdateHTTPHeaderPolicyReplacingHeadersRequest)(nil), // 7: pb.UpdateHTTPHeaderPolicyReplacingHeadersRequest
(*UpdateHTTPHeaderPolicyDeletingHeadersRequest)(nil), // 8: pb.UpdateHTTPHeaderPolicyDeletingHeadersRequest
(*UpdateHTTPHeaderPolicyCORSRequest)(nil), // 9: pb.UpdateHTTPHeaderPolicyCORSRequest
(*RPCSuccess)(nil), // 10: pb.RPCSuccess
(*FindEnabledHTTPHeaderPolicyConfigRequest)(nil), // 0: pb.FindEnabledHTTPHeaderPolicyConfigRequest
(*FindEnabledHTTPHeaderPolicyConfigResponse)(nil), // 1: pb.FindEnabledHTTPHeaderPolicyConfigResponse
(*CreateHTTPHeaderPolicyRequest)(nil), // 2: pb.CreateHTTPHeaderPolicyRequest
(*CreateHTTPHeaderPolicyResponse)(nil), // 3: pb.CreateHTTPHeaderPolicyResponse
(*UpdateHTTPHeaderPolicyAddingHeadersRequest)(nil), // 4: pb.UpdateHTTPHeaderPolicyAddingHeadersRequest
(*UpdateHTTPHeaderPolicySettingHeadersRequest)(nil), // 5: pb.UpdateHTTPHeaderPolicySettingHeadersRequest
(*UpdateHTTPHeaderPolicyAddingTrailersRequest)(nil), // 6: pb.UpdateHTTPHeaderPolicyAddingTrailersRequest
(*UpdateHTTPHeaderPolicyReplacingHeadersRequest)(nil), // 7: pb.UpdateHTTPHeaderPolicyReplacingHeadersRequest
(*UpdateHTTPHeaderPolicyDeletingHeadersRequest)(nil), // 8: pb.UpdateHTTPHeaderPolicyDeletingHeadersRequest
(*UpdateHTTPHeaderPolicyCORSRequest)(nil), // 9: pb.UpdateHTTPHeaderPolicyCORSRequest
(*UpdateHTTPHeaderPolicyNonStandardHeadersRequest)(nil), // 10: pb.UpdateHTTPHeaderPolicyNonStandardHeadersRequest
(*RPCSuccess)(nil), // 11: pb.RPCSuccess
}
var file_service_http_header_policy_proto_depIdxs = []int32{
0, // 0: pb.HTTPHeaderPolicyService.findEnabledHTTPHeaderPolicyConfig:input_type -> pb.FindEnabledHTTPHeaderPolicyConfigRequest
@@ -712,17 +784,19 @@ var file_service_http_header_policy_proto_depIdxs = []int32{
6, // 4: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyAddingTrailers:input_type -> pb.UpdateHTTPHeaderPolicyAddingTrailersRequest
7, // 5: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyReplacingHeaders:input_type -> pb.UpdateHTTPHeaderPolicyReplacingHeadersRequest
8, // 6: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyDeletingHeaders:input_type -> pb.UpdateHTTPHeaderPolicyDeletingHeadersRequest
9, // 7: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyCORS:input_type -> pb.UpdateHTTPHeaderPolicyCORSRequest
1, // 8: pb.HTTPHeaderPolicyService.findEnabledHTTPHeaderPolicyConfig:output_type -> pb.FindEnabledHTTPHeaderPolicyConfigResponse
3, // 9: pb.HTTPHeaderPolicyService.createHTTPHeaderPolicy:output_type -> pb.CreateHTTPHeaderPolicyResponse
10, // 10: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyAddingHeaders:output_type -> pb.RPCSuccess
10, // 11: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicySettingHeaders:output_type -> pb.RPCSuccess
10, // 12: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyAddingTrailers:output_type -> pb.RPCSuccess
10, // 13: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyReplacingHeaders:output_type -> pb.RPCSuccess
10, // 14: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyDeletingHeaders:output_type -> pb.RPCSuccess
10, // 15: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyCORS:output_type -> pb.RPCSuccess
8, // [8:16] is the sub-list for method output_type
0, // [0:8] is the sub-list for method input_type
10, // 7: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyNonStandardHeaders:input_type -> pb.UpdateHTTPHeaderPolicyNonStandardHeadersRequest
9, // 8: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyCORS:input_type -> pb.UpdateHTTPHeaderPolicyCORSRequest
1, // 9: pb.HTTPHeaderPolicyService.findEnabledHTTPHeaderPolicyConfig:output_type -> pb.FindEnabledHTTPHeaderPolicyConfigResponse
3, // 10: pb.HTTPHeaderPolicyService.createHTTPHeaderPolicy:output_type -> pb.CreateHTTPHeaderPolicyResponse
11, // 11: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyAddingHeaders:output_type -> pb.RPCSuccess
11, // 12: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicySettingHeaders:output_type -> pb.RPCSuccess
11, // 13: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyAddingTrailers:output_type -> pb.RPCSuccess
11, // 14: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyReplacingHeaders:output_type -> pb.RPCSuccess
11, // 15: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyDeletingHeaders:output_type -> pb.RPCSuccess
11, // 16: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyNonStandardHeaders:output_type -> pb.RPCSuccess
11, // 17: pb.HTTPHeaderPolicyService.updateHTTPHeaderPolicyCORS:output_type -> pb.RPCSuccess
9, // [9:18] is the sub-list for method output_type
0, // [0:9] 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
@@ -855,6 +929,18 @@ func file_service_http_header_policy_proto_init() {
return nil
}
}
file_service_http_header_policy_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateHTTPHeaderPolicyNonStandardHeadersRequest); 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{
@@ -862,7 +948,7 @@ func file_service_http_header_policy_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_http_header_policy_proto_rawDesc,
NumEnums: 0,
NumMessages: 10,
NumMessages: 11,
NumExtensions: 0,
NumServices: 1,
},
@@ -902,6 +988,8 @@ type HTTPHeaderPolicyServiceClient interface {
UpdateHTTPHeaderPolicyReplacingHeaders(ctx context.Context, in *UpdateHTTPHeaderPolicyReplacingHeadersRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 修改删除的Headers
UpdateHTTPHeaderPolicyDeletingHeaders(ctx context.Context, in *UpdateHTTPHeaderPolicyDeletingHeadersRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 修改非标的Headers
UpdateHTTPHeaderPolicyNonStandardHeaders(ctx context.Context, in *UpdateHTTPHeaderPolicyNonStandardHeadersRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 修改策略CORS设置
UpdateHTTPHeaderPolicyCORS(ctx context.Context, in *UpdateHTTPHeaderPolicyCORSRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
}
@@ -977,6 +1065,15 @@ func (c *hTTPHeaderPolicyServiceClient) UpdateHTTPHeaderPolicyDeletingHeaders(ct
return out, nil
}
func (c *hTTPHeaderPolicyServiceClient) UpdateHTTPHeaderPolicyNonStandardHeaders(ctx context.Context, in *UpdateHTTPHeaderPolicyNonStandardHeadersRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.HTTPHeaderPolicyService/updateHTTPHeaderPolicyNonStandardHeaders", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hTTPHeaderPolicyServiceClient) UpdateHTTPHeaderPolicyCORS(ctx context.Context, in *UpdateHTTPHeaderPolicyCORSRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.HTTPHeaderPolicyService/updateHTTPHeaderPolicyCORS", in, out, opts...)
@@ -1002,6 +1099,8 @@ type HTTPHeaderPolicyServiceServer interface {
UpdateHTTPHeaderPolicyReplacingHeaders(context.Context, *UpdateHTTPHeaderPolicyReplacingHeadersRequest) (*RPCSuccess, error)
// 修改删除的Headers
UpdateHTTPHeaderPolicyDeletingHeaders(context.Context, *UpdateHTTPHeaderPolicyDeletingHeadersRequest) (*RPCSuccess, error)
// 修改非标的Headers
UpdateHTTPHeaderPolicyNonStandardHeaders(context.Context, *UpdateHTTPHeaderPolicyNonStandardHeadersRequest) (*RPCSuccess, error)
// 修改策略CORS设置
UpdateHTTPHeaderPolicyCORS(context.Context, *UpdateHTTPHeaderPolicyCORSRequest) (*RPCSuccess, error)
}
@@ -1031,6 +1130,9 @@ func (*UnimplementedHTTPHeaderPolicyServiceServer) UpdateHTTPHeaderPolicyReplaci
func (*UnimplementedHTTPHeaderPolicyServiceServer) UpdateHTTPHeaderPolicyDeletingHeaders(context.Context, *UpdateHTTPHeaderPolicyDeletingHeadersRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPHeaderPolicyDeletingHeaders not implemented")
}
func (*UnimplementedHTTPHeaderPolicyServiceServer) UpdateHTTPHeaderPolicyNonStandardHeaders(context.Context, *UpdateHTTPHeaderPolicyNonStandardHeadersRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPHeaderPolicyNonStandardHeaders not implemented")
}
func (*UnimplementedHTTPHeaderPolicyServiceServer) UpdateHTTPHeaderPolicyCORS(context.Context, *UpdateHTTPHeaderPolicyCORSRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPHeaderPolicyCORS not implemented")
}
@@ -1165,6 +1267,24 @@ func _HTTPHeaderPolicyService_UpdateHTTPHeaderPolicyDeletingHeaders_Handler(srv
return interceptor(ctx, in, info, handler)
}
func _HTTPHeaderPolicyService_UpdateHTTPHeaderPolicyNonStandardHeaders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateHTTPHeaderPolicyNonStandardHeadersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HTTPHeaderPolicyServiceServer).UpdateHTTPHeaderPolicyNonStandardHeaders(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.HTTPHeaderPolicyService/UpdateHTTPHeaderPolicyNonStandardHeaders",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HTTPHeaderPolicyServiceServer).UpdateHTTPHeaderPolicyNonStandardHeaders(ctx, req.(*UpdateHTTPHeaderPolicyNonStandardHeadersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _HTTPHeaderPolicyService_UpdateHTTPHeaderPolicyCORS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateHTTPHeaderPolicyCORSRequest)
if err := dec(in); err != nil {
@@ -1215,6 +1335,10 @@ var _HTTPHeaderPolicyService_serviceDesc = grpc.ServiceDesc{
MethodName: "updateHTTPHeaderPolicyDeletingHeaders",
Handler: _HTTPHeaderPolicyService_UpdateHTTPHeaderPolicyDeletingHeaders_Handler,
},
{
MethodName: "updateHTTPHeaderPolicyNonStandardHeaders",
Handler: _HTTPHeaderPolicyService_UpdateHTTPHeaderPolicyNonStandardHeaders_Handler,
},
{
MethodName: "updateHTTPHeaderPolicyCORS",
Handler: _HTTPHeaderPolicyService_UpdateHTTPHeaderPolicyCORS_Handler,

View File

@@ -28,6 +28,9 @@ service HTTPHeaderPolicyService {
// 修改删除的Headers
rpc updateHTTPHeaderPolicyDeletingHeaders (UpdateHTTPHeaderPolicyDeletingHeadersRequest) returns (RPCSuccess);
// 修改非标的Headers
rpc updateHTTPHeaderPolicyNonStandardHeaders(UpdateHTTPHeaderPolicyNonStandardHeadersRequest) returns (RPCSuccess);
// 修改策略CORS设置
rpc updateHTTPHeaderPolicyCORS(UpdateHTTPHeaderPolicyCORSRequest) returns (RPCSuccess);
}
@@ -84,4 +87,10 @@ message UpdateHTTPHeaderPolicyDeletingHeadersRequest {
message UpdateHTTPHeaderPolicyCORSRequest {
int64 httpHeaderPolicyId = 1;
bytes corsJSON = 2;
}
// 修改非标的Headers
message UpdateHTTPHeaderPolicyNonStandardHeadersRequest {
int64 httpHeaderPolicyId = 1; // Header策略ID
repeated string headerNames = 2; // 非标Header名称列表
}

View File

@@ -13,8 +13,9 @@ type HTTPHeaderPolicy struct {
SetHeaders []*HTTPHeaderConfig `yaml:"setHeaders" json:"setHeaders"`
DeleteHeaders []string `yaml:"deleteHeaders" json:"deleteHeaders"` // 删除的Header
Expires *HTTPExpireHeaderConfig `yaml:"expires" json:"expires"` // TODO
CORS *HTTPCORSHeaderConfig `yaml:"cors" json:"cors"`
Expires *HTTPExpireHeaderConfig `yaml:"expires" json:"expires"` // 内容过期设置 TODO
CORS *HTTPCORSHeaderConfig `yaml:"cors" json:"cors"` // CORS跨域设置
NonStandardHeaders []string `yaml:"nonStandardHeaders" json:"nonStandardHeaders"` // 非标Header列表
setHeaderNames []string
deleteHeaderMap map[string]bool // header => bool