-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for value-domain.com (#1018)
* Value-Domain added * Apply TTL option * Fix typings to pass against python 3.6 * Fix typings and more for mypy lint check * Format by flake8 * Format test_valuedomain.py by flake8 * Fix comment of test_valuedomain.py * retrigger checks of PR
- Loading branch information
wak109
authored
Dec 28, 2021
1 parent
55d44e0
commit acd89f2
Showing
29 changed files
with
7,357 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Test for valuedomain implementation of the interface.""" | ||
from unittest import TestCase | ||
from lexicon.tests.providers.integration_tests import IntegrationTestsV2 | ||
|
||
# Hook into testing framework by inheriting unittest.TestCase and reuse | ||
# the tests which *each and every* implementation of the interface must | ||
# pass, by inheritance from integration_tests.IntegrationTests | ||
|
||
|
||
class ValueDomainProviderTests(TestCase, IntegrationTestsV2): | ||
"""Integration tests for value-domain provider""" | ||
provider_name = 'valuedomain' | ||
domain = 'canadian-wisteria.net' | ||
|
||
def _filter_post_data_parameters(self): | ||
return ['login_token'] | ||
|
||
def _filter_headers(self): | ||
return ['Authorization'] | ||
|
||
def _filter_query_parameters(self): | ||
return ['secret_key'] | ||
|
||
def _filter_response(self, response): | ||
"""See `IntegrationTests._filter_response` for more information on how | ||
to filter the provider response.""" | ||
return response |
55 changes: 55 additions & 0 deletions
55
tests/fixtures/cassettes/valuedomain/IntegrationTests/test_provider_authenticate.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Cache-Control: | ||
- no-cache, no-store | ||
Connection: | ||
- close | ||
Host: | ||
- api.value-domain.com | ||
User-Agent: | ||
- curl/7.74.0 | ||
method: GET | ||
uri: https://api.value-domain.com/v1/domains | ||
response: | ||
body: | ||
string: '{"paging":{"max":1,"limit":10,"page":1},"results":[{"domainid":2623680,"domainname":"canadian-wisteria.net","registrar":"ENOM","expirationdate":"2023-10-13","autorenew":0,"autorenew_all":0,"autorenew_domain":0}],"request_id":"202111151919435616150311570V","request":{"path":"\/v1\/domains","method":"GET","params":[]}}' | ||
headers: | ||
CF-Cache-Status: | ||
- DYNAMIC | ||
CF-RAY: | ||
- 6ae7be2bec87e23f-SIN | ||
Connection: | ||
- close | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
Date: | ||
- Mon, 15 Nov 2021 10:19:43 GMT | ||
Expect-CT: | ||
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" | ||
Server: | ||
- cloudflare | ||
Set-Cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
Strict-Transport-Security: | ||
- max-age=15552000; preload | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
alt-svc: | ||
- h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; | ||
ma=86400 | ||
set-cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
55 changes: 55 additions & 0 deletions
55
...domain/IntegrationTests/test_provider_authenticate_with_unmanaged_domain_should_fail.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Cache-Control: | ||
- no-cache, no-store | ||
Connection: | ||
- close | ||
Host: | ||
- api.value-domain.com | ||
User-Agent: | ||
- curl/7.74.0 | ||
method: GET | ||
uri: https://api.value-domain.com/v1/domains | ||
response: | ||
body: | ||
string: '{"paging":{"max":1,"limit":10,"page":1},"results":[{"domainid":2623680,"domainname":"canadian-wisteria.net","registrar":"ENOM","expirationdate":"2023-10-13","autorenew":0,"autorenew_all":0,"autorenew_domain":0}],"request_id":"202111151919448202180311570V","request":{"path":"\/v1\/domains","method":"GET","params":[]}}' | ||
headers: | ||
CF-Cache-Status: | ||
- DYNAMIC | ||
CF-RAY: | ||
- 6ae7be2f79406bab-SIN | ||
Connection: | ||
- close | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
Date: | ||
- Mon, 15 Nov 2021 10:19:44 GMT | ||
Expect-CT: | ||
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" | ||
Server: | ||
- cloudflare | ||
Set-Cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
Strict-Transport-Security: | ||
- max-age=15552000; preload | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
alt-svc: | ||
- h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; | ||
ma=86400 | ||
set-cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
118 changes: 118 additions & 0 deletions
118
...tionTests/test_provider_when_calling_create_record_for_A_with_valid_name_and_content.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Cache-Control: | ||
- no-cache, no-store | ||
Connection: | ||
- close | ||
Host: | ||
- api.value-domain.com | ||
User-Agent: | ||
- curl/7.74.0 | ||
method: GET | ||
uri: https://api.value-domain.com/v1/domains | ||
response: | ||
body: | ||
string: '{"paging":{"max":1,"limit":10,"page":1},"results":[{"domainid":2623680,"domainname":"canadian-wisteria.net","registrar":"ENOM","expirationdate":"2023-10-13","autorenew":0,"autorenew_all":0,"autorenew_domain":0}],"request_id":"202111151919444420590311570V","request":{"path":"\/v1\/domains","method":"GET","params":[]}}' | ||
headers: | ||
CF-Cache-Status: | ||
- DYNAMIC | ||
CF-RAY: | ||
- 6ae7be330c89d9cc-SIN | ||
Connection: | ||
- close | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
Date: | ||
- Mon, 15 Nov 2021 10:19:44 GMT | ||
Expect-CT: | ||
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" | ||
Server: | ||
- cloudflare | ||
Set-Cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
Strict-Transport-Security: | ||
- max-age=15552000; preload | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
alt-svc: | ||
- h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; | ||
ma=86400 | ||
set-cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
status: | ||
code: 200 | ||
message: OK | ||
- request: | ||
body: null | ||
headers: | ||
Cache-Control: | ||
- no-cache, no-store | ||
Connection: | ||
- close | ||
Host: | ||
- api.value-domain.com | ||
User-Agent: | ||
- curl/7.74.0 | ||
method: GET | ||
uri: https://api.value-domain.com/v1/domains/canadian-wisteria.net/dns | ||
response: | ||
body: | ||
string: '{"results":{"domainid":2623680,"domainname":"canadian-wisteria.net","ns_type":"valuedomain1","records":"a | ||
* 60.71.198.145\na localhost 127.0.0.1\ncname docs docs.example.com\ntxt _acme-challenge.fqdn | ||
challengetoken\ntxt _acme-challenge.full challengetoken\ntxt _acme-challenge.test | ||
challengetoken\ntxt _acme-challenge.createrecordset challengetoken1\ntxt _acme-challenge.createrecordset | ||
challengetoken2\ntxt _acme-challenge.noop challengetoken\ntxt _acme-challenge.deleterecordinset | ||
challengetoken2\ntxt _acme-challenge.listrecordset challengetoken1\ntxt _acme-challenge.listrecordset | ||
challengetoken2\ntxt random.fqdntest challengetoken\ntxt random.fulltest challengetoken\ntxt | ||
random.test challengetoken\ntxt updated.test challengetoken\ntxt orig.nameonly.test | ||
challengetoken\ntxt updated.testfqdn challengetoken\ntxt updated.testfull | ||
challengetoken\ntxt updated.test challengetoken\ntxt updated.testfqdn challengetoken\ntxt | ||
updated.testfull challengetoken","ttl":"600"},"request_id":"202111151919457279030311570V","request":{"path":"\/v1\/domains\/canadian-wisteria.net\/dns","method":"GET","params":[]}}' | ||
headers: | ||
CF-Cache-Status: | ||
- DYNAMIC | ||
CF-RAY: | ||
- 6ae7be3729024dbc-SIN | ||
Connection: | ||
- close | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
Date: | ||
- Mon, 15 Nov 2021 10:19:45 GMT | ||
Expect-CT: | ||
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" | ||
Server: | ||
- cloudflare | ||
Set-Cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
Strict-Transport-Security: | ||
- max-age=15552000; preload | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
alt-svc: | ||
- h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; | ||
ma=86400 | ||
set-cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
118 changes: 118 additions & 0 deletions
118
...Tests/test_provider_when_calling_create_record_for_CNAME_with_valid_name_and_content.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Cache-Control: | ||
- no-cache, no-store | ||
Connection: | ||
- close | ||
Host: | ||
- api.value-domain.com | ||
User-Agent: | ||
- curl/7.74.0 | ||
method: GET | ||
uri: https://api.value-domain.com/v1/domains | ||
response: | ||
body: | ||
string: '{"paging":{"max":1,"limit":10,"page":1},"results":[{"domainid":2623680,"domainname":"canadian-wisteria.net","registrar":"ENOM","expirationdate":"2023-10-13","autorenew":0,"autorenew_all":0,"autorenew_domain":0}],"request_id":"202111151919459952360311570V","request":{"path":"\/v1\/domains","method":"GET","params":[]}}' | ||
headers: | ||
CF-Cache-Status: | ||
- DYNAMIC | ||
CF-RAY: | ||
- 6ae7be3b2f094b98-SIN | ||
Connection: | ||
- close | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
Date: | ||
- Mon, 15 Nov 2021 10:19:46 GMT | ||
Expect-CT: | ||
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" | ||
Server: | ||
- cloudflare | ||
Set-Cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
Strict-Transport-Security: | ||
- max-age=15552000; preload | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
alt-svc: | ||
- h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; | ||
ma=86400 | ||
set-cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
status: | ||
code: 200 | ||
message: OK | ||
- request: | ||
body: null | ||
headers: | ||
Cache-Control: | ||
- no-cache, no-store | ||
Connection: | ||
- close | ||
Host: | ||
- api.value-domain.com | ||
User-Agent: | ||
- curl/7.74.0 | ||
method: GET | ||
uri: https://api.value-domain.com/v1/domains/canadian-wisteria.net/dns | ||
response: | ||
body: | ||
string: '{"results":{"domainid":2623680,"domainname":"canadian-wisteria.net","ns_type":"valuedomain1","records":"a | ||
* 60.71.198.145\na localhost 127.0.0.1\ncname docs docs.example.com\ntxt _acme-challenge.fqdn | ||
challengetoken\ntxt _acme-challenge.full challengetoken\ntxt _acme-challenge.test | ||
challengetoken\ntxt _acme-challenge.createrecordset challengetoken1\ntxt _acme-challenge.createrecordset | ||
challengetoken2\ntxt _acme-challenge.noop challengetoken\ntxt _acme-challenge.deleterecordinset | ||
challengetoken2\ntxt _acme-challenge.listrecordset challengetoken1\ntxt _acme-challenge.listrecordset | ||
challengetoken2\ntxt random.fqdntest challengetoken\ntxt random.fulltest challengetoken\ntxt | ||
random.test challengetoken\ntxt updated.test challengetoken\ntxt orig.nameonly.test | ||
challengetoken\ntxt updated.testfqdn challengetoken\ntxt updated.testfull | ||
challengetoken\ntxt updated.test challengetoken\ntxt updated.testfqdn challengetoken\ntxt | ||
updated.testfull challengetoken","ttl":"600"},"request_id":"202111151919467316210311570V","request":{"path":"\/v1\/domains\/canadian-wisteria.net\/dns","method":"GET","params":[]}}' | ||
headers: | ||
CF-Cache-Status: | ||
- DYNAMIC | ||
CF-RAY: | ||
- 6ae7be3ebe5649d8-SIN | ||
Connection: | ||
- close | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
Date: | ||
- Mon, 15 Nov 2021 10:19:46 GMT | ||
Expect-CT: | ||
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" | ||
Server: | ||
- cloudflare | ||
Set-Cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
Strict-Transport-Security: | ||
- max-age=15552000; preload | ||
Transfer-Encoding: | ||
- chunked | ||
X-Content-Type-Options: | ||
- nosniff | ||
alt-svc: | ||
- h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; | ||
ma=86400 | ||
set-cookie: | ||
- u=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- s=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; secure | ||
- ss=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; SameSite=None; | ||
secure | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
Oops, something went wrong.