blinkist-config 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/blinkist-config.gemspec +1 -1
- data/lib/blinkist/config/adapters/aws_ssm_adapter.rb +22 -8
- data/lib/blinkist/config/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 353a2346a48c19ef03b27e92acf5886003889968
|
4
|
+
data.tar.gz: bbddc8979580d2d1c7d8c3d472723ad2be28a000
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f837b33a8be95107bd0b0b9b64db641956a780375c915f35a989735fdba3d7994c3a7859e29e74facd06dde47de9516369db6713a8e154f119d60be0a0bbc55
|
7
|
+
data.tar.gz: 5ef268065e9c25eebc044665a8bf6be2938d9e6351b6cc8fb95879ae3a339b04dd9329d90509d1ad962e35f30123585b49bbe09b641a9cdfa1f4e960aa060a64
|
data/blinkist-config.gemspec
CHANGED
@@ -16,7 +16,7 @@ module Blinkist
|
|
16
16
|
def get(key, default=nil, scope: nil)
|
17
17
|
prefix = prefix_for(scope)
|
18
18
|
|
19
|
-
query_ssm_parameter
|
19
|
+
query_ssm_parameter prefix + key
|
20
20
|
rescue Aws::SSM::Errors::ParameterNotFound
|
21
21
|
default
|
22
22
|
end
|
@@ -29,9 +29,9 @@ module Blinkist
|
|
29
29
|
|
30
30
|
def prefix_for(scope)
|
31
31
|
if scope.nil?
|
32
|
-
DEFAULT_PREFIX + @app_name
|
32
|
+
DEFAULT_PREFIX + @app_name + "/"
|
33
33
|
else
|
34
|
-
DEFAULT_PREFIX + scope
|
34
|
+
DEFAULT_PREFIX + scope + "/"
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -43,11 +43,25 @@ module Blinkist
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def query_all_ssm_parameters(prefix)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
parameters = []
|
47
|
+
next_token = nil
|
48
|
+
|
49
|
+
# SSM limits the results and we need to loop
|
50
|
+
loop do
|
51
|
+
result = @client.get_parameters_by_path(
|
52
|
+
path: prefix,
|
53
|
+
recursive: true,
|
54
|
+
with_decryption: true,
|
55
|
+
next_token: next_token
|
56
|
+
)
|
57
|
+
|
58
|
+
parameters += result.parameters
|
59
|
+
next_token = result.next_token
|
60
|
+
|
61
|
+
break if next_token.nil?
|
62
|
+
end
|
63
|
+
|
64
|
+
parameters.map do |parameter|
|
51
65
|
@items_cache[parameter.name] = parameter.value
|
52
66
|
end
|
53
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blinkist-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Schleicher, Blinks Labs GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1
|
75
|
+
version: '1'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1
|
82
|
+
version: '1'
|
83
83
|
description: This GEM allows you to keep your configuration class-based by calling
|
84
84
|
Blinkist::Config.get!(...) instead of accessing the ENV directly. You can set up
|
85
85
|
different types of adapters to connect to various configuration systems like your
|