minimal_pipeline 0.0.3 → 0.0.4
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/lib/minimal_pipeline/keystore.rb +12 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 291342154ec4ae2001e7eea75f34b99f4ae2cf2cfdd9ee968416902a5940cbc5
|
4
|
+
data.tar.gz: 2eac06083452015ea0a17d16ca110ba8b58216ef29173e17229345482fefbce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1075b8dd74da1225308d66c87b07816c2693e5a4449ae8aa4793564a35cc516d5aa5650e9b201f88c31c3df412aab10ae15ce146a2ed03ddb25b79a2d578c94
|
7
|
+
data.tar.gz: 3bde6935d42ca5493472c5f88552436f96414de46267524a8189baaa5fb3eea7bf736cc6391165ba25de852fc1542e37a235d1ad52fdc52c699a0c23eea91397
|
@@ -27,19 +27,24 @@ class MinimalPipeline
|
|
27
27
|
class Keystore
|
28
28
|
# Initializes a `Keystore` client
|
29
29
|
# Requires environment variables `AWS_REGION` or `region` to be set.
|
30
|
-
# Also requires `
|
30
|
+
# Also requires `keystore_table` and `keystore_kms_id`
|
31
31
|
def initialize
|
32
|
-
raise 'You must set env variable AWS_REGION.'
|
33
|
-
|
34
|
-
|
32
|
+
raise 'You must set env variable AWS_REGION or region.' \
|
33
|
+
if ENV['AWS_REGION'].nil? && ENV['region'].nil?
|
34
|
+
raise 'Missing keystore_table in environment!' \
|
35
|
+
if ENV['inventory_store'].nil? || ENV['keystore_table'].nil?
|
36
|
+
raise 'Missing keystore_kms_id in environment!' \
|
37
|
+
if ENV['inventory_store_key'].nil? || ENV['keystore_kms_id'].nil?
|
35
38
|
|
36
|
-
region = ENV['AWS_REGION']
|
39
|
+
region = ENV['AWS_REGION'] || ENV['region']
|
40
|
+
keystore_table = ENV['keystore_table'] || ENV['inventory_store']
|
41
|
+
keystore_kms_id = ENV['keystore_kms_id'] || ENV['inventory_store_key']
|
37
42
|
kms = Aws::KMS::Client.new(region: region)
|
38
43
|
dynamo = Aws::DynamoDB::Client.new(region: region)
|
39
44
|
@keystore = ::Keystore.new(dynamo: dynamo,
|
40
|
-
table_name:
|
45
|
+
table_name: keystore_table,
|
41
46
|
kms: kms,
|
42
|
-
key_id:
|
47
|
+
key_id: keystore_kms_id)
|
43
48
|
end
|
44
49
|
|
45
50
|
# Retrieves a value from the Keystore
|