acme-client 2.0.1 → 2.0.2

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
  SHA256:
3
- metadata.gz: 64374fceebb44c96455db6bda3486fdff6afcb54548fb073177d972ddfe5ea58
4
- data.tar.gz: fcfe92ab66fe177c4ead06cf605f9207187250cafae6b6135e3b941fb20b9ed2
3
+ metadata.gz: 05f87acfd3874c1d642f80201ef97d81abee4c36e97f194227f0a4cf3501f981
4
+ data.tar.gz: 688ad48aca9ef6350f0350a8ed719f8efea00c611995124c56c1221160219152
5
5
  SHA512:
6
- metadata.gz: 81a260cebd6797af5f1bfd2fc9249fb8969aa69eaf806c9849fc37ffe327a03a5eec8287606297d4d2bf62cdcfcde4a182d96fac5de0d58b4771b81d2b0aa45d
7
- data.tar.gz: 2231b13253d255bc83004fd67d17bfcbf69ab94d593c4bc41f9509ef11a1f49a947bf01921334fed4e024184ad96d5fd595e11f2d8e9790b2d27a3ecb963c761
6
+ metadata.gz: e23b7f8b4116da8dd7bc9834ef4fb441bb90f2f3a54fae653bed0a3ea56d6d0a7b98642df443dd08834ffdd46b3f5b86b995d3b4eb4253f6f43511babe010592
7
+ data.tar.gz: 706a2d72509b69a754c0a40d676652bde2f2ed284abdbed26982991c65ac42beb74586fddf2f790144de839f7ef570cae31617a882574459093a5ab157dc65a4
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  /vendor/bundle
11
+ /.idea/
@@ -7,7 +7,7 @@ AllCops:
7
7
  Rails:
8
8
  Enabled: false
9
9
 
10
- Naming/FileName:
10
+ Style/FileName:
11
11
  Exclude:
12
12
  - 'lib/acme-client.rb'
13
13
 
@@ -66,7 +66,7 @@ Metrics/ParameterLists:
66
66
  Max: 5
67
67
  CountKeywordArgs: false
68
68
 
69
- Layout/EndAlignment:
69
+ Lint/EndAlignment:
70
70
  Enabled: false
71
71
 
72
72
  Style/ParallelAssignment:
@@ -135,5 +135,5 @@ Style/ExpandPathArguments:
135
135
  Security/JSONLoad:
136
136
  Enabled: false
137
137
 
138
- Naming/AccessorMethodName:
138
+ Style/AccessorMethodName:
139
139
  Enabled: false
@@ -1,3 +1,14 @@
1
+ ## `2.0.2`
2
+
3
+ * Fix constant lookup on InvalidDirectory
4
+ * Forward connection options when fetching nonce
5
+ * Fix splats without parenthesis warning
6
+
7
+
8
+ ## `2.0.1`
9
+
10
+ * Properly require URI
11
+
1
12
  ## `2.0.0`
2
13
 
3
14
  * Release of the `ACMEv2` branch
@@ -177,7 +177,8 @@ class Acme::Client
177
177
  end
178
178
 
179
179
  def get_nonce
180
- response = Faraday.head(endpoint_for(:new_nonce), nil, 'User-Agent' => USER_AGENT)
180
+ connection = new_connection(endpoint: endpoint_for(:new_nonce))
181
+ response = connection.head(nil, nil, 'User-Agent' => USER_AGENT)
181
182
  nonces << response.headers['replay-nonce']
182
183
  true
183
184
  end
@@ -268,12 +269,18 @@ class Acme::Client
268
269
  endpoint = "#{uri.scheme}://#{uri.hostname}:#{uri.port}"
269
270
  @connections ||= {}
270
271
  @connections[mode] ||= {}
271
- @connections[mode][endpoint] ||= new_connection(endpoint: endpoint, mode: mode)
272
+ @connections[mode][endpoint] ||= new_acme_connection(endpoint: endpoint, mode: mode)
272
273
  end
273
274
 
274
- def new_connection(endpoint:, mode:)
275
- Faraday.new(endpoint, **@connection_options) do |configuration|
275
+ def new_acme_connection(endpoint:, mode:)
276
+ new_connection(endpoint: endpoint) do |configuration|
276
277
  configuration.use Acme::Client::FaradayMiddleware, client: self, mode: mode
278
+ end
279
+ end
280
+
281
+ def new_connection(endpoint:)
282
+ Faraday.new(endpoint, **@connection_options) do |configuration|
283
+ yield(configuration) if block_given?
277
284
  configuration.adapter Faraday.default_adapter
278
285
  end
279
286
  end
@@ -13,19 +13,19 @@ class Acme::Client::Resources::Account
13
13
  end
14
14
 
