Browse Source

cloudflareServer修改创建和更新证书绑定方法为ubiquitous

YuXinLong 1 year ago
parent
commit
4a42356571

+ 17 - 17
cloudflareApi/zone/zone.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // 	protoc-gen-go v1.28.1
-// 	protoc        v3.21.5
+// 	protoc        v3.19.1
 // source: proto/zone.proto
 
 package zone
@@ -25,18 +25,18 @@ type Phase int32
 const (
 	Phase_http_request_sanitize  Phase = 0 //URL 规范化
 	Phase_http_request_transform Phase = 1 //URL 重写规则
-	//  http_request_origin = 2;  //起源规则
-	//  http_request_cache_settings = 3;  //缓存规则
-	//  http_config_settings = 4; //配置规则
-	//  http_request_dynamic_redirect = 5;  //动态重定向
-	//  ddos_l7 = 6;  //HTTP DDoS 攻击防护
-	//  http_request_firewall_custom = 7; //Web 应用程序防火墙 (WAF)
-	//  http_ratelimit = 8; //限速规则
-	//  http_request_firewall_managed = 9;  //Web 应用程序防火墙 (WAF)
-	//  http_request_sbfm = 10; //超级机器人战斗模式
-	//  http_request_redirect = 11; //批量重定向
+	// http_request_origin = 2;  //起源规则
+	// http_request_cache_settings = 3;  //缓存规则
+	// http_config_settings = 4; //配置规则
+	// http_request_dynamic_redirect = 5;  //动态重定向
+	// ddos_l7 = 6;  //HTTP DDoS 攻击防护
+	// http_request_firewall_custom = 7; //Web 应用程序防火墙 (WAF)
+	// http_ratelimit = 8; //限速规则
+	// http_request_firewall_managed = 9;  //Web 应用程序防火墙 (WAF)
+	// http_request_sbfm = 10; //超级机器人战斗模式
+	// http_request_redirect = 11; //批量重定向
 	Phase_http_request_late_transform Phase = 12 //HTTP 请求头修改规则
-	//  http_custom_errors = 13;  //自定义错误响应
+	// http_custom_errors = 13;  //自定义错误响应
 	Phase_http_response_headers_transform Phase = 14 //HTTP响应头修改规则
 )
 
@@ -1484,12 +1484,12 @@ type Rule struct {
 	unknownFields protoimpl.UnknownFields
 
 	Expression string `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"`
-	//  optional uint32 ttl = 2;
-	//  optional string queryArgsType = 3;
-	//  repeated string queryArgs = 4;
-	//  optional string originHost = 5;
+	// optional uint32 ttl = 2;
+	// optional string queryArgsType = 3;
+	// repeated string queryArgs = 4;
+	// optional string originHost = 5;
 	OriginPath *string `protobuf:"bytes,6,opt,name=originPath,proto3,oneof" json:"originPath,omitempty"`
-	//  optional uint32 originProtocol = 7;
+	// optional uint32 originProtocol = 7;
 	RequestHeader  map[string]string `protobuf:"bytes,8,rep,name=requestHeader,proto3" json:"requestHeader,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
 	ResponseHeader map[string]string `protobuf:"bytes,9,rep,name=responseHeader,proto3" json:"responseHeader,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
 }

+ 9 - 9
cloudflareApi/zone/zone_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.21.5
+// - protoc             v3.19.1
 // source: proto/zone.proto
 
 package zone
