acme-client 2.0.23 → 2.0.25

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: 1eb2a09bcf4340643965c2e0f51368dac752614c98f58c258a941a038ce556d1
4
- data.tar.gz: f59b2621ea672475bc8221bfbc207e7db7c64d90e595210ec269008d8644853a
3
+ metadata.gz: 57864d566a88b4298a243bfaa6f34b5556a7aa1f36f41fd4e61636d0e7fae74e
4
+ data.tar.gz: c68a9476baa8fad93f9373e16d3dad6249edb2cc7f007d0d1bf4386cf0cf7f6e
5
5
  SHA512:
6
- metadata.gz: b8d2e1561561b6c90c87bdf61ba5e399f110239bfd0cfcbb15b37943f0c36193bc05bde11466141189fe743d9134fa1ee9048603798cdd8a8d47f29cc6e58694
7
- data.tar.gz: bba9cadd52794d4e507bc4021dc5eaaafc631ad9567b5e9e2074efde7adecd017c2010cf16ed811dd966de8541c969659cdeea99689c6015b676e00d62ab4d61
6
+ metadata.gz: c2cb942f81bfb49f952f955b9eea415b86718c8fe4fb3426cf7cdc1fcb8925b97dfe20e07300480fef894b6438ab5b2046d670564f8bc66a8a80bd5f14e2a282
7
+ data.tar.gz: f5343edaa0fb6543d2f37e6017732969e63e687c9db877ff8ba188444244e1a180b59cedfbbef12d021a702f65cb089fc08f0ec79ab2363b660343d9df421f5c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## `2.0.25`
2
+
3
+ * Add support for profiles extension
4
+
5
+ ## `2.0.24`
6
+
7
+ * Add support for account orders url attribute.
8
+
1
9
  ## `2.0.23`
2
10
 
3
11
  * Allow Order to be create without url. Location is not always required in the specification.
data/README.md CHANGED
@@ -244,6 +244,22 @@ new_private_key = OpenSSL::PKey::RSA.new(4096)
244
244
  client.account_key_change(new_private_key: new_private_key)
245
245
  ```
246
246
 
247
+ ### Profile Extension
248
+
249
+ Provide a CA profile when creating a new order:
250
+
251
+ ```ruby
252
+ order = client.new_order(identifiers: ['example.com'], profile: 'shortlived')
253
+ ```
254
+
255
+ ACME servers may list supported profiles in the directory endpoint:
256
+
257
+ ```ruby
258
+ client.profiles => {"classic": "https://example.com/docs/classic", "shortlived": "https://example.com/docs/shortlived"}
259
+ ```
260
+
261
+ See the [RFC draft of certificate profiles](https://datatracker.ietf.org/doc/draft-aaron-acme-profiles/) for more info.
262
+
247
263
  ## Requirements
248
264
 
249
265
  Ruby >= 3.0
@@ -34,16 +34,18 @@ class Acme::Client::Resources::Account
34
34
  url: url,
35
35
  term_of_service: term_of_service,
36
36
  status: status,
37
- contact: contact
37
+ contact: contact,
38
+ orders: orders_url
38
39
  }
39
40
  end
40
41
 
41
42
  private
42
43
 
43
- def assign_attributes(url:, term_of_service:, status:, contact:)
44
+ def assign_attributes(url:, term_of_service:, status:, contact:, orders: nil)
44
45
  @url = url
45
46
  @term_of_service = term_of_service
46
47
  @status = status
47
48
  @contact = Array(contact)
49
+ @orders_url = orders
48
50
  end
49
51
  end
@@ -14,7 +14,8 @@ class Acme::Client::Resources::Directory
14
14
  terms_of_service: 'termsOfService',
15
15
  website: 'website',
16
16
  caa_identities: 'caaIdentities',
17
- external_account_required: 'externalAccountRequired'
17
+ external_account_required: 'externalAccountRequired',
18
+ profiles: 'profiles'
18
19
  }
19
20
 
20
21
  def initialize(client, **arguments)
@@ -45,6 +46,10 @@ class Acme::Client::Resources::Directory
45
46
  meta[DIRECTORY_META[:external_account_required]]
46
47
  end
47
48
 
49
+ def profiles
50
+ meta[DIRECTORY_META[:profiles]]
51
+ end
52
+
48
53
  def meta
49
54
  @directory[:meta]
50
55
  end
@@ -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
4
+ attr_reader :url, :status, :contact, :finalize_url, :identifiers, :authorization_urls, :expires, :certificate_url, :profile
5
5
 
6
6
  def initialize(client, **arguments)
7
7
  @client = client
@@ -44,13 +44,14 @@ class Acme::Client::Resources::Order
44
44
  finalize_url: finalize_url,
45
45
  authorization_urls: authorization_urls,
46
46
  identifiers: identifiers,
47
- certificate_url: certificate_url
47
+ certificate_url: certificate_url,
48
+ profile: profile
48
49
  }
49
50
  end
50
51
 
51
52
  private
52
53
 
53
- def assign_attributes(url: nil, status:, expires:, finalize_url:, authorization_urls:, identifiers:, certificate_url: nil)
54
+ def assign_attributes(url: nil, status:, expires:, finalize_url:, authorization_urls:, identifiers:, certificate_url: nil, profile: nil) # rubocop:disable Layout/LineLength,Metrics/ParameterLists
54
55
  @url = url
55
56
  @status = status
56
57
  @expires = expires
@@ -58,5 +59,6 @@ class Acme::Client::Resources::Order
58
59
  @authorization_urls = authorization_urls
59
60
  @identifiers = identifiers
60
61
  @certificate_url = certificate_url
62
+ @profile = profile
61
63
  end
62
64
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Acme
4
4
  class Client
5
- VERSION = '2.0.23'.freeze
5
+ VERSION = '2.0.25'.freeze
6
6
  end
7
7
  end
data/lib/acme/client.rb CHANGED
@@ -135,11 +135,12 @@ class Acme::Client
135
135
  @kid ||= account.kid
136
136
  end
137
137
 
138
- def new_order(identifiers:, not_before: nil, not_after: nil)
138
+ def new_order(identifiers:, not_before: nil, not_after: nil, profile: nil)
139
139
  payload = {}
140
140
  payload['identifiers'] = prepare_order_identifiers(identifiers)
141
141
  payload['notBefore'] = not_before if not_before
142
142
  payload['notAfter'] = not_after if not_after
143
+ payload['profile'] = profile if profile
143
144
 
144
145
  response = post(endpoint_for(:new_order), payload: payload)
145
146
  arguments = attributes_from_order_response(response)
@@ -253,6 +254,10 @@ class Acme::Client
253
254
  directory.external_account_required
254
255
  end
255
256
 
257
+ def profiles
258
+ directory.profiles
259
+ end
260
+
256
261
  private
257
262
 
258
263
  def load_directory
@@ -286,6 +291,7 @@ class Acme::Client
286
291
  response.body,
287
292
  :status,
288
293
  [:term_of_service, 'termsOfServiceAgreed'],
294
+ :orders,
289
295
  :contact
290
296
  )
291
297
  end
@@ -298,7 +304,8 @@ class Acme::Client
298
304
  [:finalize_url, 'finalize'],
299
305
  [:authorization_urls, 'authorizations'],
300
306
  [:certificate_url, 'certificate'],
301
- :identifiers
307
+ :identifiers,
308
+ :profile
302
309
  )
303
310
 
304
311
  attributes[:url] = response.headers[:location] if response.headers[:location]
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.23
4
+ version: 2.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Barbier
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-29 00:00:00.000000000 Z
10
+ date: 2025-08-07 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake