Procházet zdrojové kódy

feature: 实现域名配置中强制开启https的功能

liufan před 4 měsíci
rodič
revize
fcc6863780
1 změnil soubory, kde provedl 66 přidání a 12 odebrání
  1. 66 12
      zone.proto

+ 66 - 12
zone.proto

@@ -30,6 +30,9 @@ service ZoneCloudflare {
   //RuleSet UR
   rpc UpdateRuleSet(UpdateRuleSetRequestCloudflare) returns (RuleList){}
   rpc GetRuleSet(GetRuleSetRequestCloudflare) returns (RuleList){}
+  rpc ListZoneRuleSets(ListZoneRuleSetsRequestCloudflare)returns(RuleSetList){}
+  rpc CreateZoneRuleSet(CreateZoneRuleSetRequestCloudflare)returns(CreateZoneRuleSetReplyCloudflare){}
+  rpc DeleteZoneRuleSet(DeleteZoneRuleSetRequestCloudflare)returns(DeleteZoneRuleSetReplyCloudflare){}
 
   //Argo Smart Routing Setting UR
   rpc UpdateArgoSetting(UpdateArgoRequestCloudflare) returns(ArgoSetting){}
@@ -37,6 +40,7 @@ service ZoneCloudflare {
   rpc GetArgoSettingSubscription(IdRequest)returns(ArgoSetting){}
   rpc CreateArgoSettingSubscription(IdRequest)returns(ArgoSetting){}
   rpc SetSmartTieredCache(SetSmartTieredCacheRequestCloudflare)returns(SetSmartTieredCacheReplyCloudflare){}
+  rpc UpdateAlwaysUseHttps(UpdateAlwaysUseHttpsRequestCloudflare)returns(UpdateAlwaysUseHttpsReplyCloudflare){}
 }
 
 //Zone CURD
@@ -56,6 +60,7 @@ message ZoneCloudflareEntity{
     sint64 price = 3;
   }
 }
+//
 
 message ZoneIDByNameRequestCloudflare {
   string apiKey = 1;
@@ -191,18 +196,14 @@ message DeletePageRuleRequestCloudflare{
   string page_rule_id = 4;
 }
 
-
-
-
-
 //RuleSet UR
 
 enum Phase{
   http_request_sanitize = 0;  //URL 规范化
   http_request_transform = 1; //URL 重写规则
-  //  http_request_origin = 2;  //起源规则
-  //  http_request_cache_settings = 3;  //缓存规则
-  //  http_config_settings = 4; //配置规则
+  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)
@@ -218,18 +219,42 @@ enum Phase{
 }
 message Rule{
   string expression = 1;
-  //  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;
   optional string originPath = 6;
-  //  optional uint32 originProtocol = 7;
+  optional uint32 originProtocol = 7;
   map<string, string> requestHeader = 8;
   map<string, string> responseHeader = 9;
+  optional string ssl = 10;
 }
 message RuleList{
   repeated Rule rules = 1;
 }
+message RuleSet{
+  optional string id = 1;
+  string name = 2;
+  string kind = 3;
+  Phase phase = 4;
+}
+message ListZoneRuleSetsRequestCloudflare{
+  string apiKey = 1;
+  string apiEmail = 2;
+  string zoneId = 3;
+}
+message DeleteZoneRuleSetRequestCloudflare{
+  string apiKey = 1;
+  string apiEmail = 2;
+  string zoneId = 3;
+  string ruleSetId = 4;
+}
+message DeleteZoneRuleSetReplyCloudflare{
+  bool success = 1;
+}
+message RuleSetList {
+  repeated RuleSet ruleSets = 1;
+}
 
 message GetRuleSetRequestCloudflare{
   string apiKey = 1;
@@ -244,6 +269,24 @@ message UpdateRuleSetRequestCloudflare{
   Phase phase = 4;
   repeated Rule rules = 5;
 }
+message UpdateRuleSetByRuleSetIdRequestCloudflare{
+  string apiKey = 1;
+  string apiEmail = 2;
+  string zoneId = 3;
+  string ruleSetId = 4;
+  Phase phase = 5;
+  repeated Rule rules = 6;
+}
+message CreateZoneRuleSetRequestCloudflare{
+  string apiKey = 1;
+  string apiEmail = 2;
+  string zoneId = 3;
+  RuleSet ruleSet = 4;
+  repeated Rule rules = 5;
+}
+message CreateZoneRuleSetReplyCloudflare{
+  bool success = 1;
+}
 message UpdatePageRulesPrioritiesStruct{
   string id = 1;
   int64 priority = 2;
@@ -281,3 +324,14 @@ message SetSmartTieredCacheRequestCloudflare{
 message SetSmartTieredCacheReplyCloudflare{
   bool enabled = 1;
 }
+
+message UpdateAlwaysUseHttpsRequestCloudflare{
+  string apiKey = 1;
+  string apiEmail = 2;
+  string zoneId = 3;
+  bool enabled = 4;
+}
+
+message UpdateAlwaysUseHttpsReplyCloudflare{
+  bool success = 1;
+}