dnsimple 4.6.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +12 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +9 -13
- data/.rubocop_dnsimple.yml +42 -40
- data/.rubocop_todo.yml +44 -5
- data/.travis.yml +14 -8
- data/CHANGELOG.md +56 -26
- data/CONTRIBUTING.md +43 -0
- data/Gemfile +6 -1
- data/LICENSE.txt +1 -1
- data/README.md +10 -7
- data/dnsimple.gemspec +3 -3
- data/lib/dnsimple.rb +2 -0
- data/lib/dnsimple/client.rb +23 -13
- data/lib/dnsimple/client/accounts.rb +2 -0
- data/lib/dnsimple/client/certificates.rb +2 -0
- data/lib/dnsimple/client/clients.rb +5 -2
- data/lib/dnsimple/client/contacts.rb +2 -0
- data/lib/dnsimple/client/domains.rb +3 -19
- data/lib/dnsimple/client/domains_collaborators.rb +2 -0
- data/lib/dnsimple/client/domains_delegation_signer_records.rb +2 -0
- data/lib/dnsimple/client/domains_dnssec.rb +2 -0
- data/lib/dnsimple/client/domains_email_forwards.rb +2 -0
- data/lib/dnsimple/client/domains_pushes.rb +2 -0
- data/lib/dnsimple/client/identity.rb +2 -0
- data/lib/dnsimple/client/oauth.rb +2 -0
- data/lib/dnsimple/client/registrar.rb +69 -0
- data/lib/dnsimple/client/registrar_auto_renewal.rb +2 -0
- data/lib/dnsimple/client/registrar_delegation.rb +2 -0
- data/lib/dnsimple/client/registrar_whois_privacy.rb +3 -1
- data/lib/dnsimple/client/services.rb +2 -0
- data/lib/dnsimple/client/services_domains.rb +2 -0
- data/lib/dnsimple/client/templates.rb +2 -0
- data/lib/dnsimple/client/templates_domains.rb +2 -0
- data/lib/dnsimple/client/templates_records.rb +2 -0
- data/lib/dnsimple/client/tlds.rb +2 -0
- data/lib/dnsimple/client/vanity_name_servers.rb +12 -10
- data/lib/dnsimple/client/webhooks.rb +2 -0
- data/lib/dnsimple/client/zones.rb +2 -0
- data/lib/dnsimple/client/zones_distributions.rb +2 -0
- data/lib/dnsimple/client/zones_records.rb +2 -0
- data/lib/dnsimple/default.rb +12 -10
- data/lib/dnsimple/error.rb +3 -1
- data/lib/dnsimple/extra.rb +4 -2
- data/lib/dnsimple/options.rb +2 -0
- data/lib/dnsimple/response.rb +7 -7
- data/lib/dnsimple/struct.rb +3 -0
- data/lib/dnsimple/struct/account.rb +2 -0
- data/lib/dnsimple/struct/certificate.rb +4 -2
- data/lib/dnsimple/struct/certificate_bundle.rb +5 -0
- data/lib/dnsimple/struct/certificate_purchase.rb +2 -0
- data/lib/dnsimple/struct/certificate_renewal.rb +2 -0
- data/lib/dnsimple/struct/collaborator.rb +2 -0
- data/lib/dnsimple/struct/contact.rb +2 -0
- data/lib/dnsimple/struct/delegation_signer_record.rb +2 -0
- data/lib/dnsimple/struct/dnssec.rb +2 -0
- data/lib/dnsimple/struct/domain.rb +4 -3
- data/lib/dnsimple/struct/domain_check.rb +2 -0
- data/lib/dnsimple/struct/domain_premium_price.rb +2 -0
- data/lib/dnsimple/struct/domain_price.rb +24 -0
- data/lib/dnsimple/struct/domain_push.rb +2 -0
- data/lib/dnsimple/struct/domain_registration.rb +2 -0
- data/lib/dnsimple/struct/domain_renewal.rb +2 -0
- data/lib/dnsimple/struct/domain_transfer.rb +5 -0
- data/lib/dnsimple/struct/email_forward.rb +2 -0
- data/lib/dnsimple/struct/extended_attribute.rb +2 -0
- data/lib/dnsimple/struct/oauth_token.rb +2 -0
- data/lib/dnsimple/struct/service.rb +2 -0
- data/lib/dnsimple/struct/template.rb +2 -0
- data/lib/dnsimple/struct/template_record.rb +2 -0
- data/lib/dnsimple/struct/tld.rb +2 -0
- data/lib/dnsimple/struct/user.rb +2 -0
- data/lib/dnsimple/struct/vanity_name_server.rb +2 -0
- data/lib/dnsimple/struct/webhook.rb +2 -0
- data/lib/dnsimple/struct/whoami.rb +2 -0
- data/lib/dnsimple/struct/whois_privacy.rb +2 -0
- data/lib/dnsimple/struct/whois_privacy_renewal.rb +2 -0
- data/lib/dnsimple/struct/zone.rb +2 -0
- data/lib/dnsimple/struct/zone_distribution.rb +2 -0
- data/lib/dnsimple/struct/zone_file.rb +2 -0
- data/lib/dnsimple/struct/zone_record.rb +2 -0
- data/lib/dnsimple/version.rb +3 -1
- data/spec/dnsimple/client/accounts_spec.rb +2 -0
- data/spec/dnsimple/client/certificates_spec.rb +35 -33
- data/spec/dnsimple/client/client_service_spec.rb +3 -1
- data/spec/dnsimple/client/contacts_spec.rb +4 -2
- data/spec/dnsimple/client/domains_collaborators_spec.rb +4 -2
- data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +3 -1
- data/spec/dnsimple/client/domains_dnssec_spec.rb +2 -0
- data/spec/dnsimple/client/domains_email_forwards_spec.rb +10 -8
- data/spec/dnsimple/client/domains_pushes_spec.rb +4 -2
- data/spec/dnsimple/client/domains_spec.rb +16 -41
- data/spec/dnsimple/client/identity_spec.rb +2 -0
- data/spec/dnsimple/client/oauth_spec.rb +2 -0
- data/spec/dnsimple/client/registrar_auto_renewal_spec.rb +2 -0
- data/spec/dnsimple/client/registrar_delegation_spec.rb +4 -2
- data/spec/dnsimple/client/registrar_spec.rb +116 -4
- data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +2 -0
- data/spec/dnsimple/client/services_domains_spec.rb +4 -4
- data/spec/dnsimple/client/services_spec.rb +3 -3
- data/spec/dnsimple/client/templates_domains_spec.rb +2 -0
- data/spec/dnsimple/client/templates_records_spec.rb +3 -1
- data/spec/dnsimple/client/templates_spec.rb +4 -2
- data/spec/dnsimple/client/tlds_spec.rb +2 -0
- data/spec/dnsimple/client/vanity_name_servers_spec.rb +2 -0
- data/spec/dnsimple/client/webhooks_spec.rb +3 -1
- data/spec/dnsimple/client/zones_distributions_spec.rb +2 -0
- data/spec/dnsimple/client/zones_records_spec.rb +4 -2
- data/spec/dnsimple/client/zones_spec.rb +3 -1
- data/spec/dnsimple/client_spec.rb +18 -16
- data/spec/dnsimple/extra_spec.rb +2 -0
- data/spec/dnsimple/options/base_spec.rb +2 -0
- data/spec/dnsimple/options/list_options_spec.rb +6 -4
- data/spec/fixtures.http/accounts/success-account.http +0 -1
- data/spec/fixtures.http/accounts/success-user.http +0 -1
- data/spec/fixtures.http/addCollaborator/invite-success.http +0 -1
- data/spec/fixtures.http/addCollaborator/success.http +0 -1
- data/spec/fixtures.http/appliedServices/success.http +0 -1
- data/spec/fixtures.http/cancelDomainTransfer/success.http +18 -0
- data/spec/fixtures.http/changeDomainDelegation/success.http +0 -1
- data/spec/fixtures.http/changeDomainDelegationToVanity/success.http +0 -1
- data/spec/fixtures.http/checkDomain/success.http +0 -1
- data/spec/fixtures.http/checkDomainPremiumPrice/error_400_not_a_premium_domain.http +18 -0
- data/spec/fixtures.http/checkDomainPremiumPrice/error_400_tld_not_supported.http +18 -0
- data/spec/fixtures.http/checkDomainPremiumPrice/success.http +20 -0
- data/spec/fixtures.http/checkZoneDistribution/error.http +0 -1
- data/spec/fixtures.http/checkZoneDistribution/failure.http +0 -1
- data/spec/fixtures.http/checkZoneDistribution/success.http +0 -1
- data/spec/fixtures.http/checkZoneRecordDistribution/error.http +0 -1
- data/spec/fixtures.http/checkZoneRecordDistribution/failure.http +0 -1
- data/spec/fixtures.http/checkZoneRecordDistribution/success.http +0 -1
- data/spec/fixtures.http/createContact/created.http +0 -1
- data/spec/fixtures.http/createDelegationSignerRecord/created.http +0 -1
- data/spec/fixtures.http/createDelegationSignerRecord/validation-error.http +0 -1
- data/spec/fixtures.http/createDomain/created.http +20 -16
- data/spec/fixtures.http/createEmailForward/created.http +21 -17
- data/spec/fixtures.http/createPrimaryServer/created.http +21 -0
- data/spec/fixtures.http/createSecondaryZone/created.http +21 -0
- data/spec/fixtures.http/createTemplate/created.http +0 -1
- data/spec/fixtures.http/createTemplateRecord/created.http +0 -1
- data/spec/fixtures.http/createWebhook/created.http +0 -1
- data/spec/fixtures.http/createZoneRecord/created-apex.http +0 -1
- data/spec/fixtures.http/createZoneRecord/created.http +0 -1
- data/spec/fixtures.http/deleteContact/error-contact-in-use.http +18 -0
- data/spec/fixtures.http/deleteEmailForward/success.http +12 -7
- data/spec/fixtures.http/disableDnssec/not-enabled.http +0 -1
- data/spec/fixtures.http/disableWhoisPrivacy/success.http +0 -1
- data/spec/fixtures.http/downloadCertificate/success.http +0 -1
- data/spec/fixtures.http/enableDnssec/success.http +0 -1
- data/spec/fixtures.http/enableVanityNameServers/success.http +0 -1
- data/spec/fixtures.http/enableWhoisPrivacy/created.http +0 -1
- data/spec/fixtures.http/enableWhoisPrivacy/success.http +0 -1
- data/spec/fixtures.http/getCertificate/success.http +10 -11
- data/spec/fixtures.http/getCertificatePrivateKey/success.http +0 -1
- data/spec/fixtures.http/getContact/success.http +0 -1
- data/spec/fixtures.http/getDelegationSignerRecord/success.http +0 -1
- data/spec/fixtures.http/getDnssec/success.http +0 -1
- data/spec/fixtures.http/getDomain/success.http +13 -9
- data/spec/fixtures.http/getDomainDelegation/success-empty.http +0 -1
- data/spec/fixtures.http/getDomainDelegation/success.http +0 -1
- data/spec/fixtures.http/getDomainPremiumPrice/failure.http +0 -1
- data/spec/fixtures.http/getDomainPremiumPrice/success.http +0 -1
- data/spec/fixtures.http/getDomainPrices/failure.http +19 -0
- data/spec/fixtures.http/getDomainPrices/success.http +21 -0
- data/spec/fixtures.http/getDomainTransfer/success.http +20 -0
- data/spec/fixtures.http/getEmailForward/success.http +14 -10
- data/spec/fixtures.http/getPrimaryServer/success.http +21 -0
- data/spec/fixtures.http/getService/success.http +0 -1
- data/spec/fixtures.http/getTemplate/success.http +0 -1
- data/spec/fixtures.http/getTemplateRecord/success.http +0 -1
- data/spec/fixtures.http/getTld/success.http +0 -1
- data/spec/fixtures.http/getTldExtendedAttributes/success-attributes.http +0 -1
- data/spec/fixtures.http/getTldExtendedAttributes/success-noattributes.http +0 -1
- data/spec/fixtures.http/getTldExtendedAttributes/success.http +0 -1
- data/spec/fixtures.http/getWebhook/success.http +0 -1
- data/spec/fixtures.http/getWhoisPrivacy/success.http +0 -1
- data/spec/fixtures.http/getZone/success.http +0 -1
- data/spec/fixtures.http/getZoneFile/success.http +0 -1
- data/spec/fixtures.http/getZoneRecord/success.http +0 -1
- data/spec/fixtures.http/initiatePush/success.http +0 -1
- data/spec/fixtures.http/issueLetsencryptCertificate/success.http +18 -21
- data/spec/fixtures.http/issueRenewalLetsencryptCertificate/success.http +18 -21
- data/spec/fixtures.http/linkPrimaryServer/success.http +21 -0
- data/spec/fixtures.http/listAccounts/success-account.http +0 -1
- data/spec/fixtures.http/listAccounts/success-user.http +0 -1
- data/spec/fixtures.http/listCertificates/success.http +10 -11
- data/spec/fixtures.http/listCollaborators/success.http +0 -1
- data/spec/fixtures.http/listContacts/success.http +0 -1
- data/spec/fixtures.http/listDelegationSignerRecords/success.http +0 -1
- data/spec/fixtures.http/listDomains/success.http +20 -16
- data/spec/fixtures.http/listEmailForwards/success.http +0 -1
- data/spec/fixtures.http/listPrimaryServers/success.http +21 -0
- data/spec/fixtures.http/listPushes/success.http +0 -1
- data/spec/fixtures.http/listServices/success.http +0 -1
- data/spec/fixtures.http/listTemplateRecords/success.http +0 -1
- data/spec/fixtures.http/listTemplates/success.http +0 -1
- data/spec/fixtures.http/listTlds/success.http +0 -1
- data/spec/fixtures.http/listWebhooks/success.http +0 -1
- data/spec/fixtures.http/listZoneRecords/success.http +0 -1
- data/spec/fixtures.http/listZones/success.http +0 -1
- data/spec/fixtures.http/method-not-allowed.http +0 -1
- data/spec/fixtures.http/notfound-certificate.http +0 -1
- data/spec/fixtures.http/notfound-collaborator.http +0 -1
- data/spec/fixtures.http/notfound-contact.http +0 -1
- data/spec/fixtures.http/notfound-delegationsignerrecord.http +0 -1
- data/spec/fixtures.http/notfound-domain.http +0 -1
- data/spec/fixtures.http/notfound-domainpush.http +0 -1
- data/spec/fixtures.http/notfound-emailforward.http +0 -1
- data/spec/fixtures.http/notfound-record.http +0 -1
- data/spec/fixtures.http/notfound-template.http +0 -1
- data/spec/fixtures.http/notfound-webhook.http +0 -1
- data/spec/fixtures.http/notfound-whoisprivacy.http +0 -1
- data/spec/fixtures.http/notfound-zone.http +0 -1
- data/spec/fixtures.http/oauthAccessToken/error-invalid-request.http +0 -1
- data/spec/fixtures.http/oauthAccessToken/success.http +0 -1
- data/spec/fixtures.http/pages-1of3.http +0 -1
- data/spec/fixtures.http/pages-2of3.http +0 -1
- data/spec/fixtures.http/pages-3of3.http +0 -1
- data/spec/fixtures.http/purchaseLetsencryptCertificate/success.http +20 -21
- data/spec/fixtures.http/purchaseRenewalLetsencryptCertificate/success.http +20 -21
- data/spec/fixtures.http/registerDomain/success.http +1 -2
- data/spec/fixtures.http/renewDomain/error-tooearly.http +0 -1
- data/spec/fixtures.http/renewDomain/success.http +1 -2
- data/spec/fixtures.http/renewWhoisPrivacy/success.http +0 -1
- data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http +1 -2
- data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http +1 -2
- data/spec/fixtures.http/response.http +0 -1
- data/spec/fixtures.http/transferDomain/error-indnsimple.http +0 -1
- data/spec/fixtures.http/transferDomain/error-missing-authcode.http +0 -1
- data/spec/fixtures.http/transferDomain/success.http +1 -2
- data/spec/fixtures.http/unlinkPrimaryServer/success.http +21 -0
- data/spec/fixtures.http/updateContact/success.http +0 -1
- data/spec/fixtures.http/updateTemplate/success.http +0 -1
- data/spec/fixtures.http/updateZoneRecord/success.http +0 -1
- data/spec/fixtures.http/validation-error.http +0 -1
- data/spec/fixtures.http/whoami/success-account.http +0 -1
- data/spec/fixtures.http/whoami/success-user.http +0 -1
- data/spec/fixtures.http/whoami/success.http +0 -1
- data/spec/spec_helper.rb +3 -1
- data/spec/support/helpers.rb +2 -0
- data/spec/support/webmock.rb +2 -0
- metadata +36 -15
- data/.ruby-gemset +0 -1
- data/spec/fixtures.http/resetDomainToken/success.http +0 -17
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
module Struct
|
3
5
|
|
@@ -20,6 +22,9 @@ module Dnsimple
|
|
20
22
|
# @return [Bool] True if the domain WHOIS privacy was requested.
|
21
23
|
attr_accessor :whois_privacy
|
22
24
|
|
25
|
+
# @return [String,nil] The reason if transfer failed.
|
26
|
+
attr_accessor :status_description
|
27
|
+
|
23
28
|
# @return [String] When the domain renewal was created in DNSimple.
|
24
29
|
attr_accessor :created_at
|
25
30
|
|
data/lib/dnsimple/struct/tld.rb
CHANGED
data/lib/dnsimple/struct/user.rb
CHANGED
data/lib/dnsimple/struct/zone.rb
CHANGED
data/lib/dnsimple/version.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Dnsimple::Client, ".certificates" do
|
@@ -63,7 +65,7 @@ describe Dnsimple::Client, ".certificates" do
|
|
63
65
|
end
|
64
66
|
|
65
67
|
let(:account_id) { 1010 }
|
66
|
-
let(:domain_id) { "
|
68
|
+
let(:domain_id) { "dnsimple.us" }
|
67
69
|
|
68
70
|
it "delegates to client.paginate" do
|
69
71
|
expect(subject).to receive(:paginate).with(:certificates, account_id, domain_id, foo: "bar")
|
@@ -71,16 +73,16 @@ describe Dnsimple::Client, ".certificates" do
|
|
71
73
|
end
|
72
74
|
|
73
75
|
it "supports sorting" do
|
74
|
-
subject.all_certificates(account_id, domain_id, sort: "id:asc,
|
76
|
+
subject.all_certificates(account_id, domain_id, sort: "id:asc,expiration:desc")
|
75
77
|
|
76
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates?page=1&per_page=100&sort=id:asc,
|
78
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates?page=1&per_page=100&sort=id:asc,expiration:desc")
|
77
79
|
end
|
78
80
|
end
|
79
81
|
|
80
82
|
describe "#certificate" do
|
81
83
|
let(:account_id) { 1010 }
|
82
|
-
let(:domain_id) { "
|
83
|
-
let(:certificate_id) {
|
84
|
+
let(:domain_id) { "bingo.pizza" }
|
85
|
+
let(:certificate_id) { 101967 }
|
84
86
|
|
85
87
|
before do
|
86
88
|
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/certificates/#{certificate_id}})
|
@@ -106,19 +108,19 @@ describe Dnsimple::Client, ".certificates" do
|
|
106
108
|
|
107
109
|
result = response.data
|
108
110
|
expect(result).to be_a(Dnsimple::Struct::Certificate)
|
109
|
-
expect(result.id).to eq(
|
110
|
-
expect(result.domain_id).to eq(
|
111
|
-
expect(result.contact_id).to eq(
|
112
|
-
expect(result.common_name).to eq("www.
|
113
|
-
expect(result.alternate_names).to eq(
|
111
|
+
expect(result.id).to eq(101967)
|
112
|
+
expect(result.domain_id).to eq(289333)
|
113
|
+
expect(result.contact_id).to eq(2511)
|
114
|
+
expect(result.common_name).to eq("www.bingo.pizza")
|
115
|
+
expect(result.alternate_names).to eq([])
|
114
116
|
expect(result.years).to eq(1)
|
115
|
-
expect(result.csr).to eq("-----BEGIN CERTIFICATE REQUEST-----\
|
117
|
+
expect(result.csr).to eq("-----BEGIN CERTIFICATE REQUEST-----\nMIICmTCCAYECAQAwGjEYMBYGA1UEAwwPd3d3LmJpbmdvLnBpenphMIIBIjANBgkq\nhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw4+KoZ9IDCK2o5qAQpi+Icu5kksmjQzx\n5o5g4B6XhRxhsfHlK/i3iU5hc8CONjyVv8j82835RNsiKrflnxGa9SH68vbQfcn4\nIpbMz9c+Eqv5h0Euqlc3A4DBzp0unEu5QAUhR6Xu1TZIWDPjhrBOGiszRlLQcp4F\nzy6fD6j5/d/ylpzTp5v54j+Ey31Bz86IaBPtSpHI+Qk87Hs8DVoWxZk/6RlAkyur\nXDGWnPu9n3RMfs9ag5anFhggLIhCNtVN4+0vpgPQ59pqwYo8TfdYzK7WSKeL7geu\nCqVE3bHAqU6dLtgHOZfTkLwGycUh4p9aawuc6fsXHHYDpIL8s3vAvwIDAQABoDow\nOAYJKoZIhvcNAQkOMSswKTAnBgNVHREEIDAeggtiaW5nby5waXp6YYIPd3d3LmJp\nbmdvLnBpenphMA0GCSqGSIb3DQEBCwUAA4IBAQBwOLKv+PO5hSJkgqS6wL/wRqLh\nQ1zbcHRHAjRjnpRz06cDvN3X3aPI+lpKSNFCI0A1oKJG7JNtgxX3Est66cuO8ESQ\nPIb6WWN7/xlVlBCe7ZkjAFgN6JurFdclwCp/NI5wBCwj1yb3Ar5QQMFIZOezIgTI\nAWkQSfCmgkB96d6QlDWgidYDDjcsXugQveOQRPlHr0TsElu47GakxZdJCFZU+WPM\nodQQf5SaqiIK2YaH1dWO//4KpTS9QoTy1+mmAa27apHcmz6X6+G5dvpHZ1qH14V0\nJoMWIK+39HRPq6mDo1UMVet/xFUUrG/H7/tFlYIDVbSpVlpVAFITd/eQkaW/\n-----END CERTIFICATE REQUEST-----\n")
|
116
118
|
expect(result.state).to eq("issued")
|
117
119
|
expect(result.authority_identifier).to eq("letsencrypt")
|
118
120
|
expect(result.auto_renew).to be(false)
|
119
|
-
expect(result.created_at).to eq("
|
120
|
-
expect(result.updated_at).to eq("
|
121
|
-
expect(result.
|
121
|
+
expect(result.created_at).to eq("2020-06-18T18:54:17Z")
|
122
|
+
expect(result.updated_at).to eq("2020-06-18T19:10:14Z")
|
123
|
+
expect(result.expires_at).to eq("2020-09-16T18:10:13Z")
|
122
124
|
end
|
123
125
|
|
124
126
|
context "when the certificate does not exist" do
|
@@ -229,7 +231,7 @@ describe Dnsimple::Client, ".certificates" do
|
|
229
231
|
|
230
232
|
describe "#purchase_letsencrypt_certificate" do
|
231
233
|
let(:account_id) { 1010 }
|
232
|
-
let(:domain_id) { "
|
234
|
+
let(:domain_id) { "bingo.pizza" }
|
233
235
|
let(:contact_id) { 100 }
|
234
236
|
|
235
237
|
before do
|
@@ -262,9 +264,9 @@ describe Dnsimple::Client, ".certificates" do
|
|
262
264
|
result = response.data
|
263
265
|
expect(result).to be_a(Dnsimple::Struct::CertificatePurchase)
|
264
266
|
|
265
|
-
expect(result.id).to eq(
|
266
|
-
expect(result.certificate_id).to eq(
|
267
|
-
expect(result.state).to eq("
|
267
|
+
expect(result.id).to eq(101967)
|
268
|
+
expect(result.certificate_id).to eq(101967)
|
269
|
+
expect(result.state).to eq("new")
|
268
270
|
expect(result.auto_renew).to be(false)
|
269
271
|
end
|
270
272
|
|
@@ -282,8 +284,8 @@ describe Dnsimple::Client, ".certificates" do
|
|
282
284
|
|
283
285
|
describe "#issue_letsencrypt_certificate" do
|
284
286
|
let(:account_id) { 1010 }
|
285
|
-
let(:domain_id) { "
|
286
|
-
let(:certificate_id) {
|
287
|
+
let(:domain_id) { "bingo.pizza" }
|
288
|
+
let(:certificate_id) { 101967 }
|
287
289
|
|
288
290
|
before do
|
289
291
|
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/certificates/letsencrypt/#{certificate_id}/issue})
|
@@ -304,9 +306,9 @@ describe Dnsimple::Client, ".certificates" do
|
|
304
306
|
result = response.data
|
305
307
|
expect(result).to be_a(Dnsimple::Struct::Certificate)
|
306
308
|
|
307
|
-
expect(result.id).to eq(
|
308
|
-
expect(result.domain_id).to eq(
|
309
|
-
expect(result.common_name).to eq("www.
|
309
|
+
expect(result.id).to eq(101967)
|
310
|
+
expect(result.domain_id).to eq(289333)
|
311
|
+
expect(result.common_name).to eq("www.bingo.pizza")
|
310
312
|
expect(result.alternate_names).to eq([])
|
311
313
|
expect(result.years).to eq(1)
|
312
314
|
expect(result.csr).to be(nil)
|
@@ -340,8 +342,8 @@ describe Dnsimple::Client, ".certificates" do
|
|
340
342
|
|
341
343
|
describe "#purchase_letsencrypt_certificate_renewal" do
|
342
344
|
let(:account_id) { 1010 }
|
343
|
-
let(:domain_id) { "
|
344
|
-
let(:certificate_id) {
|
345
|
+
let(:domain_id) { "bingo.pizza" }
|
346
|
+
let(:certificate_id) { 101967 }
|
345
347
|
|
346
348
|
before do
|
347
349
|
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/certificates/letsencrypt/#{certificate_id}/renewals})
|
@@ -371,9 +373,9 @@ describe Dnsimple::Client, ".certificates" do
|
|
371
373
|
result = response.data
|
372
374
|
expect(result).to be_a(Dnsimple::Struct::CertificateRenewal)
|
373
375
|
|
374
|
-
expect(result.id).to eq(
|
376
|
+
expect(result.id).to eq(65082)
|
375
377
|
expect(result.old_certificate_id).to eq(certificate_id)
|
376
|
-
expect(result.new_certificate_id).to eq(
|
378
|
+
expect(result.new_certificate_id).to eq(101972)
|
377
379
|
expect(result.state).to eq("new")
|
378
380
|
end
|
379
381
|
|
@@ -391,9 +393,9 @@ describe Dnsimple::Client, ".certificates" do
|
|
391
393
|
|
392
394
|
describe "#issue_letsencrypt_certificate_renewal" do
|
393
395
|
let(:account_id) { 1010 }
|
394
|
-
let(:domain_id) { "
|
395
|
-
let(:certificate_id) {
|
396
|
-
let(:certificate_renewal_id) {
|
396
|
+
let(:domain_id) { "bingo.pizza" }
|
397
|
+
let(:certificate_id) { 101972 }
|
398
|
+
let(:certificate_renewal_id) { 65082 }
|
397
399
|
|
398
400
|
before do
|
399
401
|
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/certificates/letsencrypt/#{certificate_id}/renewals/#{certificate_renewal_id}/issue})
|
@@ -414,9 +416,9 @@ describe Dnsimple::Client, ".certificates" do
|
|
414
416
|
result = response.data
|
415
417
|
expect(result).to be_a(Dnsimple::Struct::Certificate)
|
416
418
|
|
417
|
-
expect(result.id).to eq(
|
418
|
-
expect(result.domain_id).to eq(
|
419
|
-
expect(result.common_name).to eq("www.
|
419
|
+
expect(result.id).to eq(101972)
|
420
|
+
expect(result.domain_id).to eq(289333)
|
421
|
+
expect(result.common_name).to eq("www.bingo.pizza")
|
420
422
|
expect(result.alternate_names).to eq([])
|
421
423
|
expect(result.years).to eq(1)
|
422
424
|
expect(result.csr).to be(nil)
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Dnsimple::Client::ClientService do
|
4
6
|
|
5
7
|
describe "#paginate" do
|
6
8
|
service_class = Class.new(Dnsimple::Client::ClientService) do
|
7
|
-
Item = Class.new(Dnsimple::Struct::Base) do
|
9
|
+
Item = Class.new(Dnsimple::Struct::Base) do # rubocop:disable Lint/ConstantDefinitionInBlock
|
8
10
|
attr_accessor :id
|
9
11
|
end
|
10
12
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Dnsimple::Client, ".contacts" do
|
@@ -84,13 +86,13 @@ describe Dnsimple::Client, ".contacts" do
|
|
84
86
|
|
85
87
|
describe "#create_contact" do
|
86
88
|
let(:account_id) { 1010 }
|
89
|
+
let(:attributes) { { first_name: "Simone", last_name: "Carletti", address1: "Italian Street", city: "Rome", state_province: "RM", postal_code: "00171", country: "IT", email: "example@example.com", phone: "+393391234567" } }
|
87
90
|
|
88
91
|
before do
|
89
92
|
stub_request(:post, %r{/v2/#{account_id}/contacts$})
|
90
93
|
.to_return(read_http_fixture("createContact/created.http"))
|
91
94
|
end
|
92
95
|
|
93
|
-
let(:attributes) { { first_name: "Simone", last_name: "Carletti", address1: "Italian Street", city: "Rome", state_province: "RM", postal_code: "00171", country: "IT", email: "example@example.com", phone: "+393391234567" } }
|
94
96
|
|
95
97
|
it "builds the correct request" do
|
96
98
|
subject.create_contact(account_id, attributes)
|
@@ -151,13 +153,13 @@ describe Dnsimple::Client, ".contacts" do
|
|
151
153
|
|
152
154
|
describe "#update_contact" do
|
153
155
|
let(:account_id) { 1010 }
|
156
|
+
let(:attributes) { { first_name: "Updated" } }
|
154
157
|
|
155
158
|
before do
|
156
159
|
stub_request(:patch, %r{/v2/#{account_id}/contacts/.+$})
|
157
160
|
.to_return(read_http_fixture("updateContact/success.http"))
|
158
161
|
end
|
159
162
|
|
160
|
-
let(:attributes) { { first_name: "Updated" } }
|
161
163
|
|
162
164
|
it "builds the correct request" do
|
163
165
|
subject.update_contact(account_id, contact_id = 1, attributes)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Dnsimple::Client, ".domains" do
|
@@ -61,7 +63,7 @@ describe Dnsimple::Client, ".domains" do
|
|
61
63
|
let(:account_id) { 1010 }
|
62
64
|
let(:domain_id) { "example.com" }
|
63
65
|
|
64
|
-
context "
|
66
|
+
context "when inviting a user already registered on DNSimple" do
|
65
67
|
before do
|
66
68
|
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators$})
|
67
69
|
.to_return(read_http_fixture("addCollaborator/success.http"))
|
@@ -91,7 +93,7 @@ describe Dnsimple::Client, ".domains" do
|
|
91
93
|
end
|
92
94
|
end
|
93
95
|
|
94
|
-
context "
|
96
|
+
context "when inviting a user not registered on DNSimple" do
|
95
97
|
before do
|
96
98
|
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators$})
|
97
99
|
.to_return(read_http_fixture("addCollaborator/invite-success.http"))
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Dnsimple::Client, ".domains" do
|
@@ -97,6 +99,7 @@ describe Dnsimple::Client, ".domains" do
|
|
97
99
|
|
98
100
|
describe "#create_delegation_signer_record" do
|
99
101
|
let(:account_id) { 1010 }
|
102
|
+
let(:attributes) { { algorithm: "13", digest: "ABC123", digest_type: "2", keytag: "1111" } }
|
100
103
|
let(:domain_id) { "example.com" }
|
101
104
|
|
102
105
|
before do
|
@@ -104,7 +107,6 @@ describe Dnsimple::Client, ".domains" do
|
|
104
107
|
.to_return(read_http_fixture("createDelegationSignerRecord/created.http"))
|
105
108
|
end
|
106
109
|
|
107
|
-
let(:attributes) { { algorithm: "13", digest: "ABC123", digest_type: "2", keytag: "1111" } }
|
108
110
|
|
109
111
|
it "builds the correct request" do
|
110
112
|
subject.create_delegation_signer_record(account_id, domain_id, attributes)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Dnsimple::Client, ".domains" do
|
@@ -97,6 +99,7 @@ describe Dnsimple::Client, ".domains" do
|
|
97
99
|
|
98
100
|
describe "#create_email_forward" do
|
99
101
|
let(:account_id) { 1010 }
|
102
|
+
let(:attributes) { { from: "jim", to: "jim@another.com" } }
|
100
103
|
let(:domain_id) { "example.com" }
|
101
104
|
|
102
105
|
before do
|
@@ -104,7 +107,6 @@ describe Dnsimple::Client, ".domains" do
|
|
104
107
|
.to_return(read_http_fixture("createEmailForward/created.http"))
|
105
108
|
end
|
106
109
|
|
107
|
-
let(:attributes) { { from: "jim", to: "jim@another.com" } }
|
108
110
|
|
109
111
|
it "builds the correct request" do
|
110
112
|
subject.create_email_forward(account_id, domain_id, attributes)
|
@@ -127,7 +129,7 @@ describe Dnsimple::Client, ".domains" do
|
|
127
129
|
describe "#email_forward" do
|
128
130
|
let(:account_id) { 1010 }
|
129
131
|
let(:domain_id) { "example.com" }
|
130
|
-
let(:email_forward_id) {
|
132
|
+
let(:email_forward_id) { 41872 }
|
131
133
|
|
132
134
|
before do
|
133
135
|
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/email_forwards.+$})
|
@@ -147,12 +149,12 @@ describe Dnsimple::Client, ".domains" do
|
|
147
149
|
|
148
150
|
result = response.data
|
149
151
|
expect(result).to be_a(Dnsimple::Struct::EmailForward)
|
150
|
-
expect(result.id).to eq(
|
151
|
-
expect(result.domain_id).to eq(
|
152
|
-
expect(result.from).to eq("
|
153
|
-
expect(result.to).to eq("
|
154
|
-
expect(result.created_at).to eq("
|
155
|
-
expect(result.updated_at).to eq("
|
152
|
+
expect(result.id).to eq(41872)
|
153
|
+
expect(result.domain_id).to eq(235146)
|
154
|
+
expect(result.from).to eq("example@dnsimple.xyz")
|
155
|
+
expect(result.to).to eq("example@example.com")
|
156
|
+
expect(result.created_at).to eq("2021-01-25T13:54:40Z")
|
157
|
+
expect(result.updated_at).to eq("2021-01-25T13:54:40Z")
|
156
158
|
end
|
157
159
|
|
158
160
|
context "when the email forward does not exist" do
|