]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Remove deprecated actions
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 12 Nov 2021 15:06:17 +0000 (16:06 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 22 Dec 2021 08:30:44 +0000 (09:30 +0100)
pdns/dnsdist-lua-actions.cc
pdns/dnsdist-lua.cc

index 2221d57cbc986ce167285ed2361267361bd3e15f..c0b184c2d48cd3b6ffa22df9f03da698f3006687 100644 (file)
@@ -2129,11 +2129,6 @@ void setupLuaActions(LuaContext& luaCtx)
       return std::shared_ptr<DNSAction>(new SetNoRecurseAction);
     });
 
-  luaCtx.writeFunction("NoRecurseAction", []() {
-      warnlog("access to NoRecurseAction is deprecated and will be removed in a future version, please use SetNoRecurseAction instead");
-      return std::shared_ptr<DNSAction>(new SetNoRecurseAction);
-    });
-
   luaCtx.writeFunction("SetMacAddrAction", [](int code) {
       return std::shared_ptr<DNSAction>(new SetMacAddrAction(code));
     });
@@ -2142,11 +2137,6 @@ void setupLuaActions(LuaContext& luaCtx)
       return std::shared_ptr<DNSAction>(new SetEDNSOptionAction(code, data));
     });
 
-  luaCtx.writeFunction("MacAddrAction", [](int code) {
-      warnlog("access to MacAddrAction is deprecated and will be removed in a future version, please use SetMacAddrAction instead");
-      return std::shared_ptr<DNSAction>(new SetMacAddrAction(code));
-    });
-
   luaCtx.writeFunction("PoolAction", [](const std::string& a) {
       return std::shared_ptr<DNSAction>(new PoolAction(a));
     });
@@ -2239,11 +2229,6 @@ void setupLuaActions(LuaContext& luaCtx)
       return std::shared_ptr<DNSAction>(new SetDisableValidationAction);
     });
 
-  luaCtx.writeFunction("DisableValidationAction", []() {
-      warnlog("access to DisableValidationAction is deprecated and will be removed in a future version, please use SetDisableValidationAction instead");
-      return std::shared_ptr<DNSAction>(new SetDisableValidationAction);
-  });
-
   luaCtx.writeFunction("LogAction", [](boost::optional<std::string> fname, boost::optional<bool> binary, boost::optional<bool> append, boost::optional<bool> buffered, boost::optional<bool> verboseOnly, boost::optional<bool> includeTimestamp) {
       return std::shared_ptr<DNSAction>(new LogAction(fname ? *fname : "", binary ? *binary : true, append ? *append : false, buffered ? *buffered : false, verboseOnly ? *verboseOnly : true, includeTimestamp ? *includeTimestamp : false));
     });
@@ -2295,11 +2280,6 @@ void setupLuaActions(LuaContext& luaCtx)
       return std::shared_ptr<DNSAction>(new SetSkipCacheAction);
     });
 
-  luaCtx.writeFunction("SkipCacheAction", []() {
-      warnlog("access to SkipCacheAction is deprecated and will be removed in a future version, please use SetSkipCacheAction instead");
-      return std::shared_ptr<DNSAction>(new SetSkipCacheAction);
-    });
-
   luaCtx.writeFunction("SetSkipCacheResponseAction", []() {
       return std::shared_ptr<DNSResponseAction>(new SetSkipCacheResponseAction);
     });
@@ -2308,11 +2288,6 @@ void setupLuaActions(LuaContext& luaCtx)
       return std::shared_ptr<DNSAction>(new SetTempFailureCacheTTLAction(maxTTL));
     });
 
-  luaCtx.writeFunction("TempFailureCacheTTLAction", [](int maxTTL) {
-      warnlog("access to TempFailureCacheTTLAction is deprecated and will be removed in a future version, please use SetTempFailureCacheTTLAction instead");
-      return std::shared_ptr<DNSAction>(new SetTempFailureCacheTTLAction(maxTTL));
-    });
-
   luaCtx.writeFunction("DropResponseAction", []() {
       return std::shared_ptr<DNSResponseAction>(new DropResponseAction);
     });
@@ -2406,29 +2381,14 @@ void setupLuaActions(LuaContext& luaCtx)
       return std::shared_ptr<DNSAction>(new SetECSPrefixLengthAction(v4PrefixLength, v6PrefixLength));
     });
 
-  luaCtx.writeFunction("ECSPrefixLengthAction", [](uint16_t v4PrefixLength, uint16_t v6PrefixLength) {
-      warnlog("access to ECSPrefixLengthAction is deprecated and will be removed in a future version, please use SetECSPrefixLengthAction instead");
-      return std::shared_ptr<DNSAction>(new SetECSPrefixLengthAction(v4PrefixLength, v6PrefixLength));
-    });
-
   luaCtx.writeFunction("SetECSOverrideAction", [](bool ecsOverride) {
       return std::shared_ptr<DNSAction>(new SetECSOverrideAction(ecsOverride));
     });
 
