Skip to content

Commit

Permalink
Check for user and password also in DAV blobstores
Browse files Browse the repository at this point in the history
[#88572736]

Signed-off-by: Krum Tsvetkov <krum.tsvetkov@sap.com>
  • Loading branch information
voelzmo committed May 20, 2015
1 parent 4a1f662 commit 5a1a8df
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions bosh_cli/lib/cli/release.rb
Expand Up @@ -73,6 +73,7 @@ def has_blobstore_secret?
has_legacy_secret? ||
has_blobstore_secrets?(bs, "atmos", "secret") ||
has_blobstore_secrets?(bs, "simple", "user", "password") ||
has_blobstore_secrets?(bs, "dav", "user", "password") ||
has_blobstore_secrets?(bs, "swift", "rackspace") ||
has_blobstore_secrets?(bs, "swift", "hp") ||
has_blobstore_secrets?(bs, "swift", "openstack") ||
Expand Down
5 changes: 5 additions & 0 deletions bosh_cli/spec/assets/config/dav/config/final.yml
@@ -0,0 +1,5 @@
---
blobstore:
provider: dav
options:
endpoint: http://bosh-blobstore.some.url.com:8080
6 changes: 6 additions & 0 deletions bosh_cli/spec/assets/config/dav/config/private.yml
@@ -0,0 +1,6 @@
---
blobstore:
dav:
endpoint: http://bosh-blobstore.some.url.com:8080
user: dav-user
password: dav-password
17 changes: 17 additions & 0 deletions bosh_cli/spec/unit/release_spec.rb
Expand Up @@ -260,6 +260,23 @@ def new_release(dir)
expect(r.has_blobstore_secret?).to eq(true)
end

it "should merge DAV secrets into options" do
r = Bosh::Cli::Release.new(spec_asset("config/dav"))
opts = {
:endpoint => 'http://bosh-blobstore.some.url.com:8080',
:user => 'dav-user',
:password => 'dav-password'
}
expect(Bosh::Blobstore::Client).to receive(:safe_create).with("dav", opts)
r.blobstore
end

it "should detect blobstore secrets for DAV options" do
r = Bosh::Cli::Release.new(spec_asset("config/dav"))
expect(r.has_blobstore_secret?).to eq(true)
end


it 'should not use credentials for a local blobstore' do
r = Bosh::Cli::Release.new(spec_asset("config/local"))
expect(r.has_blobstore_secret?).to eq(true)
Expand Down

0 comments on commit 5a1a8df

Please sign in to comment.