secret_config 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcd736808cbbcc2366bd1e6f8ab87eedc17bbd45bae3492aa7f28b9d1c7be046
4
- data.tar.gz: bcea91adfdfe4e3b0f57d78c4954b07e61234870d746aafddd35448ee524d298
3
+ metadata.gz: f21043b5cb86e83686e3e3cdb920c39bdd21c6c8e8dcfbd2d1cc34f81aef8e8c
4
+ data.tar.gz: d932bca14ac864d3558e825ae226f227da60af5abe53f81dc601b05c2c51bfde
5
5
  SHA512:
6
- metadata.gz: 9c12a1b4709b92c0db325f209ac36ca244bf8ac7acf518ff165ebdbbcb2a84a658c25cdee931c13e86ebba033e16998c7acd96e53e6da6021c086c350a1277c2
7
- data.tar.gz: 87c131f25083a20a0850369704f36311d6ae6e25cc940ba76845a2fcc45cf758a00d513f8157c332defd402990eddd6fe65a3e22997b72e5693ccf147d21150a
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 --path production.yml
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 --path production.yml --key_id "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
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 --path production.yml --key_alias my_key_alias
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 --path production.yml
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` or `copy`
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
- if separator
66
- value.to_s.split(separator).collect { |element| convert_type(type, element.strip) }
67
- else
68
- convert_type(type, value)
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.
@@ -1,3 +1,3 @@
1
1
  module SecretConfig
2
- VERSION = "0.9.0".freeze
2
+ VERSION = "0.9.1".freeze
3
3
  end
@@ -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.0
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-05-28 00:00:00.000000000 Z
11
+ date: 2020-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby