acme-client 2.0.34 → 2.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +9 -0
- data/Rakefile +5 -0
- data/lib/acme/client/resources/order.rb +14 -2
- data/lib/acme/client/version.rb +1 -1
- data/lib/acme/client.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f38120a91d760cdaf3a37defaf5c100da771a656655bb9cf26276901371e89f3
|
|
4
|
+
data.tar.gz: 712b061ca7d441c0fcbb5554a21a44c1495bf0fa5a7b21010942f644f79d353b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d830b1206e60ae98a031de5237618c3a526fdd2f29ebaed5aa018352c15c3838e30015a104de622a850846ac56e5bbe94c06b94378bab854adb961031c8548ef
|
|
7
|
+
data.tar.gz: 741e5e8b735527b1f95b630564ce0cf1729880323cb3eae7696ce7a7738570de73ab2ce0aaf3bb0bf53c2b7418d3ad56240e2373f55414bf2e112f7802443dc2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -224,6 +224,15 @@ end
|
|
|
224
224
|
order.certificate # => PEM-formatted certificate
|
|
225
225
|
```
|
|
226
226
|
|
|
227
|
+
When the server fails issuance after accepting the finalize request, the order moves to `invalid` and carries a problem document explaining why.
|
|
228
|
+
|
|
229
|
+
```ruby
|
|
230
|
+
if order.status == 'invalid'
|
|
231
|
+
order.error # => { "type" => "urn:ietf:params:acme:error:rateLimited", "detail" => "..." }
|
|
232
|
+
order.typed_error # => Acme::Client::Error::RateLimited
|
|
233
|
+
end
|
|
234
|
+
```
|
|
235
|
+
|
|
227
236
|
### Ordering an alternative certificate
|
|
228
237
|
|
|
229
238
|
The provider may provide alternate certificate with different certificate chain. You can specify the required chain and the client will automatically download alternate certificate and match the chain by name.
|
data/Rakefile
CHANGED
|
@@ -3,4 +3,9 @@ require 'bundler/gem_tasks'
|
|
|
3
3
|
require 'rspec/core/rake_task'
|
|
4
4
|
RSpec::Core::RakeTask.new(:spec)
|
|
5
5
|
|
|
6
|
+
desc 'Check the gem against the live IANA ACME error registry'
|
|
7
|
+
task :spec_iana_registry do
|
|
8
|
+
sh({ 'RUN_IANA_REGISTRY_SPEC' => '1' }, 'bundle exec rspec spec/iana_registry_spec.rb')
|
|
9
|
+
end
|
|
10
|
+
|
|
6
11
|
task default: [:spec]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
class Acme::Client::Resources::Order
|
|
4
|
-
attr_reader :url, :status, :contact, :finalize_url, :identifiers, :authorization_urls, :expires, :certificate_url, :profile, :replaces, :retry_after, :retry_after_time
|
|
4
|
+
attr_reader :url, :status, :contact, :finalize_url, :identifiers, :authorization_urls, :expires, :certificate_url, :profile, :replaces, :error, :retry_after, :retry_after_time
|
|
5
5
|
|
|
6
6
|
def initialize(client, **arguments)
|
|
7
7
|
@client = client
|
|
@@ -46,6 +46,16 @@ class Acme::Client::Resources::Order
|
|
|
46
46
|
@client.renewal_info(certificate:, ari_id:)
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
+
def typed_error
|
|
50
|
+
return nil unless error
|
|
51
|
+
|
|
52
|
+
problem = Acme::Client::Problem.from(error)
|
|
53
|
+
error_type = problem&.type
|
|
54
|
+
error_detail = problem&.detail || 'Unknown error'
|
|
55
|
+
error_class = Acme::Client::Error::ACME_ERRORS.fetch(error_type, Acme::Client::Error)
|
|
56
|
+
error_class.new(error_detail, problem: problem)
|
|
57
|
+
end
|
|
58
|
+
|
|
49
59
|
def to_h
|
|
50
60
|
{
|
|
51
61
|
url: url,
|
|
@@ -57,13 +67,14 @@ class Acme::Client::Resources::Order
|
|
|
57
67
|
certificate_url: certificate_url,
|
|
58
68
|
profile: profile,
|
|
59
69
|
replaces: replaces,
|
|
70
|
+
error: error,
|
|
60
71
|
retry_after: retry_after
|
|
61
72
|
}
|
|
62
73
|
end
|
|
63
74
|
|
|
64
75
|
private
|
|
65
76
|
|
|
66
|
-
def assign_attributes(url: nil, status:, expires:, finalize_url:, authorization_urls:, identifiers:, certificate_url: nil, profile: nil, replaces: nil, retry_after: nil) # rubocop:disable Layout/LineLength,Metrics/ParameterLists
|
|
77
|
+
def assign_attributes(url: nil, status:, expires:, finalize_url:, authorization_urls:, identifiers:, certificate_url: nil, profile: nil, replaces: nil, error: nil, retry_after: nil) # rubocop:disable Layout/LineLength,Metrics/ParameterLists
|
|
67
78
|
@url = url unless url.nil?
|
|
68
79
|
@status = status
|
|
69
80
|
@expires = expires
|
|
@@ -73,6 +84,7 @@ class Acme::Client::Resources::Order
|
|
|
73
84
|
@certificate_url = certificate_url
|
|
74
85
|
@profile = profile
|
|
75
86
|
@replaces = replaces
|
|
87
|
+
@error = error
|
|
76
88
|
@retry_after = retry_after
|
|
77
89
|
@retry_after_time = Acme::Client::Util.parse_retry_after(retry_after)
|
|
78
90
|
end
|
data/lib/acme/client/version.rb
CHANGED
data/lib/acme/client.rb
CHANGED