acme-client 2.0.27 → 2.0.28

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d41b8df6f16f62b2bd33a0fd960d7675c02e1d065fb3bf3466b58f59aad3a740
4
- data.tar.gz: 846346e6d27381ea63fa1cb82b9044bef0acc25e5ca38ebf332fb692c02b577e
3
+ metadata.gz: c77ea7f7e3923d5c76ddd26c802ade553e7875f0f95b753a240f06c1e77e3689
4
+ data.tar.gz: 4f7a6f073795c9328b7322bd39f5640fb53e89c2b3790417ea2be2f2f13c5e7e
5
5
  SHA512:
6
- metadata.gz: 49cda221593c2902534457cd4b89e7c24fedc3ee33f52ae4af5e83df14e4baf0cd68e547ec95c54e4dffd2fa1aea2989e51f371f5abfb37cc0630e7e4176977f
7
- data.tar.gz: '059a4b9b2f260ab7dc8cb3f069120c74b3f76ec4ce5d6ff22f7eb625b75c6c032bfca3709795e247f82873d022a2f1e09ef939687e7c0f74589564cae41c9c94'
6
+ metadata.gz: e12eae043f2e3b8fd505b88980f45336aee50013c23297ef8dd6f3f58cb427c62be9d0d1098dee4242fe258bc12b3bf417b22e3be772c3bcf8d6eb9b15748b75
7
+ data.tar.gz: 24fb6340f56d6eb998d57706dbfb92f92a64f488157410d0997e38bda9c009e541c4a2e5686d936d1be5a5c40aee39bcb3d8953edea86ddea4d0915c87344cfa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## `2.0.28`
2
+
3
+ * Make [Retry-After](https://datatracker.ietf.org/doc/html/rfc8555/#section-6.6) accessible from RateLimited#retry_after exceptions
4
+
1
5
  ## `2.0.27`
2
6
 
3
7
  * Add support for Renewal Information (ARI) (RFC 9773)
@@ -0,0 +1,8 @@
1
+ class Acme::Client::Error::RateLimited < Acme::Client::Error::ServerError
2
+ attr_reader :retry_after
3
+
4
+ def initialize(message, retry_after = 10)
5
+ super(message)
6
+ @retry_after = retry_after.nil? ? 10 : retry_after.to_i
7
+ end
8
+ end
@@ -101,6 +101,9 @@ module Acme::Client::HTTPClient
101
101
  end
102
102
 
103
103
  def raise_on_error!
104
+ if error_class == Acme::Client::Error::RateLimited
105
+ raise error_class.new(error_message, env.response_headers['Retry-After'])
106
+ end
104
107
  raise error_class, error_message
105
108
  end
106
109
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Acme
4
4
  class Client
5
- VERSION = '2.0.27'.freeze
5
+ VERSION = '2.0.28'.freeze
6
6
  end
7
7
  end
data/lib/acme/client.rb CHANGED
@@ -20,6 +20,7 @@ require 'acme/client/self_sign_certificate'
20
20
  require 'acme/client/resources'
21
21
  require 'acme/client/jwk'
22
22
  require 'acme/client/error'
23
+ require 'acme/client/error/rate_limited'
23
24
  require 'acme/client/util'
24
25
  require 'acme/client/chain_identifier'
25
26
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acme-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.27
4
+ version: 2.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Barbier
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-11-12 00:00:00.000000000 Z
10
+ date: 2025-11-28 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake
@@ -155,6 +155,7 @@ files:
155
155
  - lib/acme/client/certificate_request/ec_key_patch.rb
156
156
  - lib/acme/client/chain_identifier.rb
157
157
  - lib/acme/client/error.rb
158
+ - lib/acme/client/error/rate_limited.rb
158
159
  - lib/acme/client/http_client.rb
159
160
  - lib/acme/client/jwk.rb
160
161
  - lib/acme/client/jwk/base.rb