This option can be used to get a list of all known provider which support
a token based authentication method.
In order to provide this feature the provider details has been extended
to contain the information if a provider supports this authentication
method or not.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
p_list_providers = subparsers.add_parser("list-providers",
help=_("List all available providers"))
p_list_providers = subparsers.add_parser("list-providers",
help=_("List all available providers"))
+ # list-token-provider
+ p_list_token_provider = subparsers.add_parser("list-token-provider",
+ help=_("List all providers which supports authentication via token"))
+
# update
p_update = subparsers.add_parser("update", help=_("Update DNS record"))
p_update.add_argument("hostname")
# update
p_update = subparsers.add_parser("update", help=_("Update DNS record"))
p_update.add_argument("hostname")
provider_names = d.get_provider_names()
print("\n".join(provider_names))
provider_names = d.get_provider_names()
print("\n".join(provider_names))
+ elif args.subparsers_name == "list-token-providers":
+ token_provider = d.get_provider_with_token_support()
+ print("\n".join(token_provider))
+
elif args.subparsers_name == "update":
d.updateone(hostname=args.hostname, force=args.force)
elif args.subparsers_name == "update":
d.updateone(hostname=args.hostname, force=args.force)
"""
return sorted(self.providers.keys())
"""
return sorted(self.providers.keys())
+ def get_provider_with_token_support(self):
+ """
+ Returns a list with names of all registered providers
+ which support token based authtentication.
+ """
+
+ token_provider = []
+
+ for handle, provider in sorted(self.providers.items()):
+ if provider.supports_token_auth is True:
+ token_provider.append(handle)
+
+ return sorted(token_provider)
+
def load_configuration(self, filename):
logger.debug(_("Loading configuration file %s") % filename)
def load_configuration(self, filename):
logger.debug(_("Loading configuration file %s") % filename)
# Required to remove AAAA records if IPv6 is absent again.
can_remove_records = True
# Required to remove AAAA records if IPv6 is absent again.
can_remove_records = True
+ # True if the provider supports authentication via a random
+ # generated token instead of username and password.
+ supports_token_auth = True
+
@staticmethod
def supported():
"""
@staticmethod
def supported():
"""
# The DynDNS protocol version 2 does not allow to remove records
can_remove_records = False
# The DynDNS protocol version 2 does not allow to remove records
can_remove_records = False
+ # The DynDNS protocol version 2 only supports authentication via
+ # username and password.
+ supports_token_auth = False
+
def prepare_request_data(self, proto):
data = {
"hostname" : self.hostname,
def prepare_request_data(self, proto):
data = {
"hostname" : self.hostname,
url = "http://dyndns.kasserver.com"
can_remove_records = False
url = "http://dyndns.kasserver.com"
can_remove_records = False
+ supports_token_auth = False
def update(self):
# There is no additional data required so we directly can
def update(self):
# There is no additional data required so we directly can
+ supports_token_auth = False
+
@staticmethod
def supported():
# Search if the nsupdate utility is available
@staticmethod
def supported():
# Search if the nsupdate utility is available
url = "https://nic.changeip.com/nic/update"
can_remove_records = False
url = "https://nic.changeip.com/nic/update"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
url = "http://www.ddnss.de/upd.php"
can_remove_records = False
url = "http://www.ddnss.de/upd.php"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
url = "http://members.dhs.org/nic/hosts"
can_remove_records = False
url = "http://members.dhs.org/nic/hosts"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
url = "https://control.dnspark.com/api/dynamic/update.php"
can_remove_records = False
url = "https://control.dnspark.com/api/dynamic/update.php"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
url = "https://www.dtdns.com/api/autodns.cfm"
can_remove_records = False
url = "https://www.dtdns.com/api/autodns.cfm"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
url = "https://www.duckdns.org/update"
can_remove_records = False
url = "https://www.duckdns.org/update"
can_remove_records = False
+ supports_token_auth = True
def update(self):
# Raise an error if no auth details are given.
def update(self):
# Raise an error if no auth details are given.
url = "https://dynup.de/dyn.php"
can_remove_records = False
url = "https://dynup.de/dyn.php"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
url = "http://api.cp.easydns.com/dyn/tomato.php"
url = "http://api.cp.easydns.com/dyn/tomato.php"
+ supports_token_auth = False
+
def update_protocol(self, proto):
data = {
"myip" : self.get_address(proto, "-"),
def update_protocol(self, proto):
data = {
"myip" : self.get_address(proto, "-"),
website = "http://www.dyns.net/"
protocols = ("ipv4",)
can_remove_records = False
website = "http://www.dyns.net/"
protocols = ("ipv4",)
can_remove_records = False
+ supports_token_auth = False
# There is very detailed informatio about how to send the update request and
# the possible response codes. (Currently we are using the v1.1 proto)
# There is very detailed informatio about how to send the update request and
# the possible response codes. (Currently we are using the v1.1 proto)
url = "https://dynamic.name-services.com/interface.asp"
can_remove_records = False
url = "https://dynamic.name-services.com/interface.asp"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
# here: https://entrydns.net/help
url = "https://entrydns.net/records/modify"
can_remove_records = False
# here: https://entrydns.net/help
url = "https://entrydns.net/records/modify"
can_remove_records = False
+ supports_token_auth = True
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
# page. All used values have been collected by testing.
url = "https://freedns.afraid.org/dynamic/update.php"
can_remove_records = False
# page. All used values have been collected by testing.
url = "https://freedns.afraid.org/dynamic/update.php"
can_remove_records = False
+ supports_token_auth = True
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
url = "https://dynamicdns.key-systems.net/update.php"
can_remove_records = False
url = "https://dynamicdns.key-systems.net/update.php"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
address = self.get_address(proto)
def update_protocol(self, proto):
address = self.get_address(proto)
# Information about the format of the HTTPS request is to be found
# https://dns.lightningwirelabs.com/knowledge-base/api/ddns
# Information about the format of the HTTPS request is to be found
# https://dns.lightningwirelabs.com/knowledge-base/api/ddns
+ supports_token_auth = True
+
url = "https://dns.lightningwirelabs.com/update"
def update(self):
url = "https://dns.lightningwirelabs.com/update"
def update(self):
url = "https://dynamicdns.park-your-domain.com/update"
can_remove_records = False
url = "https://dynamicdns.park-your-domain.com/update"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
# Namecheap requires the hostname splitted into a host and domain part.
def update_protocol(self, proto):
# Namecheap requires the hostname splitted into a host and domain part.
# has not been implemented here, yet.
can_remove_records = False
# has not been implemented here, yet.
can_remove_records = False
+ supports_token_auth = True
+
# After a failed update, there will be no retries
# https://bugzilla.ipfire.org/show_bug.cgi?id=10603
holdoff_failure_days = None
# After a failed update, there will be no retries
# https://bugzilla.ipfire.org/show_bug.cgi?id=10603
holdoff_failure_days = None
url = "https://dyndns.regfish.de/"
can_remove_records = False
url = "https://dyndns.regfish.de/"
can_remove_records = False
+ supports_token_auth = True
def update(self):
data = {
def update(self):
data = {
url = "https://www.servercow.de/dnsupdate/update.php"
can_remove_records = False
url = "https://www.servercow.de/dnsupdate/update.php"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
url = "https://update.spdyn.de/nic/update"
url = "https://update.spdyn.de/nic/update"
+ supports_token_auth = True
+
@property
def username(self):
return self.get("username") or self.hostname
@property
def username(self):
return self.get("username") or self.hostname
website = "http://www.zoneedit.com"
protocols = ("ipv4",)
website = "http://www.zoneedit.com"
protocols = ("ipv4",)
+ supports_token_auth = False
+
# Detailed information about the request and the response codes can be
# obtained here:
# http://www.zoneedit.com/doc/api/other.html
# Detailed information about the request and the response codes can be
# obtained here:
# http://www.zoneedit.com/doc/api/other.html
url = "https://cp.dnsmadeeasy.com/servlet/updateip?"
can_remove_records = False
url = "https://cp.dnsmadeeasy.com/servlet/updateip?"
can_remove_records = False
+ supports_token_auth = False
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {
url = "https://zzzz.io/api/v1/update"
can_remove_records = False
url = "https://zzzz.io/api/v1/update"
can_remove_records = False
+ supports_token_auth = True
def update_protocol(self, proto):
data = {
def update_protocol(self, proto):
data = {