letsencrypt_plugin 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,63 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class LetsencryptPluginTest < ActiveSupport::TestCase
4
+ ACME_VERSION = 'v0.6.1'.freeze
5
+ ACME_USER_AGENT = "Acme::Client #{ACME_VERSION} (https://github.com/unixcharles/acme-client)".freeze
6
+ ENDPOINT_URL = 'https://acme-staging.api.letsencrypt.org'.freeze
7
+ API_URL = "#{ENDPOINT_URL}/acme".freeze
8
+ PRIVATE_KEY = %(
9
+ -----BEGIN RSA PRIVATE KEY-----
10
+ MIIJKQIBAAKCAgEAq7H+CkqDvwzLv9dAgNkJd33abTJEkFGJ8Wlb1FvucQz0AXYr
11
+ pYLyj7NaCrBotWSZGjEJtPgY53LVYMDOPb99++6Dk3WThdOm7SMINVXZVubha6kh
12
+ cZEXP54GbsCspPf6nNqBBxHCnUwWMF8IQqi0MWR4qNxmKdEkpNztaBwLKSFVPsQ0
13
+ tFyrGzYa8L4NBjee2iiDuc6lyLNJz2x/QFLAfgxl5qwEkNETlM72MBTlM3kGY8R3
14
+ vFEMTHPIKB3uPpwRpMj8L63RKzzfrc9CF6L4Mhm5oNFPCgvbCEazOG+LJp3d8mYS
15
+ f0DDNQ6Xh/CgLnSmp3UefrJbAQTd0iJN1kmSi//BlNGRCKWEd82g06hx0mTa9uYd
16
+ D10SWiQyPvHl4sXDw3BL7Ei9YO4zh9HzfJsQXqchsBvUggDToHeRp2xfKHDraEgb
17
+ O/AqhC1FGdMKORrLZpLBmhjl40Uo1cKQvlnVIdRZB58Bz2eHs45J7DNbKlBmvqfO
18
+ BrE7Og8wDlU3XZHgwQfKxMHAWoPsGvDmJF4YtTfgDx6fVKeMnx9qzICJeFVfby3i
19
+ G8tOWPSJXVTqvvBXbBziOHxm/l8zfku0Ri7Ev0YE6TBFX6b44DKAiUoZvE0Nomix
20
+ abYvd00XQO6wN0/ivCzNg4UYmh9YS2r3Q7bih4Y2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gm814I88gFoVa3GUHNRdTgXo4d6I/FkHEfTW
52
+ 14w5AFVDhRPvKaDVGwcdADiPXoFcl5DfSIRsAjjFuXc+T3y6vJztwLlE1zm2jHtE
53
+ q8g0lfkyKScsITN5RTFqaAgrP0N+GZ/xAoIBAQCGFAVKXlJZaabvB2Y4pzUrbeoS
54
+ lsP+4HYVttCyp9CJUcKhJfD7uJrt6djGkworvHQOvtw5uEbHWpFYB9pnxba/f7xi
55
+ Uf7iAxu2pPHOSNGYBqigR3faq+WfDXEpgG6fpOGRPGA6dKoz+XK48Bh32ggTbyeU
56
+ ZK/V50gulSGNn7WngWDJRRv5KaO27RGnpH9P4lOW3iTbHlq+AVvyoflvKeyFEEFb
57
+ 1puR60qLkicz16bFy39CdKC7gyWVR7qJu4SkTqx44/uNchS2h/EF6HTuiBQBMocn
58
+ /YMHuMW7AvB459zhSHqzvZiMN3spTQMCvDicTCFfNuw95++1qUaB8WLGqZju
59
+ -----END RSA PRIVATE KEY-----).freeze
60
+
4
61
  def setup
5
62
  WebMock.disable_net_connect!(allow_localhost: true)
6
63
  end
@@ -9,7 +66,7 @@ class LetsencryptPluginTest < ActiveSupport::TestCase
9
66
  WebMock.allow_net_connect!
10
67
  end
11
68
 
12
- test 'truth' do
69
+ test 'is_valid_module' do
13
70
  assert_kind_of Module, LetsencryptPlugin
14
71
  end
15
72
 
@@ -70,47 +127,89 @@ class LetsencryptPluginTest < ActiveSupport::TestCase
70
127
  end
71
128
  end
72
129
 
