]> git.ipfire.org Git - oddments/ddns.git/commitdiff
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 2a9642fc2952c07861df6908ad33e50faa47ccfa..2ede3a497db70b6951bb39064ca0a85b81630c71 100644 (file)
 
 # [test.spdns.org]
 # provider = spdns.org
 
 # [test.spdns.org]
 # provider = spdns.org
+
+# Only use one the these two auth options.
+# token = token
 # username = user
 # password = pass
 
 # username = user
 # password = pass
 
index 00a3855bbffab6d61679ccc7614eaac0cef18352..2309257cde2cc8f243e7c3a9122d53cd9a5f01c6 100644 (file)
@@ -986,6 +986,14 @@ class DDNSProviderSPDNS(DDNSProtocolDynDNS2, DDNSProvider):
 
        url = "https://update.spdns.de/nic/update"
 
 
        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"
 
 class DDNSProviderStrato(DDNSProtocolDynDNS2, DDNSProvider):
        handle    = "strato.com"