secret_garden 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +12 -0
- data/lib/secret_garden/backend.rb +4 -1
- data/lib/secret_garden/vault.rb +10 -1
- data/lib/secret_garden/version.rb +1 -1
- data/lib/secret_garden.rb +2 -2
- data/secret_garden.gemspec +3 -3
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d8ecf43d78e66640973ad649de512f520759e5c7c818216b0419997adf2e23f6
|
4
|
+
data.tar.gz: 193132a07e3f86f6733d8c80fbd350084f43f450fa463a3b3b5bce3d9dad476f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af0ff71ae25000c686b945a71fb2d2f1479c57da4de20201995f011c82cf904d0b82d9083a997115667ec750e74e67345a866752e413ea7fac6d799a00febe84
|
7
|
+
data.tar.gz: 32bd90d2e484da0b17d219839669ae8ff2813987f363278a8c141ae66d6e0585270544d96622ce03bd36cf19e4a95606095a1bf9124d14581077742b9fe29310
|
data/README.md
CHANGED
@@ -74,6 +74,18 @@ require 'vault'
|
|
74
74
|
SecretGarden.export 'DATABASE_URL'
|
75
75
|
```
|
76
76
|
|
77
|
+
### Vault configurations
|
78
|
+
|
79
|
+
For vault, you may want to specify retry behavior. You can do this with:
|
80
|
+
|
81
|
+
```
|
82
|
+
SecretGarden.add_backend :vault,
|
83
|
+
with_retries: [
|
84
|
+
Vault::HTTPConnectionError,
|
85
|
+
attempts: 42
|
86
|
+
]
|
87
|
+
```
|
88
|
+
|
77
89
|
## Development
|
78
90
|
|
79
91
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/secret_garden/vault.rb
CHANGED
@@ -9,6 +9,9 @@ module SecretGarden
|
|
9
9
|
class SecretNotDefined < StandardError; end
|
10
10
|
class PropertyNotDefined < StandardError; end
|
11
11
|
|
12
|
+
# Options for SecretGarden.add_backend
|
13
|
+
attr_accessor :with_retries
|
14
|
+
|
12
15
|
def fetch(secret)
|
13
16
|
unless vault_secret = fetch_from_vault(secret.path)
|
14
17
|
raise SecretNotDefined,
|
@@ -24,7 +27,13 @@ module SecretGarden
|
|
24
27
|
end
|
25
28
|
|
26
29
|
def fetch_from_vault(path)
|
27
|
-
|
30
|
+
if with_retries
|
31
|
+
::Vault.with_retries(*with_retries) do
|
32
|
+
::Vault.logical.read path
|
33
|
+
end
|
34
|
+
else
|
35
|
+
::Vault.logical.read path
|
36
|
+
end
|
28
37
|
end
|
29
38
|
|
30
39
|
end
|
data/lib/secret_garden.rb
CHANGED
@@ -7,9 +7,9 @@ module SecretGarden
|
|
7
7
|
|
8
8
|
class SecretNotDefined < StandardError; end
|
9
9
|
|
10
|
-
def self.add_backend(val)
|
10
|
+
def self.add_backend(val, **options)
|
11
11
|
klass = SecretGarden.const_get(val.to_s.capitalize)
|
12
|
-
@backends = backends + [klass.new(map)]
|
12
|
+
@backends = backends + [klass.new(map, **options)]
|
13
13
|
nil
|
14
14
|
end
|
15
15
|
|
data/secret_garden.gemspec
CHANGED
@@ -6,12 +6,12 @@ require 'secret_garden/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "secret_garden"
|
8
8
|
spec.version = SecretGarden::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["Erica Kastner"]
|
10
|
+
spec.email = ["ekastner@mailbox.org"]
|
11
11
|
|
12
12
|
spec.summary = %q{Access your 12-factor app secrets securely}
|
13
13
|
spec.description = %q{Provide secrets either via ENV or fall back to secure backends like vault}
|
14
|
-
spec.homepage = "http://github.com/
|
14
|
+
spec.homepage = "http://github.com/erithmetic/secret_garden"
|
15
15
|
|
16
16
|
spec.license = "MIT"
|
17
17
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: secret_garden
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Erica Kastner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,7 +68,7 @@ dependencies:
|
|
68
68
|
version: '0'
|
69
69
|
description: Provide secrets either via ENV or fall back to secure backends like vault
|
70
70
|
email:
|
71
|
-
-
|
71
|
+
- ekastner@mailbox.org
|
72
72
|
executables: []
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
@@ -90,7 +90,7 @@ files:
|
|
90
90
|
- lib/secret_garden/vault.rb
|
91
91
|
- lib/secret_garden/version.rb
|
92
92
|
- secret_garden.gemspec
|
93
|
-
homepage: http://github.com/
|
93
|
+
homepage: http://github.com/erithmetic/secret_garden
|
94
94
|
licenses:
|
95
95
|
- MIT
|
96
96
|
metadata: {}
|
@@ -109,8 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
|
-
|
113
|
-
rubygems_version: 2.5.1
|
112
|
+
rubygems_version: 3.0.1
|
114
113
|
signing_key:
|
115
114
|
specification_version: 4
|
116
115
|
summary: Access your 12-factor app secrets securely
|