Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump addressable from 2.5.1 to 2.8.1 #284

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ GIT
virtus

GEM
remote: https://rubygems.org/
remote: https://gems.contribsys.com/
specs:
sidekiq-pro (3.4.0)
sidekiq (>= 4.1.5)

GEM
remote: https://rubygems.org/
specs:
HDRHistogram (0.1.3)
activemodel (4.2.10)
Expand All @@ -91,8 +96,8 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
amq-protocol (2.3.0)
arel (6.0.4)
atomic (1.1.99)
Expand Down Expand Up @@ -157,7 +162,7 @@ GEM
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (2.0.5)
public_suffix (5.0.0)
rack (2.2.3)
rack-protection (2.0.1)
rack
Expand Down Expand Up @@ -189,8 +194,6 @@ GEM
connection_pool (~> 2.2, >= 2.2.0)
rack-protection (>= 1.5.0)
redis (~> 3.2, >= 3.2.1)
sidekiq-pro (3.4.0)
sidekiq (>= 4.1.5)
thread_safe (0.3.6)
travis-config (1.1.3)
hashr (~> 2.0)
Expand Down
6 changes: 6 additions & 0 deletions lib/travis/scheduler/serialize/worker/config/decrypt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ def apply
config[key] = process_env(config[key]) if config[key]
end

force_vault_to_be_secure!(config)
config[:vault] = decryptor.decrypt(config[:vault]) if config[:vault]
config[:addons] = decryptor.decrypt(config[:addons]) if config[:addons]
config
end

private

def force_vault_to_be_secure!(config)
config[:vault].delete(:token) if config.dig(:vault, :token).is_a?(String)
end

def secure_env?
!!options[:secure_env]
end
Expand Down
10 changes: 10 additions & 0 deletions spec/travis/scheduler/serialize/worker/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ def encrypt(string)
let(:env) { [{ FOO: 'foo', BAR: 'bar' }, encrypt('BAZ=baz')] }
it { should eql env: ['FOO=foo', 'BAR=bar', 'SECURE BAZ=baz'], global_env: ['FOO=foo', 'BAR=bar', 'SECURE BAZ=baz'] }
end

describe 'decrypts vault secure token' do
let(:config) { { vault: { token: { secure: encrypt('my_key') } } } }
it { should eql vault: {token: 'my_key'} }
end

describe 'clears vault unsecure token' do
let(:config) { { vault: { token: 'my_key' } } }
it { should eql vault: {} }
end
end

describe 'with secure env disabled' do
Expand Down