15
15
  def update(contact: nil, terms_of_service_agreed: nil)
16
- assign_attributes **@client.account_update(
16
+ assign_attributes(**@client.account_update(
17
17
  contact: contact, terms_of_service_agreed: term_of_service
18
- ).to_h
18
+ ).to_h)
19
19
  true
20
20
  end
21
21
 
22
22
  def deactivate
23
- assign_attributes **@client.account_deactivate.to_h
23
+ assign_attributes(**@client.account_deactivate.to_h)
24
24
  true
25
25
  end
26
26
 
27
27
  def reload
28
- assign_attributes **@client.account.to_h
28
+ assign_attributes(**@client.account.to_h)
29
29
  true
30
30
  end
31
31
 
@@ -9,12 +9,12 @@ class Acme::Client::Resources::Authorization
9
9
  end
10
10
 
11
11
  def deactivate
12
- assign_attributes **@client.deactivate_authorization(url: url).to_h
12
+ assign_attributes(**@client.deactivate_authorization(url: url).to_h)
13
13
  true
14
14
  end
15
15
 
16
16
  def reload
17
- assign_attributes **@client.authorization(url: url).to_h
17
+ assign_attributes(**@client.authorization(url: url).to_h)
18
18
  true
19
19
  end
20
20
 
@@ -17,14 +17,22 @@ class Acme::Client::Resources::Challenges::Base
17
17
  end
18
18
 
19
19
  def reload
20
- assign_attributes **@client.challenge(url: url).to_h
20
+ assign_attributes(**@client.challenge(url: url).to_h)
21
21
  true
22
22
  end
23
23
 
24
- def request_validation
25
- assign_attributes **@client.request_challenge_validation(
26
- url: url, key_authorization: key_authorization
24
+ def send_challenge_vallidation(url:, key_authorization:)
25
+ @client.request_challenge_validation(
26
+ url: url,
27
+ key_authorization: key_authorization
27
28
  ).to_h
29
+ end
30
+
31
+ def request_validation
32
+ assign_attributes(**send_challenge_vallidation(
33
+ url: url,
34
+ key_authorization: key_authorization
35
+ ))
28
36
  true
29
37
  end
30
38
 
@@ -63,7 +63,8 @@ class Acme::Client::Resources::Directory
63
63
  end
64
64
  result
65
65
  rescue JSON::ParserError => exception
66
- raise InvalidDirectory, "Invalid directory url\n#{@directory} did not return a valid directory\n#{exception.inspect}"
66
+ raise Acme::Client::Error::InvalidDirectory,
67
+ "Invalid directory url\n#{@directory} did not return a valid directory\n#{exception.inspect}"
67
68
  end
68
69
 
69
70
  def fetch_directory
@@ -9,7 +9,7 @@ class Acme::Client::Resources::Order
9
9
  end
10
10
 
11
11
  def reload
12
- assign_attributes **@client.order(url: url).to_h
12
+ assign_attributes(**@client.order(url: url).to_h)
13
13
  true
14
14
  end
15
15
 
@@ -20,7 +20,7 @@ class Acme::Client::Resources::Order
20
20
  end
21
21
 
22
22
  def finalize(csr:)
23
- assign_attributes **@client.finalize(url: finalize_url, csr: csr).to_h
23
+ assign_attributes(**@client.finalize(url: finalize_url, csr: csr).to_h)
24
24
  true
25
25
  end
26
26
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Acme
4
4
  class Client
5
- VERSION = '2.0.1'.freeze
5
+ VERSION = '2.0.2'.freeze
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acme-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Barbier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2019-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -48,22 +48,22 @@ dependencies:
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '3.3'
54
51
  - - ">="
55
52
  - !ruby/object:Gem::Version
56
53
  version: 3.3.0
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '3.3'
57
57
  type: :development
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: '3.3'
64
61
  - - ">="
65
62
  - !ruby/object:Gem::Version
66
63
  version: 3.3.0
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '3.3'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: vcr
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -88,22 +88,22 @@ dependencies:
88
88
  name: webmock
89
89
  requirement: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - "~>"
92
- - !ruby/object:Gem::Version
93
- version: '1.21'
94
91
  - - ">="
95
92
  - !ruby/object:Gem::Version
96
93
  version: 1.21.0
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.21'
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '1.21'
104
101
  - - ">="
105
102
  - !ruby/object:Gem::Version
106
103
  version: 1.21.0
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '1.21'
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: faraday
109
109
  requirement: !ruby/object:Gem::Requirement
@@ -185,8 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0'
187
187
  requirements: []
188
- rubyforge_project:
189
- rubygems_version: 2.7.6
188
+ rubygems_version: 3.0.2
190
189
  signing_key:
191
190
  specification_version: 4
192
191
  summary: Client for the ACME protocol.