certmeister 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -10
- data/README.md +7 -13
- data/contrib/.ruby-version +1 -1
- data/contrib/Gemfile +1 -1
- data/lib/certmeister/policy/existing.rb +3 -1
- data/lib/certmeister/version.rb +1 -1
- data/spec/certmeister/policy/existing_spec.rb +6 -0
- metadata +1 -2
- data/certmeister-redis.gemspec +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5a9e171d0871cb9253d14dca465d5a9803fa07c
|
4
|
+
data.tar.gz: 163ae3a914300d3893107bd791d5a9a8f707a24e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2da9a19b6c041e1567cc4e83258d44b8c40084904d53e03b5d0ce8ff1c39c3097aa639f7547ca123615a9d7dda352868a00062690da32624bffdcaf631b468e
|
7
|
+
data.tar.gz: 63887e6513a50bc4418d6aab14ef10c07dae4c614d881a27f7b30bef38526c87f1ac34440e293f4cb90f99e34faa9ee7ca1020849293517761a80c1b0549afc5
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
certmeister (1.0.
|
5
|
-
certmeister-rack (1.0.
|
6
|
-
certmeister (= 1.0.
|
4
|
+
certmeister (1.0.1)
|
5
|
+
certmeister-rack (1.0.1)
|
6
|
+
certmeister (= 1.0.1)
|
7
7
|
rack (~> 1.5)
|
8
|
-
certmeister-redis (1.0.0)
|
9
|
-
certmeister (= 1.0.0)
|
10
|
-
redis-sentinel (~> 1.4)
|
11
8
|
|
12
9
|
GEM
|
13
10
|
remote: http://rubygems.org/
|
@@ -17,9 +14,6 @@ GEM
|
|
17
14
|
rack-test (0.6.2)
|
18
15
|
rack (>= 1.0)
|
19
16
|
rake (0.9.6)
|
20
|
-
redis (3.0.7)
|
21
|
-
redis-sentinel (1.4.2)
|
22
|
-
redis
|
23
17
|
rspec (3.1.0)
|
24
18
|
rspec-core (~> 3.1.0)
|
25
19
|
rspec-expectations (~> 3.1.0)
|
@@ -40,7 +34,6 @@ DEPENDENCIES
|
|
40
34
|
bundler (~> 1.5)
|
41
35
|
certmeister!
|
42
36
|
certmeister-rack!
|
43
|
-
certmeister-redis!
|
44
37
|
rack-test (~> 0.6)
|
45
38
|
rake (~> 0)
|
46
39
|
rspec (~> 3.1)
|
data/README.md
CHANGED
@@ -15,12 +15,17 @@ The reference access policy in use by Hetzner PTY Ltd is:
|
|
15
15
|
|
16
16
|
This allows us the convenience of Puppet's autosign feature, without the horrendous security implications.
|
17
17
|
|
18
|
-
This repository currently builds
|
18
|
+
This repository currently builds two gems:
|
19
19
|
|
20
20
|
* _certmeister_ - the CA, some off-the-shelf policy modules and an in-memory cert store
|
21
|
-
* _certmeister-redis_ - a redis-backed store
|
22
21
|
* _certmeister-rack_ - a rack application to provide an HTTP interface to the CA
|
23
22
|
|
23
|
+
Only an in-memory store is provided. Others are available as separate gems:
|
24
|
+
|
25
|
+
* [certmeister-dynamodb](https://github.com/sheldonh/certmeister-dynamodb)
|
26
|
+
* [certmeister-pg](https://github.com/sheldonh/certmeister-pg)
|
27
|
+
* [certmeister-redis](https://github.com/sheldonh/certmeister-redis)
|
28
|
+
|
24
29
|
An example, using redis and rack and enforcing Hetzner PTY Ltd's policy, is available in [contrib/config.ru](contrib/config.ru).
|
25
30
|
|
26
31
|
To hit the service:
|
@@ -34,19 +39,8 @@ $ curl -L \
|
|
34
39
|
|
35
40
|
## Testing
|
36
41
|
|
37
|
-
Because we test both certmeister and certmeister-redis with `rake spec`, you need redis up if you want to run the tests. It's easy:
|
38
|
-
|
39
|
-
* Install redis-2.8.4 or later.
|
40
|
-
* Start redis.
|
41
|
-
* Run tests.
|
42
|
-
* Stop redis.
|
43
|
-
|
44
42
|
```
|
45
|
-
sudo yum install -y ansible
|
46
|
-
sudo ansible-playbook -i contrib/hosts contrib/redis.yml
|
47
|
-
redis-server --logfile /dev/null &
|
48
43
|
rake spec
|
49
|
-
kill %1; wait %1
|
50
44
|
```
|
51
45
|
|
52
46
|
## Releasing
|
data/contrib/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.1.5
|
data/contrib/Gemfile
CHANGED
@@ -12,7 +12,9 @@ module Certmeister
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def authenticate(request)
|
15
|
-
if
|
15
|
+
if not request[:cn]
|
16
|
+
Certmeister::Policy::Response.new(false, "missing cn")
|
17
|
+
elsif @store.fetch(request[:cn]).nil?
|
16
18
|
Certmeister::Policy::Response.new(true, nil)
|
17
19
|
else
|
18
20
|
Certmeister::Policy::Response.new(false, "certificate for cn already exists")
|
data/lib/certmeister/version.rb
CHANGED
@@ -17,6 +17,12 @@ describe Certmeister::Policy::Existing do
|
|
17
17
|
expect { subject.authenticate }.to raise_error(ArgumentError)
|
18
18
|
end
|
19
19
|
|
20
|
+
it "refuses to authenticate a request with a missing cn" do
|
21
|
+
response = subject.authenticate(cn: nil)
|
22
|
+
expect(response).to_not be_authenticated
|
23
|
+
expect(response.error).to eql "missing cn"
|
24
|
+
end
|
25
|
+
|
20
26
|
context "when the store contains a cert for axl.hetzner.africa" do
|
21
27
|
|
22
28
|
subject { Certmeister::Policy::Existing.new(Certmeister::InMemoryStore.new({"axl.hetzner.africa" => "...cert..."})) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: certmeister
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sheldon Hearn
|
@@ -72,7 +72,6 @@ files:
|
|
72
72
|
- README.md
|
73
73
|
- Rakefile
|
74
74
|
- certmeister-rack.gemspec
|
75
|
-
- certmeister-redis.gemspec
|
76
75
|
- certmeister.gemspec
|
77
76
|
- contrib/.ruby-gemset
|
78
77
|
- contrib/.ruby-version
|
data/certmeister-redis.gemspec
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'certmeister/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "certmeister-redis"
|
8
|
-
spec.version = Certmeister::VERSION
|
9
|
-
spec.authors = ["Sheldon Hearn"]
|
10
|
-
spec.email = ["sheldonh@starjuice.net"]
|
11
|
-
spec.summary = %q{Redis store for certmeister}
|
12
|
-
spec.description = %q{This gem provides a redis store for use in certmeister, the conditional autosigning certificate authority.}
|
13
|
-
spec.homepage = "https://github.com/sheldonh/certmeister"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z lib/certmeister spec/certmeister`.split("\x0").grep(/redis/)
|
17
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
-
spec.require_paths = ["lib"]
|
19
|
-
|
20
|
-
spec.add_dependency "certmeister", Certmeister::VERSION
|
21
|
-
spec.add_dependency "redis-sentinel", "~> 1.4"
|
22
|
-
end
|