sambot 0.1.112 → 0.1.113

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0de72fb94d33394f6a22bc622e7bb25bc006fad5
4
- data.tar.gz: 2b9c9c892cf49945ef7fe560c4b018df0a59ff45
3
+ metadata.gz: e27a0242225518e356de8ec660debdeed7ab5c07
4
+ data.tar.gz: 40c3677ed6d41aa92c5a4ffb902fd58246162e81
5
5
  SHA512:
6
- metadata.gz: 6752fc68229ee431c8c4d831d61ba300a2b35736f6c376457b344eb99c7f02b19fb8de1e7cc1d114c940148c77c0b212e3f0782077c2bd3e234e7f608cdea156
7
- data.tar.gz: 745daed4cc978fe0c7eccf6c6623f7d8a1357965534efefa4d6d8dd09abab5e5fd92a5bd56a6e354e3d98deba0ab29e664ea2d58b0b052b7415e688218bbac15
6
+ metadata.gz: f714c9358725f402933712fde9a05a8568502d752dac1f33f7915a6ba45e6e58c9110cfd119bd838d0bb305af93e99d4dc1065f76bf534328c3c0c4dee9fe030
7
+ data.tar.gz: a9cfbfcff2b7991a3a4f7aef821e9dc461ade7d9130ee000d3e1edf3998992979c8baa0970e695de26d1e39efb66a99b570d8006ec7527117465fa6d3c7bd346
@@ -20,9 +20,9 @@ module Sambot
20
20
 
21
21
  FORWARDS = {
22
22
  'chef.brighter.io': { ip: '127.0.0.13', port: 443, local_port: 9013 },
23
- 'teamcity.brighter.io': { ip: '127.0.0.14', port: 443, local_port: 9014 },
24
- 'splunk.brighter.io': { ip: '127.0.0.15', port: 443, local_port: 9015 },
25
- 'jenkins.brighter.io': { ip: '127.0.0.16', port: 443, local_port: 9016 },
23
+ 'teamcity.brighter.io': { ip: '127.0.0.14', port: 80, local_port: 9014 },
24
+ 'splunk.brighter.io': { ip: '127.0.0.15', port: 80, local_port: 9015 },
25
+ 'jenkins.brighter.io': { ip: '127.0.0.16', port: 80, local_port: 9016 },
26
26
  'vault.brighter.io': { ip: '127.0.0.1', port: 8200, local_port: 9017 }
27
27
  }
28
28
 
@@ -66,7 +66,7 @@ module Sambot
66
66
  end
67
67
 
68
68
  def setup_secrets_management(username, password)
69
- unless Vault.has_environment_variables?
69
+ unless Vault.has_environment_variables?(FORWARDS)
70
70
  UI.info("You have either not configured your workstation or you have not opened up a new shell to pick up the changes applied during configuration")
71
71
  end
72
72
  UI.debug "Authenticating with Hashicorp Vault in Rackspace DEV/QE"
@@ -21,7 +21,7 @@ module Sambot
21
21
  end
22
22
  end
23
23
 
24
- def self.setup_environment(forwards, target = '~/.bash_profile')
24
+ def self.setup_environment(forwards, target = File.expand_path('~/.bash_profile'))
25
25
  save_environment_variable('VAULT_SKIP_VERIFY', true, target)
26
26
  save_environment_variable('VAULT_ADDR', build_vault_address(forwards), target)
27
27
  end
@@ -30,7 +30,7 @@ module Sambot
30
30
  "https://vault.brighter.io:#{forwards[:'vault.brighter.io'][:local_port]}"
31
31
  end
32
32
 
33
- def self.save_environment_variable(key, value, target = '~/.bash_profile')
33
+ def self.save_environment_variable(key, value, target = File.expand_path('~/.bash_profile'))
34
34
  contents = File.read(target)
35
35
  contents = contents.gsub(/export #{key}=#{value}/, '') if has_environment_variable?(key, value, target)
36
36
  contents << "export #{key}=#{value.to_s}\n"
@@ -38,18 +38,18 @@ module Sambot
38
38
  ENV[key] = value.to_s
39
39
  end
40
40
 
41
- def self.has_environment_variables?(forwards, target = '~/.bash_profile')
41
+ def self.has_environment_variables?(forwards, target = File.expand_path('~/.bash_profile'))
42
42
  has_vault_skip_verify = has_environment_variable?('VAULT_SKIP_VERIFY', true, target)
43
43
  has_vault_addr = has_environment_variable?('VAULT_ADDR', build_vault_address(forwards), target)
44
44
  (has_vault_addr != nil) && (has_vault_skip_verify != nil)
45
45
  end
46
46
 
47
- def self.has_environment_variable?(key, value, target = '~/.bash_profile')
47
+ def self.has_environment_variable?(key, value, target = File.expand_path('~/.bash_profile'))
48
48
  contents = File.read(target)
49
49
  contents.match(/export #{key}=#{value}/)
50
50
  end
51
51
 
52
- def self.save_token(token, home_directory = '~')
52
+ def self.save_token(token, home_directory = File.expand_path('~'))
53
53
  File.write(File.expand_path(File.join(home_directory, '.vault-token')), token)
54
54
  end
55
55
 
@@ -50,7 +50,7 @@ module Sambot
50
50
 
51
51
  def self.update_environment_variables
52
52
  UI.debug('Updating your Vault environment variables')
53
- Vault.setup_environment
53
+ Vault.setup_environment(Session::FORWARDS)
54
54
  end
55
55
 
56
56
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sambot
4
- VERSION = '0.1.112'.freeze
4
+ VERSION = '0.1.113'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sambot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.112
4
+ version: 0.1.113
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Kouame