130
+ test 'register with text based private key' do
131
+ cg = LetsencryptPlugin::CertGenerator.new(private_key: PRIVATE_KEY,
132
+ endpoint: ENDPOINT_URL,
133
+ domain: 'example.com',
134
+ email: 'foobarbaz@example.com')
135
+ assert !cg.nil?
136
+
137
+ stub_request(:head, "#{API_URL}/new-reg")
138
+ .with(headers: { 'Accept' => '*/*' })
139
+ .to_return(status: 200, body: '', headers: {})
140
+
141
+ stub_request(:post, "#{API_URL}/new-reg")
142
+ .with(body: '{"protected":"eyJ0eX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 'ltaDlZUzJyM1E3YmloNFkyS3MyWllxdnNkazFnLWZiNGZRcyJ9LCJub25jZSI6bnVsbH0",'\
155
+ '"payload":"eyJyZXNvdXJjZSI6Im5ldy1yZWciLCJjb250YWN0IjpbIm1haWx0bzpmb29iYXJiYXpAZ'\
156
+ 'XhhbXBsZS5jb20iXX0",'\
157
+ '"signature":"aQ6T0XVo9jS_jXlvQ6bjAfqcrMYpQTPE9_CD7v1hDBUzKpSoygAJmrbb0kSumMkWf-r'\
158
+ 'acxG5i7tcD4ed32ap1OsWUoPGWhXkQifAqToYMdfBzjwaS_OfjPpFflPOZmUvOygtGt3LTsdhA27PCSC'\
159
+ 'saZDlozz2143b00QhZ-gVkFRJEwOMN22ByOsL-1_R_UEp7mqwQKzeZ_nsW7japvGWcru13bzqiD2b069'\
160
+ 'kwrfksnMIMSjFWnJPnxCLpY-DQn8kCBeJfljW-mOJyZFck1ko0KBiOEbY_k0IJ0aspwg9lGRLkVX-wWV'\
161
+ '8Q_e8gwoLjmaXouUxAl2E3wNInXRJkgDOMfEUSOHzxI6WFYLzhVKVl7ktP7zx21my2vL_J_nROTDaVIU'\
162
+ 'qJgdUgEZ40KR_Kjd_pRKPcB8kHyKtDnCopmrPXLu0QCuHYAn_M-cYgkFOyvplJNodaZfKamLuwChywPl'\
163
+ 'DC5tr1BQvdlUVp-cwr_C_KU-Kpkws924xI0ah8ksuwsHpkp2458aVEIeDEEw7FgHZXUPKXaJcBIHjQ1R'\
164
+ 'vnm062Ub_4LR25TrKTgftDCftK2YtN4LA-jtlfOrdM47xZatAzhmFy_vFIIu_-phh5he0nn8Mx2byjsZ'\
165
+ '1M-DeW0Wl9_zxhhOo1gtmFhtguCKw3W0mdcdDZmhRleNS-HtYA0w41LA"}',
166
+ headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
167
+ 'User-Agent' => ACME_USER_AGENT })
168
+ .to_return(status: 200, body: '', headers: {})
169
+
170
+ assert_nothing_raised do
171
+ cg.register
172
+ end
173
+ end
174
+
73
175
  test 'register' do
74
176
  cg = LetsencryptPlugin::CertGenerator.new(private_key: 'key/test_keyfile_4096.pem',
75
- endpoint: 'https://acme-staging.api.letsencrypt.org',
177
+ endpoint: ENDPOINT_URL,
76
178
  domain: 'example.com',
77
179
  email: 'foobarbaz@example.com')
78
-
79
- cg.client = Acme::Client.new(private_key: cg.load_private_key, endpoint: cg.options[:endpoint])
80
180
  assert !cg.nil?
81
181
 
82
- stub_request(:head, 'https://acme-staging.api.letsencrypt.org/acme/new-reg')
182
+ stub_request(:head, "#{API_URL}/new-reg")
83
183
  .with(headers: { 'Accept' => '*/*' })
84
184
  .to_return(status: 200, body: '', headers: {})
85
185
 
