chamber 2.1.9 → 2.2.0
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 +2 -2
- data/lib/chamber/binary/runner.rb +3 -0
- data/lib/chamber/commands/secure.rb +24 -1
- data/lib/chamber/version.rb +1 -1
- data/spec/lib/chamber/commands/secure_spec.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7334c719ee050a35ca3e532d257c4484a9324e64
|
4
|
+
data.tar.gz: 616f43d8cdc2e1a8a24794e37b78823762641f87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c56177f3a87c753448d031273d78b81014ded32fa25d10af1d608c1884c1f327924555dc3b9246b9a4ea51eb2a8ab123546703cbb02daa6a6f821dff08ea709
|
7
|
+
data.tar.gz: af2ee3db0222320182667feb3f6a773b32b2c011a7d562070f8b87ae27c65345dbdafb34a7b60512d45237218dce53a8da57f6f45be7a453023e65e42fc0eb13
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Chamber [](https://travis-ci.org/thekompanee/chamber) [](https://codeclimate.com/github/thekompanee/chamber) [](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
|
-
|
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
|
-
|
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
|
data/lib/chamber/version.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
14
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: thor
|