Skip to content

Commit

Permalink
Update dreamhost _authenticate to use dns-list_records instead of dom…
Browse files Browse the repository at this point in the history
…ain-list_domains (#998)
  • Loading branch information
ryan953 committed Nov 3, 2021
1 parent 64c5021 commit 1088fe3
Show file tree
Hide file tree
Showing 27 changed files with 55 additions and 54 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lexicon/providers/dnsimple.py @analogj
lexicon/providers/dnsmadeeasy.py @analogj @nydr
lexicon/providers/dnspark.py @analogj
lexicon/providers/dnspod.py @analogj
lexicon/providers/dreamhost.py @chhsiao1981
lexicon/providers/dreamhost.py @chhsiao1981 @ryan953
lexicon/providers/dynu.py @HerrFolgreich
lexicon/providers/easydns.py @analogj
lexicon/providers/easyname.py @astzweig @rqelibari
Expand Down
7 changes: 4 additions & 3 deletions lexicon/providers/dreamhost.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@ def _record_to_dreamhost_record(record):

def _authenticate(self):
self.domain_id = None
payload = self._get("domain-list_domains")
payload = self._get("dns-list_records")
data = payload.get("data", None)
if data is None:
raise AuthenticationError("Domain not found")

for domain in data:
if domain.get("domain", "") == self.domain:
for record in data:
if record.get("record", "") == self.domain and record.get("type", "") in ["A", "AAAA"]:
self.domain_id = self.domain
break
if self.domain_id is None:
raise AuthenticationError("Domain not found")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com","AXFR_IPS":"none","TTL_SEC":0,"DOMAINID":1047330,"SOA_EMAIL":"trinopoty@hotmail.com","EXPIRE_SEC":0,"RETRY_SEC":0,"STATUS":1,"DESCRIPTION":"","LPM_DISPLAYGROUP":"","REFRESH_SEC":0,"MASTER_IPS":"","TYPE":"master"}],"ERRORARRAY":[]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com","AXFR_IPS":"none","TTL_SEC":0,"DOMAINID":1047330,"SOA_EMAIL":"trinopoty@hotmail.com","EXPIRE_SEC":0,"RETRY_SEC":0,"STATUS":1,"DESCRIPTION":"","LPM_DISPLAYGROUP":"","REFRESH_SEC":0,"MASTER_IPS":"","TYPE":"master"}],"ERRORARRAY":[]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com","AXFR_IPS":"none","TTL_SEC":0,"DOMAINID":1047330,"SOA_EMAIL":"trinopoty@hotmail.com","EXPIRE_SEC":0,"RETRY_SEC":0,"STATUS":1,"DESCRIPTION":"","LPM_DISPLAYGROUP":"","REFRESH_SEC":0,"MASTER_IPS":"","TYPE":"master"}],"ERRORARRAY":[]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com","AXFR_IPS":"none","TTL_SEC":0,"DOMAINID":1047330,"SOA_EMAIL":"trinopoty@hotmail.com","EXPIRE_SEC":0,"RETRY_SEC":0,"STATUS":1,"DESCRIPTION":"","LPM_DISPLAYGROUP":"","REFRESH_SEC":0,"MASTER_IPS":"","TYPE":"master"}],"ERRORARRAY":[]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com","AXFR_IPS":"none","TTL_SEC":0,"DOMAINID":1047330,"SOA_EMAIL":"trinopoty@hotmail.com","EXPIRE_SEC":0,"RETRY_SEC":0,"STATUS":1,"DESCRIPTION":"","LPM_DISPLAYGROUP":"","REFRESH_SEC":0,"MASTER_IPS":"","TYPE":"master"}],"ERRORARRAY":[]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interactions:
Content-Type: [application/json]
User-Agent: [python-requests/2.18.4]
method: GET
uri: https://api.dreamhost.com/?cmd=domain-list_domains&format=json
uri: https://api.dreamhost.com/?cmd=dns-list_records&format=json
response:
body: {string: !!python/unicode '{"result":"success","data":[{"domain":"lexicon-example.com"}]}'}
body: {string: !!python/unicode '{"result":"success","data":[{"type":"A","record":"lexicon-example.com"}]}'}
headers:
access-control-allow-origin: ['*']
connection: [keep-alive]
Expand Down

0 comments on commit 1088fe3

Please sign in to comment.