86
- stub_request(:post, 'https://acme-staging.api.letsencrypt.org/acme/new-reg')
87
- .with(body: '{"protected":"eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIiwibm9uY2UiOm51bGwsImp3ayI6eyJrdH'\
88
- 'kiOiJSU0EiLCJlIjoiQVFBQiIsIm4iOiJxN0gtQ2txRHZ3ekx2OWRBZ05rSmQzM2FiVEpFa0ZHSjhXbG'\
89
- 'IxRnZ1Y1F6MEFYWXJwWUx5ajdOYUNyQm90V1NaR2pFSnRQZ1k1M0xWWU1ET1BiOTktLTZEazNXVGhkT2'\
90
- '03U01JTlZYWlZ1YmhhNmtoY1pFWFA1NEdic0NzcFBmNm5OcUJCeEhDblV3V01GOElRcWkwTVdSNHFOeG'\
91
- '1LZEVrcE56dGFCd0xLU0ZWUHNRMHRGeXJHellhOEw0TkJqZWUyaWlEdWM2bHlMTkp6MnhfUUZMQWZneG'\
92
- 'w1cXdFa05FVGxNNzJNQlRsTTNrR1k4UjN2RkVNVEhQSUtCM3VQcHdScE1qOEw2M1JLenpmcmM5Q0Y2TD'\
93
- 'RNaG01b05GUENndmJDRWF6T0ctTEpwM2Q4bVlTZjBERE5RNlhoX0NnTG5TbXAzVWVmckpiQVFUZDBpSk'\
94
- '4xa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r_C_KU-Kpkws924xI0ah8ksuwsHpkp2458aVEIeDEEw7FgHZXUPKXaJcBIHjQ1R'\
209
+ 'vnm062Ub_4LR25TrKTgftDCftK2YtN4LA-jtlfOrdM47xZatAzhmFy_vFIIu_-phh5he0nn8Mx2byjsZ'\
210
+ '1M-DeW0Wl9_zxhhOo1gtmFhtguCKw3W0mdcdDZmhRleNS-HtYA0w41LA"}',
112
211
  headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
113
- 'User-Agent' => 'Faraday v0.9.2' })
212
+ 'User-Agent' => ACME_USER_AGENT })
114
213
  .to_return(status: 200, body: '', headers: {})
115
214
 
116
215
  assert_nothing_raised do
@@ -120,18 +219,16 @@ class LetsencryptPluginTest < ActiveSupport::TestCase
120
219
 
121
220
  test 'register_with_privkey_in_db' do
122
221
  cg = LetsencryptPlugin::CertGenerator.new(private_key_in_db: true,
123
- endpoint: 'https://acme-staging.api.letsencrypt.org',
222
+ endpoint: ENDPOINT_URL,
124
223
  domain: 'example.com',
125
224
  email: 'foobarbaz@example.com')
126
-
127
- cg.client = Acme::Client.new(private_key: cg.load_private_key, endpoint: cg.options[:endpoint])
128
225
  assert !cg.nil?
129
226
 
130
- stub_request(:head, 'https://acme-staging.api.letsencrypt.org/acme/new-reg')
227
+ stub_request(:head, "#{API_URL}/new-reg")
131
228
  .with(headers: { 'Accept' => '*/*' })
132
229
  .to_return(status: 200, body: '', headers: {})
133
230
 
134
- stub_request(:post, 'https://acme-staging.api.letsencrypt.org/acme/new-reg')
231
+ stub_request(:post, "#{API_URL}/new-reg")
135
232
  .with(body: '{"protected":"eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIiwibm9uY2UiOm51bGwsImp3ayI6eyJrdH'\
136
233
  'kiOiJSU0EiLCJlIjoiQVFBQiIsIm4iOiJxN0gtQ2txRHZ3ekx2OWRBZ05rSmQzM2FiVEpFa0ZHSjhXbG'\
137
234
  'IxRnZ1Y1F6MEFYWXJwWUx5ajdOYUNyQm90V1NaR2pFSnRQZ1k1M0xWWU1ET1BiOTktLTZEazNXVGhkT2'\
@@ -158,7 +255,7 @@ class LetsencryptPluginTest < ActiveSupport::TestCase
158
255
  'A_Na8Y2HtkWeZyUQPY1G3eSTPbBKR94T20LhcDSdNInzIFIhE5qI-WWCgHws6jB1K4Iip58zMgeTjGsD'\
159
256
  '5Rc8ttBJwfprac8hBqMST_rzo-gn70b-iT3PJkasUbm32UwOxXtavJ5g"}',
160
257
  headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
161
- 'User-Agent' => 'Faraday v0.9.2' })
258
+ 'User-Agent' => ACME_USER_AGENT })
162
259
  .to_return(status: 200, body: '', headers: {})
163
260
 
164
261
  assert_nothing_raised do
@@ -168,65 +265,60 @@ class LetsencryptPluginTest < ActiveSupport::TestCase
168
265
 
169
266
  test 'register_and_authorize' do
170
267
  cg = LetsencryptPlugin::CertGenerator.new(private_key: 'key/test_keyfile_4096.pem',
171
- endpoint: 'https://acme-staging.api.letsencrypt.org',
268
+ endpoint: ENDPOINT_URL,
172
269
  domain: 'example.com',
173
270
  email: 'foobarbaz@example.com')
174
-
175
- cg.client = Acme::Client.new(private_key: cg.load_private_key, endpoint: cg.options[:endpoint])
176
271
  assert !cg.nil?
177
272
 
178
- stub_request(:head, 'https://acme-staging.api.letsencrypt.org/acme/new-reg')
273
+ stub_request(:head, "#{API_URL}/new-reg")
179
274
  .with(headers: { 'Accept' => '*/*' })
180
275
  .to_return(status: 200, body: '', headers: {})
181
276
 
182
- protected_field = '"protected":"eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIiwibm9uY2UiOm51bGwsImp3ayI6eyJ'\
183
- 'rdHkiOiJSU0EiLCJlIjoiQVFBQiIsIm4iOiJxN0gtQ2txRHZ3ekx2OWRBZ05rSmQzM2FiVEpFa0Z'\
184
- 'HSjhXbGIxRnZ1Y1F6MEFYWXJwWUx5aj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PNndOMF9pdkN6Tmc0VV'\
289
+ 'ltaDlZUzJyM1E3YmloNFkyS3MyWllxdnNkazFnLWZiNGZRcyJ9LCJub25jZSI6bnVsbH0"'
290
+ stub_request(:post, "#{API_URL}/new-reg")
199
291
  .with(body: "{#{protected_field},"\
200
292
  '"payload":"eyJyZXNvdXJjZSI6Im5ldy1yZWciLCJjb250YWN0IjpbIm1haWx0bzpmb29iYXJiYXpAZ'\
201
293
  'XhhbXBsZS5jb20iXX0",'\
202
- '"signature":"T4aKq85rcACJdyEEx_Dw90lLypyPba6GSyG1YlFjCMwM7qdRlCsb3YIJE_Eia-A9IVl'\
203
- 'cXKc2rzvVOPvGB2bYmPCxep5o7uy1mkC7hKJhSEw97mT_sidrLamEKIrYtnVrW0KSO3EKEY-rUSMIeOA'\
204
- 'qLuZosSXLCEDlQTLqPUJPrhm8pDBRLzEqUO1HIMLfOEH5bWwXHofxL_QqUQjzMqIh_VWqy08MxuWEThD'\
205
- 'UyKPewBx1E_Y0H-vsM_D39SJA04s9fnIGyOlXISL1LZ9pFZ_W5rF25_P9vwks9m7E8iZFo-rFc073DsM'\
206
- 'zc_-5VbUgAoAqDZA69q8FTkgUkA6pu-vZsxeIb6OUNS6wxt6U4dqYS1aBXnhLeKvbIb7NqFmY8erzvcG'\
207
- 'XBvab1F0ndg6sw5PmrDZyOzcCKdA9eQk6LqCnfh8TcoywmJiqm2Ck49BUUe4t98AjvMNhaHel4Vn4HUX'\
208
- 'GX5xOEmt7gtsIE6YJP04ZoRKeWCrbYwjYIfLNlsbXpZj5oXPzBxOvwBuS6KL2HweeUGObiBsxRLsc1Bo'\
209
- 'A_Na8Y2HtkWeZyUQPY1G3eSTPbBKR94T20LhcDSdNInzIFIhE5qI-WWCgHws6jB1K4Iip58zMgeTjGsD'\
210
- '5Rc8ttBJwfprac8hBqMST_rzo-gn70b-iT3PJkasUbm32UwOxXtavJ5g"}',
294
+ '"signature":"aQ6T0XVo9jS_jXlvQ6bjAfqcrMYpQTPE9_CD7v1hDBUzKpSoygAJmrbb0kSumMkWf-r'\
295
+ 'acxG5i7tcD4ed32ap1OsWUoPGWhXkQifAqToYMdfBzjwaS_OfjPpFflPOZmUvOygtGt3LTsdhA27PCSC'\
296
+ 'saZDlozz2143b00QhZ-gVkFRJEwOMN22ByOsL-1_R_UEp7mqwQKzeZ_nsW7japvGWcru13bzqiD2b069'\
297
+ 'kwrfksnMIMSjFWnJPnxCLpY-DQn8kCBeJfljW-mOJyZFck1ko0KBiOEbY_k0IJ0aspwg9lGRLkVX-wWV'\
298
+ '8Q_e8gwoLjmaXouUxAl2E3wNInXRJkgDOMfEUSOHzxI6WFYLzhVKVl7ktP7zx21my2vL_J_nROTDaVIU'\
299
+ 'qJgdUgEZ40KR_Kjd_pRKPcB8kHyKtDnCopmrPXLu0QCuHYAn_M-cYgkFOyvplJNodaZfKamLuwChywPl'\
300
+ 'DC5tr1BQvdlUVp-cwr_C_KU-Kpkws924xI0ah8ksuwsHpkp2458aVEIeDEEw7FgHZXUPKXaJcBIHjQ1R'\
301
+ 'vnm062Ub_4LR25TrKTgftDCftK2YtN4LA-jtlfOrdM47xZatAzhmFy_vFIIu_-phh5he0nn8Mx2byjsZ'\
302
+ '1M-DeW0Wl9_zxhhOo1gtmFhtguCKw3W0mdcdDZmhRleNS-HtYA0w41LA"}',
211
303
  headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
212
- 'User-Agent' => 'Faraday v0.9.2' })
304
+ 'User-Agent' => ACME_USER_AGENT })
213
305
  .to_return(status: 200, body: '', headers: {})
214
306
 
215
- stub_request(:post, 'https://acme-staging.api.letsencrypt.org/acme/new-authz')
307
+ stub_request(:post, "#{API_URL}/new-authz")
216
308
  .with(body: "{#{protected_field},"\
217
309
  '"payload":"eyJyZXNvdXJjZSI6Im5ldy1hdXRoeiIsImlkZW50aWZpZXIiOnsidHlwZSI6ImRucyIsI'\
218
310
  'nZhbHVlIjoiZXhhbXBsZ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xYsGq3yEdXlGFv_f2iNbfhhiFHl_ZbRsjbLY5QU5TRa'\
315
+ 'Y6w5LjVkMwNLuusAeR5SwkOjGYQw-PQ303xuCx2WhlcIVlz06Lex9zrYH7TVc1Tfl5aiaqw4lABJoFu8'\
316
+ 'YLWx83gQZbeyBJJ612e_oNqsbmd0RWytXzS-qydLmpjl2KS7U_877JIoZPePwqzbuNoUmeVfqQcCGcpM'\
317
+ 't1atBAoBVgOKW5cWlEhZD4BRY_q-dX2hcR-7T1suLdMpEc1b_JQr0EVxgz0rZWcE3xAtlQLYZtC7n_nW'\
318
+ 'B4EiQzRiiP1mgPRwdmASmAAMp7ToW53lYh-vLxpHX7CzLdug2AuvFkG6ajaGFMzZaJ4dyxf0GbznSNyV'\
319
+ 'ulEJlxSt81MVthCX3JjUtRDcJHZx6tQFR1Gm1RUDE7Sob0Xe6jZKfqRE"}',
228
320
  headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
229
- 'User-Agent' => 'Faraday v0.9.2' })
321
+ 'User-Agent' => ACME_USER_AGENT })
230
322
  .to_return(status: 200,
231
323
  body: '{'\
232
324
  ' "status": "valid",'\
@@ -240,15 +332,15 @@ class LetsencryptPluginTest < ActiveSupport::TestCase
240
332
  ' {'\
241
333
  ' "type": "http-01",'\
242
334
  ' "status": "pending",'\
243
- ' "uri": "https://acme-staging.api.letsencrypt.org/acme/challenge/JmusiS7mAL_OZ1tIbwQxpYadpM9E3Azbywa6KSveuEk/93",'\
335
+ " \"uri\": \"#{API_URL}/challenge/JmusiS7mAL_OZ1tIbwQxpYadpM9E3Azbywa6KSveuEk/93\","\
244
336
  ' "token":"-Jbrff2stnTiZXFFKJHXtYrZof2dqlQaegRbeG1t6BY"'\
245
337
  ' }'\
246
338
  ' ],'\
247
339
  ' "combinations":[[0]]'\
248
340
  '}',
249
341
  headers: { 'Content-Type' => 'application/json',
250
- 'Link' => '<https://acme-staging.api.letsencrypt.org/acme/new-cert>;rel="next"',
251
- 'Location' => 'https://acme-staging.api.letsencrypt.org/acme/authz/JmusiS7mAL_OZ1tIbwQxpYadpM9E3Azbywa6KSveuEk',
342
+ 'Link' => "<#{API_URL}/new-cert>;rel=\"next\"",
343
+ 'Location' => "#{API_URL}/authz/JmusiS7mAL_OZ1tIbwQxpYadpM9E3Azbywa6KSveuEk",
252
344
  'Replay-Nonce' => 'Hdhg8ovViG7ipkQrQRW2dsDbK5vxhGd_4T9HDqg3u4c' })
253
345
 
254
346
  assert_nothing_raised do
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module LetsencryptPlugin
4
+ class ConfigurationTest < ActiveSupport::TestCase
5
+ test 'reads multiple domains from test config' do
6
+ config_file_path = Rails.root.join('config', 'letsencrypt_plugin.yml')
7
+ config = LetsencryptPlugin::Configuration.load_file(config_file_path)
8
+ domains = config.domain.split(' ')
9
+ assert_kind_of Array, domains
10
+ assert_operator domains.length, :>, 0
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,30 @@
1
+ require 'test_helper'
2
+
3
+ class PrivateKeyStoreTest < ActiveSupport::TestCase
4
+ # Note we should probably stub the implementation of OpenSSL key generation
5
+ test 'if_keysize_smaller_than_2048_is_invalid' do
6
+ exception = assert_raises RuntimeError do
7
+ PrivateKeyStore.new(1024).retrieve
8
+ end
9
+ assert_equal 'Invalid key size: 1024. Required size is between 2048 - 4096 bits', exception.message
10
+ end
11
+
12
+ test 'if_keysize_greater_than_4096_is_invalid' do
13
+ exception = assert_raises RuntimeError do
14
+ PrivateKeyStore.new(8192).retrieve
15
+ end
16
+ assert_equal 'Invalid key size: 8192. Required size is between 2048 - 4096 bits', exception.message
17
+ end
18
+
19
+ test 'if_keysize_equal_4096_is_valid' do
20
+ assert_nothing_raised do
21
+ PrivateKeyStore.new(4096).retrieve
22
+ end
23
+ end
24
+
25
+ test 'if_keysize_equal_2048_is_valid' do
26
+ assert_nothing_raised do
27
+ PrivateKeyStore.new(2048).retrieve
28
+ end
29
+ end
30
+ end
@@ -2,8 +2,5 @@ require 'test_helper'
2
2
 
3
3
  module LetsencryptPlugin
4
4
  class ChallengeTest < ActiveSupport::TestCase
5
- # test "the truth" do
6
- # assert true
7
- # end
8
5
  end
9
6
  end
@@ -1,25 +1,20 @@
1
- require 'codeclimate-test-reporter'
2
- CodeClimate::TestReporter.start
3
- require 'simplecov'
4
- SimpleCov.start
5
-
6
1
  # Configure Rails Environment
7
2
  ENV['RAILS_ENV'] = 'test'
8
3
 
4
+ require 'simplecov'
5
+ require 'byebug'
6
+
9
7
  require File.expand_path('../../test/dummy/config/environment.rb', __FILE__)
10
- ActiveRecord::Migrator.migrations_paths = [File.expand_path('../../test/dummy/db/migrate', __FILE__)]
11
- ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
12
8
  require 'rails/test_help'
13
9
  require 'minitest/rails'
14
10
  require 'minitest/reporters'
15
- Minitest::Reporters.use!
11
+ require 'webmock/minitest'
16
12
 
13
+ SimpleCov.start
17
14
  # Filter out Minitest backtrace while allowing backtrace from other libraries
18
15
  # to be shown.
19
16
  Minitest.backtrace_filter = Minitest::BacktraceFilter.new
20
-
21
- # Load support files
22
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
17
+ Minitest::Reporters.use!
23
18
 
24
19
  # Load fixtures from the engine
25
20
  if ActiveSupport::TestCase.respond_to?(:fixture_path=)
@@ -27,5 +22,3 @@ if ActiveSupport::TestCase.respond_to?(:fixture_path=)
27
22
  ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
28
23
  ActiveSupport::TestCase.fixtures :all
29
24
  end
30
-
31
- require 'webmock/minitest'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letsencrypt_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukasz Gromanowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-26 00:00:00.000000000 Z
11
+ date: 2017-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -17,9 +17,6 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.2'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '5.1'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,149 +24,160 @@ dependencies:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '4.2'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '5.1'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: acme-client
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: 0.3.0
33
+ version: 0.6.1
40
34
  type: :runtime
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
38
  - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: 0.3.0
40
+ version: 0.6.1
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: minitest
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
- - - ">="
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0'
47
+ version: 5.10.2
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
- - - ">="
52
+ - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '0'
54
+ version: 5.10.2
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: minitest-rails
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
- - - ">="
59
+ - - "~>"
66
60
  - !ruby/object:Gem::Version
67
- version: '0'
61
+ version: 3.0.0
68
62
  type: :development
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
- - - ">="
66
+ - - "~>"
73
67
  - !ruby/object:Gem::Version
74
- version: '0'
68
+ version: 3.0.0
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: minitest-reporters
77
71
  requirement: !ruby/object:Gem::Requirement
78
72
  requirements:
79
- - - ">="
73
+ - - "~>"
80
74
  - !ruby/object:Gem::Version
81
- version: '0'
75
+ version: 1.1.14
82
76
  type: :development
83
77
  prerelease: false
84
78
  version_requirements: !ruby/object:Gem::Requirement
85
79
  requirements:
86
- - - ">="
80
+ - - "~>"
87
81
  - !ruby/object:Gem::Version
88
- version: '0'
82
+ version: 1.1.14
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: sqlite3
91
85
  requirement: !ruby/object:Gem::Requirement
92
86
  requirements:
93
- - - ">="
87
+ - - "~>"
94
88
  - !ruby/object:Gem::Version
95
- version: '0'
89
+ version: 1.3.13
96
90
  type: :development
97
91
  prerelease: false
98
92
  version_requirements: !ruby/object:Gem::Requirement
99
93
  requirements:
100
- - - ">="
94
+ - - "~>"
101
95
  - !ruby/object:Gem::Version
102
- version: '0'
96
+ version: 1.3.13
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: codeclimate-test-reporter
105
99
  requirement: !ruby/object:Gem::Requirement
106
100
  requirements:
107
- - - ">="
101
+ - - "~>"
108
102
  - !ruby/object:Gem::Version
109
- version: '0'
103
+ version: 1.0.8
110
104
  type: :development
111
105
  prerelease: false
112
106
  version_requirements: !ruby/object:Gem::Requirement
113
107
  requirements:
114
- - - ">="
108
+ - - "~>"
115
109
  - !ruby/object:Gem::Version
116
- version: '0'
110
+ version: 1.0.8
117
111
  - !ruby/object:Gem::Dependency
118
112
  name: rubocop
119
113
  requirement: !ruby/object:Gem::Requirement
120
114
  requirements:
121
- - - ">="
115
+ - - "~>"
122
116
  - !ruby/object:Gem::Version
123
- version: '0'
117
+ version: 0.49.1
124
118
  type: :development
125
119
  prerelease: false
126
120
  version_requirements: !ruby/object:Gem::Requirement
127
121
  requirements:
128
- - - ">="
122
+ - - "~>"
129
123
  - !ruby/object:Gem::Version
130
- version: '0'
124
+ version: 0.49.1
131
125
  - !ruby/object:Gem::Dependency
132
126
  name: webmock
133
127
  requirement: !ruby/object:Gem::Requirement
134
128
  requirements:
135
- - - ">="
129
+ - - "~>"
136
130
  - !ruby/object:Gem::Version
137
- version: '0'
131
+ version: 3.0.1
138
132
  type: :development
139
133
  prerelease: false
140
134
  version_requirements: !ruby/object:Gem::Requirement
141
135
  requirements:
142
- - - ">="
136
+ - - "~>"
143
137
  - !ruby/object:Gem::Version
144
- version: '0'
138
+ version: 3.0.1
145
139
  - !ruby/object:Gem::Dependency
146
140
  name: mocha
147
141
  requirement: !ruby/object:Gem::Requirement