-  luaCtx.writeFunction("ECSOverrideAction", [](bool ecsOverride) {
-      warnlog("access to ECSOverrideAction is deprecated and will be removed in a future version, please use SetECSOverrideAction instead");
-      return std::shared_ptr<DNSAction>(new SetECSOverrideAction(ecsOverride));
-    });
-
   luaCtx.writeFunction("SetDisableECSAction", []() {
       return std::shared_ptr<DNSAction>(new SetDisableECSAction());
     });
 
-  luaCtx.writeFunction("DisableECSAction", []() {
-      warnlog("access to DisableECSAction is deprecated and will be removed in a future version, please use SetDisableECSAction instead");
-      return std::shared_ptr<DNSAction>(new SetDisableECSAction());
-    });
-
   luaCtx.writeFunction("SetECSAction", [](const std::string v4, boost::optional<std::string> v6) {
       if (v6) {
         return std::shared_ptr<DNSAction>(new SetECSAction(Netmask(v4), Netmask(*v6)));
@@ -2456,20 +2416,10 @@ void setupLuaActions(LuaContext& luaCtx)
       return std::shared_ptr<DNSAction>(new SetTagAction(tag, value));
     });
 
-  luaCtx.writeFunction("TagAction", [](std::string tag, std::string value) {
-      warnlog("access to TagAction is deprecated and will be removed in a future version, please use SetTagAction instead");
-      return std::shared_ptr<DNSAction>(new SetTagAction(tag, value));
-    });
-
   luaCtx.writeFunction("SetTagResponseAction", [](std::string tag, std::string value) {
       return std::shared_ptr<DNSResponseAction>(new SetTagResponseAction(tag, value));
     });
 
-  luaCtx.writeFunction("TagResponseAction", [](std::string tag, std::string value) {
-      warnlog("access to TagResponseAction is deprecated and will be removed in a future version, please use SetTagResponseAction instead");
-      return std::shared_ptr<DNSResponseAction>(new SetTagResponseAction(tag, value));
-    });
-
   luaCtx.writeFunction("ContinueAction", [](std::shared_ptr<DNSAction> action) {
       return std::shared_ptr<DNSAction>(new ContinueAction(action));
     });
@@ -2498,14 +2448,6 @@ void setupLuaActions(LuaContext& luaCtx)
       return ret;
     });
 
-  luaCtx.writeFunction("SetNegativeAndSOAAction", [](bool nxd, const std::string& zone, uint32_t ttl, const std::string& mname, const std::string& rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum, boost::optional<responseParams_t> vars) {
-      warnlog("access to SetNegativeAndSOAAction is deprecated and will be removed in a future version, please use NegativeAndSOAAction instead");
-      auto ret = std::shared_ptr<DNSAction>(new NegativeAndSOAAction(nxd, DNSName(zone), ttl, DNSName(mname), DNSName(rname), serial, refresh, retry, expire, minimum));
-      auto action = std::dynamic_pointer_cast<NegativeAndSOAAction>(ret);
-      parseResponseConfig(vars, action->d_responseConfig);
-      return ret;
-    });
-
   luaCtx.writeFunction("SetProxyProtocolValuesAction", [](const std::vector<std::pair<uint8_t, std::string>>& values) {
       return std::shared_ptr<DNSAction>(new SetProxyProtocolValuesAction(values));
     });
index f45682216837f81a2f545458857839c947ffffd7..69dc8efc436c1a8cf84d9555d18ba8891c0aea12 100644 (file)
@@ -954,7 +954,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
   });
 #endif /* DISABLE_CARBON */
 
-  luaCtx.writeFunction("webserver", [client, configCheck](const std::string& address, boost::optional<std::string> password, boost::optional<std::string> apiKey, const boost::optional<std::unordered_map<std::string, std::string>> customHeaders, const boost::optional<std::string> acl) {
+  luaCtx.writeFunction("webserver", [client, configCheck](const std::string& address) {
     setLuaSideEffect();
     ComboAddress local;
     try {
@@ -968,37 +968,12 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
       return;
     }
 
-    if (password || apiKey || customHeaders || acl) {
-      warnlog("Passing additional parameters to 'webserver()' is deprecated, please use 'setWebserverConfig()' instead.");
-    }
-
     try {
       int sock = SSocket(local.sin4.sin_family, SOCK_STREAM, 0);
       SSetsockopt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
       SBind(sock, local);
       SListen(sock, 5);
-      auto launch = [sock, local, password, apiKey, customHeaders, acl]() {
-        if (password) {
-          auto holder = make_unique<CredentialsHolder>(std::string(*password), false);
-          if (!holder->wasHashed() && holder->isHashingAvailable()) {
-            infolog("Passing a plain-text password to 'webserver()' is deprecated, please use 'setWebserverConfig()' instead and consider generating a hashed password using 'hashPassword()'.");
-          }
-
-          setWebserverPassword(std::move(holder));
-        }
-
-        if (apiKey) {
-          auto holder = make_unique<CredentialsHolder>(std::string(*apiKey), false);
-          setWebserverAPIKey(std::move(holder));
-        }
-
-        if (customHeaders) {
-          setWebserverCustomHeaders(customHeaders);
-        }
-
-        if (acl) {
-          setWebserverACL(*acl);
-        }
+      auto launch = [sock, local]() {
         thread t(dnsdistWebserverThread, sock, local);
         t.detach();
       };