@@ -22,7 +22,7 @@ const _ = grpc.SupportPackageIsVersion7
 //
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
 type ZoneCloudflareClient interface {
-	//Zone CURD
+	// Zone CURD
 	ZoneIDByNameCloudflare(ctx context.Context, in *ZoneIDByNameRequestCloudflare, opts ...grpc.CallOption) (*ZoneIDByNameReplyCloudflare, error)
 	ZoneDetails(ctx context.Context, in *ZoneDetailsRequestCloudflare, opts ...grpc.CallOption) (*ZoneDetailsReplyCloudflare, error)
 	GetZones(ctx context.Context, in *GetZonesRequestCloudflare, opts ...grpc.CallOption) (*GetZonesReplyCloudflare, error)
@@ -31,16 +31,16 @@ type ZoneCloudflareClient interface {
 	ListZones(ctx context.Context, in *ListZonesRequestCloudflare, opts ...grpc.CallOption) (*ZonesList, error)
 	ListZonesByAccountId(ctx context.Context, in *ListZonesByAccountIdRequestCloudflare, opts ...grpc.CallOption) (*ZonesList, error)
 	ActivationCheck(ctx context.Context, in *ActivationCheckRequestCloudflare, opts ...grpc.CallOption) (*ActivationCheckReplyCloudflare, error)
-	//PageRule CURD
+	// PageRule CURD
 	ListPageRule(ctx context.Context, in *ListPageRuleRequestCloudflare, opts ...grpc.CallOption) (*PageRuleList, error)
 	CreatePageRule(ctx context.Context, in *CreatePageRuleRequestCloudflare, opts ...grpc.CallOption) (*PageRule, error)
 	UpdatePageRule(ctx context.Context, in *UpdatePageRuleRequestCloudflare, opts ...grpc.CallOption) (*PageRule, error)
 	DeletePageRule(ctx context.Context, in *DeletePageRuleRequestCloudflare, opts ...grpc.CallOption) (*PageRule, error)
 	UpdatePageRulesPriorities(ctx context.Context, in *UpdatePageRulesPrioritiesRequestCloudflare, opts ...grpc.CallOption) (*PageRuleList, error)
-	//RuleSet UR
+	// RuleSet UR
 	UpdateRuleSet(ctx context.Context, in *UpdateRuleSetRequestCloudflare, opts ...grpc.CallOption) (*RuleList, error)
 	GetRuleSet(ctx context.Context, in *GetRuleSetRequestCloudflare, opts ...grpc.CallOption) (*RuleList, error)
-	//Argo Smart Routing Setting UR
+	// Argo Smart Routing Setting UR
 	UpdateArgoSetting(ctx context.Context, in *UpdateArgoRequestCloudflare, opts ...grpc.CallOption) (*ArgoSetting, error)
 	GetArgoSetting(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*ArgoSetting, error)
 	GetArgoSettingSubscription(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*ArgoSetting, error)
@@ -230,7 +230,7 @@ func (c *zoneCloudflareClient) CreateArgoSettingSubscription(ctx context.Context
 // All implementations must embed UnimplementedZoneCloudflareServer
 // for forward compatibility
 type ZoneCloudflareServer interface {
-	//Zone CURD
+	// Zone CURD
 	ZoneIDByNameCloudflare(context.Context, *ZoneIDByNameRequestCloudflare) (*ZoneIDByNameReplyCloudflare, error)
 	ZoneDetails(context.Context, *ZoneDetailsRequestCloudflare) (*ZoneDetailsReplyCloudflare, error)
 	GetZones(context.Context, *GetZonesRequestCloudflare) (*GetZonesReplyCloudflare, error)
@@ -239,16 +239,16 @@ type ZoneCloudflareServer interface {
 	ListZones(context.Context, *ListZonesRequestCloudflare) (*ZonesList, error)
 	ListZonesByAccountId(context.Context, *ListZonesByAccountIdRequestCloudflare) (*ZonesList, error)
 	ActivationCheck(context.Context, *ActivationCheckRequestCloudflare) (*ActivationCheckReplyCloudflare, error)
-	//PageRule CURD
+	// PageRule CURD
 	ListPageRule(context.Context, *ListPageRuleRequestCloudflare) (*PageRuleList, error)
 	CreatePageRule(context.Context, *CreatePageRuleRequestCloudflare) (*PageRule, error)
 	UpdatePageRule(context.Context, *UpdatePageRuleRequestCloudflare) (*PageRule, error)
 	DeletePageRule(context.Context, *DeletePageRuleRequestCloudflare) (*PageRule, error)
 	UpdatePageRulesPriorities(context.Context, *UpdatePageRulesPrioritiesRequestCloudflare) (*PageRuleList, error)
-	//RuleSet UR
+	// RuleSet UR
 	UpdateRuleSet(context.Context, *UpdateRuleSetRequestCloudflare) (*RuleList, error)
 	GetRuleSet(context.Context, *GetRuleSetRequestCloudflare) (*RuleList, error)
-	//Argo Smart Routing Setting UR
+	// Argo Smart Routing Setting UR
 	UpdateArgoSetting(context.Context, *UpdateArgoRequestCloudflare) (*ArgoSetting, error)
 	GetArgoSetting(context.Context, *IdRequest) (*ArgoSetting, error)
 	GetArgoSettingSubscription(context.Context, *IdRequest) (*ArgoSetting, error)

+ 2 - 2
server/CertificateCloudflareServer.go

@@ -60,7 +60,7 @@ func (s *CertificateServer) CreateCertificate(ctx context.Context, requestCloudf
 	zoneCustomSSL.Certificate = requestCloudflare.GetCertificate()
 	zoneCustomSSL.PrivateKey = requestCloudflare.GetPrivateKey()
 	zoneCustomSSL.GeoRestrictions = &geoRestrictions
-	zoneCustomSSL.BundleMethod = "force"
+	zoneCustomSSL.BundleMethod = "ubiquitous"
 	zoneCustomSSL.Type = "sni_custom"
 	createCertificate, err := api.CreateSSL(ctxAPI, id, zoneCustomSSL)
 
@@ -122,7 +122,7 @@ func (s *CertificateServer) EditCertificate(ctx context.Context, requestCloudfla
 	zoneCustomSSL.Certificate = requestCloudflare.GetCertificate()
 	zoneCustomSSL.PrivateKey = requestCloudflare.GetPrivateKey()
 	zoneCustomSSL.GeoRestrictions = &geoRestrictions
-	zoneCustomSSL.BundleMethod = "force"
+	zoneCustomSSL.BundleMethod = "ubiquitous"
 	zoneCustomSSL.Type = "sni_custom"
 	editCertificate, err := api.UpdateSSL(ctxAPI, id, requestCloudflare.GetCertificateId(), zoneCustomSSL)
 	if err != nil {