dnsimple 4.6.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dependabot/config.yml +9 -0
- data/.rubocop.yml +2 -0
- data/.rubocop_dnsimple.yml +64 -40
- data/.travis.yml +1 -3
- data/CHANGELOG.md +34 -26
- data/CONTRIBUTING.md +37 -0
- data/Gemfile +4 -1
- data/LICENSE.txt +1 -1
- data/README.md +8 -5
- data/dnsimple.gemspec +3 -3
- data/lib/dnsimple.rb +2 -0
- data/lib/dnsimple/client.rb +12 -10
- data/lib/dnsimple/client/accounts.rb +2 -0
- data/lib/dnsimple/client/certificates.rb +2 -0
- data/lib/dnsimple/client/clients.rb +2 -0
- data/lib/dnsimple/client/contacts.rb +2 -0
- data/lib/dnsimple/client/domains.rb +2 -0
- 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 +46 -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 +2 -0
- 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 +11 -9
- data/lib/dnsimple/error.rb +2 -0
- data/lib/dnsimple/extra.rb +2 -0
- data/lib/dnsimple/options.rb +2 -0
- data/lib/dnsimple/response.rb +6 -4
- data/lib/dnsimple/struct.rb +2 -0
- data/lib/dnsimple/struct/account.rb +2 -0
- data/lib/dnsimple/struct/certificate.rb +2 -0
- 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 +2 -0
- data/lib/dnsimple/struct/domain_check.rb +2 -0
- data/lib/dnsimple/struct/domain_premium_price.rb +2 -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 +2 -0
- data/spec/dnsimple/client/client_service_spec.rb +2 -0
- data/spec/dnsimple/client/contacts_spec.rb +2 -0
- data/spec/dnsimple/client/domains_collaborators_spec.rb +2 -0
- data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +2 -0
- data/spec/dnsimple/client/domains_dnssec_spec.rb +2 -0
- data/spec/dnsimple/client/domains_email_forwards_spec.rb +2 -0
- data/spec/dnsimple/client/domains_pushes_spec.rb +2 -0
- data/spec/dnsimple/client/domains_spec.rb +2 -0
- 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 +2 -0
- data/spec/dnsimple/client/registrar_spec.rb +69 -0
- data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +2 -0
- data/spec/dnsimple/client/services_domains_spec.rb +2 -0
- data/spec/dnsimple/client/services_spec.rb +2 -0
- data/spec/dnsimple/client/templates_domains_spec.rb +2 -0
- data/spec/dnsimple/client/templates_records_spec.rb +2 -0
- data/spec/dnsimple/client/templates_spec.rb +2 -0
- 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 +2 -0
- data/spec/dnsimple/client/zones_distributions_spec.rb +2 -0
- data/spec/dnsimple/client/zones_records_spec.rb +2 -0
- data/spec/dnsimple/client/zones_spec.rb +2 -0
- data/spec/dnsimple/client_spec.rb +3 -1
- 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 +2 -0
- data/spec/fixtures.http/cancelDomainTransfer/success.http +30 -0
- data/spec/fixtures.http/getDomainTransfer/success.http +30 -0
- data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http +1 -1
- data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http +1 -1
- data/spec/spec_helper.rb +3 -1
- data/spec/support/helpers.rb +2 -0
- data/spec/support/webmock.rb +2 -0
- metadata +11 -13
- data/.ruby-gemset +0 -1
data/lib/dnsimple/error.rb
CHANGED
data/lib/dnsimple/extra.rb
CHANGED
data/lib/dnsimple/options.rb
CHANGED
data/lib/dnsimple/response.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
|
3
5
|
# The Response represents a response returned by a client request.
|
@@ -69,10 +71,10 @@ module Dnsimple
|
|
69
71
|
super
|
70
72
|
|
71
73
|
pagination = http_response["pagination"]
|
72
|
-
@page
|
73
|
-
@per_page
|
74
|
-
@total_entries
|
75
|
-
@total_pages
|
74
|
+
@page = pagination["current_page"]
|
75
|
+
@per_page = pagination["per_page"]
|
76
|
+
@total_entries = pagination["total_entries"]
|
77
|
+
@total_pages = pagination["total_pages"]
|
76
78
|
end
|
77
79
|
|
78
80
|
end
|
data/lib/dnsimple/struct.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dnsimple
|
2
4
|
module Struct
|
3
5
|
|
@@ -8,14 +10,17 @@ module Dnsimple
|
|
8
10
|
|
9
11
|
# @return [String] The server certificate
|
10
12
|
attr_accessor :server
|
13
|
+
|
11
14
|
alias server_certificate server
|
12
15
|
|
13
16
|
# @return [String] The root certificate
|
14
17
|
attr_accessor :root
|
18
|
+
|
15
19
|
alias root_certificate root
|
16
20
|
|
17
21
|
# @return [Array<String>] Intermediate certificates
|
18
22
|
attr_accessor :chain
|
23
|
+
|
19
24
|
alias intermediate_certificates chain
|
20
25
|
|
21
26
|
end
|
@@ -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, ".registrar" do
|
@@ -212,6 +214,73 @@ describe Dnsimple::Client, ".registrar" do
|
|
212
214
|
end
|
213
215
|
end
|
214
216
|
|
217
|
+
describe "#get_transfer_domain" do
|
218
|
+
let(:account_id) { 1010 }
|
219
|
+
|
220
|
+
before do
|
221
|
+
stub_request(:get, %r{/v2/#{account_id}/registrar/domains/.+/transfers/.+$})
|
222
|
+
.to_return(read_http_fixture("getDomainTransfer/success.http"))
|
223
|
+
end
|
224
|
+
|
225
|
+
it "builds the correct request" do
|
226
|
+
subject.get_domain_transfer(account_id, domain_name = "example.com", transfer_id = 42)
|
227
|
+
|
228
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/registrar/domains/#{domain_name}/transfers/#{transfer_id}")
|
229
|
+
.with(headers: { "Accept" => "application/json" })
|
230
|
+
end
|
231
|
+
|
232
|
+
it "returns the domain transfer" do
|
233
|
+
response = subject.get_domain_transfer(account_id, "example.com", 42)
|
234
|
+
expect(response).to be_a(Dnsimple::Response)
|
235
|
+
|
236
|
+
result = response.data
|
237
|
+
expect(result).to be_a(Dnsimple::Struct::DomainTransfer)
|
238
|
+
expect(result.id).to eq(42)
|
239
|
+
expect(result.domain_id).to eq(2)
|
240
|
+
expect(result.registrant_id).to eq(3)
|
241
|
+
expect(result.state).to eq("cancelled")
|
242
|
+
expect(result.auto_renew).to be(false)
|
243
|
+
expect(result.whois_privacy).to be(false)
|
244
|
+
expect(result.status_description).to eq("Canceled by customer")
|
245
|
+
expect(result.created_at).to eq("2020-04-27T18:08:44Z")
|
246
|
+
expect(result.updated_at).to eq("2020-04-27T18:20:01Z")
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
describe "#cancel_domain_transfer" do
|
251
|
+
let(:account_id) { 1010 }
|
252
|
+
|
253
|
+
before do
|
254
|
+
stub_request(:delete, %r{/v2/#{account_id}/registrar/domains/.+/transfers/.+$})
|
255
|
+
.to_return(read_http_fixture("cancelDomainTransfer/success.http"))
|
256
|
+
end
|
257
|
+
|
258
|
+
it "builds the correct request" do
|
259
|
+
subject.cancel_domain_transfer(account_id, domain_name = "example.com", transfer_id = 42)
|
260
|
+
|
261
|
+
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/registrar/domains/#{domain_name}/transfers/#{transfer_id}")
|
262
|
+
.with(headers: { "Accept" => "application/json" })
|
263
|
+
end
|
264
|
+
|
265
|
+
it "returns the domain transfer" do
|
266
|
+
response = subject.cancel_domain_transfer(account_id, "example.com", 42)
|
267
|
+
expect(response).to be_a(Dnsimple::Response)
|
268
|
+
|
269
|
+
result = response.data
|
270
|
+
expect(result).to be_a(Dnsimple::Struct::DomainTransfer)
|
271
|
+
expect(result.id).to eq(42)
|
272
|
+
expect(result.domain_id).to eq(6)
|
273
|
+
expect(result.registrant_id).to eq(1)
|
274
|
+
expect(result.state).to eq("transferring")
|
275
|
+
expect(result.auto_renew).to be(true)
|
276
|
+
expect(result.whois_privacy).to be(false)
|
277
|
+
expect(result.status_description).to eq(nil)
|
278
|
+
expect(result.created_at).to eq("2020-04-24T19:19:03Z")
|
279
|
+
expect(result.updated_at).to eq("2020-04-24T19:19:15Z")
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
|
215
284
|
describe "#transfer_domain_out" do
|
216
285
|
let(:account_id) { 1010 }
|
217
286
|
|