diff --git a/CODEOWNERS b/CODEOWNERS index 25fe7308c..80b2c3af6 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -54,6 +54,7 @@ lexicon/providers/namecheap.py @pschmitt @rbelnap lexicon/providers/namesilo.py @analogj lexicon/providers/netcup.py @coldfix lexicon/providers/nfsn.py @tersers +lexicon/providers/njalla.py @chapatt lexicon/providers/nsone.py @init-js @trinopoty lexicon/providers/onapp.py @alexzorin lexicon/providers/online.py @kapouer diff --git a/README.md b/README.md new file mode 100644 index 000000000..12cd3dc3a --- /dev/null +++ b/README.md @@ -0,0 +1,294 @@ +

+ + lexicon_view + +

+ + + +# lexicon +Manipulate DNS records on various DNS providers in a standardized/agnostic way. + +[![Build Status](https://dev.azure.com/AnalogJ/lexicon/_apis/build/status/AnalogJ.lexicon?branchName=master)](https://dev.azure.com/AnalogJ/lexicon/_build/latest?definitionId=1&branchName=master) +[![Coverage Status](https://coveralls.io/repos/github/AnalogJ/lexicon/badge.svg)](https://coveralls.io/github/AnalogJ/lexicon?branch=master) +[![Docker Pulls](https://img.shields.io/docker/pulls/analogj/lexicon.svg)](https://hub.docker.com/r/analogj/lexicon) +[![PyPI](https://img.shields.io/pypi/v/dns-lexicon.svg)](https://pypi.python.org/pypi/dns-lexicon) +[![PyPI](https://img.shields.io/pypi/pyversions/dns-lexicon.svg)](https://pypi.python.org/pypi/dns-lexicon) +[![GitHub license](https://img.shields.io/github/license/AnalogJ/lexicon.svg)](https://github.com/AnalogJ/lexicon/blob/master/LICENSE) + +## Introduction +Lexicon provides a way to manipulate DNS records on multiple DNS providers in a standardized way. +Lexicon has a CLI but it can also be used as a python library. + +Lexicon was designed to be used in automation, specifically letsencrypt. + +- [Generating Intranet & Private Network SSL Certificates using Lets Encrypt & Lexicon](http://blog.thesparktree.com/post/138999997429/generating-intranet-and-private-network-ssl) + +## Providers +Only DNS providers who have an API can be supported by `lexicon`. + +The current supported providers are: + +- Aliyun.com ([docs](https://help.aliyun.com/document_detail/29739.html)) +- AuroraDNS ([docs](https://www.pcextreme.com/aurora/dns)) +- AWS Route53 ([docs](https://docs.aws.amazon.com/Route53/latest/APIReference/Welcome.html)) +- Azure DNS ([docs](https://docs.microsoft.com/en-us/rest/api/dns/)) +- Cloudflare ([docs](https://api.cloudflare.com/#endpoints)) +- ClouDNS ([docs](https://www.cloudns.net/wiki/article/56/)) +- CloudXNS ([docs](https://www.cloudxns.net/Support/lists/cid/17.html)) +- ConoHa ([docs](https://www.conoha.jp/docs/)) +- Constellix ([docs](https://api-docs.constellix.com/?version=latest)) +- DigitalOcean ([docs](https://developers.digitalocean.com/documentation/v2/#create-a-new-domain)) +- Dinahosting ([docs](https://en.dinahosting.com/api)) +- DirectAdmin ([docs](https://www.directadmin.com/features.php?id=504)) +- DNSimple (docs: [v1](https://developer.dnsimple.com/), [v2](https://developer.dnsimple.com/v2/)) +- DnsMadeEasy ([docs](https://api-docs.dnsmadeeasy.com/?version=latest)) +- DNSPark ([docs](https://dnspark.zendesk.com/entries/31210577-REST-API-DNS-Documentation)) +- DNSPod ([docs](https://support.dnspod.cn/Support/api)) +- Dreamhost ([docs](https://help.dreamhost.com/hc/en-us/articles/217560167-API_overview)) +- EasyDNS ([docs](http://docs.sandbox.rest.easydns.net/)) +- Easyname ([docs](https://www.easyname.com/en)) +- EUserv ([docs](https://support.euserv.com/api-doc/)) +- ExoScale ([docs](https://community.exoscale.com/documentation/dns/api/)) +- Gandi (docs: [RPC (old)](http://doc.rpc.gandi.net/) / [LiveAPI](http://doc.livedns.gandi.net/)) +- Gehirn ([docs](https://support.gehirn.jp/apidocs/gis/dns/index.html)) +- Glesys ([docs](https://github.com/glesys/API/wiki/)) +- GoDaddy ([docs](https://developer.godaddy.com/getstarted#access)) +- Google Cloud DNS ([docs](https://cloud.google.com/dns/api/v1/)) +- Gransy (sites subreg.cz, regtons.com and regnames.eu, [docs](https://subreg.cz/manual/)) +- Hover ([docs](https://hoverapi.docs.apiary.io/)) +- Hurricane Electric DNS ([docs](https://dns.he.net/)) +- Hetzner ([docs](https://dns.hetzner.com/api-docs/)) +- Infoblox ([docs](https://docs.infoblox.com/display/ILP/Infoblox+Documentation+Portal)) +- Internet.bs ([docs](https://internetbs.net/ResellerRegistrarDomainNameAPI)) +- INWX ([docs](https://www.inwx.de/en/offer/api)) +- Linode ([docs](https://www.linode.com/api/dns)) +- Linode v4 ([docs](https://developers.linode.com/api/docs/v4#tag/Domains)) +- LuaDNS ([docs](http://www.luadns.com/api.html)) +- Memset ([docs](https://www.memset.com/apidocs/methods_dns.html)) +- Namecheap ([docs](https://www.namecheap.com/support/api/methods.aspx)) +- Namesilo ([docs](https://www.namesilo.com/api_reference.php)) +- Netcup ([docs](https://ccp.netcup.net/run/webservice/servers/endpoint.php)) +- NFSN (NearlyFreeSpeech) +- Njalla ([docs](https://njal.la/api/)) +- NS1 ([docs](https://ns1.com/api/)) +- OnApp ([docs](https://docs.onapp.com/display/55API/OnApp+5.5+API+Guide)) +- Online +- OVH ([docs](https://api.ovh.com/)) +- Plesk ([docs](https://docs.plesk.com/en-US/onyx/api-rpc/about-xml-api.28709/)) +- PointHQ ([docs](https://pointhq.com/api/docs)) +- PowerDNS ([docs](https://doc.powerdns.com/md/httpapi/api_spec/)) +- Rackspace ([docs](https://developer.rackspace.com/docs/cloud-dns/v1/developer-guide/)) +- Rage4 ([docs](https://gbshouse.uservoice.com/knowledgebase/articles/109834-rage4-dns-developers-api)) +- RcodeZero ([docs](https://my.rcodezero.at/api-doc)) +- Sakura Cloud by SAKURA Internet Inc. ([docs](https://developer.sakura.ad.jp/cloud/api/1.1/)) +- SafeDNS by UKFast ([docs](https://developers.ukfast.io/documentation/safedns)) +- SoftLayer ([docs](https://sldn.softlayer.com/article/REST#HTTP_Request_Types)) +- Subreg (deprecated, use Gransy) +- Transip ([docs](https://www.transip.nl/transip/api/)) +- Vultr ([docs](https://www.vultr.com/api/)) +- Yandex ([docs](https://tech.yandex.com/domain/doc/reference/dns-add-docpage/)) +- Zeit ([docs](https://zeit.co/api#post-domain-records)) +- Zilore ([docs](https://zilore.com/en/help/api)) +- Zonomi ([docs](http://zonomi.com/app/dns/dyndns.jsp)) + +Potential providers are as follows. If you would like to contribute one, follow the [CONTRIBUTING.md](https://github.com/AnalogJ/lexicon/blob/master/CONTRIBUTING.md) and then open a pull request. + +- AHNames ([docs](https://ahnames.com/en/resellers?tab=2)) +- ~~DurableDNS ([docs](https://durabledns.com/wiki/doku.php/ddns))~~ Can't set TXT records +- cyon.ch +- Dyn ([docs](https://help.dyn.com/dns-api-knowledge-base/)) :dollar: requires paid account +- Dynu +- EntryDNS ([docs](https://entrydns.net/help)) :dollar: requires paid account +- FreeDNS ([docs](https://freedns.afraid.org/scripts/freedns.clients.php)) +- Host Virtual DNS ([docs](https://github.com/hostvirtual/hostvirtual-python-sdk/blob/master/hostvirtual.py)) :dollar: requires paid account +- HostEurope +- Infoblox NIOS +- ironDNS ([docs](https://www.irondns.net/download/soapapiguide.pdf;jsessionid=02A1029AA9FB8BACD2048A60F54668C0)) :dollar: requires paid account +- ISPConfig +- InternetX autoDNS ([docs](https://internetx.com)) +- Knot DNS +- KingHost +- Liquidweb ([docs](https://www.liquidweb.com/storm/api/docs/v1/Network/DNS/Zone.html)) :dollar: requires paid account +- Loopia ([docs](https://www.loopia.com/api/)) :dollar: requires paid account +- Mythic Beasts([docs](https://www.mythic-beasts.com/support/api/primary)) +- NFSN (NearlyFreeSpeech) ([docs](https://api.nearlyfreespeech.net/)) :dollar: requires paid account +- RFC2136 ([docs](https://en.wikipedia.org/wiki/Dynamic_DNS)) +- Servercow ([docs](https://servercow.de)) +- selectel.com +- TELE3 ([docs](https://www.tele3.cz)) +- UltraDNS ([docs](https://restapi.ultradns.com/v1/docs)) :dollar: requires paid account +- UnoEuro API +- VSCALE +- WorldWideDns ([docs](https://www.worldwidedns.net/dns_api_protocol.asp)) :dollar: requires paid account +- Zerigo ([docs](https://www.zerigo.com/managed-dns/rest-api)) :dollar: requires paid account +- Zoneedit ([docs](http://forum.zoneedit.com/index.php?threads/dns-update-api.419/)) +- __Any others I missed__ + +## Setup + +**Warning: it is strongly advised with pip to install Lexicon in a Python virtual environment, in order to avoid interference +between Python modules preinstalled on your system as OS packages and modules installed by pip (see https://docs.python-guide.org/dev/virtualenvs/).** + +To use lexicon as a CLI application, do the following: + + pip install dns-lexicon + +Some providers (like Route53 and TransIP) require additional dependencies. You can install [provider specific dependencies](https://github.com/AnalogJ/lexicon/blob/master/setup.py#L34-L44) separately: + + pip install dns-lexicon[route53] + +To install lexicon with the additional dependencies of every provider, do the following: + + pip install dns-lexicon[full] + +You can also install the latest version from the repository directly. + + pip install git+https://github.com/AnalogJ/lexicon.git + +and with Route 53 provider dependencies: + + pip install git+https://github.com/AnalogJ/lexicon.git#egg=dns-lexicon[route53] + +*As an alternative you can also install Lexicon using the OS packages available for major Linux distributions (see `lexicon` or `dns-lexicon` package in https://pkgs.org/download/lexicon).* + +## Usage + + $ lexicon -h + usage: lexicon [-h] [--version] [--delegated DELEGATED] + {cloudflare,cloudxns,digitalocean,dnsimple,dnsmadeeasy,dnspark,dnspod,easydns,luadns,namesilo,nsone,pointhq,rage4,route53,vultr,yandex,zonomi} + ... + + Create, Update, Delete, List DNS entries + + positional arguments: + {cloudflare,cloudxns,digitalocean,dnsimple,dnsmadeeasy,dnspark,dnspod,easydns,luadns,namesilo,nsone,pointhq,rage4,route53,vultr,yandex,zonomi} + specify the DNS provider to use + cloudflare cloudflare provider + cloudxns cloudxns provider + digitalocean digitalocean provider + ... + rage4 rage4 provider + route53 route53 provider + vultr vultr provider + yandex yandex provider + zonomi zonomi provider + + optional arguments: + -h, --help show this help message and exit + --version show the current version of lexicon + --delegated DELEGATED + specify the delegated domain + + + $ lexicon cloudflare -h + usage: lexicon cloudflare [-h] [--name NAME] [--content CONTENT] [--ttl TTL] + [--priority PRIORITY] [--identifier IDENTIFIER] + [--auth-username AUTH_USERNAME] + [--auth-token AUTH_TOKEN] + {create,list,update,delete} domain + {A,AAAA,CNAME,MX,NS,SPF,SOA,TXT,SRV,LOC} + + positional arguments: + {create,list,update,delete} + specify the action to take + domain specify the domain, supports subdomains as well + {A,AAAA,CNAME,MX,NS,SPF,SOA,TXT,SRV,LOC} + specify the entry type + + optional arguments: + -h, --help show this help message and exit + --name NAME specify the record name + --content CONTENT specify the record content + --ttl TTL specify the record time-to-live + --priority PRIORITY specify the record priority + --identifier IDENTIFIER + specify the record for update or delete actions + --auth-username AUTH_USERNAME + specify email address used to authenticate + --auth-token AUTH_TOKEN + specify token used authenticate + +Using the lexicon CLI is pretty simple: + + # setup provider environmental variables: + export LEXICON_CLOUDFLARE_USERNAME="myusername@example.com" + export LEXICON_CLOUDFLARE_TOKEN="cloudflare-api-token" + + # list all TXT records on cloudflare + lexicon cloudflare list example.com TXT + + # create a new TXT record on cloudflare + lexicon cloudflare create www.example.com TXT --name="_acme-challenge.www.example.com." --content="challenge token" + + # delete a TXT record on cloudflare + lexicon cloudflare delete www.example.com TXT --name="_acme-challenge.www.example.com." --content="challenge token" + lexicon cloudflare delete www.example.com TXT --identifier="cloudflare record id" + +## Authentication +Most supported DNS services provide an API token, however each service implements authentication differently. +Lexicon attempts to standardize authentication around the following CLI flags: + +- `--auth-username` - For DNS services that require it, this is usually the account id or email address +- `--auth-password` - For DNS services that do not provide an API token, this is usually the account password +- `--auth-token` - This is the most common auth method, the API token provided by the DNS service + +You can see all the `--auth-*` flags for a specific service by reading the DNS service specific help: `lexicon cloudflare -h` + +### Environmental Variables + +#### Authentication + +Instead of providing Authentication information via the CLI, you can also specify them via Environmental Variables. +Every DNS service and auth flag maps to an Environmental Variable as follows: `LEXICON_{DNS Provider Name}_{Auth Type}` + +So instead of specifying `--auth-username` and `--auth-token` flags when calling `lexicon cloudflare ...`, +you could instead set the `LEXICON_CLOUDFLARE_USERNAME` and `LEXICON_CLOUDFLARE_TOKEN` environmental variables. + +If you've got a subdomain delegation configured and need records configured within that (eg, you're trying to set `test.foo.example.com` where `foo.example.com` is configured as a separate zone), set `LEXICON_DELEGATED` to the delegated domain. + + LEXICON_DELEGATED=foo.example.com + +#### TLD Cache + +The [tldextract](https://pypi.org/project/tldextract/) library is used by Lexicon to find the actual domain name +from the provided FQDN (eg. `domain.net` is the actual domain in `www.domain.net`). Lexicon stores `tldextract` cache +by default in `~/.lexicon_tld_set` where `~` is the current user's home directory. You can change this path using +the `LEXICON_TLDEXTRACT_CACHE` environment variable. + +For instance, to store `tldextract` cache in `/my/path/to/tld_cache`, you can invoke Lexicon like this from a Linux shell: + + LEXICON_TLDEXTRACT_CACHE=/my/path/to/tld_cache lexicon myprovider create www.example.net TXT ... + +### Letsencrypt Instructions +Lexicon has an example [dehydrated hook file](examples/dehydrated.default.sh) that you can use for any supported provider. +All you need to do is set the PROVIDER env variable. + + PROVIDER=cloudflare dehydrated --cron --hook dehydrated.default.sh --challenge dns-01 + +Lexicon can also be used with [Certbot](https://certbot.eff.org/) and the included [Certbot hook file](examples/certbot.default.sh) (requires configuration). + +## TroubleShooting & Useful Tools +There is an included example Dockerfile that can be used to automatically generate certificates for your website. + +## ToDo list + +- [x] Create and Register a lexicon pip package. +- [ ] Write documentation on supported environmental variables. +- [x] Wire up automated release packaging on PRs. +- [x] Check for additional dns hosts with apis (from [fog](http://fog.io/about/provider_documentation.html), [dnsperf](http://www.dnsperf.com/), [libcloud](https://libcloud.readthedocs.io/en/latest/dns/supported_providers.html)) +- [ ] Get a list of Letsencrypt clients, and create hook files for them ([letsencrypt clients](https://github.com/letsencrypt/letsencrypt/wiki/Links)) + +## Contributing Changes. +If the DNS provider you use is not already available, please consider contributing by opening a pull request and +following the [CONTRIBUTING.md](https://github.com/AnalogJ/lexicon/blob/master/CONTRIBUTING.md) + +## License +- MIT +- [Logo: transform by Mike Rowe from the Noun Project](https://thenounproject.com/term/transform/397964) + + +## References + + tox + diff --git a/lexicon/providers/njalla.py b/lexicon/providers/njalla.py new file mode 100644 index 000000000..ca75f7cca --- /dev/null +++ b/lexicon/providers/njalla.py @@ -0,0 +1,159 @@ +"""Module provider for Njalla""" +from __future__ import absolute_import +import logging + +import requests +from lexicon.providers.base import Provider as BaseProvider + + +LOGGER = logging.getLogger(__name__) + +NAMESERVER_DOMAINS = [ + '1-you.njalla.no', + '2-can.njalla.in', + '3-get.njalla.fo', +] + + +def provider_parser(subparser): + """Module provider for Njalla""" + subparser.add_argument( + "--auth-token", help="specify API token for authentication") + + +class Provider(BaseProvider): + """Provider class for Njalla""" + def __init__(self, config): + super(Provider, self).__init__(config) + self.domain_id = None + self.api_endpoint = 'https://njal.la/api/1/' + + def _authenticate(self): + params = { + 'domain': self.domain, + } + result = self._api_call('get-domain', params) + + if result['name'] != self.domain: + raise Exception('Domain not found') + + self.domain_id = self.domain + + # Create record. If record already exists with the same content, do nothing' + def _create_record(self, rtype, name, content): + params = { + 'domain': self.domain, + 'type': rtype, + 'name': name, + 'content': content, + 'ttl': 10800, + } + if self._get_lexicon_option('ttl'): + params['ttl'] = self._get_lexicon_option('ttl') + result = self._api_call('add-record', params) + + LOGGER.debug('create_record: %s', result) + return result + + # List all records. Return an empty list if no records found + # type, name and content are used to filter records. + # If possible filter during the query, otherwise filter after response is received. + def _list_records(self, rtype=None, name=None, content=None): + params = { + 'domain': self.domain, + } + result = self._api_call('list-records', params) + + records = result['records'] + processed_records = [{ + 'id': record['id'], + 'type': record['type'], + 'name': self._full_name(record['name']), + 'ttl': record['ttl'], + 'content': record['content'], + } for record in records] + filtered_records = [record for record in processed_records if ( + (rtype is None or record['type'] == rtype) + and (name is None or record['name'] == self._full_name(name)) + and (content is None or record['content'] == content))] + + LOGGER.debug('list_records: %s', filtered_records) + return filtered_records + + # Create or update a record. + def _update_record(self, identifier, rtype=None, name=None, content=None): + if not identifier: + identifier = self._get_record_identifier(rtype=rtype, name=name) + + params = { + 'id': identifier, + 'domain': self.domain, + 'content': content, + } + result = self._api_call('edit-record', params) + + LOGGER.debug('update_record: %s', result) + return result + + # Delete an existing record. + # If record does not exist, do nothing. + def _delete_record(self, identifier=None, rtype=None, name=None, content=None): + if not identifier: + identifier = self._get_record_identifier(rtype=rtype, name=name, content=content) + + params = { + 'domain': self.domain, + 'id': identifier, + } + self._api_call('remove-record', params) + + LOGGER.debug('delete_record: %s', True) + return True + + # Helpers + def _api_call(self, method, params): + if self._get_provider_option('auth_token') is None: + raise Exception('Must provide API token') + + data = { + 'method': method, + 'params': params, + } + response = self._request('POST', + "", + data) + + if 'error' in response.keys(): + error = response['error'] + raise Exception('%d: %s' % (error['code'], error['message'])) + + return response['result'] + + def _get_record_identifier(self, rtype=None, name=None, content=None): + records = self._list_records(rtype=rtype, name=name, content=content) + if len(records) == 1: + return records[0]['id'] + + raise Exception('Unambiguous record could not be found.') + + def _request(self, action="GET", url="/", data=None, query_params=None): + if data is None: + data = {} + if query_params is None: + query_params = {} + token = self._get_provider_option('auth_token') + headers = { + 'Authorization': 'Njalla ' + token, + 'Content-Type': 'application/json', + 'Accept': 'application/json', + } + response = requests.request( + action, + self.api_endpoint + url, + headers=headers, + params=query_params, + json=data, + ) + # if the request fails for any reason, throw an error. + response.raise_for_status() + return response.json() diff --git a/lexicon/tests/providers/test_njalla.py b/lexicon/tests/providers/test_njalla.py new file mode 100644 index 000000000..c46cc5fb7 --- /dev/null +++ b/lexicon/tests/providers/test_njalla.py @@ -0,0 +1,26 @@ +"""Integration tests for Njalla provider""" +from unittest import TestCase + +import pytest +from lexicon.tests.providers.integration_tests import IntegrationTestsV2 + +# Hook into testing framework by inheriting unittest.TestCase and reuse +# the tests which *each and every* implementation of the interface must +# pass, by inheritance from integration_tests.IntegrationTests + + +class NjallaProviderTests(TestCase, IntegrationTestsV2): + """TestCase for Njalla""" + provider_name = 'njalla' + domain = 'example.com' + + def _filter_headers(self): + return ['Authorization'] + + @pytest.mark.skip(reason="provider allows duplicate records") + def test_provider_when_calling_create_record_with_duplicate_records_should_be_noop(self): + return + + @pytest.mark.skip(reason="provider does not recognize record sets") + def test_provider_when_calling_delete_record_with_record_set_name_remove_all(self): + return diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_authenticate.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_authenticate.yaml new file mode 100644 index 000000000..4edd18451 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_authenticate.yaml @@ -0,0 +1,64 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:46 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=vIFZ4pKrVGvZZ5wrmYQKLkMfMyAaHSFVH5uCLGWuwnOFlccz19xwD53mkk6xx3vv; + expires=Thu, 19-Aug-2021 22:42:46 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=wllsz5gwhg1tp0n7j55jyzrdkju45prg; expires=Thu, 03-Sep-2020 22:42:46 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_authenticate_with_unmanaged_domain_should_fail.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_authenticate_with_unmanaged_domain_should_fail.yaml new file mode 100644 index 000000000..74a88c9bd --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_authenticate_with_unmanaged_domain_should_fail.yaml @@ -0,0 +1,64 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "thisisadomainidonotown.com"}, "method": + "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '76' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"error": {"code": 403, "message": "permission denied"}, + "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '75' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:46 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=VonTQpL5fdG4twffYy5py2vLTiv5cBLcQ7xZzlJXFfpxxxucBTAHJrjS6XQCcilY; + expires=Thu, 19-Aug-2021 22:42:46 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=oyvqp5anhlkuviiu569i7oawepxk3kic; expires=Thu, 03-Sep-2020 22:42:46 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_A_with_valid_name_and_content.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_A_with_valid_name_and_content.yaml new file mode 100644 index 000000000..d155d1671 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_A_with_valid_name_and_content.yaml @@ -0,0 +1,126 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:47 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=YAbqyChr0mLvpkKKLdB9WfcUs7Hbunh77I9x4G3yM63Z52rCOEBHqkiCPGJwitd6; + expires=Thu, 19-Aug-2021 22:42:47 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=a8l01bx2osmrbr7wcvo1bxovdigylvs8; expires=Thu, 03-Sep-2020 22:42:47 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "127.0.0.1", "domain": "example.com", + "type": "A", "name": "localhost", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '130' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188132, "name": "localhost", "type": + "A", "content": "127.0.0.1", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '116' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:48 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=8yrPeNu9ezVFZWWajXtQYSvWq2DY0DFDjaJly4XOG5GSSeyXTOSNufnJVkcMRRYg; + expires=Thu, 19-Aug-2021 22:42:48 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=2jvbkpxxbq5xd9nc9e14kudu0my6pywp; expires=Thu, 03-Sep-2020 22:42:48 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_CNAME_with_valid_name_and_content.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_CNAME_with_valid_name_and_content.yaml new file mode 100644 index 000000000..cead4d4da --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_CNAME_with_valid_name_and_content.yaml @@ -0,0 +1,126 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:48 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=N9n43Fqaco3Tk22Q38doMeUuAmbyT9nXr0H15YSqGae71608OiBjs9JJ3aecnVW9; + expires=Thu, 19-Aug-2021 22:42:48 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=aed21fw4se1b1xc8dl9l4tpbqi6bcxv7; expires=Thu, 03-Sep-2020 22:42:48 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "docs.example.com", "domain": "example.com", + "type": "CNAME", "name": "docs", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '136' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188133, "name": "docs", "type": + "CNAME", "content": "docs.example.com", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '122' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:49 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=PBb1zdJNj5if9dDhmcaq1WHAwL1IZzldgaaSFLy9jAXaxnDvPtzMejStrq5jvreG; + expires=Thu, 19-Aug-2021 22:42:49 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=e0za396lulbzbpry49mufg3dmq6ps9lm; expires=Thu, 03-Sep-2020 22:42:49 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_fqdn_name_and_content.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_fqdn_name_and_content.yaml new file mode 100644 index 000000000..4a93a21c8 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_fqdn_name_and_content.yaml @@ -0,0 +1,127 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:50 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=c39cDyN5INPfCks9FJpPKefmn5Lsu6KBwfahN2qIp15pjHQmwUb1DX7xq1qQxIl5; + expires=Thu, 19-Aug-2021 22:42:50 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=jluv6o5tcdzi719t3oayhx20baremlkp; expires=Thu, 03-Sep-2020 22:42:50 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "_acme-challenge.fqdn.example.com.", "ttl": 3600}, "method": + "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '159' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '134' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:50 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=Ev2yYZCi4VfgQqRGLRyRPteMf236ETAwEwBpkAry3LcRVUpjsQl8ZTQVT4NygCFO; + expires=Thu, 19-Aug-2021 22:42:50 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=09s1dzkx1w50ltnfrkc34uzuw4zxhs5k; expires=Thu, 03-Sep-2020 22:42:50 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_full_name_and_content.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_full_name_and_content.yaml new file mode 100644 index 000000000..483d2c934 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_full_name_and_content.yaml @@ -0,0 +1,127 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:51 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=eZRYNGo7Ey4RjIX58HnGj0zKkxQPZRXvfOd5kPq9rWrIK89LqsK0paipDFe4dewb; + expires=Thu, 19-Aug-2021 22:42:51 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=yps5uzc4es01ve1ijxy7p1ekqshuqgym; expires=Thu, 03-Sep-2020 22:42:51 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "_acme-challenge.full.example.com", "ttl": 3600}, "method": + "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '158' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188135, "name": "_acme-challenge.full", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '134' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:51 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=JJfJv4zCs6JtR3e8OanXo0t1nysF7wfk5tUpKGGKNzk7M6xA5FF4LNGMKQPgtJHB; + expires=Thu, 19-Aug-2021 22:42:51 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=o9e9fv2fe5ohr7xrnlbxg6sv0s2k6uhw; expires=Thu, 03-Sep-2020 22:42:51 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_valid_name_and_content.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_valid_name_and_content.yaml new file mode 100644 index 000000000..a28223af4 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_for_TXT_with_valid_name_and_content.yaml @@ -0,0 +1,126 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:52 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=TUlw4PMhqqBACbgsm21vOMw1Jw836D16zGuTS3UiW7qEYfQXpUp7M97ILptmsKM6; + expires=Thu, 19-Aug-2021 22:42:52 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=t9a60rhw17sp0a8qdh7799po1yk8vpl8; expires=Thu, 03-Sep-2020 22:42:52 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "_acme-challenge.test", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '148' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188136, "name": "_acme-challenge.test", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '134' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:53 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=B96GvsK1lvTIeUfQyXh2mi8KIX3tuelyeeNZYV0t49pJxenRDB4N4WVLce1JaL5Q; + expires=Thu, 19-Aug-2021 22:42:53 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=u81dph6opj1v42nte0dhkowhvm673fpa; expires=Thu, 03-Sep-2020 22:42:53 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_multiple_times_should_create_record_set.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_multiple_times_should_create_record_set.yaml new file mode 100644 index 000000000..95c98f043 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_create_record_multiple_times_should_create_record_set.yaml @@ -0,0 +1,190 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:53 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=aTsDhpGGOOFZ42NrBWTcWLdsFia8UlrXroSoYbEDmU1shTovVzi0ofTFsVekBMWr; + expires=Thu, 19-Aug-2021 22:42:53 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=6jr4r7mrkyoee5f8yqdz4meltawfdfj1; expires=Thu, 03-Sep-2020 22:42:53 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken1", "domain": "example.com", + "type": "TXT", "name": "_acme-challenge.createrecordset.example.com.", "ttl": + 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '171' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '146' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:54 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=a06GUzRAwT8gBlNafCD1iKWSz7VSsFsgX5yDpiIaUH40oH4e3pWFy6T3ekNKBsFx; + expires=Thu, 19-Aug-2021 22:42:54 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=kvxyflaplgcti3x35apf80olb35zcuzs; expires=Thu, 03-Sep-2020 22:42:54 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken2", "domain": "example.com", + "type": "TXT", "name": "_acme-challenge.createrecordset.example.com.", "ttl": + 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '171' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188138, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '146' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:54 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=V8tQBXeZOn7aRo0SbSOSvysoNGURL2grEF9ZFSNZYP4NkZNyBTs9nwPl2RRzBUVP; + expires=Thu, 19-Aug-2021 22:42:54 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=hxibld27ywkxie8zo9noljpy69odw58u; expires=Thu, 03-Sep-2020 22:42:54 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_filter_should_remove_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_filter_should_remove_record.yaml new file mode 100644 index 000000000..828a28503 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_filter_should_remove_record.yaml @@ -0,0 +1,332 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:55 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=N91PETx7hcGZFerTC6rY7EEptgviGcM2EyNoh7UeUtws495MY4bVrpELVy2xUptz; + expires=Thu, 19-Aug-2021 22:42:55 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=75wmyj11c9113dwzejkzzi3o2j3kqb04; expires=Thu, 03-Sep-2020 22:42:55 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "delete.testfilt", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '143' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188139, "name": "delete.testfilt", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '129' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:56 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=1WgfuROuk1EkkN9UHnegUt77Q96avxn4a6z9lz8E7qZOxXHGGRkZUw8vwUZftS6J; + expires=Thu, 19-Aug-2021 22:42:56 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=bomoni3ghq1ge2l0ibaj54gxoyomg2j0; expires=Thu, 03-Sep-2020 22:42:56 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188139, "name": "delete.testfilt", "type": "TXT", "content": + "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1074' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:56 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=Ndi29MjqKgZHxiSLJJSY9zEwz41EDyOM34UYVKFhISO9ClT8ei464f6T8H2BxZ7I; + expires=Thu, 19-Aug-2021 22:42:56 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=b0g78ohydcnuklixv7nwfcrozzk0rcfv; expires=Thu, 03-Sep-2020 22:42:56 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com", "id": 188139}, "method": + "remove-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '76' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '33' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:57 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=Zb66t1oulsDApJT0htl1xd6d33UB8dq2K2CcL3pMJ1cKCldJlsrLTNI1OKRT8gV8; + expires=Thu, 19-Aug-2021 22:42:57 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=8szzt534lln2gd5tmjg1vd11962hxpsl; expires=Thu, 03-Sep-2020 22:42:57 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '974' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:58 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=mFDk7t0lS2CqH9oEWulHtjyyEetOyMtm4429K8RR0yi2k0AoP4VLyRzSFA4P04ti; + expires=Thu, 19-Aug-2021 22:42:58 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=86u7en82qynb5n0pt1uccnwjlw6kayle; expires=Thu, 03-Sep-2020 22:42:58 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_fqdn_name_should_remove_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_fqdn_name_should_remove_record.yaml new file mode 100644 index 000000000..409ae63bd --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_fqdn_name_should_remove_record.yaml @@ -0,0 +1,333 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:58 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=HdRiwxLRPOcx7Z3pqM2cbAOwG3DlBWNMrRJedJO4PYuD5TKnyOuCz92H2io24G3Z; + expires=Thu, 19-Aug-2021 22:42:58 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=jxi8btgohc0874euc4v7ztpos55dvh4q; expires=Thu, 03-Sep-2020 22:42:58 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "delete.testfqdn.example.com.", "ttl": 3600}, "method": + "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '154' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188140, "name": "delete.testfqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '129' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:59 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=hFB8dly02D5vxgw02iogcre6FaWIAklPCNaPfd16Zp4Qi0SWmO1YMUWFli2YJh0R; + expires=Thu, 19-Aug-2021 22:42:59 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=2uvcvanaijng6fpn0uvfcf68j4bzf9om; expires=Thu, 03-Sep-2020 22:42:59 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188140, "name": "delete.testfqdn", "type": "TXT", "content": + "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1074' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:42:59 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=N2oSmPjePIiOWkQEPMj4Khs9hgHUDZDq5Ti0re2KmGOECNqmpztV4vSOHhMmuSYK; + expires=Thu, 19-Aug-2021 22:42:59 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=uktkq1vmxxaf6xtrvhvhgiwi383ww5pm; expires=Thu, 03-Sep-2020 22:42:59 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com", "id": 188140}, "method": + "remove-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '76' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '33' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:00 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=ijZc4kie5UGbOqd734H5ZBoK3BQyhALRfu6Eq471OHYl9mDMYsOE68Wo0j765FOg; + expires=Thu, 19-Aug-2021 22:43:00 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=3mxnm2nkg8owgaeabk5duy0721cphh8a; expires=Thu, 03-Sep-2020 22:43:00 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '974' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:01 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=mhgnDS1tFV4kHww6UEE9m3SECGlweFpInS97HRHPExx3LhmF8n9RPXA6HXdMEhQi; + expires=Thu, 19-Aug-2021 22:43:01 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=rbc2p31y058ivxejey3u708z7rlvnbx1; expires=Thu, 03-Sep-2020 22:43:01 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_full_name_should_remove_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_full_name_should_remove_record.yaml new file mode 100644 index 000000000..466af9b90 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_filter_with_full_name_should_remove_record.yaml @@ -0,0 +1,333 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:01 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=FzJYxbbd3TLjCeuc1LyW83ujaXs2QqjcS3tjhyy9pjaOhh2hBODkXvwS3YaiunEk; + expires=Thu, 19-Aug-2021 22:43:01 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=ytn15yy5c9b135ynqf4jdvl12o04lmvr; expires=Thu, 03-Sep-2020 22:43:01 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "delete.testfull.example.com", "ttl": 3600}, "method": + "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '153' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188141, "name": "delete.testfull", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '129' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:02 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=Rv975lxJIj1Gr3Bbi2kpVVxJIAwnHSeu3OLsqXSIMSBg4wGLUeypRp834gYtR2Pk; + expires=Thu, 19-Aug-2021 22:43:02 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=4nm6gi96z8jvpcnyyvsk2c92imb2u57d; expires=Thu, 03-Sep-2020 22:43:02 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188141, "name": "delete.testfull", "type": "TXT", "content": + "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1074' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:02 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=8WxsPy47EWoyGoNw5DpEfT3XxHl76skPKBfobl4Jn8j2edb5UJiyTq6jeatLgOkl; + expires=Thu, 19-Aug-2021 22:43:02 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=dpop6hmzpjymlrxpi56fbozzwlqtlzs5; expires=Thu, 03-Sep-2020 22:43:02 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com", "id": 188141}, "method": + "remove-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '76' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '33' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:03 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=KQdDnKP4jD6hBdPhBuwcKP3v6hyEXFrHbQle7hVWdxnj9kt7Xf2hSx3wjy6U4n5p; + expires=Thu, 19-Aug-2021 22:43:03 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=s242twvg4y49w78szkgets4kn0k51pka; expires=Thu, 03-Sep-2020 22:43:03 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '974' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:04 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=dLPDOWm4YpWEAuBzCCb9IpguqKR1DIAiVcEtn5FM5tDAaF91XKaHe9YG7zg5OdlH; + expires=Thu, 19-Aug-2021 22:43:04 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=yruotfchx3rejqq0vntb0ffy39me996b; expires=Thu, 03-Sep-2020 22:43:04 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_identifier_should_remove_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_identifier_should_remove_record.yaml new file mode 100644 index 000000000..e718b2e25 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_by_identifier_should_remove_record.yaml @@ -0,0 +1,332 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:04 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=aLR9VFOcvLuVNmvPCQDFZ21mVBj1D4NFDb2sU89ctRFO264eJDo6Ci3Z6Ak0B2B9; + expires=Thu, 19-Aug-2021 22:43:04 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=50dputqmrn1dkkro0zz9ke626qp4ppt8; expires=Thu, 03-Sep-2020 22:43:04 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "delete.testid", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188142, "name": "delete.testid", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '127' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:05 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=aPqHtT2Dvt3AmphHQKSGSP61HuGBBeaDWyigL7tQqpvp2ERpwPAXZh7qtizT005T; + expires=Thu, 19-Aug-2021 22:43:05 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=7r63h1dbl5d1zam9c8p5i5ha18il1boz; expires=Thu, 03-Sep-2020 22:43:05 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188142, "name": "delete.testid", "type": "TXT", "content": + "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1072' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:06 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=fq3CId1HwEc9FylTxL3CobnLTlhwTZGolmQSWdK2IGlDjN5R4sqEwMLPw60TL950; + expires=Thu, 19-Aug-2021 22:43:06 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=mu88lmkng0x1oi1z2x4946lwcr7qcjp0; expires=Thu, 03-Sep-2020 22:43:06 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com", "id": 188142}, "method": + "remove-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '76' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '33' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:06 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=KZugayx7mE4TCuEtcH3iEzNlFk98rP6ssGNHGKj3OFdwszoodB7JzHPtmz1mNsTi; + expires=Thu, 19-Aug-2021 22:43:06 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=u6z9fvd7egn9v7d1l3294jaiqh1wvdql; expires=Thu, 03-Sep-2020 22:43:06 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '974' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:07 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=avUUzTWguGPjc25CDCPfPTejI0VmtgXWnRyo7uJwQJYbdBkg9vXc2POMoZoa1vSA; + expires=Thu, 19-Aug-2021 22:43:07 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=gqu8ckwokz5tcwyq7yhmc7zjylx5jg65; expires=Thu, 03-Sep-2020 22:43:07 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_with_record_set_by_content_should_leave_others_untouched.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_with_record_set_by_content_should_leave_others_untouched.yaml new file mode 100644 index 000000000..88314495d --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_delete_record_with_record_set_by_content_should_leave_others_untouched.yaml @@ -0,0 +1,399 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:07 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=Vio488YVT9YXnJhZXHtr2MOrB26qqwc5SnuvmTDomhjmRqsyBP3p9WcCLkHNIZNo; + expires=Thu, 19-Aug-2021 22:43:07 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=cqq46iiljtu6vxp0z3yytnfem3vuiszf; expires=Thu, 03-Sep-2020 22:43:07 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken1", "domain": "example.com", + "type": "TXT", "name": "_acme-challenge.deleterecordinset.example.com.", "ttl": + 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '173' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188143, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '148' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:08 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=XmNRDD02Q0n2wFBx6PpYoAKLTwmIEqLujwG7p1LMWw8rt1uloVAWdpQlx6q2iCZt; + expires=Thu, 19-Aug-2021 22:43:08 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=c6wacrmeq8liehy3evq8qz3wsn7p5roo; expires=Thu, 03-Sep-2020 22:43:08 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken2", "domain": "example.com", + "type": "TXT", "name": "_acme-challenge.deleterecordinset.example.com.", "ttl": + 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '173' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '148' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:09 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=jmooRjPXBf2pd9lScVcxn0RE0vS22BVJXOaOahANforZ3ryrsnYqmDfFPBntr0TA; + expires=Thu, 19-Aug-2021 22:43:09 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=hxd400o2e4qnwoijk0ds8fxfqzcjtcvy; expires=Thu, 03-Sep-2020 22:43:09 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188143, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188144, + "name": "_acme-challenge.deleterecordinset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1212' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:09 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=R1ZikIpFsEIE3FifJyq9zhte4yeLK8sSi1zQQrFWIDwOsmIgvI9mJFMsD9M4H9D9; + expires=Thu, 19-Aug-2021 22:43:09 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=ba68s750oss5p8pcv47x3j168981yfz7; expires=Thu, 03-Sep-2020 22:43:09 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com", "id": 188143}, "method": + "remove-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '76' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '33' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:10 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=TeloMw3EMK5iZqts9r4dIsxKuwfG34LVlF2XdSZUbc9nXPXWQ1zpFuzHqM78yJeZ; + expires=Thu, 19-Aug-2021 22:43:10 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=6tqaele9tqwzrnbi7zqkc3f4lui8cs49; expires=Thu, 03-Sep-2020 22:43:10 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1093' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:10 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=FIliVRmqBygdcVAcAIN5aE3y9i0zwZD0ANu4tQkUzsIGk1HwGDWXqhrMPnlIyil3; + expires=Thu, 19-Aug-2021 22:43:10 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=fwg4rbzn59k6feqwpp1ucr2gt30jusku; expires=Thu, 03-Sep-2020 22:43:10 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_after_setting_ttl.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_after_setting_ttl.yaml new file mode 100644 index 000000000..6f39a65fb --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_after_setting_ttl.yaml @@ -0,0 +1,201 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:11 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=RRLixxMrj4sUiuIVqqiHgy1x5i3r3LtHQ7HlIkFp2OqLePx3iwPjZqVeikKWzLnv; + expires=Thu, 19-Aug-2021 22:43:11 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=h7t74do129nxg7lxsacr9h5uo2k1omub; expires=Thu, 03-Sep-2020 22:43:11 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "ttlshouldbe3600", "domain": "example.com", + "type": "TXT", "name": "ttl.fqdn.example.com.", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '148' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188145, "name": "ttl.fqdn", "type": + "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '123' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:12 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=yj5jgEGBAJJn7GLR5eMyGVVvPz9FKea5w3coDDovMq7jbnzdTsoQs7TYKxCs9SWc; + expires=Thu, 19-Aug-2021 22:43:12 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=b3nomak3lo8eptcda0y3e2a83n39mkux; expires=Thu, 03-Sep-2020 22:43:12 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}]}, + "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1187' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:12 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=yf0I0WB2vYoVScCkEceEEQYyv1N0eC182Y5PuvpH0VFri139oo0MEd9kaYLl0KQA; + expires=Thu, 19-Aug-2021 22:43:12 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=m11bebhbova82b7jnarv4a0wbb7cyq9h; expires=Thu, 03-Sep-2020 22:43:12 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_should_handle_record_sets.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_should_handle_record_sets.yaml new file mode 100644 index 000000000..864c319b2 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_should_handle_record_sets.yaml @@ -0,0 +1,267 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:13 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=7TYtX2Kt1VWHf3BmYT43euwqKssunqsPH68AUoQF6FyzNu6yZvpFPSjfmcc4NNgl; + expires=Thu, 19-Aug-2021 22:43:13 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=bzg81fnm0kyoman0f51zh8map6obd2ib; expires=Thu, 03-Sep-2020 22:43:13 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken1", "domain": "example.com", + "type": "TXT", "name": "_acme-challenge.listrecordset.example.com.", "ttl": 3600}, + "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '169' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188146, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '144' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:14 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=fY2cVjEPhj7Lps8mtQGo3yaiNTTKdJCUlLaYFx47GaIwckfLSWSn1ZLOjH4d3Azy; + expires=Thu, 19-Aug-2021 22:43:14 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=re1h93ub37n02qkrxsm8hcrjd4huermz; expires=Thu, 03-Sep-2020 22:43:14 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken2", "domain": "example.com", + "type": "TXT", "name": "_acme-challenge.listrecordset.example.com.", "ttl": 3600}, + "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '169' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '144' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:14 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=RJH1GpdhCBkU7yZtJqSLN9HSWG95pnST3ufzKT7sJCYqVIfSlVx7bLG2kHmkUhTW; + expires=Thu, 19-Aug-2021 22:43:14 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=22fx9nm5bkhmnpxzhs944rgn7gjeye9c; expires=Thu, 03-Sep-2020 22:43:14 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1417' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:15 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=7sKV2JmRafPNIfBFNqQ4IgyuaMxqee8uhQ2Gp7sDqNvO0W8IjmJfMs9GXApgTuam; + expires=Thu, 19-Aug-2021 22:43:15 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=lfrg729xnav4otfeex9k8kivhi9vm7cl; expires=Thu, 03-Sep-2020 22:43:15 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_fqdn_name_filter_should_return_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_fqdn_name_filter_should_return_record.yaml new file mode 100644 index 000000000..02293d8f0 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_fqdn_name_filter_should_return_record.yaml @@ -0,0 +1,206 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:15 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=WvPJDy3s4N5WVfo3ntNvI6MxkyPlP4mGTe4V718IhtRWkttHoP9cTzH0n3wgp4Hy; + expires=Thu, 19-Aug-2021 22:43:15 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=w9e2ggo47x3xesgexdn1go8i56xjy5z1; expires=Thu, 03-Sep-2020 22:43:15 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "random.fqdntest.example.com.", "ttl": 3600}, "method": + "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '154' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188148, "name": "random.fqdntest", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '129' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:16 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=1n0yq0MhiIBlys8cHoZkQm92SQzU2aCvCidGIGInYCm6LbpLn8SVRcssFAqf78ky; + expires=Thu, 19-Aug-2021 22:43:16 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=5pmgcr0z5pp21u3ihw7cz4pw5wucg3lh; expires=Thu, 03-Sep-2020 22:43:16 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188148, + "name": "random.fqdntest", "type": "TXT", "content": "challengetoken", "ttl": + 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1517' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:17 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=yK4JX4h1dIuDeQ3ZdGz1VLaP2Rml8zO8aJui8Ys6NFC1opiXc8WitULZgRtOjcvY; + expires=Thu, 19-Aug-2021 22:43:17 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=c8chfhsvqxhx8z83y0j659mpdgt1ts27; expires=Thu, 03-Sep-2020 22:43:17 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_full_name_filter_should_return_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_full_name_filter_should_return_record.yaml new file mode 100644 index 000000000..202e7af6d --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_full_name_filter_should_return_record.yaml @@ -0,0 +1,207 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:17 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=Uw0ZMNgIG1T8OKKLt4t2d5YVIAkVRvLWIWPKnv2ZKS5g0n0lPFvEIyspMpnMq6cy; + expires=Thu, 19-Aug-2021 22:43:17 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=7prhxujbqzheigrxti2s365afsc52upe; expires=Thu, 03-Sep-2020 22:43:17 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "random.fulltest.example.com", "ttl": 3600}, "method": + "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '153' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188149, "name": "random.fulltest", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '129' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:18 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=khyljbThOmmrI5jyEkwpZ7w0jLDOv7jcr6Mwrkz3eIXa6dElH7yHbIxBvIWPexie; + expires=Thu, 19-Aug-2021 22:43:18 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=hwxhwhnvz42obhwfqv4l01hflzzpeek5; expires=Thu, 03-Sep-2020 22:43:18 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188148, + "name": "random.fqdntest", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188149, "name": "random.fulltest", "type": "TXT", "content": + "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1617' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:18 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=obIgyXxXW4YgYEGlwIjGIBckHDPP9nCWi08fuZSRTJSikFzEmVee6Zml9CF44xM2; + expires=Thu, 19-Aug-2021 22:43:18 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=fa7rrizx2l7jlvwrkkhqcwcmsdsb6jku; expires=Thu, 03-Sep-2020 22:43:18 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_invalid_filter_should_be_empty_list.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_invalid_filter_should_be_empty_list.yaml new file mode 100644 index 000000000..0cd3b73ce --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_invalid_filter_should_be_empty_list.yaml @@ -0,0 +1,144 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:19 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=6kTNFaHEusY8J9ZvLlELMpMicnqdJXiyKhctdlGXEsLTSATP3GQjR0UbboRnEVMx; + expires=Thu, 19-Aug-2021 22:43:19 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=c2anedf2t6drwr9agd79poapray3aeok; expires=Thu, 03-Sep-2020 22:43:19 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188148, + "name": "random.fqdntest", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188149, "name": "random.fulltest", "type": "TXT", "content": + "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1617' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:20 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=TFQ7aStPbVqAc7DHuwgiM6LmRSfvJMdT6nuLUo34oElaEo4gsjy8Yu8iDYoXYUAS; + expires=Thu, 19-Aug-2021 22:43:20 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=06wshoa16km4r3nq39os1g3tgz7h0v0b; expires=Thu, 03-Sep-2020 22:43:20 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_name_filter_should_return_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_name_filter_should_return_record.yaml new file mode 100644 index 000000000..2bc6212d3 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_name_filter_should_return_record.yaml @@ -0,0 +1,207 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:20 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=cZpklF8FvUAT4CNqgRtLR1JmpuXvKE5XXu1nvkcVGnUm8fjRgb40iZdBYVdvUiw1; + expires=Thu, 19-Aug-2021 22:43:20 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=o7j3ivtdrk08jsn5c6ca7tddvi67vqsm; expires=Thu, 03-Sep-2020 22:43:20 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "random.test", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '139' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188150, "name": "random.test", "type": + "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '125' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:21 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=hnH5yQ7P1nK1bK0UCzgRZ4sD7lzKTXo08eI2EVWpwZ0fRlghEZ8QOD90hPRucXSd; + expires=Thu, 19-Aug-2021 22:43:21 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=h54tmisi6m6qj1cjxfj9ns3xks52gir7; expires=Thu, 03-Sep-2020 22:43:21 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188148, + "name": "random.fqdntest", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188149, "name": "random.fulltest", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188150, "name": "random.test", "type": + "TXT", "content": "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1713' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:21 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=bc9Fhg7eV12gwKLDcqwK79uLD5eDFN3Qz7sDYGEvMcqrL4sihruuzDmCRws6ltcI; + expires=Thu, 19-Aug-2021 22:43:21 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=9nwqwl7ql3zdddt0rhfi4dmlcw72ygvw; expires=Thu, 03-Sep-2020 22:43:21 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_no_arguments_should_list_all.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_no_arguments_should_list_all.yaml new file mode 100644 index 000000000..6804addf3 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_list_records_with_no_arguments_should_list_all.yaml @@ -0,0 +1,145 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:22 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=Nd5zo7B9QMmwq6uzsUk9q0B165j0Y5wMPItTtHmIQSmcn2qVrMlQKovtCXNDa74F; + expires=Thu, 19-Aug-2021 22:43:22 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=du2ql61wa847zssez36x128sba0r9cmo; expires=Thu, 03-Sep-2020 22:43:22 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188148, + "name": "random.fqdntest", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188149, "name": "random.fulltest", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188150, "name": "random.test", "type": + "TXT", "content": "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1713' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:23 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=Aai3o0aMsTivcf0OcIbqTGUI8CkuvvnP597bh6siMPRIWH8hTiR6jRZ44sKFhel4; + expires=Thu, 19-Aug-2021 22:43:23 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=dfywfgmve0z4ufvy2yx9jzotqeorj2dx; expires=Thu, 03-Sep-2020 22:43:23 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_should_modify_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_should_modify_record.yaml new file mode 100644 index 000000000..ce1a51104 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_should_modify_record.yaml @@ -0,0 +1,270 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:23 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=opF9sY2B4gZm2976NPtU1mGVsDMdmnxLS24c1pWn0Yr9mmjLzYjyH41Y8QnDEdsJ; + expires=Thu, 19-Aug-2021 22:43:23 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=crnquep8u7fao6qs5c9kgc894df434ui; expires=Thu, 03-Sep-2020 22:43:23 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "orig.test", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '137' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188151, "name": "orig.test", "type": + "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '123' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:24 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=QNzx1NQIjCKPF35fMga4QSJzb8oVPSDbLy5yi26ckPq7vHkyHLsVR5LPPsAhV91b; + expires=Thu, 19-Aug-2021 22:43:24 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=fd7525mk3mb5an44hwsg01u1lx2xe7zu; expires=Thu, 03-Sep-2020 22:43:24 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188148, + "name": "random.fqdntest", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188149, "name": "random.fulltest", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188150, "name": "random.test", "type": + "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188151, "name": "orig.test", + "type": "TXT", "content": "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1807' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:25 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=MeANLTCHgxYT6GgseJ6gQ9RvvHyhvATVLUJHG4VSYnq6Msd37uzT5Ok41CpEmEgk; + expires=Thu, 19-Aug-2021 22:43:25 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=r20k6ndf7crm7vml1x2aqfeybcq5rigs; expires=Thu, 03-Sep-2020 22:43:25 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "id": 188151}, "method": "edit-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '103' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188151, "name": "orig.test", "type": + "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '123' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:25 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=o84u4wJ64jFLaMgVrGAOkB2mE02aTWi5m6Ch37Zl4CLG60qgoBd74JtBUvthA3Lu; + expires=Thu, 19-Aug-2021 22:43:25 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=8739ztmylqdz52i24iiig8x0jnk84qbf; expires=Thu, 03-Sep-2020 22:43:25 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_should_modify_record_name_specified.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_should_modify_record_name_specified.yaml new file mode 100644 index 000000000..c5c5b3466 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_should_modify_record_name_specified.yaml @@ -0,0 +1,272 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:26 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=PWaG18zvzEqNDFtbcL3a2Ihi8PgRMhMACePNPTPXVxWKNV5jqvaDJoeH1zmoKgBj; + expires=Thu, 19-Aug-2021 22:43:26 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=b8ah7sai9ewlpl76rc3qzee43pjxhj7u; expires=Thu, 03-Sep-2020 22:43:26 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "orig.nameonly.test", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '146' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188152, "name": "orig.nameonly.test", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '132' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:27 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=71ChKlLS81mTAy3nBnkbidtUcPdu4hWx0GYXzTbLs8st0O3SyVM3uyoTAionJXIX; + expires=Thu, 19-Aug-2021 22:43:27 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=g4nhlcqa53v1wxi6vks2ln7ah2a9o41r; expires=Thu, 03-Sep-2020 22:43:27 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188148, + "name": "random.fqdntest", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188149, "name": "random.fulltest", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188150, "name": "random.test", "type": + "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188151, "name": "orig.test", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188152, "name": + "orig.nameonly.test", "type": "TXT", "content": "challengetoken", "ttl": 3600}]}, + "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '1910' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:27 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=WgUmx4Qx1zve6uRj9PkextbMA0z29vThmEjXpCGz4CXKQL184KdowAt9kiyKw8pY; + expires=Thu, 19-Aug-2021 22:43:27 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=xeppf4qbay5v9mk9izea3h615y9k6s1r; expires=Thu, 03-Sep-2020 22:43:27 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "updated", "domain": "example.com", + "id": 188152}, "method": "edit-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '96' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188152, "name": "orig.nameonly.test", + "type": "TXT", "content": "updated", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '125' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:28 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=LUriXGegzauvDR0cpVO0yM8xpiVVQb1OVsENjyhvm5lThvT0ursahGgDSBLels7V; + expires=Thu, 19-Aug-2021 22:43:28 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=rrgyuwzg9hfyjk9v3j2u3ksbd470ucpn; expires=Thu, 03-Sep-2020 22:43:28 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml new file mode 100644 index 000000000..41d58beec --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml @@ -0,0 +1,273 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:28 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=hGcGR5KTNIOgVF2FmiYXPtMfqb40XLtlKqqh3UFpSaQT7M6wsR3nSh4dVsd0vtQN; + expires=Thu, 19-Aug-2021 22:43:28 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=7l5tw8algdnggd9eunzsjp33ookcejrh; expires=Thu, 03-Sep-2020 22:43:28 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "orig.testfqdn.example.com.", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '152' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188153, "name": "orig.testfqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '127' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:29 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=IACqWbq0MQPl1kUkAyT53Rm9dci6YX8hopkUDuRqAFk9wpM2gIAM6K2BWLKeh6tz; + expires=Thu, 19-Aug-2021 22:43:29 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=7f22nyfgo6fc4a1xoz2a5r2ex4axwt4x; expires=Thu, 03-Sep-2020 22:43:29 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188148, + "name": "random.fqdntest", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188149, "name": "random.fulltest", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188150, "name": "random.test", "type": + "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188151, "name": "orig.test", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188152, "name": + "orig.nameonly.test", "type": "TXT", "content": "updated", "ttl": 3600}, {"id": + 188153, "name": "orig.testfqdn", "type": "TXT", "content": "challengetoken", + "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '2001' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:30 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=s1oKCaR3ekOz4Lbm25hHqGKJWF0jCokYSUTyb7JOgCIuzclXvneDgLSjKTTC5BFE; + expires=Thu, 19-Aug-2021 22:43:30 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=62rb6wvamzhv64t8yaqh8nm27pf74dg2; expires=Thu, 03-Sep-2020 22:43:30 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "id": 188153}, "method": "edit-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '103' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188153, "name": "orig.testfqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '127' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:30 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=9AlIUt0J1I6moWxCjGII2zxC2V0hydctdyUz4OC8nECMD3dNCZ53ddtfLYE9bsme; + expires=Thu, 19-Aug-2021 22:43:30 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=ddmq4qdn30z5tz7nsozcb78x5mwlvsju; expires=Thu, 03-Sep-2020 22:43:30 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_with_full_name_should_modify_record.yaml b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_with_full_name_should_modify_record.yaml new file mode 100644 index 000000000..a520d7363 --- /dev/null +++ b/tests/fixtures/cassettes/njalla/IntegrationTests/test_provider_when_calling_update_record_with_full_name_should_modify_record.yaml @@ -0,0 +1,274 @@ +interactions: +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "get-domain"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"name": "example.com", "status": "active", + "expiry": "2021-06-29T23:53:03Z", "mailforwarding": false, "max_nameservers": + 10, "dnssec_type": "dsData"}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '179' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:31 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=OqzVswXWvcG908S6AFoiJWqpgCrI9SNfWAKFJS9hhJe0aknN6Hu9woJGmww0oYic; + expires=Thu, 19-Aug-2021 22:43:31 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=0zmz1bipb4mz7gpvgxkgggs8dwtlaj4c; expires=Thu, 03-Sep-2020 22:43:31 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "type": "TXT", "name": "orig.testfull.example.com", "ttl": 3600}, "method": "add-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '151' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188154, "name": "orig.testfull", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '127' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:31 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=wVhBiOK9yJKgleYGEL0YCyYFymXxGU30YO5RQSyRZtDZampv3ePo9ZiaXnGGsfAy; + expires=Thu, 19-Aug-2021 22:43:31 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=h3n5cs9lsmq6cl9cax5vjih3rcz2jhv9; expires=Thu, 03-Sep-2020 22:43:31 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"domain": "example.com"}, "method": "list-records"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '61' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"records": [{"id": 188132, "name": "localhost", + "type": "A", "content": "127.0.0.1", "ttl": 3600}, {"id": 133783, "name": + "@", "type": "Dynamic", "content": "hj96h42che8lw1l2", "ttl": 60, "update_url": + "https://njal.la/update/?h=example.com&k=hj96h42che8lw1l2&auto", "current_ips": + ["35.139.63.101"]}, {"id": 188133, "name": "docs", "type": "CNAME", "content": + "docs.example.com", "ttl": 3600}, {"id": 188134, "name": "_acme-challenge.fqdn", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188135, "name": + "_acme-challenge.full", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188136, "name": "_acme-challenge.test", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188137, "name": "_acme-challenge.createrecordset", + "type": "TXT", "content": "challengetoken1", "ttl": 3600}, {"id": 188138, + "name": "_acme-challenge.createrecordset", "type": "TXT", "content": "challengetoken2", + "ttl": 3600}, {"id": 188144, "name": "_acme-challenge.deleterecordinset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188145, + "name": "ttl.fqdn", "type": "TXT", "content": "ttlshouldbe3600", "ttl": 3600}, + {"id": 188146, "name": "_acme-challenge.listrecordset", "type": "TXT", "content": + "challengetoken1", "ttl": 3600}, {"id": 188147, "name": "_acme-challenge.listrecordset", + "type": "TXT", "content": "challengetoken2", "ttl": 3600}, {"id": 188148, + "name": "random.fqdntest", "type": "TXT", "content": "challengetoken", "ttl": + 3600}, {"id": 188149, "name": "random.fulltest", "type": "TXT", "content": + "challengetoken", "ttl": 3600}, {"id": 188150, "name": "random.test", "type": + "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188151, "name": "orig.test", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, {"id": 188152, "name": + "orig.nameonly.test", "type": "TXT", "content": "updated", "ttl": 3600}, {"id": + 188153, "name": "orig.testfqdn", "type": "TXT", "content": "challengetoken", + "ttl": 3600}, {"id": 188154, "name": "orig.testfull", "type": "TXT", "content": + "challengetoken", "ttl": 3600}]}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '2099' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:32 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=J0hQ9iTvCEdABIAPUJrk0yAcvz9XarDSGHLry5gOF8oLJSuXLV3oAQRMnv1LUlm7; + expires=Thu, 19-Aug-2021 22:43:32 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=iwa4nz3a0uo2sqomxakdq89f0k4ktlx2; expires=Thu, 03-Sep-2020 22:43:32 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: !!python/unicode '{"params": {"content": "challengetoken", "domain": "example.com", + "id": 188154}, "method": "edit-record"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '103' + Content-Type: + - application/json + User-Agent: + - python-requests/2.24.0 + method: POST + uri: https://njal.la/api/1/ + response: + body: + string: !!python/unicode '{"result": {"id": 188154, "name": "orig.testfull", + "type": "TXT", "content": "challengetoken", "ttl": 3600}, "jsonrpc": "2.0"} + + ' + headers: + connection: + - keep-alive + content-length: + - '127' + content-security-policy: + - script-src 'self' 'unsafe-inline' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 Aug 2020 22:43:33 GMT + onion-location: + - http://njalladnspotetti.onion/api/1/ + referrer-policy: + - same-origin + server: + - nginx + set-cookie: + - csrftoken=VZdhbs3cg5OSli4pgxXHWkDaPxDZJRz2V0vbY7B56e9XU7hsbzNsDE2xOjvWsgib; + expires=Thu, 19-Aug-2021 22:43:33 GMT; Max-Age=31449600; Path=/; Secure + - sessionid=0wp7wuy3sysiul9lbq1uiymwg6d5fnnn; expires=Thu, 03-Sep-2020 22:43:33 + GMT; HttpOnly; Max-Age=1209600; Path=/; Secure + strict-transport-security: + - max-age=63072000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + - Cookie + x-content-type-options: + - nosniff + x-frame-options: + - SAMEORIGIN + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1