secret_config 0.9.0 → 0.9.1
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/README.md +5 -5
- data/lib/secret_config/registry.rb +4 -5
- data/lib/secret_config/version.rb +1 -1
- data/test/registry_test.rb +5 -0
- 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: f21043b5cb86e83686e3e3cdb920c39bdd21c6c8e8dcfbd2d1cc34f81aef8e8c
|
4
|
+
data.tar.gz: d932bca14ac864d3558e825ae226f227da60af5abe53f81dc601b05c2c51bfde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d72ec54655bab806b3c1c7243fc033e529924f0024cae1c2f604904b3ea620e833e36744a1dfbbe8bb1b2d0c6d5fc0b644bb7477f7978c186fcbdca795596fb9
|
7
|
+
data.tar.gz: cf24dc349803e4bd328fe471b0bcec0cd1f94b5b94b0261db990f4acab975494497b31044807f1fe87ba9d2ff5bb408db1674cedafad6676200c3de0904bc158
|
data/README.md
CHANGED
@@ -638,22 +638,22 @@ secrets:
|
|
638
638
|
|
639
639
|
Import a yaml file, into a path in AWS SSM Parameter Store:
|
640
640
|
|
641
|
-
secret-config --import /production/my_application --
|
641
|
+
secret-config --import /production/my_application --file production.yml
|
642
642
|
|
643
643
|
Import a yaml file, into a path in AWS SSM Parameter Store, using a custom KMS key to encrypt the values:
|
644
644
|
|
645
|
-
secret-config --import /production/my_application --
|
645
|
+
secret-config --import /production/my_application --file production.yml --key_id "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
646
646
|
|
647
647
|
Import a yaml file, into a path in AWS SSM Parameter Store, using a custom KMS key alias to encrypt the values:
|
648
648
|
|
649
|
-
secret-config --import /production/my_application --
|
649
|
+
secret-config --import /production/my_application --file production.yml --key_alias my_key_alias
|
650
650
|
|
651
651
|
#### Diff
|
652
652
|
|
653
653
|
Before importing a new config file into the AWS SSM Parameter store, a diff can be performed to determine
|
654
654
|
what the differences are that will be applied when the import is run with the `--prune` option.
|
655
655
|
|
656
|
-
secret-config --diff /production/my_application --
|
656
|
+
secret-config --diff /production/my_application --file production.yml
|
657
657
|
|
658
658
|
Key:
|
659
659
|
|
@@ -691,7 +691,7 @@ Import configuration from an existing path in AWS SSM Parameter Store into anoth
|
|
691
691
|
#### Generating random passwords
|
692
692
|
|
693
693
|
In the multi-tenant example above, we may want to generate a secure random password for each tenant.
|
694
|
-
In the source file or registry, set the value to `$random`, this will ensure that during the `import`
|
694
|
+
In the source file or registry, set the value to `$random`, this will ensure that during the `import`
|
695
695
|
that the destination will receive a secure random value.
|
696
696
|
|
697
697
|
By default the length of the randomized value is 32 bytes, use `--random_size` to adjust the length of
|
@@ -62,11 +62,10 @@ module SecretConfig
|
|
62
62
|
|
63
63
|
value = convert_encoding(encoding, value) if encoding
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
65
|
+
return convert_type(type, value) unless separator
|
66
|
+
return value if value.is_a?(Array)
|
67
|
+
|
68
|
+
value.to_s.split(separator).collect { |element| convert_type(type, element.strip) }
|
70
69
|
end
|
71
70
|
|
72
71
|
# Set the value for a key in the centralized configuration store.
|
data/test/registry_test.rb
CHANGED
@@ -139,6 +139,11 @@ class RegistryTest < Minitest::Test
|
|
139
139
|
value = registry.fetch("mysql/ports2", type: :integer, separator: ",")
|
140
140
|
assert_equal([12345, 5343, 26815], value)
|
141
141
|
end
|
142
|
+
|
143
|
+
it "accepts a default without requiring conversion" do
|
144
|
+
value = registry.fetch("mysql/ports5", type: :integer, separator: ",", default: [23, 45, 72])
|
145
|
+
assert_equal([23, 45, 72], value)
|
146
|
+
end
|
142
147
|
end
|
143
148
|
|
144
149
|
it "decodes Base 64" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: secret_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|