chamber 2.1.9 → 2.2.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: a1235ef5ed5b461a0f8244cdd1318f9c5f067103
4
- data.tar.gz: beae0e7eac1f3f3a5307a7ac9f74c3417ee04bc6
3
+ metadata.gz: 7334c719ee050a35ca3e532d257c4484a9324e64
4
+ data.tar.gz: 616f43d8cdc2e1a8a24794e37b78823762641f87
5
5
  SHA512:
6
- metadata.gz: 3f60d8418604706455a43aeff200f73806d62a47c19c70e2e1e406497202a55364fd4968e213570321fba054b033c6d330d28b0cd078ebfd772c59ee56e2ab4d
7
- data.tar.gz: 91e7e19085a6f96961fdc6a1ad020a4378c4f2ff179eee6492b7ca33f7c061c879af4f99249aa13aed0e3e32115a9d2c94e0de89ebceccdbf8d3e6deb8af0127
6
+ metadata.gz: 6c56177f3a87c753448d031273d78b81014ded32fa25d10af1d608c1884c1f327924555dc3b9246b9a4ea51eb2a8ab123546703cbb02daa6a6f821dff08ea709
7
+ data.tar.gz: af2ee3db0222320182667feb3f6a773b32b2c011a7d562070f8b87ae27c65345dbdafb34a7b60512d45237218dce53a8da57f6f45be7a453023e65e42fc0eb13
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Chamber [![Build Status](https://travis-ci.org/m5rk/chamber.png)](https://travis-ci.org/m5rk/chamber) [![Code Climate](https://codeclimate.com/github/m5rk/chamber.png)](https://codeclimate.com/github/m5rk/chamber)
1
+ # Chamber [![Build Status](https://travis-ci.org/thekompanee/chamber.png)](https://travis-ci.org/thekompanee/chamber) [![Code Climate](https://codeclimate.com/github/thekompanee/chamber.png)](https://codeclimate.com/github/thekompanee/chamber) [![Code Climate](https://codeclimate.com/github/thekompanee/chamber/coverage.png)](https://codeclimate.com/github/thekompanee/chamber)
2
2
 
3
3
  Chamber is the auto-encrypting, extremely organizable, Heroku-loving, CLI-having,
4
4
  non-extra-repo-needing, non-Rails-specific-ing, CI-serving configuration
@@ -20,7 +20,7 @@ we (and assumed others) needed.
20
20
  settings must be stored in environment variables
21
21
  1. Thou shalt seemlessly work with Travis CI and other cloud CI platforms
22
22
  1. Thou shalt not force users to use arcane
23
- really_long_variable_names_just_to_keep_their_settings_organized
23
+ long_variable_names_just_to_keep_their_settings_organized
24
24
  1. Thou shalt not require users keep a separate repo or cloud share sync just to
25
25
  keep their secure settings updated
26
26
  1. Thou shalt not be bound to a single framework like Rails (it should be usable in
@@ -83,6 +83,9 @@ class Runner < Thor
83
83
  end
84
84
 
85
85
  desc 'secure', 'Secures any values which appear to need to be encrypted in any of the settings files which match irrespective of namespaces'
86
+ method_option :only_sensitive,
87
+ type: :boolean,
88
+ default: true
86
89
  def secure
87
90
  Commands::Secure.call(options)
88
91
  end
@@ -3,13 +3,36 @@ require 'chamber/commands/base'
3
3
  module Chamber
4
4
  module Commands
5
5
  class Secure < Chamber::Commands::Base
6
+ include Chamber::Commands::Securable
6
7
 
7
8
  def initialize(options = {})
8
9
  super(options.merge(namespaces: ['*']))
9
10
  end
10
11
 
11
12
  def call
12
- chamber.secure
13
+ disable_warnings do
14
+ securable_environment_variables.each do |key, value|
15
+ next if value.match %r{\A[A-Za-z0-9\+\/]{342}==\z}
16
+
17
+ if dry_run
18
+ shell.say_status 'encrypt', key, :blue
19
+ else
20
+ shell.say_status 'encrypt', key, :green
21
+ end
22
+ end
23
+ end
24
+
25
+ chamber.secure unless dry_run
26
+ end
27
+
28
+ private
29
+
30
+ def disable_warnings
31
+ $stderr = ::File.open('/dev/null', 'w')
32
+
33
+ yield
34
+
35
+ $stderr = STDERR
13
36
  end
14
37
  end
15
38
  end
@@ -1,3 +1,3 @@
1
1
  module Chamber
2
- VERSION = '2.1.9'
2
+ VERSION = '2.2.0'
3
3
  end
@@ -9,7 +9,8 @@ describe Secure do
9
9
  let(:settings_filename) { rootpath + 'settings' + 'unencrypted.yml' }
10
10
  let(:options) { { basepath: rootpath,
11
11
  rootpath: rootpath,
12
- encryption_key: rootpath + '../spec_key'} }
12
+ encryption_key: rootpath + '../spec_key',
13
+ shell: double.as_null_object } }
13
14
 
14
15
  it 'can return values formatted as environment variables' do
15
16
  ::FileUtils.mkdir_p rootpath + 'settings' unless ::File.exist? rootpath + 'settings'
@@ -20,7 +21,7 @@ test:
20
21
  HEREDOC
21
22
  end
22
23
 
23
- files = Secure.call(options)
24
+ Secure.call(options)
24
25
 
25
26
  expect(::File.read(settings_filename)).to match %r{_secure_my_unencrpyted_setting: [A-Za-z0-9\+\/]{342}==}
26
27
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chamber
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stevenhallen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-04-05 00:00:00.000000000 Z
14
+ date: 2014-04-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor