certmeister 1.2.1 → 2.0.0
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 -3
- data/lib/certmeister/in_memory_store.rb +8 -0
- data/lib/certmeister/test/memory_store_interface.rb +15 -0
- data/lib/certmeister/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 083750255abf59b0e78a0c68f3b3aca6fd57d790
|
4
|
+
data.tar.gz: 5438388c4400a77bfa580dbb86d11560104a246a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 437fd1f9d23f2e5355bb70453bbaa06d9195ab037b23eeda614eccc109e7027900de0ae1b7637d346a887775173bc5761d6d3b7e50220a7cc007327e6599a5c4
|
7
|
+
data.tar.gz: 9d4b7cfef3c402a6547df3cee80301a00bdc4eda57a8f86c04f572f85eaba7760d55bacfa6fb6a23b15560cfa82fe0871f11f283875ac608934e1f799eda49bf
|
data/Gemfile.lock
CHANGED
@@ -4,6 +4,8 @@ module Certmeister
|
|
4
4
|
|
5
5
|
class InMemoryStore
|
6
6
|
|
7
|
+
include Enumerable
|
8
|
+
|
7
9
|
def initialize(certs = {})
|
8
10
|
@certs = certs
|
9
11
|
@healthy = true
|
@@ -24,6 +26,12 @@ module Certmeister
|
|
24
26
|
!!@certs.delete(cn)
|
25
27
|
end
|
26
28
|
|
29
|
+
def each
|
30
|
+
@certs.each do |cn, cert|
|
31
|
+
yield cn, cert
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
27
35
|
def health_check
|
28
36
|
@healthy
|
29
37
|
end
|
@@ -32,6 +32,21 @@ module Certmeister
|
|
32
32
|
expect(subject.fetch('axl.hetzner.africa')).to be_nil
|
33
33
|
end
|
34
34
|
|
35
|
+
it "is enumerable" do
|
36
|
+
expect(subject).to be_a(Enumerable)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "iterates certificates by cn" do
|
40
|
+
subject.store('axl.hetzner.africa', "hetzner-cert")
|
41
|
+
subject.store('axl.starjuice.net', "hetzner-cert")
|
42
|
+
received = {}
|
43
|
+
subject.each do |cn, cert|
|
44
|
+
expect(received).to_not include(cn)
|
45
|
+
received[cn] = cert
|
46
|
+
end
|
47
|
+
expect(received).to eql({'axl.hetzner.africa' => "hetzner-cert", 'axl.starjuice.net' => "hetzner-cert"})
|
48
|
+
end
|
49
|
+
|
35
50
|
it "returns false when removing a non-existent CN" do
|
36
51
|
expect(subject.remove('axl.hetzner.africa')).to be false
|
37
52
|
end
|
data/lib/certmeister/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: certmeister
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sheldon Hearn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|