Updated to support latest Cloudflare Registrar responses #719
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
It appears that the /registrar API has been through some improvements since this module was written. I want to support cloudflare as a registrar in dnscontrol but the existing code doesn't return nameservers and other data. The publicly documented API does not match response being returned from the API at this time.
e.g.
This is the
accounts/[id]/registrar/domainoutput for a domain I currently control (I've censored the domain, but everything else is real){ "errors": [], "messages": [], "result": { "administrator_contact_id": 526506, "auto_renew": true, "available": false, "billing_contact_id": 1081360, "can_register": false, "cloudflare_dns": false, "cloudflare_registration": true, "contacts": { "administrator_id": 526506, "billing_id": 1081360, "registrant_id": 249079, "technical_id": 803933 }, "contacts_updated_at": "2020-07-26T04:18:28Z", "created_at": "2018-09-10T05:16:19Z", "created_registrar": "Unknown (Verisign-sbscorp)", "current_registrar": "Cloudflare", "dns": [], "ds_records": [], "email_verified": true, "expires_at": "2022-09-10T05:16:19Z", "fees": { "icann_fee": 0.18, "redemption_fee": 40.0, "registration_fee": 9.77, "renewal_fee": 9.77, "transfer_fee": 9.77 }, "last_known_status": "registrationActive", "last_transferred_at": "2020-07-26T04:18:28Z", "locked": true, "name": "THISISNOTTHEREAL.COM", "name_servers": [ "daisy.ns.cloudflare.com", "vin.ns.cloudflare.com" ], "payment_expires_at": "2022-09-10T05:16:19Z", "pending_transfer": false, "permissions": [ "show_private_data", "modify_contacts", "renew", "transfer_out", "change_nameservers", "delete" ], "previous_registrar": "Internet Domain Service BS", "privacy": true, "registered_at": null, "registrant_contact_id": 249079, "registry_object_id": "######_DOMAIN_NET-VRSN", "registry_statuses": "clienttransferprohibited", "supported_tld": true, "technical_contact_id": 803933, "transfer_conditions": { "exists": true, "not_premium": true, "not_secure": true, "not_started": true, "not_waiting": true, "supported_tld": true }, "updated_at": "2021-08-12T05:06:21Z", "updated_registrar": "Cloudflare", "using_created_registrar_nameservers": false, "using_current_registrar_nameservers": false, "using_previous_registrar_nameservers": false, "using_updated_registrar_nameservers": false, "whois": { "administrator": { "address": "DATA REDACTED", "city": "DATA REDACTED", "country": "US", "email": "https://domaincontact.cloudflareregistrar.com/THISISNOTTHEREAL.COM", "fax": "DATA REDACTED", "first_name": "DATA REDACTED", "last_name": "DATA REDACTED", "organization": "DATA REDACTED", "phone": "DATA REDACTED", "state": "ID", "zip": "DATA REDACTED" }, "billing": { "address": "DATA REDACTED", "city": "DATA REDACTED", "country": "US", "email": "https://domaincontact.cloudflareregistrar.com/THISISNOTTHEREAL.COM", "fax": "DATA REDACTED", "first_name": "DATA REDACTED", "last_name": "DATA REDACTED", "organization": "DATA REDACTED", "phone": "DATA REDACTED", "state": "ID", "zip": "DATA REDACTED" }, "privacy": true, "raw": "Domain name: THISISNOTTHEREAL.COM\nRegistry Domain ID: \nRegistrar WHOIS Server: whois.cloudflare.com\nRegistrar URL: https://www.cloudflare.com/\nUpdated Date: 2021-08-12T05:06:21Z\nCreation Date: 2018-09-10T05:16:19Z\nRegistrar Registration Expiration Date: 2022-09-10T05:16:19Z\nRegistrar: Cloudflare, Inc.\nRegistrar IANA ID: 1910\nRegistrar Abuse Contact Email: [email protected]\nRegistrar Abuse Contact Phone: +1-650-319-8936\nDomain Status: clienttransferprohibited (https://www.icann.org/epp#clienttransferprohibited)\nRegistry Registrant ID: \nRegistrant Name: DATA REDACTED DATA REDACTED\nRegistrant Organization: DATA REDACTED\nRegistrant Street: DATA REDACTED \nRegistrant City: DATA REDACTED\nRegistrant State/Province: ID\nRegistrant Postal Code: DATA REDACTED\nRegistrant Country: US\nRegistrant Phone: DATA REDACTED\nRegistrant Phone Ext: \nRegistrant Fax: DATA REDACTED\nRegistrant Fax Ext: \nRegistrant Email: https://domaincontact.cloudflareregistrar.com/THISISNOTTHEREAL.COM\nRegistry Admin ID: \nAdmin Name: DATA REDACTED DATA REDACTED\nAdmin Organization: DATA REDACTED\nAdmin Street: DATA REDACTED \nAdmin City: DATA REDACTED\nAdmin State/Province: ID\nAdmin Postal Code: DATA REDACTED\nAdmin Country: US\nAdmin Phone: DATA REDACTED\nAdmin Phone Ext: \nAdmin Fax: DATA REDACTED\nAdmin Fax Ext: \nAdmin Email: https://domaincontact.cloudflareregistrar.com/THISISNOTTHEREAL.COM\nRegistry Tech ID: \nTech Name: DATA REDACTED DATA REDACTED\nTech Organization: DATA REDACTED\nTech Street: DATA REDACTED \nTech City: DATA REDACTED\nTech State/Province: ID\nTech Postal Code: DATA REDACTED\nTech Country: US\nTech Phone: DATA REDACTED\nTech Phone Ext: \nTech Fax: DATA REDACTED\nTech Fax Ext: \nTech Email: https://domaincontact.cloudflareregistrar.com/THISISNOTTHEREAL.COM\nName Server: DAISY.NS.CLOUDFLARE.COM\nName Server: VIN.NS.CLOUDFLARE.COM\nDNSSEC: unsigned\nURL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/\n>>> Last update of WHOIS database: 2020-07-26T04:18:28Z <<<\n\nThe Data in Cloudflare's WHOIS database is provided by Cloudflare for\ninformation purposes, and to assist persons in obtaining information about or\nrelated to a domain name registration record. Cloudflare does not guarantee\nits accuracy. By submitting a WHOIS query, you agree that you will use this Data\nonly for lawful purposes and that, under no circumstances will you use this Data to:\n (1) allow, enable, or otherwise support the transmission of mass unsolicited,\n commercial advertising or solicitations via e-mail (spam); or\n (2) enable high volume, automated, electronic processes that apply to\n Cloudflare (or its systems).\nCloudflare reserves the right to modify these terms at any time.\nBy submitting this query, you agree to abide by this policy.", "registrant": { "address": "DATA REDACTED", "city": "DATA REDACTED", "country": "US", "email": "https://domaincontact.cloudflareregistrar.com/THISISNOTTHEREAL.COM", "fax": "DATA REDACTED", "first_name": "DATA REDACTED", "last_name": "DATA REDACTED", "organization": "DATA REDACTED", "phone": "DATA REDACTED", "state": "ID", "zip": "DATA REDACTED" }, "technical": { "address": "DATA REDACTED", "city": "DATA REDACTED", "country": "US", "email": "https://domaincontact.cloudflareregistrar.com/THISISNOTTHEREAL.COM", "fax": "DATA REDACTED", "first_name": "DATA REDACTED", "last_name": "DATA REDACTED", "organization": "DATA REDACTED", "phone": "DATA REDACTED", "state": "ID", "zip": "DATA REDACTED" } } }, "success": true }A bunch of things from the documented API are missing (e.g. registrant_contact, id, transfer_in) and a ton of new (and useful) fields have been added. So the existing documentation doesn't match the current implementation.
Has your change been tested?
I added new tests and have used this with my personal account. I was unable to test transfers as they are no longer documented on the API page and I don't have a domain to transfer in at the moment.
Checklist: