sekreto 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sekreto.rb +8 -1
- data/lib/sekreto/config.rb +4 -0
- data/lib/sekreto/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab381faa21b251cd3abadcc6c2d854dac68a4f9af5d2a507b6eb060f67bdd385
|
4
|
+
data.tar.gz: 97760f0f1a7cecf45bfa98263b3be0a0f7144227f82fbc0eff2fd8e930b97b76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e68a1eb57ce8c74025391b1856211e3bd1458003bc12f618e1a08bad9f0448ee1f1b8800d8294e20cfd10f82aba8adef0525b3edadbd6316f22cb874aea20f9
|
7
|
+
data.tar.gz: 7a05fbb69de6d2952fce1477d72daee5601ee6c52c46436b0eeb25aff59fe180375b17b849300c3609f0456deb5f650378dd6cdc6d3960a75c3ec5f45d9260c9
|
data/lib/sekreto.rb
CHANGED
@@ -14,9 +14,12 @@ module Sekreto
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def get_value(secret_id)
|
17
|
-
|
17
|
+
fail 'Not allowed env' unless config.is_allowed_env.call
|
18
18
|
response = secrets_manager.get_secret_value(secret_id: secret_name(secret_id))
|
19
19
|
response.secret_string
|
20
|
+
rescue StandardError => err
|
21
|
+
logger.warn("[Sekreto] Failed to get value!\n#{err}")
|
22
|
+
config.fallback_lookup.call(secret_id)
|
20
23
|
end
|
21
24
|
|
22
25
|
def get_json_value(secret_id)
|
@@ -37,5 +40,9 @@ module Sekreto
|
|
37
40
|
def secrets_manager
|
38
41
|
config.secrets_manager
|
39
42
|
end
|
43
|
+
|
44
|
+
def logger
|
45
|
+
config.logger
|
46
|
+
end
|
40
47
|
end
|
41
48
|
end
|
data/lib/sekreto/config.rb
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
1
3
|
module Sekreto
|
2
4
|
class Config
|
3
5
|
attr_accessor :prefix
|
4
6
|
attr_accessor :is_allowed_env
|
5
7
|
attr_accessor :fallback_lookup
|
6
8
|
attr_accessor :secrets_manager
|
9
|
+
attr_accessor :logger
|
7
10
|
|
8
11
|
def initialize
|
9
12
|
@prefix = 'secrets'
|
10
13
|
@is_allowed_env = -> { true }
|
11
14
|
@fallback_lookup = ->(secret_id) { ENV[secret_id] }
|
12
15
|
@secrets_manager = nil
|
16
|
+
@logger = Logger.new(STDOUT)
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
data/lib/sekreto/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sekreto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Autolist Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-secretsmanager
|