zanzibar 0.1.18 → 0.1.19
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 +8 -8
- data/lib/zanzibar/actions/bundle.rb +2 -1
- data/lib/zanzibar/version.rb +1 -1
- data/spec/files/Zanzifile +4 -1
- data/spec/lib/zanzibar/actions/bundle_spec.rb +18 -6
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZWVlZGZlZDQ4ZmI4NWY1OTk1ZTcxNDQzYTE1MzYyYzFhZTY2NDY2Mw==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
NWUzYzYyMjExODhiNzIxMjc0NDI5ODA1NDkwNDdlNmVkNTY5NDYzMQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
MTFmZWE4MGIwMWRkNWMwYTYyOTNiZmYwOGU1ZjAwNWExYzJiMTNmYmEwNGYz
|
|
10
|
+
NmU4MDkwZjQ4ZjNhZDk2MTBlMGU3ZjJlMzA1N2E2MTRlMzUwYTY1ZmI0NGFl
|
|
11
|
+
MzhhZTY0ZjU2M2IxODk3MjFjYmNhYzkwZWQzZjY3YTUwMzI0MmE=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
YWY0ODJmYTBiMzg4NjRiMzc1MTgzMmVkMDVlZTQ5MGU0MGM1YWZkNzk4YThm
|
|
14
|
+
YTU2YTgxYTYwY2U1MGQ1ZjIzN2E1Y2Y3NTZjZjZmOTM0YjkxZjMzNzE4OWFk
|
|
15
|
+
NzliNDJlNWQ4NDY2ZTdhNjFlOTEzMjJlMTA1MmE3N2NhNjllMDQ=
|
|
@@ -92,9 +92,10 @@ module Zanzibar
|
|
|
92
92
|
|
|
93
93
|
downloaded_secrets = {}
|
|
94
94
|
remote_secrets.each do |key, secret|
|
|
95
|
+
full_path = secret.has_key?('prefix') ? File.join(@settings['secret_dir'], secret['prefix']) : @settings['secret_dir']
|
|
95
96
|
downloaded_secrets[key] = download_one_secret(secret['id'],
|
|
96
97
|
secret['label'],
|
|
97
|
-
|
|
98
|
+
full_path,
|
|
98
99
|
args,
|
|
99
100
|
secret['name'] || "#{secret['id']}_password")
|
|
100
101
|
|
data/lib/zanzibar/version.rb
CHANGED
data/spec/files/Zanzifile
CHANGED
|
@@ -24,9 +24,12 @@ describe Zanzibar::Cli do
|
|
|
24
24
|
FakeFS::FileSystem.clone files
|
|
25
25
|
|
|
26
26
|
stub_request(:any, 'https://www.zanzitest.net/webservices/sswebservice.asmx')
|
|
27
|
-
.to_return(body: AUTH_XML, status: 200).then
|
|
28
|
-
.to_return(body: SECRET_WITH_KEY_XML, status: 200).then
|
|
29
|
-
.to_return(body: PRIVATE_KEY_XML, status: 200)
|
|
27
|
+
.to_return({body: AUTH_XML, status: 200}).then
|
|
28
|
+
.to_return({body: SECRET_WITH_KEY_XML, status: 200}).then
|
|
29
|
+
.to_return({body: PRIVATE_KEY_XML, status: 200}).then
|
|
30
|
+
.to_return({body: AUTH_XML, status: 200}).then
|
|
31
|
+
.to_return({body: SECRET_WITH_KEY_XML, status: 200}).then
|
|
32
|
+
.to_return({body: PRIVATE_KEY_XML, status: 200})
|
|
30
33
|
|
|
31
34
|
Dir.chdir File.join(source_root, 'spec', 'files')
|
|
32
35
|
end
|
|
@@ -50,6 +53,12 @@ describe Zanzibar::Cli do
|
|
|
50
53
|
expect(FakeFS::FileTest.file? File.join('secrets', 'zanzi_key')).to be(true)
|
|
51
54
|
end
|
|
52
55
|
|
|
56
|
+
it 'should download a file to a prefix' do
|
|
57
|
+
expect(FakeFS::FileTest.file? File.join('secrets/ssh', 'zanzi_key')).to be(false)
|
|
58
|
+
expect { subject.bundle }.to output(/Finished downloading secrets/).to_stdout
|
|
59
|
+
expect(FakeFS::FileTest.file? File.join('secrets/ssh', 'zanzi_key')).to be(true)
|
|
60
|
+
end
|
|
61
|
+
|
|
53
62
|
it 'should create a .gitignore' do
|
|
54
63
|
expect(FakeFS::FileTest.file? File.join('secrets', '.gitignore')).to be(false)
|
|
55
64
|
expect { subject.bundle }.to output(/Finished downloading secrets/).to_stdout
|
|
@@ -64,7 +73,7 @@ describe Zanzibar::Cli do
|
|
|
64
73
|
|
|
65
74
|
it 'should not redownload files it already has' do
|
|
66
75
|
expect { subject.bundle }.to output(/Finished downloading secrets/).to_stdout
|
|
67
|
-
expect(WebMock).to have_requested(:post, 'https://www.zanzitest.net/webservices/sswebservice.asmx').times(
|
|
76
|
+
expect(WebMock).to have_requested(:post, 'https://www.zanzitest.net/webservices/sswebservice.asmx').times(6)
|
|
68
77
|
|
|
69
78
|
WebMock.reset!
|
|
70
79
|
|
|
@@ -74,16 +83,19 @@ describe Zanzibar::Cli do
|
|
|
74
83
|
|
|
75
84
|
it 'should redownload on update action' do
|
|
76
85
|
expect { subject.bundle }.to output(/Finished downloading secrets/).to_stdout
|
|
77
|
-
expect(WebMock).to have_requested(:post, 'https://www.zanzitest.net/webservices/sswebservice.asmx').times(
|
|
86
|
+
expect(WebMock).to have_requested(:post, 'https://www.zanzitest.net/webservices/sswebservice.asmx').times(6)
|
|
78
87
|
|
|
79
88
|
WebMock.reset!
|
|
80
89
|
stub_request(:any, 'https://www.zanzitest.net/webservices/sswebservice.asmx')
|
|
90
|
+
.to_return({body: AUTH_XML, status: 200}).then
|
|
91
|
+
.to_return({body: SECRET_WITH_KEY_XML, status: 200}).then
|
|
92
|
+
.to_return({body: PRIVATE_KEY_XML, status: 200}).then
|
|
81
93
|
.to_return(body: AUTH_XML, status: 200).then
|
|
82
94
|
.to_return(body: SECRET_WITH_KEY_XML, status: 200).then
|
|
83
95
|
.to_return(body: PRIVATE_KEY_XML, status: 200)
|
|
84
96
|
|
|
85
97
|
expect { subject.update }.to output(/Finished downloading secrets/).to_stdout
|
|
86
|
-
expect(WebMock).to have_requested(:post, 'https://www.zanzitest.net/webservices/sswebservice.asmx').times(
|
|
98
|
+
expect(WebMock).to have_requested(:post, 'https://www.zanzitest.net/webservices/sswebservice.asmx').times(6)
|
|
87
99
|
end
|
|
88
100
|
|
|
89
101
|
it 'should reject a malformed Zanzifile' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zanzibar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.19
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Davis-Cooke
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-06-
|
|
11
|
+
date: 2015-06-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|