diff --git a/CODEOWNERS b/CODEOWNERS index 5685aa6e9..a338bb569 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -55,6 +55,7 @@ lexicon/providers/luadns.py @analogj lexicon/providers/memset.py @tnwhitwell lexicon/providers/mythicbeasts.py @lexitus lexicon/providers/namecheap.py @pschmitt @rbelnap +lexicon/providers/namecom.py @Jamim lexicon/providers/namesilo.py @analogj lexicon/providers/netcup.py @coldfix lexicon/providers/nfsn.py @tersers diff --git a/README.rst b/README.rst index ff1c00fdc..8597478af 100644 --- a/README.rst +++ b/README.rst @@ -118,6 +118,7 @@ The current supported providers are: - `Memset `_ - `Mythic Beasts (v2 API) `_ - `Njalla `_ +- `Name.com `_ - `Namecheap `_ - `Namesilo `_ - `Netcup `_ diff --git a/lexicon/providers/namecom.py b/lexicon/providers/namecom.py new file mode 100644 index 000000000..965bab560 --- /dev/null +++ b/lexicon/providers/namecom.py @@ -0,0 +1,212 @@ +"""Module provider for Name.com""" +from __future__ import absolute_import + +import logging + +from requests import HTTPError, Session +from requests.auth import HTTPBasicAuth + +from lexicon.providers.base import Provider as BaseProvider + +LOGGER = logging.getLogger(__name__) + +NAMESERVER_DOMAINS = ['name.com'] + +DUPLICATE_ERROR = { + 'message': 'Invalid Argument', + 'details': 'Parameter Value Error - Duplicate Record' +} + + +def provider_parser(subparser): + """Configure a subparser for Name.com.""" + + subparser.add_argument('--auth-username', help='specify a username') + subparser.add_argument('--auth-token', help='specify an API token') + + +class NamecomLoader(object): # pylint: disable=useless-object-inheritance,too-few-public-methods + """Loader that handles pagination for the Name.com provider.""" + + def __init__(self, get, url, data_key, next_page=1): + self.get = get + self.url = url + self.data_key = data_key + self.next_page = next_page + + def __iter__(self): + while self.next_page: + response = self.get(self.url, {'page': self.next_page}) + for data in response[self.data_key]: + yield data + self.next_page = response.get('next_page') + + +class NamecomProvider(BaseProvider): + """Provider implementation for Name.com.""" + + def __init__(self, config): + super(Provider, self).__init__(config) + self.api_endpoint = 'https://api.name.com/v4' + self.session = Session() + + def _authenticate(self): + self.session.auth = HTTPBasicAuth( + username=self._get_provider_option('auth_username'), + password=self._get_provider_option('auth_token') + ) + + # checking domain existence + domain_name = self.domain + for domain in NamecomLoader(self._get, '/domains', 'domains'): + if domain['domainName'] == domain_name: + self.domain_id = domain_name + return + + raise Exception('{} domain does not exist'.format(domain_name)) + + def _create_record(self, rtype, name, content): + data = { + 'type': rtype, + 'host': self._relative_name(name), + 'answer': content, + 'ttl': self._get_lexicon_option('ttl') + } + + if rtype in ('MX', 'SRV'): + # despite the documentation says a priority is + # required for MX and SRV, it's actually optional + priority = self._get_lexicon_option('priority') + if priority: + data['priority'] = priority + + url = '/domains/{}/records'.format(self.domain) + try: + record_id = self._post(url, data)['id'] + except HTTPError as error: + response = error.response + if response.status_code == 400 and \ + response.json() == DUPLICATE_ERROR: + LOGGER.warning( + 'create_record: duplicate record has been skipped' + ) + return True + raise + + LOGGER.debug('create_record: record %s has been created', record_id) + + return record_id + + def _list_records(self, rtype=None, name=None, content=None): + url = '/domains/{}/records'.format(self.domain) + records = [] + + for raw in NamecomLoader(self._get, url, 'records'): + record = { + 'id': raw['id'], + 'type': raw['type'], + 'name': raw['fqdn'][:-1], + 'ttl': raw['ttl'], + 'content': raw['answer'], + } + records.append(record) + + LOGGER.debug('list_records: retrieved %s records', len(records)) + + if rtype: + records = (record for record in records if record['type'] == rtype) + if name: + name = self._full_name(name) + records = (record for record in records if record['name'] == name) + if content: + records = (record for record in records + if record['content'] == content) + + if not isinstance(records, list): + records = list(records) + LOGGER.debug('list_records: filtered %s records', len(records)) + + return records + + def _update_record(self, identifier, rtype=None, name=None, content=None): + if not identifier: + if not (rtype and name): + raise ValueError( + 'Record identifier or rtype+name must be specified' + ) + records = self._list_records(rtype, name) + if not records: + raise Exception('There is no record to update') + + if len(records) > 1: + filtered_records = [record for record in records + if record['content'] == content] + if filtered_records: + records = filtered_records + + if len(records) > 1: + raise Exception( + 'There are multiple records to update: {}'.format( + ', '.join(record['id'] for record in records) + ) + ) + + record_id = records[0]['id'] + else: + record_id = identifier + + data = {'ttl': self._get_lexicon_option('ttl')} + + # even though the documentation says a type and an answer + # are required, they are not required actually + if rtype: + data['type'] = rtype + if name: + data['host'] = self._relative_name(name) + if content: + data['answer'] = content + + url = '/domains/{}/records/{}'.format(self.domain, record_id) + record_id = self._put(url, data)['id'] + logging.debug('update_record: record %s has been updated', record_id) + + return record_id + + def _delete_record(self, identifier=None, + rtype=None, name=None, content=None): + if not identifier: + if not (rtype and name): + raise ValueError( + 'Record identifier or rtype+name must be specified' + ) + records = self._list_records(rtype, name, content) + if not records: + LOGGER.warning('delete_record: there is no record to delete') + return None + record_ids = tuple(record['id'] for record in records) + else: + record_ids = (identifier,) + + for record_id in record_ids: + url = '/domains/{}/records/{}'.format(self.domain, record_id) + self._delete(url) + LOGGER.debug( + 'delete_record: record %s has been deleted', record_id + ) + + return record_ids if len(record_ids) > 1 else record_ids[0] + + def _get_raw_record(self, record_id): + url = '/domains/{}/records/{}'.format(self.domain, record_id) + return self._get(url) + + def _request(self, action='GET', url='/', data=None, query_params=None): + response = self.session.request(method=action, + url=self.api_endpoint + url, + json=data, + params=query_params) + response.raise_for_status() + return response.json() + + +Provider = NamecomProvider diff --git a/lexicon/tests/providers/test_namecom.py b/lexicon/tests/providers/test_namecom.py new file mode 100644 index 000000000..09f26eb7d --- /dev/null +++ b/lexicon/tests/providers/test_namecom.py @@ -0,0 +1,148 @@ +"""Integration tests for Name.com""" +import json +from unittest import TestCase + +import pytest +from mock import ANY, Mock, patch +from requests import HTTPError + +from lexicon.config import DictConfigSource +from lexicon.providers.namecom import provider_parser +from lexicon.tests.providers.integration_tests import ( + IntegrationTests, _vcr_integration_test +) + + +# 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 NamecomProviderTests(TestCase, IntegrationTests): + """TestCase for Name.com""" + + # I don't think we really need some docstrings here. + # pylint: disable=missing-function-docstring + + provider_name = 'namecom' + domain = 'mim.pw' + + def _filter_headers(self): + return ['Authorization', 'Cookie'] + + def _filter_response(self, response): + headers = response['headers'] + headers.pop('Set-Cookie', None) + headers.pop('content-length', None) + + if response['status']['code'] == 200: + try: + data = json.loads(response['body']['string'].decode()) + except ValueError: + pass + else: + if 'records' in data: + min_id = 10 ** 8 + data['records'] = [ + record for record in data['records'] + if record['id'] > min_id + ] + response['body']['string'] = json.dumps(data).encode() + + return response + + ########################### + # Provider.authenticate() # + ########################### + @_vcr_integration_test + def test_provider_authenticate(self): + provider = self._construct_authenticated_provider() + assert provider.session.auth + + ############################ + # Provider.create_record() # + ############################ + @_vcr_integration_test + def test_provider_when_calling_create_record_for_MX_with_priority(self): # pylint: disable=invalid-name + priority = 42 + config = self._test_config() + config.add_config_source(DictConfigSource({'priority': priority}), 0) + provider = self.provider_module.Provider(config) + provider.authenticate() + + record_id = provider.create_record('MX', 'mx.test1', self.domain) + assert provider._get_raw_record(record_id)['priority'] == priority # pylint: disable=protected-access + + @_vcr_integration_test + def test_provider_when_calling_create_record_for_MX_with_no_priority(self): # pylint: disable=invalid-name + provider = self._construct_authenticated_provider() + record_id = provider.create_record('MX', 'mx.test2', self.domain) + assert 'priority' not in provider._get_raw_record(record_id) # pylint: disable=protected-access + + @_vcr_integration_test + def test_provider_when_calling_create_record_should_fail_on_http_error(self): + provider = self._construct_authenticated_provider() + error = HTTPError(response=Mock()) + with patch.object(provider, '_request', side_effect=error): + with pytest.raises(HTTPError): + provider.create_record('TXT', 'httperror', 'HTTPError') + + ############################ + # Provider.update_record() # + ############################ + @_vcr_integration_test + def test_provider_when_calling_update_record_with_no_identifier_or_rtype_and_name_should_fail(self): # pylint: disable=line-too-long + provider = self._construct_authenticated_provider() + with pytest.raises(ValueError): + provider.update_record(None) + + @_vcr_integration_test + def test_provider_when_calling_update_record_should_fail_if_no_record_to_update(self): + provider = self._construct_authenticated_provider() + with pytest.raises(Exception): + provider.update_record(None, 'TXT', 'missingrecord') + + @_vcr_integration_test + def test_provider_when_calling_update_record_should_fail_if_multiple_records_to_update(self): + provider = self._construct_authenticated_provider() + provider.create_record('TXT', 'multiple.test', 'foo') + provider.create_record('TXT', 'multiple.test', 'bar') + with pytest.raises(Exception): + provider.update_record(None, 'TXT', 'multiple.test', 'updated') + + @_vcr_integration_test + def test_provider_when_calling_update_record_filter_by_content_should_pass(self): + provider = self._construct_authenticated_provider() + provider.create_record('TXT', 'multiple.test', 'foo') + provider.create_record('TXT', 'multiple.test', 'bar') + assert provider.update_record(None, 'TXT', 'multiple.test', 'foo') + + @_vcr_integration_test + def test_provider_when_calling_update_record_by_identifier_with_no_other_args_should_pass(self): + provider = self._construct_authenticated_provider() + record_id = provider.create_record('TXT', 'update.test', 'foo') + assert provider.update_record(record_id) + + ############################ + # Provider.delete_record() # + ############################ + @_vcr_integration_test + def test_provider_when_calling_delete_record_with_no_identifier_or_rtype_and_name_should_fail(self): # pylint: disable=line-too-long + provider = self._construct_authenticated_provider() + with pytest.raises(ValueError): + provider.delete_record() + + @_vcr_integration_test + @patch('lexicon.providers.namecom.LOGGER.warning') + def test_provider_when_calling_delete_record_should_pass_if_no_record_to_delete(self, warning): + provider = self._construct_authenticated_provider() + provider.delete_record(None, 'TXT', 'missingrecord') + warning.assert_called_once() + assert 'no record' in warning.call_args.args[0] + + +def test_subparser_configuration(): + """Tests the provider_parser method.""" + + subparser = Mock() + provider_parser(subparser) + subparser.add_argument.assert_any_call('--auth-username', help=ANY) + subparser.add_argument.assert_any_call('--auth-token', help=ANY) diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_authenticate.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_authenticate.yaml new file mode 100644 index 000000000..14bcd9abf --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_authenticate.yaml @@ -0,0 +1,46 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:20 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_authenticate_with_unmanaged_domain_should_fail.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_authenticate_with_unmanaged_domain_should_fail.yaml new file mode 100644 index 000000000..8a1818938 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_authenticate_with_unmanaged_domain_should_fail.yaml @@ -0,0 +1,46 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:21 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_A_with_valid_name_and_content.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_A_with_valid_name_and_content.yaml new file mode 100644 index 000000000..068de9f4a --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_A_with_valid_name_and_content.yaml @@ -0,0 +1,94 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:22 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "A", "host": "localhost", "answer": "127.0.0.1", "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '70' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073536,"domainName":"mim.pw","host":"localhost","fqdn":"localhost.mim.pw.","type":"A","answer":"127.0.0.1","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:22 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_CNAME_with_valid_name_and_content.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_CNAME_with_valid_name_and_content.yaml new file mode 100644 index 000000000..041e2252c --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_CNAME_with_valid_name_and_content.yaml @@ -0,0 +1,95 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:24 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "CNAME", "host": "docs", "answer": "docs.example.com", "ttl": + 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '76' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073537,"domainName":"mim.pw","host":"docs","fqdn":"docs.mim.pw.","type":"CNAME","answer":"docs.example.com","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:24 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_MX_with_no_priority.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_MX_with_no_priority.yaml new file mode 100644 index 000000000..6dfe6e273 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_MX_with_no_priority.yaml @@ -0,0 +1,140 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 14:04:10 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "MX", "host": "mx.test2", "answer": "mim.pw", "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178075932,"domainName":"mim.pw","host":"mx.test2","fqdn":"mx.test2.mim.pw.","type":"MX","answer":"mim.pw","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 14:04:11 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records/178075932 + response: + body: + string: '{"id":178075932,"domainName":"mim.pw","host":"mx.test2","fqdn":"mx.test2.mim.pw.","type":"MX","answer":"mim.pw","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 14:04:11 GMT + ETag: + - '"2b7ca26a06fd14e11fd2316e7b864a42b9df9139-gzip"' + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_MX_with_priority.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_MX_with_priority.yaml new file mode 100644 index 000000000..4d2cb573d --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_MX_with_priority.yaml @@ -0,0 +1,141 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 14:04:12 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "MX", "host": "mx.test1", "answer": "mim.pw", "ttl": 3600, "priority": + 42}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178075933,"domainName":"mim.pw","host":"mx.test1","fqdn":"mx.test1.mim.pw.","type":"MX","answer":"mim.pw","ttl":3600,"priority":42} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 14:04:12 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records/178075933 + response: + body: + string: '{"id":178075933,"domainName":"mim.pw","host":"mx.test1","fqdn":"mx.test1.mim.pw.","type":"MX","answer":"mim.pw","ttl":3600,"priority":42} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 14:04:13 GMT + ETag: + - '"a56ace89aafaeb20ee8da48ee719cb7967b2daf6-gzip"' + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_fqdn_name_and_content.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_fqdn_name_and_content.yaml new file mode 100644 index 000000000..4088ff76d --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_fqdn_name_and_content.yaml @@ -0,0 +1,95 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:25 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.fqdn", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '88' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073538,"domainName":"mim.pw","host":"_acme-challenge.fqdn","fqdn":"_acme-challenge.fqdn.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:25 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_full_name_and_content.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_full_name_and_content.yaml new file mode 100644 index 000000000..3060b307e --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_full_name_and_content.yaml @@ -0,0 +1,95 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:27 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.full", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '88' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073539,"domainName":"mim.pw","host":"_acme-challenge.full","fqdn":"_acme-challenge.full.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:27 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_valid_name_and_content.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_valid_name_and_content.yaml new file mode 100644 index 000000000..10a408d96 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_valid_name_and_content.yaml @@ -0,0 +1,95 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:28 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.test", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '88' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073540,"domainName":"mim.pw","host":"_acme-challenge.test","fqdn":"_acme-challenge.test.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:28 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_multiple_times_should_create_record_set.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_multiple_times_should_create_record_set.yaml new file mode 100644 index 000000000..f505cb7e8 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_multiple_times_should_create_record_set.yaml @@ -0,0 +1,144 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:30 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.createrecordset", "answer": "challengetoken1", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '100' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073541,"domainName":"mim.pw","host":"_acme-challenge.createrecordset","fqdn":"_acme-challenge.createrecordset.mim.pw.","type":"TXT","answer":"challengetoken1","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:30 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.createrecordset", "answer": "challengetoken2", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '100' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073542,"domainName":"mim.pw","host":"_acme-challenge.createrecordset","fqdn":"_acme-challenge.createrecordset.mim.pw.","type":"TXT","answer":"challengetoken2","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:31 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_should_fail_on_http_error.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_should_fail_on_http_error.yaml new file mode 100644 index 000000000..5c13da220 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_should_fail_on_http_error.yaml @@ -0,0 +1,46 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 14:15:09 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_with_duplicate_records_should_be_noop.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_with_duplicate_records_should_be_noop.yaml new file mode 100644 index 000000000..b97351315 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_create_record_with_duplicate_records_should_be_noop.yaml @@ -0,0 +1,201 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:32 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.noop", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '88' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073543,"domainName":"mim.pw","host":"_acme-challenge.noop","fqdn":"_acme-challenge.noop.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:32 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.noop", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '88' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"message":"Invalid Argument","details":"Parameter Value Error - Duplicate + Record"} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - close + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:33 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:35 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_filter_should_remove_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_filter_should_remove_record.yaml new file mode 100644 index 000000000..4f907ce5a --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_filter_should_remove_record.yaml @@ -0,0 +1,259 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:36 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "delete.testfilt", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073546,"domainName":"mim.pw","host":"delete.testfilt","fqdn":"delete.testfilt.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:36 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073546, "domainName": + "mim.pw", "host": "delete.testfilt", "fqdn": "delete.testfilt.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:37 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.23.0 + method: DELETE + uri: https://api.name.com/v4/domains/mim.pw/records/178073546 + response: + body: + string: '{} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:37 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:37 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=96 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_fqdn_name_should_remove_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_fqdn_name_should_remove_record.yaml new file mode 100644 index 000000000..eede146c1 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_fqdn_name_should_remove_record.yaml @@ -0,0 +1,259 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:38 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "delete.testfqdn", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073552,"domainName":"mim.pw","host":"delete.testfqdn","fqdn":"delete.testfqdn.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:39 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073552, "domainName": + "mim.pw", "host": "delete.testfqdn", "fqdn": "delete.testfqdn.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:39 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.23.0 + method: DELETE + uri: https://api.name.com/v4/domains/mim.pw/records/178073552 + response: + body: + string: '{} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:40 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:40 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=96 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_full_name_should_remove_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_full_name_should_remove_record.yaml new file mode 100644 index 000000000..c016dd3f1 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_full_name_should_remove_record.yaml @@ -0,0 +1,259 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:41 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "delete.testfull", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073553,"domainName":"mim.pw","host":"delete.testfull","fqdn":"delete.testfull.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:41 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073553, "domainName": + "mim.pw", "host": "delete.testfull", "fqdn": "delete.testfull.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:42 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.23.0 + method: DELETE + uri: https://api.name.com/v4/domains/mim.pw/records/178073553 + response: + body: + string: '{} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:43 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:43 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=96 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_identifier_should_remove_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_identifier_should_remove_record.yaml new file mode 100644 index 000000000..126171b99 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_by_identifier_should_remove_record.yaml @@ -0,0 +1,259 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:44 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "delete.testid", "answer": "challengetoken", "ttl": + 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '81' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073554,"domainName":"mim.pw","host":"delete.testid","fqdn":"delete.testid.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:45 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073554, "domainName": + "mim.pw", "host": "delete.testid", "fqdn": "delete.testid.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:45 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.23.0 + method: DELETE + uri: https://api.name.com/v4/domains/mim.pw/records/178073554 + response: + body: + string: '{} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:46 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:46 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=96 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_should_pass_if_no_record_to_delete.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_should_pass_if_no_record_to_delete.yaml new file mode 100644 index 000000000..22b182c5b --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_should_pass_if_no_record_to_delete.yaml @@ -0,0 +1,88 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 17:05:11 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": []}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 17:05:11 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_with_no_identifier_or_rtype_and_name_should_fail.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_with_no_identifier_or_rtype_and_name_should_fail.yaml new file mode 100644 index 000000000..791a7d61d --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_with_no_identifier_or_rtype_and_name_should_fail.yaml @@ -0,0 +1,46 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:40:08 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_with_record_set_by_content_should_leave_others_untouched.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_with_record_set_by_content_should_leave_others_untouched.yaml new file mode 100644 index 000000000..df646135b --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_with_record_set_by_content_should_leave_others_untouched.yaml @@ -0,0 +1,313 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:47 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.deleterecordinset", "answer": + "challengetoken1", "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '102' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073555,"domainName":"mim.pw","host":"_acme-challenge.deleterecordinset","fqdn":"_acme-challenge.deleterecordinset.mim.pw.","type":"TXT","answer":"challengetoken1","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:48 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.deleterecordinset", "answer": + "challengetoken2", "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '102' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073556,"domainName":"mim.pw","host":"_acme-challenge.deleterecordinset","fqdn":"_acme-challenge.deleterecordinset.mim.pw.","type":"TXT","answer":"challengetoken2","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:48 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073555, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073556, + "domainName": "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": + "_acme-challenge.deleterecordinset.mim.pw.", "type": "TXT", "answer": "challengetoken2", + "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:49 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.23.0 + method: DELETE + uri: https://api.name.com/v4/domains/mim.pw/records/178073555 + response: + body: + string: '{} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:49 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=96 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:50 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=95 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_with_record_set_name_remove_all.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_with_record_set_name_remove_all.yaml new file mode 100644 index 000000000..e1682b7b2 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_delete_record_with_record_set_name_remove_all.yaml @@ -0,0 +1,361 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:51 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.deleterecordset", "answer": "challengetoken1", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '100' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073557,"domainName":"mim.pw","host":"_acme-challenge.deleterecordset","fqdn":"_acme-challenge.deleterecordset.mim.pw.","type":"TXT","answer":"challengetoken1","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:51 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.deleterecordset", "answer": "challengetoken2", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '100' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073558,"domainName":"mim.pw","host":"_acme-challenge.deleterecordset","fqdn":"_acme-challenge.deleterecordset.mim.pw.","type":"TXT","answer":"challengetoken2","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:52 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073557, + "domainName": "mim.pw", "host": "_acme-challenge.deleterecordset", "fqdn": + "_acme-challenge.deleterecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073558, "domainName": "mim.pw", "host": "_acme-challenge.deleterecordset", + "fqdn": "_acme-challenge.deleterecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:52 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.23.0 + method: DELETE + uri: https://api.name.com/v4/domains/mim.pw/records/178073557 + response: + body: + string: '{} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:53 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=96 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python-requests/2.23.0 + method: DELETE + uri: https://api.name.com/v4/domains/mim.pw/records/178073558 + response: + body: + string: '{} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:53 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=95 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:54 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=94 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_after_setting_ttl.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_after_setting_ttl.yaml new file mode 100644 index 000000000..8aced367b --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_after_setting_ttl.yaml @@ -0,0 +1,157 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:55 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "ttl.fqdn", "answer": "ttlshouldbe3600", "ttl": + 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '77' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073559,"domainName":"mim.pw","host":"ttl.fqdn","fqdn":"ttl.fqdn.mim.pw.","type":"TXT","answer":"ttlshouldbe3600","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:55 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:56 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_should_handle_record_sets.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_should_handle_record_sets.yaml new file mode 100644 index 000000000..803412f31 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_should_handle_record_sets.yaml @@ -0,0 +1,210 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:57 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.listrecordset", "answer": "challengetoken1", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '98' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073560,"domainName":"mim.pw","host":"_acme-challenge.listrecordset","fqdn":"_acme-challenge.listrecordset.mim.pw.","type":"TXT","answer":"challengetoken1","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:57 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "_acme-challenge.listrecordset", "answer": "challengetoken2", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '98' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073561,"domainName":"mim.pw","host":"_acme-challenge.listrecordset","fqdn":"_acme-challenge.listrecordset.mim.pw.","type":"TXT","answer":"challengetoken2","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:58 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:58 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_fqdn_name_filter_should_return_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_fqdn_name_filter_should_return_record.yaml new file mode 100644 index 000000000..7a287c9a9 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_fqdn_name_filter_should_return_record.yaml @@ -0,0 +1,163 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:12:59 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "random.fqdntest", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073562,"domainName":"mim.pw","host":"random.fqdntest","fqdn":"random.fqdntest.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:00 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:00 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_full_name_filter_should_return_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_full_name_filter_should_return_record.yaml new file mode 100644 index 000000000..30ce38f80 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_full_name_filter_should_return_record.yaml @@ -0,0 +1,165 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:01 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "random.fulltest", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073563,"domainName":"mim.pw","host":"random.fulltest","fqdn":"random.fulltest.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:02 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073563, + "domainName": "mim.pw", "host": "random.fulltest", "fqdn": "random.fulltest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:02 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_invalid_filter_should_be_empty_list.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_invalid_filter_should_be_empty_list.yaml new file mode 100644 index 000000000..bdd3c6da5 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_invalid_filter_should_be_empty_list.yaml @@ -0,0 +1,116 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:03 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073563, + "domainName": "mim.pw", "host": "random.fulltest", "fqdn": "random.fulltest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:04 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_name_filter_should_return_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_name_filter_should_return_record.yaml new file mode 100644 index 000000000..c3094c097 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_name_filter_should_return_record.yaml @@ -0,0 +1,167 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:05 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "random.test", "answer": "challengetoken", "ttl": + 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '79' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073565,"domainName":"mim.pw","host":"random.test","fqdn":"random.test.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:05 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073563, + "domainName": "mim.pw", "host": "random.fulltest", "fqdn": "random.fulltest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073565, + "domainName": "mim.pw", "host": "random.test", "fqdn": "random.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:06 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_no_arguments_should_list_all.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_no_arguments_should_list_all.yaml new file mode 100644 index 000000000..373f8b5b7 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_list_records_with_no_arguments_should_list_all.yaml @@ -0,0 +1,118 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:07 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073563, + "domainName": "mim.pw", "host": "random.fulltest", "fqdn": "random.fulltest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073565, + "domainName": "mim.pw", "host": "random.test", "fqdn": "random.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:07 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_by_identifier_with_no_other_args_should_pass.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_by_identifier_with_no_other_args_should_pass.yaml new file mode 100644 index 000000000..1941ce53d --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_by_identifier_with_no_other_args_should_pass.yaml @@ -0,0 +1,144 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:38:05 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "update.test", "answer": "foo", "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '68' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178081584,"domainName":"mim.pw","host":"update.test","fqdn":"update.test.mim.pw.","type":"TXT","answer":"foo","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:38:05 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '13' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: PUT + uri: https://api.name.com/v4/domains/mim.pw/records/178081584 + response: + body: + string: '{"id":178081584,"domainName":"mim.pw","host":"update.test","fqdn":"update.test.mim.pw.","type":"TXT","answer":"foo","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:38:06 GMT + ETag: + - '"aaa02a0b9eb28fc1699cee3dfbf24c15a4ae3269-gzip"' + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_filter_by_content_should_pass.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_filter_by_content_should_pass.yaml new file mode 100644 index 000000000..87f879f95 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_filter_by_content_should_pass.yaml @@ -0,0 +1,237 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:31:55 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "multiple.test", "answer": "foo", "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '70' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178081373,"domainName":"mim.pw","host":"multiple.test","fqdn":"multiple.test.mim.pw.","type":"TXT","answer":"foo","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:31:56 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "multiple.test", "answer": "bar", "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '70' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178081374,"domainName":"mim.pw","host":"multiple.test","fqdn":"multiple.test.mim.pw.","type":"TXT","answer":"bar","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:31:56 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178081373, "domainName": "mim.pw", "host": "multiple.test", + "fqdn": "multiple.test.mim.pw.", "type": "TXT", "answer": "foo", "ttl": 3600}, + {"id": 178081374, "domainName": "mim.pw", "host": "multiple.test", "fqdn": + "multiple.test.mim.pw.", "type": "TXT", "answer": "bar", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:31:57 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"ttl": 3600, "type": "TXT", "host": "multiple.test", "answer": "foo"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '70' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: PUT + uri: https://api.name.com/v4/domains/mim.pw/records/178081373 + response: + body: + string: '{"id":178081373,"domainName":"mim.pw","host":"multiple.test","fqdn":"multiple.test.mim.pw.","type":"TXT","answer":"foo","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:31:57 GMT + ETag: + - '"2f7d93a539a47f91f7440dee95e1ee6eef299765-gzip"' + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=96 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_fail_if_multiple_records_to_update.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_fail_if_multiple_records_to_update.yaml new file mode 100644 index 000000000..a2338774c --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_fail_if_multiple_records_to_update.yaml @@ -0,0 +1,187 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:11:50 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "multiple.test", "answer": "foo", "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '70' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178080673,"domainName":"mim.pw","host":"multiple.test","fqdn":"multiple.test.mim.pw.","type":"TXT","answer":"foo","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:11:51 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "multiple.test", "answer": "bar", "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '70' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178080674,"domainName":"mim.pw","host":"multiple.test","fqdn":"multiple.test.mim.pw.","type":"TXT","answer":"bar","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:11:51 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178080673, "domainName": "mim.pw", "host": "multiple.test", + "fqdn": "multiple.test.mim.pw.", "type": "TXT", "answer": "foo", "ttl": 3600}, + {"id": 178080674, "domainName": "mim.pw", "host": "multiple.test", "fqdn": + "multiple.test.mim.pw.", "type": "TXT", "answer": "bar", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:11:52 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_fail_if_no_record_to_update.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_fail_if_no_record_to_update.yaml new file mode 100644 index 000000000..0badde723 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_fail_if_no_record_to_update.yaml @@ -0,0 +1,88 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:08:37 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": []}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:08:37 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit23 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_modify_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_modify_record.yaml new file mode 100644 index 000000000..a00587887 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_modify_record.yaml @@ -0,0 +1,220 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:08 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "orig.test", "answer": "challengetoken", "ttl": + 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '77' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073566,"domainName":"mim.pw","host":"orig.test","fqdn":"orig.test.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:08 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073563, + "domainName": "mim.pw", "host": "random.fulltest", "fqdn": "random.fulltest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073565, + "domainName": "mim.pw", "host": "random.test", "fqdn": "random.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073566, + "domainName": "mim.pw", "host": "orig.test", "fqdn": "orig.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:09 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "updated.test", "answer": "challengetoken", "ttl": + 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '80' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: PUT + uri: https://api.name.com/v4/domains/mim.pw/records/178073566 + response: + body: + string: '{"id":178073566,"domainName":"mim.pw","host":"updated.test","fqdn":"updated.test.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:09 GMT + ETag: + - '"9a7be5721dc0ed0306a84da4a2413cff82a182ea-gzip"' + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_modify_record_name_specified.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_modify_record_name_specified.yaml new file mode 100644 index 000000000..dcefc815e --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_should_modify_record_name_specified.yaml @@ -0,0 +1,298 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:11 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "orig.nameonly.test", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '86' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073567,"domainName":"mim.pw","host":"orig.nameonly.test","fqdn":"orig.nameonly.test.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:11 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073563, + "domainName": "mim.pw", "host": "random.fulltest", "fqdn": "random.fulltest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073565, + "domainName": "mim.pw", "host": "random.test", "fqdn": "random.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073566, + "domainName": "mim.pw", "host": "updated.test", "fqdn": "updated.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073567, + "domainName": "mim.pw", "host": "orig.nameonly.test", "fqdn": "orig.nameonly.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:11 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073563, + "domainName": "mim.pw", "host": "random.fulltest", "fqdn": "random.fulltest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073565, + "domainName": "mim.pw", "host": "random.test", "fqdn": "random.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073566, + "domainName": "mim.pw", "host": "updated.test", "fqdn": "updated.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073567, + "domainName": "mim.pw", "host": "orig.nameonly.test", "fqdn": "orig.nameonly.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:12 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "orig.nameonly.test", "answer": "updated", "ttl": + 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '79' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: PUT + uri: https://api.name.com/v4/domains/mim.pw/records/178073567 + response: + body: + string: '{"id":178073567,"domainName":"mim.pw","host":"orig.nameonly.test","fqdn":"orig.nameonly.test.mim.pw.","type":"TXT","answer":"updated","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:12 GMT + ETag: + - '"3ca87e35c9ca3a3044923ce9a2fc909df68ef844-gzip"' + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=96 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml new file mode 100644 index 000000000..a47647438 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml @@ -0,0 +1,224 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:13 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "orig.testfqdn", "answer": "challengetoken", "ttl": + 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '81' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073569,"domainName":"mim.pw","host":"orig.testfqdn","fqdn":"orig.testfqdn.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:14 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073563, + "domainName": "mim.pw", "host": "random.fulltest", "fqdn": "random.fulltest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073565, + "domainName": "mim.pw", "host": "random.test", "fqdn": "random.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073566, + "domainName": "mim.pw", "host": "updated.test", "fqdn": "updated.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073567, + "domainName": "mim.pw", "host": "orig.nameonly.test", "fqdn": "orig.nameonly.test.mim.pw.", + "type": "TXT", "answer": "updated", "ttl": 3600}, {"id": 178073569, "domainName": + "mim.pw", "host": "orig.testfqdn", "fqdn": "orig.testfqdn.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:14 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "updated.testfqdn", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '84' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: PUT + uri: https://api.name.com/v4/domains/mim.pw/records/178073569 + response: + body: + string: '{"id":178073569,"domainName":"mim.pw","host":"updated.testfqdn","fqdn":"updated.testfqdn.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:15 GMT + ETag: + - '"bc345a4dece46b5e3ba061b5c37f6bed2326055b-gzip"' + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_with_full_name_should_modify_record.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_with_full_name_should_modify_record.yaml new file mode 100644 index 000000000..7f3945de3 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_with_full_name_should_modify_record.yaml @@ -0,0 +1,226 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:16 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "orig.testfull", "answer": "challengetoken", "ttl": + 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '81' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: POST + uri: https://api.name.com/v4/domains/mim.pw/records + response: + body: + string: '{"id":178073570,"domainName":"mim.pw","host":"orig.testfull","fqdn":"orig.testfull.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:16 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=99 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains/mim.pw/records?page=1 + response: + body: + string: '{"records": [{"id": 178073536, "domainName": "mim.pw", "host": "localhost", + "fqdn": "localhost.mim.pw.", "type": "A", "answer": "127.0.0.1", "ttl": 3600}, + {"id": 178073537, "domainName": "mim.pw", "host": "docs", "fqdn": "docs.mim.pw.", + "type": "CNAME", "answer": "docs.example.com", "ttl": 3600}, {"id": 178073538, + "domainName": "mim.pw", "host": "_acme-challenge.fqdn", "fqdn": "_acme-challenge.fqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073539, + "domainName": "mim.pw", "host": "_acme-challenge.full", "fqdn": "_acme-challenge.full.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073540, + "domainName": "mim.pw", "host": "_acme-challenge.test", "fqdn": "_acme-challenge.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073541, + "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", "fqdn": + "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": "challengetoken1", + "ttl": 3600}, {"id": 178073542, "domainName": "mim.pw", "host": "_acme-challenge.createrecordset", + "fqdn": "_acme-challenge.createrecordset.mim.pw.", "type": "TXT", "answer": + "challengetoken2", "ttl": 3600}, {"id": 178073543, "domainName": "mim.pw", + "host": "_acme-challenge.noop", "fqdn": "_acme-challenge.noop.mim.pw.", "type": + "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073556, "domainName": + "mim.pw", "host": "_acme-challenge.deleterecordinset", "fqdn": "_acme-challenge.deleterecordinset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073559, + "domainName": "mim.pw", "host": "ttl.fqdn", "fqdn": "ttl.fqdn.mim.pw.", "type": + "TXT", "answer": "ttlshouldbe3600", "ttl": 3600}, {"id": 178073560, "domainName": + "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken1", "ttl": 3600}, {"id": 178073561, + "domainName": "mim.pw", "host": "_acme-challenge.listrecordset", "fqdn": "_acme-challenge.listrecordset.mim.pw.", + "type": "TXT", "answer": "challengetoken2", "ttl": 3600}, {"id": 178073562, + "domainName": "mim.pw", "host": "random.fqdntest", "fqdn": "random.fqdntest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073563, + "domainName": "mim.pw", "host": "random.fulltest", "fqdn": "random.fulltest.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073565, + "domainName": "mim.pw", "host": "random.test", "fqdn": "random.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073566, + "domainName": "mim.pw", "host": "updated.test", "fqdn": "updated.test.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073567, + "domainName": "mim.pw", "host": "orig.nameonly.test", "fqdn": "orig.nameonly.test.mim.pw.", + "type": "TXT", "answer": "updated", "ttl": 3600}, {"id": 178073569, "domainName": + "mim.pw", "host": "updated.testfqdn", "fqdn": "updated.testfqdn.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}, {"id": 178073570, + "domainName": "mim.pw", "host": "orig.testfull", "fqdn": "orig.testfull.mim.pw.", + "type": "TXT", "answer": "challengetoken", "ttl": 3600}]}' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:17 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=98 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +- request: + body: '{"type": "TXT", "host": "updated.testfull", "answer": "challengetoken", + "ttl": 3600}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '84' + Content-Type: + - application/json + User-Agent: + - python-requests/2.23.0 + method: PUT + uri: https://api.name.com/v4/domains/mim.pw/records/178073570 + response: + body: + string: '{"id":178073570,"domainName":"mim.pw","host":"updated.testfull","fqdn":"updated.testfull.mim.pw.","type":"TXT","answer":"challengetoken","ttl":3600} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 12:13:17 GMT + ETag: + - '"38161743a7bf47dfc930c438346f7c6b49409997-gzip"' + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=97 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_with_no_identifier_or_rtype_and_name_should_fail.yaml b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_with_no_identifier_or_rtype_and_name_should_fail.yaml new file mode 100644 index 000000000..65782a107 --- /dev/null +++ b/tests/fixtures/cassettes/namecom/IntegrationTests/test_provider_when_calling_update_record_with_no_identifier_or_rtype_and_name_should_fail.yaml @@ -0,0 +1,46 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.23.0 + method: GET + uri: https://api.name.com/v4/domains?page=1 + response: + body: + string: '{"domains":[{"domainName":"aur.im","locked":true,"autorenewEnabled":true,"expireDate":"2021-06-02T00:59:57Z","createDate":"2014-05-30T18:20:13Z"},{"domainName":"mim.pw","locked":true,"autorenewEnabled":true,"expireDate":"2021-05-30T23:59:59Z","createDate":"2014-05-30T18:20:16Z"}]} + + ' + headers: + Cache-Control: + - no-store, no-cache, must-revalidate + Connection: + - Keep-Alive + Content-Type: + - text/html; charset=UTF-8 + Date: + - Thu, 14 May 2020 16:02:08 GMT + Expires: + - Thu, 19 Nov 1981 08:52:00 GMT + Keep-Alive: + - timeout=5, max=100 + Pragma: + - no-cache + Server: + - Apache + Vary: + - Accept-Encoding,User-Agent + Via: + - 1.1 fra1-bit21 + X-Frame-Options: + - SAMEORIGIN + status: + code: 200 + message: OK +version: 1