secrets_cli 1.5.0 → 1.6.0

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
  SHA1:
3
- metadata.gz: 6a28e0d71ca45373fa0a1667d509e93ae1fe5f36
4
- data.tar.gz: ccd74acf58bdcbba8d6b2330f7b4531525d77c16
3
+ metadata.gz: 8864c1b4454dfc4f453aef217c0709be35697347
4
+ data.tar.gz: 52dac7597cd7ee33afc8ea6b8f5676cd48f7e2b9
5
5
  SHA512:
6
- metadata.gz: f895967d3effcc83abe727e55e7a9762337e5cac4e8e60df845655bf27929d3c9a397e38414da52030668a16462d7fc9deae13e9bf85d71a5f9bf5b5f690b5bd
7
- data.tar.gz: df28301cf3dc402026b2bf89fe4344093c48124637f2c18d0514dc298d6d0ffa9871403364fee148926b18a19003355fe632a9583afad3fd3d082fddd971f04e
6
+ metadata.gz: 2e16b34330c0f5bd1baff5672536d91a300fab81fb1cb2dba66d5247de5c16a7090bca9156d4f05838d718998116ef9cebb93712b4fc92d3adb9bdb8e6eeed18
7
+ data.tar.gz: 9f8bc89e94bb21bebc35cba307b4383d38a779cb9cf85769b8e3572b765c48cbadfd321d47441ed393d805764a0c6991e4071ef593044f9a523c15e4c21640fd
data/README.md CHANGED
@@ -76,13 +76,21 @@ Environment is `development` by default, but it can be overwriten by passing `--
76
76
 
77
77
  $ secrets read
78
78
 
79
- This will only read from vault.
79
+ This will read development secrets from the vault.
80
+
81
+ To read secrets from a different environment, use the `-e` flag:
82
+
83
+ $ secrets read -e production
80
84
 
81
85
  ### Pull
82
86
 
83
87
  $ secrets pull
84
88
 
85
- This will pull from vault and write to your secrets file.
89
+ This will pull from vault and write to your secrets file. The deafult file it will pull is the development one.
90
+
91
+ To pull from a different environment, also supply the `-e` flag and the `-f` flag for the file path:
92
+
93
+ $ secrets pull -e production -f config/application.production.yml
86
94
 
87
95
  ### Push
88
96
 
@@ -90,6 +98,10 @@ This will pull from vault and write to your secrets file.
90
98
 
91
99
  This will push from your secrets file to vault.
92
100
 
101
+ The same flags apply for pushing as for pulling:
102
+
103
+ $ secrets push -e production -f config/application.production.yml
104
+
93
105
  ## Development
94
106
 
95
107
  After checking out the storage_key, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -98,7 +110,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
98
110
 
99
111
  ## Contributing
100
112
 
101
- Bug storage_keyrts and pull requests are welcome on GitHub at https://github.com/infinum/secrets_cli. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
113
+ Bug reports and pull requests are welcome on GitHub at https://github.com/infinum/secrets_cli. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
102
114
 
103
115
 
104
116
  ## License
@@ -29,7 +29,12 @@ module SecretsCli
29
29
 
30
30
  def write(secrets)
31
31
  print_verbose("Writing to #{secrets_file}")
32
- File.open(File.join(secrets_dir, secrets_file), 'w') { |file| file.write(secrets) }
32
+ File.open(secrets_path, 'w') { |file| file.write(secrets) }
33
+ File.chmod(0600, secrets_path)
34
+ end
35
+
36
+ def secrets_path
37
+ @secrets_path ||= File.join(secrets_dir, secrets_file)
33
38
  end
34
39
  end
35
40
  end
@@ -1,3 +1,3 @@
1
1
  module SecretsCli
2
- VERSION = '1.5.0'
2
+ VERSION = '1.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secrets_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stjepan Hadjic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-11 00:00:00.000000000 Z
11
+ date: 2017-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler