r509-ca-http 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/R509.html +1 -1
- data/doc/R509/CertificateAuthority.html +1 -1
- data/doc/R509/CertificateAuthority/Http.html +2 -2
- data/doc/R509/CertificateAuthority/Http/Factory.html +1 -1
- data/doc/R509/CertificateAuthority/Http/Factory/CsrFactory.html +1 -1
- data/doc/R509/CertificateAuthority/Http/Factory/SpkiFactory.html +1 -1
- data/doc/R509/CertificateAuthority/Http/Server.html +1 -1
- data/doc/R509/CertificateAuthority/Http/SubjectParser.html +1 -1
- data/doc/R509/CertificateAuthority/Http/ValidityPeriodConverter.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- data/lib/r509/certificateauthority/http/server.rb +4 -3
- data/lib/r509/certificateauthority/http/version.rb +1 -1
- data/lib/r509/certificateauthority/http/views/test_revoke.erb +2 -2
- data/spec/http_spec.rb +13 -4
- metadata +17 -17
data/doc/R509.html
CHANGED
@@ -108,7 +108,7 @@
|
|
108
108
|
</div>
|
109
109
|
|
110
110
|
<div id="footer">
|
111
|
-
Generated on
|
111
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
112
112
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
113
113
|
0.8.6.1 (ruby-1.9.3).
|
114
114
|
</div>
|
@@ -108,7 +108,7 @@
|
|
108
108
|
</div>
|
109
109
|
|
110
110
|
<div id="footer">
|
111
|
-
Generated on
|
111
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
112
112
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
113
113
|
0.8.6.1 (ruby-1.9.3).
|
114
114
|
</div>
|
@@ -106,7 +106,7 @@
|
|
106
106
|
<dt id="VERSION-constant" class="">VERSION =
|
107
107
|
|
108
108
|
</dt>
|
109
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.2</span><span class='tstring_end'>"</span></span></pre></dd>
|
109
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.2.1</span><span class='tstring_end'>"</span></span></pre></dd>
|
110
110
|
|
111
111
|
</dl>
|
112
112
|
|
@@ -122,7 +122,7 @@
|
|
122
122
|
</div>
|
123
123
|
|
124
124
|
<div id="footer">
|
125
|
-
Generated on
|
125
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
126
126
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
127
127
|
0.8.6.1 (ruby-1.9.3).
|
128
128
|
</div>
|
@@ -106,7 +106,7 @@
|
|
106
106
|
</div>
|
107
107
|
|
108
108
|
<div id="footer">
|
109
|
-
Generated on
|
109
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
110
110
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
111
111
|
0.8.6.1 (ruby-1.9.3).
|
112
112
|
</div>
|
@@ -180,7 +180,7 @@
|
|
180
180
|
</div>
|
181
181
|
|
182
182
|
<div id="footer">
|
183
|
-
Generated on
|
183
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
184
184
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
185
185
|
0.8.6.1 (ruby-1.9.3).
|
186
186
|
</div>
|
@@ -180,7 +180,7 @@
|
|
180
180
|
</div>
|
181
181
|
|
182
182
|
<div id="footer">
|
183
|
-
Generated on
|
183
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
184
184
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
185
185
|
0.8.6.1 (ruby-1.9.3).
|
186
186
|
</div>
|
@@ -124,7 +124,7 @@
|
|
124
124
|
</div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
129
|
0.8.6.1 (ruby-1.9.3).
|
130
130
|
</div>
|
@@ -256,7 +256,7 @@
|
|
256
256
|
</div>
|
257
257
|
|
258
258
|
<div id="footer">
|
259
|
-
Generated on
|
259
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
260
260
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
261
261
|
0.8.6.1 (ruby-1.9.3).
|
262
262
|
</div>
|
@@ -198,7 +198,7 @@
|
|
198
198
|
</div>
|
199
199
|
|
200
200
|
<div id="footer">
|
201
|
-
Generated on
|
201
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
202
202
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
203
203
|
0.8.6.1 (ruby-1.9.3).
|
204
204
|
</div>
|
data/doc/_index.html
CHANGED
@@ -197,7 +197,7 @@
|
|
197
197
|
</div>
|
198
198
|
|
199
199
|
<div id="footer">
|
200
|
-
Generated on
|
200
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
201
201
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
202
202
|
0.8.6.1 (ruby-1.9.3).
|
203
203
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -200,7 +200,7 @@
|
|
200
200
|
</div></div>
|
201
201
|
|
202
202
|
<div id="footer">
|
203
|
-
Generated on
|
203
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
204
204
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
205
205
|
0.8.6.1 (ruby-1.9.3).
|
206
206
|
</div>
|
data/doc/index.html
CHANGED
@@ -200,7 +200,7 @@
|
|
200
200
|
</div></div>
|
201
201
|
|
202
202
|
<div id="footer">
|
203
|
-
Generated on
|
203
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
204
204
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
205
205
|
0.8.6.1 (ruby-1.9.3).
|
206
206
|
</div>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Wed Apr 17 15:24:09 2013 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.6.1 (ruby-1.9.3).
|
109
109
|
</div>
|
@@ -181,11 +181,12 @@ module R509
|
|
181
181
|
if not serial
|
182
182
|
raise ArgumentError, "Serial must be provided"
|
183
183
|
end
|
184
|
-
|
185
|
-
|
184
|
+
|
185
|
+
if not reason.nil? and reason.empty?
|
186
|
+
reason = nil
|
186
187
|
end
|
187
188
|
|
188
|
-
crl(ca).revoke_cert(serial
|
189
|
+
crl(ca).revoke_cert(serial, reason)
|
189
190
|
|
190
191
|
crl(ca).crl.to_pem
|
191
192
|
end
|
data/spec/http_spec.rb
CHANGED
@@ -194,7 +194,7 @@ describe R509::CertificateAuthority::HTTP::Server do
|
|
194
194
|
last_response.body.should == "#<ArgumentError: Serial must be provided>"
|
195
195
|
end
|
196
196
|
it "when serial is given but not reason" do
|
197
|
-
@crls["test_ca"].should_receive(:revoke_cert).with(12345,
|
197
|
+
@crls["test_ca"].should_receive(:revoke_cert).with("12345", nil).and_return(nil)
|
198
198
|
crl_list = double("crl-list")
|
199
199
|
@crls["test_ca"].should_receive(:crl).and_return(crl_list)
|
200
200
|
crl_list.should_receive(:to_pem).and_return("generated crl")
|
@@ -203,7 +203,7 @@ describe R509::CertificateAuthority::HTTP::Server do
|
|
203
203
|
last_response.body.should == "generated crl"
|
204
204
|
end
|
205
205
|
it "when serial and reason are given" do
|
206
|
-
@crls["test_ca"].should_receive(:revoke_cert).with(12345, 1).and_return(nil)
|
206
|
+
@crls["test_ca"].should_receive(:revoke_cert).with("12345", "1").and_return(nil)
|
207
207
|
crl_list = double("crl-list")
|
208
208
|
@crls["test_ca"].should_receive(:crl).and_return(crl_list)
|
209
209
|
crl_list.should_receive(:to_pem).and_return("generated crl")
|
@@ -212,13 +212,13 @@ describe R509::CertificateAuthority::HTTP::Server do
|
|
212
212
|
last_response.body.should == "generated crl"
|
213
213
|
end
|
214
214
|
it "when serial is not an integer" do
|
215
|
-
@crls["test_ca"].should_receive(:revoke_cert).with(
|
215
|
+
@crls["test_ca"].should_receive(:revoke_cert).with("foo", nil).and_raise(R509::R509Error.new("some r509 error"))
|
216
216
|
post "/1/certificate/revoke", "ca" => "test_ca", "serial" => "foo"
|
217
217
|
last_response.should_not be_ok
|
218
218
|
last_response.body.should == "#<R509::R509Error: some r509 error>"
|
219
219
|
end
|
220
220
|
it "when reason is not an integer" do
|
221
|
-
@crls["test_ca"].should_receive(:revoke_cert).with(12345,
|
221
|
+
@crls["test_ca"].should_receive(:revoke_cert).with("12345", "foo").and_return(nil)
|
222
222
|
crl_list = double("crl-list")
|
223
223
|
@crls["test_ca"].should_receive(:crl).and_return(crl_list)
|
224
224
|
crl_list.should_receive(:to_pem).and_return("generated crl")
|
@@ -226,6 +226,15 @@ describe R509::CertificateAuthority::HTTP::Server do
|
|
226
226
|
last_response.should be_ok
|
227
227
|
last_response.body.should == "generated crl"
|
228
228
|
end
|
229
|
+
it "when reason is an empty string" do
|
230
|
+
@crls["test_ca"].should_receive(:revoke_cert).with("12345", nil).and_return(nil)
|
231
|
+
crl_list = double("crl-list")
|
232
|
+
@crls["test_ca"].should_receive(:crl).and_return(crl_list)
|
233
|
+
crl_list.should_receive(:to_pem).and_return("generated crl")
|
234
|
+
post "/1/certificate/revoke", "ca" => "test_ca", "serial" => "12345", "reason" => ""
|
235
|
+
last_response.should be_ok
|
236
|
+
last_response.body.should == "generated crl"
|
237
|
+
end
|
229
238
|
end
|
230
239
|
|
231
240
|
context "unrevoke certificate" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r509-ca-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: r509
|
16
|
-
requirement: &
|
16
|
+
requirement: &2161942760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.9.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2161942760
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sinatra
|
27
|
-
requirement: &
|
27
|
+
requirement: &2161942340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2161942340
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dependo
|
38
|
-
requirement: &
|
38
|
+
requirement: &2161941880 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2161941880
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &2161941460 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2161941460
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rack-test
|
60
|
-
requirement: &
|
60
|
+
requirement: &2161941040 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2161941040
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
|
-
requirement: &
|
71
|
+
requirement: &2161940620 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2161940620
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: simplecov
|
82
|
-
requirement: &
|
82
|
+
requirement: &2161940200 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *2161940200
|
91
91
|
description: A HTTP CA API for r509
|
92
92
|
email: sirsean@gmail.com
|
93
93
|
executables: []
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
segments:
|
156
156
|
- 0
|
157
|
-
hash: -
|
157
|
+
hash: -833608814562001051
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
160
|
rubygems_version: 1.8.10
|