sambot 0.1.223 → 0.1.225
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/integration_tests/.byebug_history +3 -0
- data/integration_tests/.config.yml +31 -0
- data/integration_tests/vault_helper_spec.rb +14 -0
- data/lib/sambot/testing/vault_helper.rb +17 -2
- data/lib/sambot/version.rb +1 -1
- data/sambot.gemspec +1 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 181b34f8dc667713236f6eb5b977d4867b03dcb5
|
4
|
+
data.tar.gz: 73117bd92de7f49725971cb1a1a71671f48852dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb5c17af4f26acf78f6409965e524ae0959cedc09b5c96d5c8f23e8770cea813f0f91446895fb8286a7be195fc29b13c05b77046a9733fd3bdfea3f0290cfb4a
|
7
|
+
data.tar.gz: 07f4af7a8f0bf13babb5293c4220543c0689490fe876871e414b9568c10ccac24d89a458af0e82e7ff7a1f5bc2f13009849c21911de175599c288dc26f921ede
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: as-ldap-server
|
2
|
+
version: 0.0.7
|
3
|
+
platforms:
|
4
|
+
- centos
|
5
|
+
identifier:
|
6
|
+
description: Installs the 389-ds directory server
|
7
|
+
dependencies:
|
8
|
+
- as-vault-token-v2
|
9
|
+
suites:
|
10
|
+
- name: default
|
11
|
+
run_list:
|
12
|
+
- recipe[as-ldap-server::default]
|
13
|
+
verifier:
|
14
|
+
inspec_tests:
|
15
|
+
- name: as-ldap-server-profile
|
16
|
+
path: controls
|
17
|
+
local_testing:
|
18
|
+
secrets:
|
19
|
+
- description: LDAP root password hash
|
20
|
+
path: dev/nightswatch/ldap/root_dn_pwd
|
21
|
+
keys:
|
22
|
+
- ssha: '{SSHA}QkYU9g2DCC8CuavASnoEQ+9i8LuePRs='
|
23
|
+
- description: GCS backup credentials
|
24
|
+
path: dev/nightswatch/gcs/backupcreds
|
25
|
+
keys:
|
26
|
+
- access_key: GOOG5AA6QCCSQ2TNKOUA
|
27
|
+
- secret_key: oKVkpPerVeMDxfj/OOYkuHXgj/tIbfejCRlPkdFF
|
28
|
+
- description: GCS backup encryption key
|
29
|
+
path: dev/nightswatch/gcs/backup_encryption_key
|
30
|
+
keys:
|
31
|
+
- value: Fj9zCPAJw9t125O
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'spec_helper'
|
4
|
+
require 'awesome_print'
|
5
|
+
require 'byebug'
|
4
6
|
|
5
7
|
VaultHelper = Sambot::Testing::VaultHelper
|
6
8
|
Fixtures = Sambot::Testing::Fixtures
|
@@ -31,6 +33,18 @@ RSpec.describe Sambot::Testing::VaultHelper do
|
|
31
33
|
|
32
34
|
end
|
33
35
|
|
36
|
+
context '.load_secrets()' do
|
37
|
+
|
38
|
+
it 'can save multiple keys' do
|
39
|
+
config = Sambot::Config.read
|
40
|
+
VaultHelper.load_secrets(config)
|
41
|
+
secret = VaultHelper.read_path('dev/nightswatch/gcs/backupcreds')
|
42
|
+
expect(secret.data[:access_key]).to_not be nil
|
43
|
+
expect(secret.data[:secret_key]).to_not be nil
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
34
48
|
context '.generate_wrapped_token()' do
|
35
49
|
|
36
50
|
it 'generates the correct token' do
|
@@ -64,6 +64,16 @@ module Sambot
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
def read_path(path)
|
68
|
+
configure
|
69
|
+
Vault.logical.read(path)
|
70
|
+
end
|
71
|
+
|
72
|
+
def read_field(path, key)
|
73
|
+
configure
|
74
|
+
Vault.logical.read(path, key)
|
75
|
+
end
|
76
|
+
|
67
77
|
private
|
68
78
|
|
69
79
|
def store_secrets(secrets, src)
|
@@ -88,8 +98,13 @@ module Sambot
|
|
88
98
|
end
|
89
99
|
|
90
100
|
def write_to_vault(path, key, value)
|
91
|
-
|
92
|
-
|
101
|
+
existing_secret = Vault.logical.read(path)
|
102
|
+
new_value = {key.to_sym => value}
|
103
|
+
if existing_secret
|
104
|
+
UI.info("Adding the key '#{key}' to the existing path '#{path}'")
|
105
|
+
new_value = new_value.merge(existing_secret.data)
|
106
|
+
end
|
107
|
+
Vault.logical.write(path, new_value)
|
93
108
|
end
|
94
109
|
|
95
110
|
end
|
data/lib/sambot/version.rb
CHANGED
data/sambot.gemspec
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_dependency 'teamcity-ruby-client'
|
31
31
|
spec.add_dependency 'open4'
|
32
32
|
spec.add_dependency 'diplomat'
|
33
|
+
spec.add_dependency 'byebug'
|
33
34
|
spec.add_dependency 'semantic'
|
34
35
|
spec.add_dependency 'chef', '~> 12.18'
|
35
36
|
spec.add_dependency 'thor', '~> 0.19'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sambot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.225
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier Kouame
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor-hollaback
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: byebug
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: semantic
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -391,6 +405,8 @@ files:
|
|
391
405
|
- README.md
|
392
406
|
- bin/sambot
|
393
407
|
- bin/setup
|
408
|
+
- integration_tests/.byebug_history
|
409
|
+
- integration_tests/.config.yml
|
394
410
|
- integration_tests/docker-compose.yml
|
395
411
|
- integration_tests/spec_helper.rb
|
396
412
|
- integration_tests/vault_helper_spec.rb
|