le_ssl 0.0.4 → 0.0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/le_ssl/errors.rb +1 -1
- data/lib/le_ssl/manager.rb +6 -6
- data/lib/le_ssl/version.rb +2 -2
- data/lib/le_ssl.rb +4 -2
- data/test/dummy/log/test.log +132 -375
- data/test/le_ssl/manager_test.rb +9 -9
- data/test/le_ssl_test.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0be55879ba830ebcf463a49b9b89c94782df2b24
|
4
|
+
data.tar.gz: c6b324db5ad48c8a15b16c42c366bb74f722c5c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d764b27c5bdfd61319420053a95c83d86f3337b36d3e05ddfe46d9b0cfe5ff1cc5e78bc54a5eb0627baca72dba4235cc5748316b1d399b098f3cbc339b07f3e
|
7
|
+
data.tar.gz: 477a5b24081ee0c4549a8f143e9c2e9d7970c8c53b9af64b83c012c9b126f36c522ea17ad4314a68a36636e7c2736d431d1755955278803c7d8c0d4f2be89475
|
data/lib/le_ssl/errors.rb
CHANGED
data/lib/le_ssl/manager.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module LeSSL
|
2
2
|
class Manager
|
3
3
|
PRODUCTION_ENDPOINT = 'https://acme-v01.api.letsencrypt.org/'
|
4
4
|
DEVELOPMENT_ENDPOINT = 'https://acme-staging.api.letsencrypt.org/'
|
@@ -6,8 +6,8 @@ module LeSsl
|
|
6
6
|
def initialize(options={})
|
7
7
|
email = options[:email] || email_from_env
|
8
8
|
|
9
|
-
raise
|
10
|
-
raise
|
9
|
+
raise LeSSL::NoContactEmailError if email.nil?
|
10
|
+
raise LeSSL::TermsNotAcceptedError unless options[:agree_terms] == true
|
11
11
|
|
12
12
|
self.private_key = options[:private_key].presence
|
13
13
|
|
@@ -79,7 +79,7 @@ module LeSsl
|
|
79
79
|
|
80
80
|
return certificate
|
81
81
|
rescue Acme::Client::Error::Unauthorized => e
|
82
|
-
raise
|
82
|
+
raise LeSSL::UnauthorizedError, e.message
|
83
83
|
end
|
84
84
|
|
85
85
|
def register(email)
|
@@ -100,13 +100,13 @@ module LeSsl
|
|
100
100
|
elsif key.nil?
|
101
101
|
nil # Return silently
|
102
102
|
else
|
103
|
-
raise
|
103
|
+
raise LeSSL::PrivateKeyInvalidFormat
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
107
|
def private_key
|
108
108
|
self.private_key = private_key_string_from_env if @private_key.nil?
|
109
|
-
raise(
|
109
|
+
raise(LeSSL::NoPrivateKeyError, "No private key for certificate account found") if @private_key.nil?
|
110
110
|
|
111
111
|
@private_key
|
112
112
|
end
|
data/lib/le_ssl/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "0.0.4"
|
1
|
+
module LeSSL
|
2
|
+
VERSION = "0.0.4.1"
|
3
3
|
end
|
data/lib/le_ssl.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -1,417 +1,186 @@
|
|
1
|
-
---------------------
|
2
|
-
LeSSLTest: test_truth
|
3
|
-
---------------------
|
4
|
-
---------------------
|
5
|
-
LeSSLTest: test_truth
|
6
|
-
---------------------
|
7
|
-
---------------------
|
8
|
-
LeSSLTest: test_truth
|
9
|
-
---------------------
|
10
|
-
---------------------
|
11
|
-
LeSSLTest: test_truth
|
12
|
-
---------------------
|
13
|
-
---------------------
|
14
|
-
LeSSLTest: test_truth
|
15
|
-
---------------------
|
16
|
-
---------------------
|
17
|
-
LeSslTest: test_truth
|
18
|
-
---------------------
|
19
1
|
-------------------------------------------------------------------
|
20
|
-
|
21
|
-
-------------------------------------------------------------------
|
22
|
-
--------------------------------------------------------------------------------------------------
|
23
|
-
LeSsl::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
24
|
-
--------------------------------------------------------------------------------------------------
|
25
|
-
-------------------------------------------------------------
|
26
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
27
|
-
-------------------------------------------------------------
|
28
|
-
----------------------------------------------------------------------
|
29
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
30
|
-
----------------------------------------------------------------------
|
31
|
-
-----------------------------------------------
|
32
|
-
LeSsl::ManagerTest: test_authorization_with_DNS
|
33
|
-
-----------------------------------------------
|
34
|
-
-------------------------------
|
35
|
-
LeSsl::ManagerTest: test_client
|
36
|
-
-------------------------------
|
37
|
-
-------------------------------------------------------------------
|
38
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_private_key
|
2
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_private_key
|
39
3
|
-------------------------------------------------------------------
|
40
4
|
-------------------------------------------------------------------
|
41
|
-
|
5
|
+
LeSSL::ManagerTest: test_valid_initialization_(without_registering)
|
42
6
|
-------------------------------------------------------------------
|
7
|
+
--------------------------------------------------------------------------
|
8
|
+
LeSSL::ManagerTest: test_#email_from_env_with_current_environment_variable
|
9
|
+
--------------------------------------------------------------------------
|
43
10
|
-------------------------------
|
44
|
-
|
11
|
+
LeSSL::ManagerTest: test_client
|
45
12
|
-------------------------------
|
46
|
-
|
47
|
-
|
48
|
-
|
13
|
+
--------------------------------------------------------------------------------------------------
|
14
|
+
LeSSL::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
15
|
+
--------------------------------------------------------------------------------------------------
|
16
|
+
---------------------------------------------------------------------------------------
|
17
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
18
|
+
---------------------------------------------------------------------------------------
|
49
19
|
----------------------------------------------------------------------
|
50
|
-
|
20
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
51
21
|
----------------------------------------------------------------------
|
22
|
+
----------------------------------------------------------------------------------
|
23
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
24
|
+
----------------------------------------------------------------------------------
|
25
|
+
-------------------------------------------------------------
|
26
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_email
|
27
|
+
-------------------------------------------------------------
|
28
|
+
------------------------------------------------------------------------------------------
|
29
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
30
|
+
------------------------------------------------------------------------------------------
|
31
|
+
---------------------------------------------------------------------
|
32
|
+
LeSSL::ManagerTest: test_#email_from_env_without_environment_variable
|
33
|
+
---------------------------------------------------------------------
|
52
34
|
-----------------------------------------------
|
53
|
-
|
35
|
+
LeSSL::ManagerTest: test_authorization_with_DNS
|
54
36
|
-----------------------------------------------
|
37
|
+
-----------------------------------------------------------------------------
|
38
|
+
LeSSL::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
39
|
+
-----------------------------------------------------------------------------
|
55
40
|
--------------------------------------------------------------------------------------------------
|
56
|
-
|
41
|
+
LeSSL::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
57
42
|
--------------------------------------------------------------------------------------------------
|
58
|
-
-------------------------------------------------------------
|
59
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
60
|
-
-------------------------------------------------------------
|
61
43
|
-----------------------------------------------
|
62
|
-
|
44
|
+
LeSSL::ManagerTest: test_authorization_with_DNS
|
63
45
|
-----------------------------------------------
|
64
46
|
---------------------------------------------------------------------
|
65
|
-
|
47
|
+
LeSSL::ManagerTest: test_#email_from_env_without_environment_variable
|
66
48
|
---------------------------------------------------------------------
|
67
|
-
----------------------------------------------------------------------------------
|
68
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
69
|
-
----------------------------------------------------------------------------------
|
70
|
-
--------------------------------------------------------------------------
|
71
|
-
LeSsl::ManagerTest: test_#email_from_env_with_current_environment_variable
|
72
|
-
--------------------------------------------------------------------------
|
73
|
-
--------------------------------------------------------------------------------------------------
|
74
|
-
LeSsl::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
75
|
-
--------------------------------------------------------------------------------------------------
|
76
49
|
----------------------------------------------------------------------
|
77
|
-
|
50
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
78
51
|
----------------------------------------------------------------------
|
79
|
-
---------------------------------------------------------------------------------------
|
80
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
81
|
-
---------------------------------------------------------------------------------------
|
82
52
|
------------------------------------------------------------------------------------------
|
83
|
-
|
53
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
84
54
|
------------------------------------------------------------------------------------------
|
85
|
-
-------------------------------------------------------------
|
86
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
87
|
-
-------------------------------------------------------------
|
88
55
|
-------------------------------
|
89
|
-
|
56
|
+
LeSSL::ManagerTest: test_client
|
90
57
|
-------------------------------
|
91
|
-
-------------------------------------------------------------------
|
92
|
-
LeSsl::ManagerTest: test_valid_initialization_(without_registering)
|
93
|
-
-------------------------------------------------------------------
|
94
58
|
-----------------------------------------------------------------------------
|
95
|
-
|
59
|
+
LeSSL::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
96
60
|
-----------------------------------------------------------------------------
|
97
|
-
-------------------------------------------------------------------
|
98
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_private_key
|
99
|
-
-------------------------------------------------------------------
|
100
|
-
-------------------------------------------------------------------
|
101
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_private_key
|
102
|
-
-------------------------------------------------------------------
|
103
|
-
---------------------------------------------------------------------------------------
|
104
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
105
|
-
---------------------------------------------------------------------------------------
|
106
|
-
---------------------------------------------------------------------
|
107
|
-
LeSsl::ManagerTest: test_#email_from_env_without_environment_variable
|
108
|
-
---------------------------------------------------------------------
|
109
61
|
--------------------------------------------------------------------------
|
110
|
-
|
62
|
+
LeSSL::ManagerTest: test_#email_from_env_with_current_environment_variable
|
111
63
|
--------------------------------------------------------------------------
|
112
|
-
--------------------------------------------------------------------------------------------------
|
113
|
-
LeSsl::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
114
|
-
--------------------------------------------------------------------------------------------------
|
115
|
-
-----------------------------------------------------------------------------
|
116
|
-
LeSsl::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
117
|
-
-----------------------------------------------------------------------------
|
118
|
-
-------------------------------------------------------------------
|
119
|
-
LeSsl::ManagerTest: test_valid_initialization_(without_registering)
|
120
|
-
-------------------------------------------------------------------
|
121
64
|
----------------------------------------------------------------------------------
|
122
|
-
|
65
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
123
66
|
----------------------------------------------------------------------------------
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
67
|
+
---------------------------------------------------------------------------------------
|
68
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
69
|
+
---------------------------------------------------------------------------------------
|
70
|
+
-------------------------------------------------------------------
|
71
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_private_key
|
72
|
+
-------------------------------------------------------------------
|
73
|
+
-------------------------------------------------------------------
|
74
|
+
LeSSL::ManagerTest: test_valid_initialization_(without_registering)
|
75
|
+
-------------------------------------------------------------------
|
76
|
+
-------------------------------------------------------------
|
77
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_email
|
78
|
+
-------------------------------------------------------------
|
79
|
+
----------------------------------
|
80
|
+
LeSSLTest: test_old_LeSsl_constant
|
81
|
+
----------------------------------
|
82
|
+
----------------------------------
|
83
|
+
LeSSLTest: test_old_LeSsl_constant
|
84
|
+
----------------------------------
|
130
85
|
-------------------------------
|
131
|
-
|
86
|
+
LeSSL::ManagerTest: test_client
|
132
87
|
-------------------------------
|
88
|
+
-----------------------------------------------------------------------------
|
89
|
+
LeSSL::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
90
|
+
-----------------------------------------------------------------------------
|
133
91
|
----------------------------------------------------------------------
|
134
|
-
|
92
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
135
93
|
----------------------------------------------------------------------
|
94
|
+
-----------------------------------------------
|
95
|
+
LeSSL::ManagerTest: test_authorization_with_DNS
|
96
|
+
-----------------------------------------------
|
97
|
+
-------------------------------------------------------------------
|
98
|
+
LeSSL::ManagerTest: test_valid_initialization_(without_registering)
|
99
|
+
-------------------------------------------------------------------
|
136
100
|
-------------------------------------------------------------
|
137
|
-
|
101
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_email
|
138
102
|
-------------------------------------------------------------
|
139
|
-
----------------------------------------------------------------------
|
140
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
141
|
-
----------------------------------------------------------------------
|
142
103
|
---------------------------------------------------------------------
|
143
|
-
|
104
|
+
LeSSL::ManagerTest: test_#email_from_env_without_environment_variable
|
144
105
|
---------------------------------------------------------------------
|
145
106
|
-------------------------------------------------------------------
|
146
|
-
|
107
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_private_key
|
147
108
|
-------------------------------------------------------------------
|
148
|
-
-----------------------------------------------------------------------------
|
149
|
-
LeSsl::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
150
|
-
-----------------------------------------------------------------------------
|
151
|
-
-------------------------------------------------------------
|
152
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
153
|
-
-------------------------------------------------------------
|
154
|
-
----------------------------------------------------------------------------------
|
155
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
156
|
-
----------------------------------------------------------------------------------
|
157
109
|
--------------------------------------------------------------------------------------------------
|
158
|
-
|
110
|
+
LeSSL::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
159
111
|
--------------------------------------------------------------------------------------------------
|
160
112
|
------------------------------------------------------------------------------------------
|
161
|
-
|
113
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
162
114
|
------------------------------------------------------------------------------------------
|
163
|
-
---------------------------------------------------------------------------------------
|
164
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
165
|
-
---------------------------------------------------------------------------------------
|
166
|
-
-----------------------------------------------
|
167
|
-
LeSsl::ManagerTest: test_authorization_with_DNS
|
168
|
-
-----------------------------------------------
|
169
|
-
--------------------------------------------------------------------------
|
170
|
-
LeSsl::ManagerTest: test_#email_from_env_with_current_environment_variable
|
171
|
-
--------------------------------------------------------------------------
|
172
|
-
-------------------------------------------------------------------
|
173
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_private_key
|
174
|
-
-------------------------------------------------------------------
|
175
|
-
-------------------------------
|
176
|
-
LeSsl::ManagerTest: test_client
|
177
|
-
-------------------------------
|
178
|
-
-------------------------------
|
179
|
-
LeSsl::ManagerTest: test_client
|
180
|
-
-------------------------------
|
181
115
|
--------------------------------------------------------------------------
|
182
|
-
|
116
|
+
LeSSL::ManagerTest: test_#email_from_env_with_current_environment_variable
|
183
117
|
--------------------------------------------------------------------------
|
184
|
-
-------------------------------------------------------------------
|
185
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_private_key
|
186
|
-
-------------------------------------------------------------------
|
187
118
|
---------------------------------------------------------------------------------------
|
188
|
-
|
119
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
189
120
|
---------------------------------------------------------------------------------------
|
190
|
-
-----------------------------------------------------------------------------
|
191
|
-
LeSsl::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
192
|
-
-----------------------------------------------------------------------------
|
193
121
|
----------------------------------------------------------------------------------
|
194
|
-
|
122
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
195
123
|
----------------------------------------------------------------------------------
|
196
|
-
------------------------------------------------------------------------------------------
|
197
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
198
|
-
------------------------------------------------------------------------------------------
|
199
|
-
---------------------------------------------------------------------
|
200
|
-
LeSsl::ManagerTest: test_#email_from_env_without_environment_variable
|
201
|
-
---------------------------------------------------------------------
|
202
|
-
-------------------------------------------------------------------
|
203
|
-
LeSsl::ManagerTest: test_valid_initialization_(without_registering)
|
204
|
-
-------------------------------------------------------------------
|
205
|
-
-------------------------------------------------------------
|
206
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
207
|
-
-------------------------------------------------------------
|
208
|
-
-----------------------------------------------
|
209
|
-
LeSsl::ManagerTest: test_authorization_with_DNS
|
210
|
-
-----------------------------------------------
|
211
|
-
----------------------------------------------------------------------
|
212
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
213
|
-
----------------------------------------------------------------------
|
214
|
-
--------------------------------------------------------------------------------------------------
|
215
|
-
LeSsl::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
216
|
-
--------------------------------------------------------------------------------------------------
|
217
|
-
-------------------------------------------------------------
|
218
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
219
|
-
-------------------------------------------------------------
|
220
124
|
----------------------------------------------------------------------------------
|
221
|
-
|
125
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
222
126
|
----------------------------------------------------------------------------------
|
223
|
-
-----------------------------------------------------------------------------
|
224
|
-
LeSsl::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
225
|
-
-----------------------------------------------------------------------------
|
226
|
-
---------------------------------------------------------------------------------------
|
227
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
228
|
-
---------------------------------------------------------------------------------------
|
229
127
|
----------------------------------------------------------------------
|
230
|
-
|
128
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
231
129
|
----------------------------------------------------------------------
|
232
130
|
-------------------------------------------------------------------
|
233
|
-
|
234
|
-
-------------------------------------------------------------------
|
235
|
-
-------------------------------------------------------------------
|
236
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_private_key
|
237
|
-
-------------------------------------------------------------------
|
238
|
-
---------------------------------------------------------------------
|
239
|
-
LeSsl::ManagerTest: test_#email_from_env_without_environment_variable
|
240
|
-
---------------------------------------------------------------------
|
241
|
-
-------------------------------
|
242
|
-
LeSsl::ManagerTest: test_client
|
243
|
-
-------------------------------
|
244
|
-
--------------------------------------------------------------------------
|
245
|
-
LeSsl::ManagerTest: test_#email_from_env_with_current_environment_variable
|
246
|
-
--------------------------------------------------------------------------
|
247
|
-
--------------------------------------------------------------------------------------------------
|
248
|
-
LeSsl::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
249
|
-
--------------------------------------------------------------------------------------------------
|
250
|
-
-----------------------------------------------
|
251
|
-
LeSsl::ManagerTest: test_authorization_with_DNS
|
252
|
-
-----------------------------------------------
|
253
|
-
------------------------------------------------------------------------------------------
|
254
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
255
|
-
------------------------------------------------------------------------------------------
|
256
|
-
----------------------------------------------------------------------------------
|
257
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
258
|
-
----------------------------------------------------------------------------------
|
259
|
-
-------------------------------------------------------------------
|
260
|
-
LeSsl::ManagerTest: test_valid_initialization_(without_registering)
|
261
|
-
-------------------------------------------------------------------
|
262
|
-
--------------------------------------------------------------------------
|
263
|
-
LeSsl::ManagerTest: test_#email_from_env_with_current_environment_variable
|
264
|
-
--------------------------------------------------------------------------
|
131
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_private_key
|
265
132
|
-------------------------------------------------------------------
|
266
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_private_key
|
267
|
-
-------------------------------------------------------------------
|
268
|
-
----------------------------------------------------------------------
|
269
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
270
|
-
----------------------------------------------------------------------
|
271
|
-
-------------------------------
|
272
|
-
LeSsl::ManagerTest: test_client
|
273
|
-
-------------------------------
|
274
|
-
-----------------------------------------------------------------------------
|
275
|
-
LeSsl::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
276
|
-
-----------------------------------------------------------------------------
|
277
|
-
---------------------------------------------------------------------
|
278
|
-
LeSsl::ManagerTest: test_#email_from_env_without_environment_variable
|
279
|
-
---------------------------------------------------------------------
|
280
|
-
-------------------------------------------------------------
|
281
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
282
|
-
-------------------------------------------------------------
|
283
|
-
------------------------------------------------------------------------------------------
|
284
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
285
|
-
------------------------------------------------------------------------------------------
|
286
|
-
-----------------------------------------------
|
287
|
-
LeSsl::ManagerTest: test_authorization_with_DNS
|
288
|
-
-----------------------------------------------
|
289
|
-
---------------------------------------------------------------------------------------
|
290
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
291
|
-
---------------------------------------------------------------------------------------
|
292
133
|
--------------------------------------------------------------------------------------------------
|
293
|
-
|
134
|
+
LeSSL::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
294
135
|
--------------------------------------------------------------------------------------------------
|
295
136
|
---------------------------------------------------------------------------------------
|
296
|
-
|
137
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
297
138
|
---------------------------------------------------------------------------------------
|
298
|
-
----------------------------------------------------------------------------------
|
299
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
300
|
-
----------------------------------------------------------------------------------
|
301
|
-
-------------------------------------------------------------------
|
302
|
-
LeSsl::ManagerTest: test_valid_initialization_(without_registering)
|
303
|
-
-------------------------------------------------------------------
|
304
139
|
-------------------------------------------------------------------
|
305
|
-
|
140
|
+
LeSSL::ManagerTest: test_valid_initialization_(without_registering)
|
306
141
|
-------------------------------------------------------------------
|
307
|
-
|
308
|
-
|
309
|
-
|
142
|
+
-----------------------------------------------------------------------------
|
143
|
+
LeSSL::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
144
|
+
-----------------------------------------------------------------------------
|
310
145
|
-------------------------------------------------------------
|
311
|
-
|
146
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_email
|
312
147
|
-------------------------------------------------------------
|
313
|
-
-----------------------------------------------
|
314
|
-
LeSsl::ManagerTest: test_authorization_with_DNS
|
315
|
-
-----------------------------------------------
|
316
148
|
--------------------------------------------------------------------------
|
317
|
-
|
149
|
+
LeSSL::ManagerTest: test_#email_from_env_with_current_environment_variable
|
318
150
|
--------------------------------------------------------------------------
|
151
|
+
-------------------------------
|
152
|
+
LeSSL::ManagerTest: test_client
|
153
|
+
-------------------------------
|
154
|
+
-----------------------------------------------
|
155
|
+
LeSSL::ManagerTest: test_authorization_with_DNS
|
156
|
+
-----------------------------------------------
|
319
157
|
---------------------------------------------------------------------
|
320
|
-
|
158
|
+
LeSSL::ManagerTest: test_#email_from_env_without_environment_variable
|
321
159
|
---------------------------------------------------------------------
|
322
160
|
------------------------------------------------------------------------------------------
|
323
|
-
|
161
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
324
162
|
------------------------------------------------------------------------------------------
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
-------------------------------
|
329
|
-
LeSsl::ManagerTest: test_client
|
330
|
-
-------------------------------
|
331
|
-
-----------------------------------------------------------------------------
|
332
|
-
LeSsl::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
333
|
-
-----------------------------------------------------------------------------
|
163
|
+
----------------------------------
|
164
|
+
LeSSLTest: test_old_LeSsl_constant
|
165
|
+
----------------------------------
|
334
166
|
-------------------------------------------------------------------
|
335
|
-
LeSsl::ManagerTest:
|
167
|
+
LeSsl::ManagerTest: test_valid_initialization_(without_registering)
|
336
168
|
-------------------------------------------------------------------
|
337
169
|
----------------------------------------------------------------------
|
338
170
|
LeSsl::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
339
171
|
----------------------------------------------------------------------
|
340
|
-
-------------------------------
|
341
|
-
LeSsl::ManagerTest: test_client
|
342
|
-
-------------------------------
|
343
|
-
-------------------------------------------------------------------
|
344
|
-
LeSsl::ManagerTest: test_valid_initialization_(without_registering)
|
345
|
-
-------------------------------------------------------------------
|
346
|
-
---------------------------------------------------------------------
|
347
|
-
LeSsl::ManagerTest: test_#email_from_env_without_environment_variable
|
348
|
-
---------------------------------------------------------------------
|
349
|
-
-----------------------------------------------------------------------------
|
350
|
-
LeSsl::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
351
|
-
-----------------------------------------------------------------------------
|
352
172
|
----------------------------------------------------------------------------------
|
353
173
|
LeSsl::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
354
174
|
----------------------------------------------------------------------------------
|
355
|
-
--------------------------------------------------------------------------------------------------
|
356
|
-
LeSsl::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
357
|
-
--------------------------------------------------------------------------------------------------
|
358
|
-
-----------------------------------------------
|
359
|
-
LeSsl::ManagerTest: test_authorization_with_DNS
|
360
|
-
-----------------------------------------------
|
361
|
-
-------------------------------------------------------------
|
362
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
363
|
-
-------------------------------------------------------------
|
364
|
-
------------------------------------------------------------------------------------------
|
365
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
366
|
-
------------------------------------------------------------------------------------------
|
367
|
-
---------------------------------------------------------------------------------------
|
368
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
369
|
-
---------------------------------------------------------------------------------------
|
370
|
-
--------------------------------------------------------------------------
|
371
|
-
LeSsl::ManagerTest: test_#email_from_env_with_current_environment_variable
|
372
|
-
--------------------------------------------------------------------------
|
373
|
-
--------------------------------------------------------------------------------------------------
|
374
|
-
LeSsl::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
375
|
-
--------------------------------------------------------------------------------------------------
|
376
|
-
----------------------------------------------------------------------
|
377
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
378
|
-
----------------------------------------------------------------------
|
379
|
-
-------------------------------
|
380
|
-
LeSsl::ManagerTest: test_client
|
381
|
-
-------------------------------
|
382
175
|
--------------------------------------------------------------------------
|
383
176
|
LeSsl::ManagerTest: test_#email_from_env_with_current_environment_variable
|
384
177
|
--------------------------------------------------------------------------
|
385
|
-
------------------------------------------------------------------------------------------
|
386
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
387
|
-
------------------------------------------------------------------------------------------
|
388
|
-
----------------------------------------------------------------------------------
|
389
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
390
|
-
----------------------------------------------------------------------------------
|
391
|
-
-------------------------------------------------------------------
|
392
|
-
LeSsl::ManagerTest: test_valid_initialization_(without_registering)
|
393
|
-
-------------------------------------------------------------------
|
394
178
|
-------------------------------------------------------------------
|
395
179
|
LeSsl::ManagerTest: test_invalid_initialization_without_private_key
|
396
180
|
-------------------------------------------------------------------
|
397
181
|
---------------------------------------------------------------------------------------
|
398
182
|
LeSsl::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
399
183
|
---------------------------------------------------------------------------------------
|
400
|
-
---------------------------------------------------------------------
|
401
|
-
LeSsl::ManagerTest: test_#email_from_env_without_environment_variable
|
402
|
-
---------------------------------------------------------------------
|
403
|
-
-----------------------------------------------------------------------------
|
404
|
-
LeSsl::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
405
|
-
-----------------------------------------------------------------------------
|
406
|
-
-------------------------------------------------------------
|
407
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
408
|
-
-------------------------------------------------------------
|
409
|
-
-----------------------------------------------
|
410
|
-
LeSsl::ManagerTest: test_authorization_with_DNS
|
411
|
-
-----------------------------------------------
|
412
|
-
-------------------------------
|
413
|
-
LeSsl::ManagerTest: test_client
|
414
|
-
-------------------------------
|
415
184
|
------------------------------------------------------------------------------------------
|
416
185
|
LeSsl::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
417
186
|
------------------------------------------------------------------------------------------
|
@@ -421,69 +190,57 @@ LeSsl::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
|
421
190
|
---------------------------------------------------------------------
|
422
191
|
LeSsl::ManagerTest: test_#email_from_env_without_environment_variable
|
423
192
|
---------------------------------------------------------------------
|
424
|
-
|
425
|
-
LeSsl::ManagerTest:
|
426
|
-
|
427
|
-
---------------------------------------------------------------------------------------
|
428
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
429
|
-
---------------------------------------------------------------------------------------
|
193
|
+
-------------------------------
|
194
|
+
LeSsl::ManagerTest: test_client
|
195
|
+
-------------------------------
|
430
196
|
--------------------------------------------------------------------------------------------------
|
431
197
|
LeSsl::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
432
198
|
--------------------------------------------------------------------------------------------------
|
433
|
-
|
434
|
-
LeSsl::ManagerTest:
|
435
|
-
|
436
|
-
-------------------------------------------------------------------
|
437
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_private_key
|
438
|
-
-------------------------------------------------------------------
|
199
|
+
-----------------------------------------------
|
200
|
+
LeSsl::ManagerTest: test_authorization_with_DNS
|
201
|
+
-----------------------------------------------
|
439
202
|
-------------------------------------------------------------
|
440
203
|
LeSsl::ManagerTest: test_invalid_initialization_without_email
|
441
204
|
-------------------------------------------------------------
|
205
|
+
----------------------------------
|
206
|
+
LeSSLTest: test_old_LeSsl_constant
|
207
|
+
----------------------------------
|
208
|
+
---------------------------------------------------------------------
|
209
|
+
LeSSL::ManagerTest: test_#email_from_env_without_environment_variable
|
210
|
+
---------------------------------------------------------------------
|
211
|
+
---------------------------------------------------------------------------------------
|
212
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
213
|
+
---------------------------------------------------------------------------------------
|
442
214
|
--------------------------------------------------------------------------
|
443
|
-
|
215
|
+
LeSSL::ManagerTest: test_#email_from_env_with_current_environment_variable
|
444
216
|
--------------------------------------------------------------------------
|
445
|
-
----------------------------------------------------------------------
|
446
|
-
LeSsl::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
447
|
-
----------------------------------------------------------------------
|
448
217
|
-----------------------------------------------
|
449
|
-
|
218
|
+
LeSSL::ManagerTest: test_authorization_with_DNS
|
450
219
|
-----------------------------------------------
|
451
|
-
|
452
|
-
|
453
|
-
|
220
|
+
------------------------------------------------------------------------------------------
|
221
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
222
|
+
------------------------------------------------------------------------------------------
|
223
|
+
-------------------------------------------------------------
|
224
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_email
|
225
|
+
-------------------------------------------------------------
|
454
226
|
-----------------------------------------------------------------------------
|
455
|
-
|
227
|
+
LeSSL::ManagerTest: test_#email_from_env_with_deprecated_environment_variable
|
456
228
|
-----------------------------------------------------------------------------
|
457
|
-
---------------------------------------------------------------------
|
458
|
-
LeSsl::ManagerTest: test_#email_from_env_without_environment_variable
|
459
|
-
---------------------------------------------------------------------
|
460
229
|
----------------------------------------------------------------------
|
461
|
-
|
230
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_agreeing_terms
|
462
231
|
----------------------------------------------------------------------
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
--------------------------------------------------------------------------
|
467
|
-
LeSsl::ManagerTest: test_#email_from_env_with_current_environment_variable
|
468
|
-
--------------------------------------------------------------------------
|
469
|
-
-----------------------------------------------
|
470
|
-
LeSsl::ManagerTest: test_authorization_with_DNS
|
471
|
-
-----------------------------------------------
|
232
|
+
--------------------------------------------------------------------------------------------------
|
233
|
+
LeSSL::ManagerTest: test_valid_initialization_with_environment_variables_(but_without_registering)
|
234
|
+
--------------------------------------------------------------------------------------------------
|
472
235
|
-------------------------------------------------------------------
|
473
|
-
|
236
|
+
LeSSL::ManagerTest: test_invalid_initialization_without_private_key
|
474
237
|
-------------------------------------------------------------------
|
475
|
-
----------------------------------------------------------------------------------
|
476
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
477
|
-
----------------------------------------------------------------------------------
|
478
|
-
------------------------------------------------------------------------------------------
|
479
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_deprecated_environment_variable
|
480
|
-
------------------------------------------------------------------------------------------
|
481
238
|
-------------------------------
|
482
|
-
|
239
|
+
LeSSL::ManagerTest: test_client
|
483
240
|
-------------------------------
|
484
|
-
---------------------------------------------------------------------------------------
|
485
|
-
LeSsl::ManagerTest: test_#private_key_string_from_env_with_current_environment_variable
|
486
|
-
---------------------------------------------------------------------------------------
|
487
241
|
-------------------------------------------------------------------
|
488
|
-
|
242
|
+
LeSSL::ManagerTest: test_valid_initialization_(without_registering)
|
489
243
|
-------------------------------------------------------------------
|
244
|
+
----------------------------------------------------------------------------------
|
245
|
+
LeSSL::ManagerTest: test_#private_key_string_from_env_without_environment_variable
|
246
|
+
----------------------------------------------------------------------------------
|
data/test/le_ssl/manager_test.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class
|
3
|
+
class LeSSL::ManagerTest < ActiveSupport::TestCase
|
4
4
|
def private_key; @private_key ||= OpenSSL::PKey::RSA.new(2048); end
|
5
|
-
def manager(skip_register=true); @manager ||=
|
5
|
+
def manager(skip_register=true); @manager ||= LeSSL::Manager.new(skip_register: skip_register, email: FFaker::Internet.free_email, private_key: private_key, agree_terms: true); end
|
6
6
|
|
7
7
|
test 'valid initialization (without registering)' do
|
8
8
|
assert_nothing_raised do
|
@@ -19,7 +19,7 @@ class LeSsl::ManagerTest < ActiveSupport::TestCase
|
|
19
19
|
m = nil # Scope
|
20
20
|
|
21
21
|
assert_nothing_raised do
|
22
|
-
m =
|
22
|
+
m = LeSSL::Manager.new(skip_register: true, agree_terms: true)
|
23
23
|
end
|
24
24
|
|
25
25
|
assert_equal_private_keys private_key, m.send(:private_key)
|
@@ -30,20 +30,20 @@ class LeSsl::ManagerTest < ActiveSupport::TestCase
|
|
30
30
|
end
|
31
31
|
|
32
32
|
test 'invalid initialization without email' do
|
33
|
-
assert_raise
|
34
|
-
|
33
|
+
assert_raise LeSSL::NoContactEmailError do
|
34
|
+
LeSSL::Manager.new(agree_terms: true, private_key: private_key, skip_register: true)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
test 'invalid initialization without private_key' do
|
39
|
-
assert_raise
|
40
|
-
|
39
|
+
assert_raise LeSSL::NoPrivateKeyError do
|
40
|
+
LeSSL::Manager.new(agree_terms: true, email: FFaker::Internet.email, skip_register: true)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
test 'invalid initialization without agreeing terms' do
|
45
|
-
assert_raise
|
46
|
-
|
45
|
+
assert_raise LeSSL::TermsNotAcceptedError do
|
46
|
+
LeSSL::Manager.new(email: FFaker::Internet.email, private_key: private_key, skip_register: true)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
data/test/le_ssl_test.rb
CHANGED