dnsimple 4.6.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +12 -0
  3. data/.gitignore +3 -0
  4. data/.rubocop.yml +9 -13
  5. data/.rubocop_dnsimple.yml +42 -40
  6. data/.rubocop_todo.yml +44 -5
  7. data/.travis.yml +14 -8
  8. data/CHANGELOG.md +56 -26
  9. data/CONTRIBUTING.md +43 -0
  10. data/Gemfile +6 -1
  11. data/LICENSE.txt +1 -1
  12. data/README.md +10 -7
  13. data/dnsimple.gemspec +3 -3
  14. data/lib/dnsimple.rb +2 -0
  15. data/lib/dnsimple/client.rb +23 -13
  16. data/lib/dnsimple/client/accounts.rb +2 -0
  17. data/lib/dnsimple/client/certificates.rb +2 -0
  18. data/lib/dnsimple/client/clients.rb +5 -2
  19. data/lib/dnsimple/client/contacts.rb +2 -0
  20. data/lib/dnsimple/client/domains.rb +3 -19
  21. data/lib/dnsimple/client/domains_collaborators.rb +2 -0
  22. data/lib/dnsimple/client/domains_delegation_signer_records.rb +2 -0
  23. data/lib/dnsimple/client/domains_dnssec.rb +2 -0
  24. data/lib/dnsimple/client/domains_email_forwards.rb +2 -0
  25. data/lib/dnsimple/client/domains_pushes.rb +2 -0
  26. data/lib/dnsimple/client/identity.rb +2 -0
  27. data/lib/dnsimple/client/oauth.rb +2 -0
  28. data/lib/dnsimple/client/registrar.rb +69 -0
  29. data/lib/dnsimple/client/registrar_auto_renewal.rb +2 -0
  30. data/lib/dnsimple/client/registrar_delegation.rb +2 -0
  31. data/lib/dnsimple/client/registrar_whois_privacy.rb +3 -1
  32. data/lib/dnsimple/client/services.rb +2 -0
  33. data/lib/dnsimple/client/services_domains.rb +2 -0
  34. data/lib/dnsimple/client/templates.rb +2 -0
  35. data/lib/dnsimple/client/templates_domains.rb +2 -0
  36. data/lib/dnsimple/client/templates_records.rb +2 -0
  37. data/lib/dnsimple/client/tlds.rb +2 -0
  38. data/lib/dnsimple/client/vanity_name_servers.rb +12 -10
  39. data/lib/dnsimple/client/webhooks.rb +2 -0
  40. data/lib/dnsimple/client/zones.rb +2 -0
  41. data/lib/dnsimple/client/zones_distributions.rb +2 -0
  42. data/lib/dnsimple/client/zones_records.rb +2 -0
  43. data/lib/dnsimple/default.rb +12 -10
  44. data/lib/dnsimple/error.rb +3 -1
  45. data/lib/dnsimple/extra.rb +4 -2
  46. data/lib/dnsimple/options.rb +2 -0
  47. data/lib/dnsimple/response.rb +7 -7
  48. data/lib/dnsimple/struct.rb +3 -0
  49. data/lib/dnsimple/struct/account.rb +2 -0
  50. data/lib/dnsimple/struct/certificate.rb +4 -2
  51. data/lib/dnsimple/struct/certificate_bundle.rb +5 -0
  52. data/lib/dnsimple/struct/certificate_purchase.rb +2 -0
  53. data/lib/dnsimple/struct/certificate_renewal.rb +2 -0
  54. data/lib/dnsimple/struct/collaborator.rb +2 -0
  55. data/lib/dnsimple/struct/contact.rb +2 -0
  56. data/lib/dnsimple/struct/delegation_signer_record.rb +2 -0
  57. data/lib/dnsimple/struct/dnssec.rb +2 -0
  58. data/lib/dnsimple/struct/domain.rb +4 -3
  59. data/lib/dnsimple/struct/domain_check.rb +2 -0
  60. data/lib/dnsimple/struct/domain_premium_price.rb +2 -0
  61. data/lib/dnsimple/struct/domain_price.rb +24 -0
  62. data/lib/dnsimple/struct/domain_push.rb +2 -0
  63. data/lib/dnsimple/struct/domain_registration.rb +2 -0
  64. data/lib/dnsimple/struct/domain_renewal.rb +2 -0
  65. data/lib/dnsimple/struct/domain_transfer.rb +5 -0
  66. data/lib/dnsimple/struct/email_forward.rb +2 -0
  67. data/lib/dnsimple/struct/extended_attribute.rb +2 -0
  68. data/lib/dnsimple/struct/oauth_token.rb +2 -0
  69. data/lib/dnsimple/struct/service.rb +2 -0
  70. data/lib/dnsimple/struct/template.rb +2 -0
  71. data/lib/dnsimple/struct/template_record.rb +2 -0
  72. data/lib/dnsimple/struct/tld.rb +2 -0
  73. data/lib/dnsimple/struct/user.rb +2 -0
  74. data/lib/dnsimple/struct/vanity_name_server.rb +2 -0
  75. data/lib/dnsimple/struct/webhook.rb +2 -0
  76. data/lib/dnsimple/struct/whoami.rb +2 -0
  77. data/lib/dnsimple/struct/whois_privacy.rb +2 -0
  78. data/lib/dnsimple/struct/whois_privacy_renewal.rb +2 -0
  79. data/lib/dnsimple/struct/zone.rb +2 -0
  80. data/lib/dnsimple/struct/zone_distribution.rb +2 -0
  81. data/lib/dnsimple/struct/zone_file.rb +2 -0
  82. data/lib/dnsimple/struct/zone_record.rb +2 -0
  83. data/lib/dnsimple/version.rb +3 -1
  84. data/spec/dnsimple/client/accounts_spec.rb +2 -0
  85. data/spec/dnsimple/client/certificates_spec.rb +35 -33
  86. data/spec/dnsimple/client/client_service_spec.rb +3 -1
  87. data/spec/dnsimple/client/contacts_spec.rb +4 -2
  88. data/spec/dnsimple/client/domains_collaborators_spec.rb +4 -2
  89. data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +3 -1
  90. data/spec/dnsimple/client/domains_dnssec_spec.rb +2 -0
  91. data/spec/dnsimple/client/domains_email_forwards_spec.rb +10 -8
  92. data/spec/dnsimple/client/domains_pushes_spec.rb +4 -2
  93. data/spec/dnsimple/client/domains_spec.rb +16 -41
  94. data/spec/dnsimple/client/identity_spec.rb +2 -0
  95. data/spec/dnsimple/client/oauth_spec.rb +2 -0
  96. data/spec/dnsimple/client/registrar_auto_renewal_spec.rb +2 -0
  97. data/spec/dnsimple/client/registrar_delegation_spec.rb +4 -2
  98. data/spec/dnsimple/client/registrar_spec.rb +116 -4
  99. data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +2 -0
  100. data/spec/dnsimple/client/services_domains_spec.rb +4 -4
  101. data/spec/dnsimple/client/services_spec.rb +3 -3
  102. data/spec/dnsimple/client/templates_domains_spec.rb +2 -0
  103. data/spec/dnsimple/client/templates_records_spec.rb +3 -1
  104. data/spec/dnsimple/client/templates_spec.rb +4 -2
  105. data/spec/dnsimple/client/tlds_spec.rb +2 -0
  106. data/spec/dnsimple/client/vanity_name_servers_spec.rb +2 -0
  107. data/spec/dnsimple/client/webhooks_spec.rb +3 -1
  108. data/spec/dnsimple/client/zones_distributions_spec.rb +2 -0
  109. data/spec/dnsimple/client/zones_records_spec.rb +4 -2
  110. data/spec/dnsimple/client/zones_spec.rb +3 -1
  111. data/spec/dnsimple/client_spec.rb +18 -16
  112. data/spec/dnsimple/extra_spec.rb +2 -0
  113. data/spec/dnsimple/options/base_spec.rb +2 -0
  114. data/spec/dnsimple/options/list_options_spec.rb +6 -4
  115. data/spec/fixtures.http/accounts/success-account.http +0 -1
  116. data/spec/fixtures.http/accounts/success-user.http +0 -1
  117. data/spec/fixtures.http/addCollaborator/invite-success.http +0 -1
  118. data/spec/fixtures.http/addCollaborator/success.http +0 -1
  119. data/spec/fixtures.http/appliedServices/success.http +0 -1
  120. data/spec/fixtures.http/cancelDomainTransfer/success.http +18 -0
  121. data/spec/fixtures.http/changeDomainDelegation/success.http +0 -1
  122. data/spec/fixtures.http/changeDomainDelegationToVanity/success.http +0 -1
  123. data/spec/fixtures.http/checkDomain/success.http +0 -1
  124. data/spec/fixtures.http/checkDomainPremiumPrice/error_400_not_a_premium_domain.http +18 -0
  125. data/spec/fixtures.http/checkDomainPremiumPrice/error_400_tld_not_supported.http +18 -0
  126. data/spec/fixtures.http/checkDomainPremiumPrice/success.http +20 -0
  127. data/spec/fixtures.http/checkZoneDistribution/error.http +0 -1
  128. data/spec/fixtures.http/checkZoneDistribution/failure.http +0 -1
  129. data/spec/fixtures.http/checkZoneDistribution/success.http +0 -1
  130. data/spec/fixtures.http/checkZoneRecordDistribution/error.http +0 -1
  131. data/spec/fixtures.http/checkZoneRecordDistribution/failure.http +0 -1
  132. data/spec/fixtures.http/checkZoneRecordDistribution/success.http +0 -1
  133. data/spec/fixtures.http/createContact/created.http +0 -1
  134. data/spec/fixtures.http/createDelegationSignerRecord/created.http +0 -1
  135. data/spec/fixtures.http/createDelegationSignerRecord/validation-error.http +0 -1
  136. data/spec/fixtures.http/createDomain/created.http +20 -16
  137. data/spec/fixtures.http/createEmailForward/created.http +21 -17
  138. data/spec/fixtures.http/createPrimaryServer/created.http +21 -0
  139. data/spec/fixtures.http/createSecondaryZone/created.http +21 -0
  140. data/spec/fixtures.http/createTemplate/created.http +0 -1
  141. data/spec/fixtures.http/createTemplateRecord/created.http +0 -1
  142. data/spec/fixtures.http/createWebhook/created.http +0 -1
  143. data/spec/fixtures.http/createZoneRecord/created-apex.http +0 -1
  144. data/spec/fixtures.http/createZoneRecord/created.http +0 -1
  145. data/spec/fixtures.http/deleteContact/error-contact-in-use.http +18 -0
  146. data/spec/fixtures.http/deleteEmailForward/success.http +12 -7
  147. data/spec/fixtures.http/disableDnssec/not-enabled.http +0 -1
  148. data/spec/fixtures.http/disableWhoisPrivacy/success.http +0 -1
  149. data/spec/fixtures.http/downloadCertificate/success.http +0 -1
  150. data/spec/fixtures.http/enableDnssec/success.http +0 -1
  151. data/spec/fixtures.http/enableVanityNameServers/success.http +0 -1
  152. data/spec/fixtures.http/enableWhoisPrivacy/created.http +0 -1
  153. data/spec/fixtures.http/enableWhoisPrivacy/success.http +0 -1
  154. data/spec/fixtures.http/getCertificate/success.http +10 -11
  155. data/spec/fixtures.http/getCertificatePrivateKey/success.http +0 -1
  156. data/spec/fixtures.http/getContact/success.http +0 -1
  157. data/spec/fixtures.http/getDelegationSignerRecord/success.http +0 -1
  158. data/spec/fixtures.http/getDnssec/success.http +0 -1
  159. data/spec/fixtures.http/getDomain/success.http +13 -9
  160. data/spec/fixtures.http/getDomainDelegation/success-empty.http +0 -1
  161. data/spec/fixtures.http/getDomainDelegation/success.http +0 -1
  162. data/spec/fixtures.http/getDomainPremiumPrice/failure.http +0 -1
  163. data/spec/fixtures.http/getDomainPremiumPrice/success.http +0 -1
  164. data/spec/fixtures.http/getDomainPrices/failure.http +19 -0
  165. data/spec/fixtures.http/getDomainPrices/success.http +21 -0
  166. data/spec/fixtures.http/getDomainTransfer/success.http +20 -0
  167. data/spec/fixtures.http/getEmailForward/success.http +14 -10
  168. data/spec/fixtures.http/getPrimaryServer/success.http +21 -0
  169. data/spec/fixtures.http/getService/success.http +0 -1
  170. data/spec/fixtures.http/getTemplate/success.http +0 -1
  171. data/spec/fixtures.http/getTemplateRecord/success.http +0 -1
  172. data/spec/fixtures.http/getTld/success.http +0 -1
  173. data/spec/fixtures.http/getTldExtendedAttributes/success-attributes.http +0 -1
  174. data/spec/fixtures.http/getTldExtendedAttributes/success-noattributes.http +0 -1
  175. data/spec/fixtures.http/getTldExtendedAttributes/success.http +0 -1
  176. data/spec/fixtures.http/getWebhook/success.http +0 -1
  177. data/spec/fixtures.http/getWhoisPrivacy/success.http +0 -1
  178. data/spec/fixtures.http/getZone/success.http +0 -1
  179. data/spec/fixtures.http/getZoneFile/success.http +0 -1
  180. data/spec/fixtures.http/getZoneRecord/success.http +0 -1
  181. data/spec/fixtures.http/initiatePush/success.http +0 -1
  182. data/spec/fixtures.http/issueLetsencryptCertificate/success.http +18 -21
  183. data/spec/fixtures.http/issueRenewalLetsencryptCertificate/success.http +18 -21
  184. data/spec/fixtures.http/linkPrimaryServer/success.http +21 -0
  185. data/spec/fixtures.http/listAccounts/success-account.http +0 -1
  186. data/spec/fixtures.http/listAccounts/success-user.http +0 -1
  187. data/spec/fixtures.http/listCertificates/success.http +10 -11
  188. data/spec/fixtures.http/listCollaborators/success.http +0 -1
  189. data/spec/fixtures.http/listContacts/success.http +0 -1
  190. data/spec/fixtures.http/listDelegationSignerRecords/success.http +0 -1
  191. data/spec/fixtures.http/listDomains/success.http +20 -16
  192. data/spec/fixtures.http/listEmailForwards/success.http +0 -1
  193. data/spec/fixtures.http/listPrimaryServers/success.http +21 -0
  194. data/spec/fixtures.http/listPushes/success.http +0 -1
  195. data/spec/fixtures.http/listServices/success.http +0 -1
  196. data/spec/fixtures.http/listTemplateRecords/success.http +0 -1
  197. data/spec/fixtures.http/listTemplates/success.http +0 -1
  198. data/spec/fixtures.http/listTlds/success.http +0 -1
  199. data/spec/fixtures.http/listWebhooks/success.http +0 -1
  200. data/spec/fixtures.http/listZoneRecords/success.http +0 -1
  201. data/spec/fixtures.http/listZones/success.http +0 -1
  202. data/spec/fixtures.http/method-not-allowed.http +0 -1
  203. data/spec/fixtures.http/notfound-certificate.http +0 -1
  204. data/spec/fixtures.http/notfound-collaborator.http +0 -1
  205. data/spec/fixtures.http/notfound-contact.http +0 -1
  206. data/spec/fixtures.http/notfound-delegationsignerrecord.http +0 -1
  207. data/spec/fixtures.http/notfound-domain.http +0 -1
  208. data/spec/fixtures.http/notfound-domainpush.http +0 -1
  209. data/spec/fixtures.http/notfound-emailforward.http +0 -1
  210. data/spec/fixtures.http/notfound-record.http +0 -1
  211. data/spec/fixtures.http/notfound-template.http +0 -1
  212. data/spec/fixtures.http/notfound-webhook.http +0 -1
  213. data/spec/fixtures.http/notfound-whoisprivacy.http +0 -1
  214. data/spec/fixtures.http/notfound-zone.http +0 -1
  215. data/spec/fixtures.http/oauthAccessToken/error-invalid-request.http +0 -1
  216. data/spec/fixtures.http/oauthAccessToken/success.http +0 -1
  217. data/spec/fixtures.http/pages-1of3.http +0 -1
  218. data/spec/fixtures.http/pages-2of3.http +0 -1
  219. data/spec/fixtures.http/pages-3of3.http +0 -1
  220. data/spec/fixtures.http/purchaseLetsencryptCertificate/success.http +20 -21
  221. data/spec/fixtures.http/purchaseRenewalLetsencryptCertificate/success.http +20 -21
  222. data/spec/fixtures.http/registerDomain/success.http +1 -2
  223. data/spec/fixtures.http/renewDomain/error-tooearly.http +0 -1
  224. data/spec/fixtures.http/renewDomain/success.http +1 -2
  225. data/spec/fixtures.http/renewWhoisPrivacy/success.http +0 -1
  226. data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http +1 -2
  227. data/spec/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http +1 -2
  228. data/spec/fixtures.http/response.http +0 -1
  229. data/spec/fixtures.http/transferDomain/error-indnsimple.http +0 -1
  230. data/spec/fixtures.http/transferDomain/error-missing-authcode.http +0 -1
  231. data/spec/fixtures.http/transferDomain/success.http +1 -2
  232. data/spec/fixtures.http/unlinkPrimaryServer/success.http +21 -0
  233. data/spec/fixtures.http/updateContact/success.http +0 -1
  234. data/spec/fixtures.http/updateTemplate/success.http +0 -1
  235. data/spec/fixtures.http/updateZoneRecord/success.http +0 -1
  236. data/spec/fixtures.http/validation-error.http +0 -1
  237. data/spec/fixtures.http/whoami/success-account.http +0 -1
  238. data/spec/fixtures.http/whoami/success-user.http +0 -1
  239. data/spec/fixtures.http/whoami/success.http +0 -1
  240. data/spec/spec_helper.rb +3 -1
  241. data/spec/support/helpers.rb +2 -0
  242. data/spec/support/webmock.rb +2 -0
  243. metadata +36 -15
  244. data/.ruby-gemset +0 -1
  245. 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
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -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
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
4
  module Struct
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dnsimple
2
- VERSION = "4.6.0".freeze
4
+ VERSION = "7.0.0"
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Dnsimple::Client, ".accounts" do
@@ -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) { "example.com" }
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,expires_on:desc")
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,expires_on:desc")
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) { "weppos.net" }
83
- let(:certificate_id) { 1 }
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(1)
110
- expect(result.domain_id).to eq(2)
111
- expect(result.contact_id).to eq(3)
112
- expect(result.common_name).to eq("www.weppos.net")
113
- expect(result.alternate_names).to eq(%w( weppos.net www.weppos.net ))
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-----\nMIICljCCAX4CAQAwGTEXMBUGA1UEAwwOd3d3LndlcHBvcy5uZXQwggEiMA0GCSqG\nSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3MJwx9ahBG3kAwRjQdRvYZqtovUaxY6jp\nhd09975gO+2eYPDbc1yhNftVJ4KBT0zdEqzX0CwIlxE1MsnZ2YOsC7IJO531hMBp\ndBxM4tSG07xPz70AVUi9rY6YCUoJHmxoFbclpHFbtXZocR393WyzUK8047uM2mlz\n03AZKcMdyfeuo2/9TcxpTSCkklGqwqS9wtTogckaDHJDoBunAkMioGfOSMe7Yi6E\nYRtG4yPJYsDaq2yPJWV8+i0PFR1Wi5RCnPt0YdQWstHuZrxABi45+XVkzKtz3TUc\nYxrvPBucVa6uzd953u8CixNFkiOefvb/dajsv1GIwH6/Cvc1ftz1AgMBAAGgODA2\nBgkqhkiG9w0BCQ4xKTAnMCUGA1UdEQQeMByCDnd3dy53ZXBwb3MubmV0ggp3ZXBw\nb3MubmV0MA0GCSqGSIb3DQEBCwUAA4IBAQCDnVBO9RdJX0eFeZzlv5c8yG8duhKP\nl0Vl+V88fJylb/cbNj9qFPkKTK0vTXmS2XUFBChKPtLucp8+Z754UswX+QCsdc7U\nTTSG0CkyilcSubdZUERGej1XfrVQhrokk7Fu0Jh3BdT6REP0SIDTpA8ku/aRQiAp\np+h19M37S7+w/DMGDAq2LSX8jOpJ1yIokRDyLZpmwyLxutC21DXMGoJ3xZeUFrUT\nqRNwzkn2dJzgTrPkzhaXalUBqv+nfXHqHaWljZa/O0NVCFrHCdTdd53/6EE2Yabv\nq5SFTkRCpaxrvM/7a8Tr4ixD1/VKD6rw3+WC00000000000000000000\n-----END CERTIFICATE REQUEST-----\n")
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("2016-06-11T18:47:08Z")
120
- expect(result.updated_at).to eq("2016-06-11T18:47:37Z")
121
- expect(result.expires_on).to eq("2016-09-09")
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) { "example.com" }
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(300)
266
- expect(result.certificate_id).to eq(300)
267
- expect(result.state).to eq("requesting")
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) { "example.com" }
286
- let(:certificate_id) { 200 }
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(200)
308
- expect(result.domain_id).to eq(300)
309
- expect(result.common_name).to eq("www.example.com")
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) { "example.com" }
344
- let(:certificate_id) { 200 }
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(999)
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(300)
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) { "example.com" }
395
- let(:certificate_id) { 300 }
396
- let(:certificate_renewal_id) { 999 }
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(300)
418
- expect(result.domain_id).to eq(300)
419
- expect(result.common_name).to eq("www.example.com")
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 "invite user already registered on DNSimple" do
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 "invite not registered on DNSimple" do
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
@@ -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) { 17706 }
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(17706)
151
- expect(result.domain_id).to eq(228963)
152
- expect(result.from).to eq("jim@a-domain.com")
153
- expect(result.to).to eq("jim@another.com")
154
- expect(result.created_at).to eq("2016-02-04T14:26:50Z")
155
- expect(result.updated_at).to eq("2016-02-04T14:26:50Z")
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