148
142
  requirements:
149
- - - ">="
143
+ - - "~>"
150
144
  - !ruby/object:Gem::Version
151
- version: '0'
145
+ version: 1.2.1
152
146
  type: :development
153
147
  prerelease: false
154
148
  version_requirements: !ruby/object:Gem::Requirement
155
149
  requirements:
156
- - - ">="
150
+ - - "~>"
157
151
  - !ruby/object:Gem::Version
158
- version: '0'
152
+ version: 1.2.1
159
153
  - !ruby/object:Gem::Dependency
160
154
  name: simplecov
161
155
  requirement: !ruby/object:Gem::Requirement
162
156
  requirements:
163
- - - ">="
157
+ - - "~>"
164
158
  - !ruby/object:Gem::Version
165
- version: '0'
159
+ version: '0.13'
166
160
  type: :development
167
161
  prerelease: false
168
162
  version_requirements: !ruby/object:Gem::Requirement
169
163
  requirements:
170
- - - ">="
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '0.13'
167
+ - !ruby/object:Gem::Dependency
168
+ name: byebug
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 9.0.6
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
171
179
  - !ruby/object:Gem::Version
172
- version: '0'
180
+ version: 9.0.6
173
181
  description: 'letsencrypt-plugin is a Ruby on Rails helper for Let''s Encrypt service
174
182
  for retrieving SSL certificates (without using sudo, like original letsencrypt client
175
183
  does). It uses acme-client gem for communication with Let''s Encrypt server. '
@@ -184,18 +192,19 @@ files:
184
192
  - app/controllers/letsencrypt_plugin/application_controller.rb
185
193
  - app/models/letsencrypt_plugin/challenge.rb
186
194
  - app/models/letsencrypt_plugin/setting.rb
187
- - config/initializers/letsencrypt_plugin.rb
188
195
  - config/routes.rb
189
196
  - db/migrate/20151206135029_create_letsencrypt_plugin_challenges.rb
190
197
  - db/migrate/20160412195212_create_letsencrypt_plugin_settings.rb
191
198
  - lib/letsencrypt_plugin.rb
192
199
  - lib/letsencrypt_plugin/certificate_output.rb
193
200
  - lib/letsencrypt_plugin/challenge_store.rb
201
+ - lib/letsencrypt_plugin/configuration.rb
194
202
  - lib/letsencrypt_plugin/database_store.rb
195
203
  - lib/letsencrypt_plugin/engine.rb
196
204
  - lib/letsencrypt_plugin/file_output.rb
197
205
  - lib/letsencrypt_plugin/file_store.rb
198
206
  - lib/letsencrypt_plugin/heroku_output.rb
207
+ - lib/letsencrypt_plugin/private_key_store.rb
199
208
  - lib/letsencrypt_plugin/version.rb
200
209
  - lib/tasks/letsencrypt_plugin_tasks.rake
201
210
  - test/controllers/application_controller_test.rb
@@ -245,6 +254,8 @@ files:
245
254
  - test/fixtures/letsencrypt_plugin/challenges.yml
246
255
  - test/fixtures/letsencrypt_plugin/settings.yml
247
256
  - test/letsencrypt_plugin_test.rb
257
+ - test/lib/letsencrypt_plugin/configuration_test.rb
258
+ - test/lib/letsencrypt_plugin/private_key_store_test.rb
248
259
  - test/models/letsencrypt_plugin/challenge_test.rb
249
260
  - test/test_helper.rb
250
261
  homepage: https://github.com/lgromanowski/letsencrypt-plugin
@@ -267,13 +278,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
278
  version: '0'
268
279
  requirements: []
269
280
  rubyforge_project:
270
- rubygems_version: 2.5.1
281
+ rubygems_version: 2.6.11
271
282
  signing_key:
272
283
  specification_version: 4
273
284
  summary: Let's encrypt plugin for Ruby on Rails applications
274
285
  test_files:
275
286
  - test/controllers/application_controller_test.rb
276
287
  - test/test_helper.rb
288
+ - test/lib/letsencrypt_plugin/configuration_test.rb
289
+ - test/lib/letsencrypt_plugin/private_key_store_test.rb
277
290
  - test/letsencrypt_plugin_test.rb
278
291
  - test/models/letsencrypt_plugin/challenge_test.rb
279
292
  - test/fixtures/letsencrypt_plugin/challenges.yml