spdns.de: Add support for token based auth.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 28 Aug 2014 20:11:52 +0000 (22:11 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 28 Aug 2014 20:11:52 +0000 (22:11 +0200)
Fixes #10587.

ddns.conf.sample
src/ddns/providers.py

index 2a9642f..2ede3a4 100644 (file)
 
 # [test.spdns.org]
 # provider = spdns.org
+
+# Only use one the these two auth options.
+# token = token
 # username = user
 # password = pass
 
index 00a3855..2309257 100644 (file)
@@ -986,6 +986,14 @@ class DDNSProviderSPDNS(DDNSProtocolDynDNS2, DDNSProvider):
 
        url = "https://update.spdns.de/nic/update"
 
+       @property
+       def username(self):
+               return self.get("username") or self.hostname
+
+       @property
+       def password(self):
+               return self.get("username") or self.token
+
 
 class DDNSProviderStrato(DDNSProtocolDynDNS2, DDNSProvider):
        handle    = "strato.com"