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 +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +3 -3
- data/CHANGELOG.md +11 -0
- data/lib/acme/client.rb +11 -4
- data/lib/acme/client/resources/account.rb +4 -4
- data/lib/acme/client/resources/authorization.rb +2 -2
- data/lib/acme/client/resources/challenges/base.rb +12 -4
- data/lib/acme/client/resources/directory.rb +2 -1
- data/lib/acme/client/resources/order.rb +2 -2
- data/lib/acme/client/version.rb +1 -1
- metadata +15 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05f87acfd3874c1d642f80201ef97d81abee4c36e97f194227f0a4cf3501f981
|
4
|
+
data.tar.gz: 688ad48aca9ef6350f0350a8ed719f8efea00c611995124c56c1221160219152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e23b7f8b4116da8dd7bc9834ef4fb441bb90f2f3a54fae653bed0a3ea56d6d0a7b98642df443dd08834ffdd46b3f5b86b995d3b4eb4253f6f43511babe010592
|
7
|
+
data.tar.gz: 706a2d72509b69a754c0a40d676652bde2f2ed284abdbed26982991c65ac42beb74586fddf2f790144de839f7ef570cae31617a882574459093a5ab157dc65a4
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -7,7 +7,7 @@ AllCops:
|
|
7
7
|
Rails:
|
8
8
|
Enabled: false
|
9
9
|
|
10
|
-
|
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
|
-
|
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
|
-
|
138
|
+
Style/AccessorMethodName:
|
139
139
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/lib/acme/client.rb
CHANGED
@@ -177,7 +177,8 @@ class Acme::Client
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def get_nonce
|
180
|
-
|
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] ||=
|
272
|
+
@connections[mode][endpoint] ||= new_acme_connection(endpoint: endpoint, mode: mode)
|
272
273
|
end
|
273
274
|
|
274
|
-
def
|
275
|
-
|
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
|
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
|
23
|
+
assign_attributes(**@client.account_deactivate.to_h)
|
24
24
|
true
|
25
25
|
end
|
26
26
|
|
27
27
|
def reload
|
28
|
-
assign_attributes
|
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
|
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
|
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
|
20
|
+
assign_attributes(**@client.challenge(url: url).to_h)
|
21
21
|
true
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
25
|
-
|
26
|
-
url: url,
|
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,
|
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
|
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
|
23
|
+
assign_attributes(**@client.finalize(url: finalize_url, csr: csr).to_h)
|
24
24
|
true
|
25
25
|
end
|
26
26
|
|
data/lib/acme/client/version.rb
CHANGED
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.
|
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:
|
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
|
-
|
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.
|