acmesmith 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58fb0220ae11e6aa3899cac2c584c744bb111388
4
- data.tar.gz: 64df0d8ed2d9b5d43cd09deeb7ef1f6975ef6f02
3
+ metadata.gz: b30ccc8df20bb33b80e00e387793b0f48123dc0d
4
+ data.tar.gz: d5e42027029489bab6d284cbdf4340dd4d0c1378
5
5
  SHA512:
6
- metadata.gz: 658d7a8b735e4fc51d7b91c82cfa514058e00eb95c96c681feeb4ca35bb68f1bdb57c806040576c7aeb6ae977274549ec0f987e13b162910b6bdcdb6b2f29530
7
- data.tar.gz: 2aa5fb15c1e042fd821098617470886bf6f85914fa99115d815574132178a4a4d6c56b77186a9c5114cce99693f9bdbfd0e346feeb8ad181c69fee99295be2e5
6
+ metadata.gz: 20f3d365e5e16cddb7409fde72996798cecf0447f08bd84059f3943ad4712ee7cb64a002529e7363e9af0c6de00a1b577a6a1211f093fbde3dfb27557c84ae70
7
+ data.tar.gz: fdf60a6de0063f0d53c6d2e0991fca8c444c15cbb1c4595f7f279cc696eb6c4db318ba87a77cf480704915c47d9307801e7221795b2be00d57af8cd9f0750351
@@ -1,3 +1,11 @@
1
+ ## v2.0.3 (2018-05-19)
2
+
3
+ ### Bug fixes
4
+
5
+ - `route53` couldn't create an appropriate RRSet when ACME server needs multiple authorizations for the single domain. [#31](https://github.com/sorah/acmesmith/issues/31)
6
+
7
+ (In fact, responsing could fail when ordering certificate for `*.example.org` and `example.org` to LE.)
8
+
1
9
  ## v2.0.2 (2018-05-18)
2
10
 
3
11
  ### Bug fixes
@@ -55,7 +55,9 @@ module Acmesmith
55
55
  puts " * #{zone_id}:"
56
56
  change_batch.fetch(:changes).each do |b|
57
57
  rrset = b.fetch(:resource_record_set)
58
- puts " - #{b.fetch(:action)}: #{rrset.fetch(:name)} #{rrset.fetch(:ttl)} #{rrset.fetch(:type)} #{rrset.dig(:resource_records, 0, :value)}"
58
+ rrset.fetch(:resource_records).each do |rr|
59
+ puts " - #{b.fetch(:action)}: #{rrset.fetch(:name)} #{rrset.fetch(:ttl)} #{rrset.fetch(:type)} #{rr.fetch(:value)}"
60
+ end
59
61
  end
60
62
  print " ... "
61
63
 
@@ -98,14 +100,29 @@ module Acmesmith
98
100
  end
99
101
 
100
102
  def change_batch_for_challenges(domain_and_challenges, comment: nil, action: 'UPSERT')
101
- {
102
- comment: "ACME challenge response #{comment}",
103
- changes: domain_and_challenges.map do |d,c|
103
+ changes = domain_and_challenges
104
+ .map do |d, c|
105
+ rrset_for_challenge(d, c)
106
+ end
107
+ .group_by do |_|
108
+ # Reduce changes by name. ACME server may require multiple challenge responses for the same identifier
109
+ _.fetch(:name)
110
+ end
111
+ .map do |name, cs|
112
+ cs.inject { |result, change|
113
+ result.merge(resource_records: result.fetch(:resource_records, []) + change.fetch(:resource_records))
114
+ }
115
+ end
116
+ .map do |change|
104
117
  {
105
118
  action: action,
106
- resource_record_set: rrset_for_challenge(d,c),
119
+ resource_record_set: change,
107
120
  }
108
- end,
121
+ end
122
+
123
+ {
124
+ comment: "ACME challenge response #{comment}",
125
+ changes: changes,
109
126
  }
110
127
  end
111
128
 
@@ -1,3 +1,3 @@
1
1
  module Acmesmith
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acmesmith
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sorah (Shota Fukumori)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-17 00:00:00.000000000 Z
11
+ date: 2018-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acme-client