cf 5.3.1 → 5.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,8 +12,10 @@ module CFAdmin::ServiceBroker
12
12
  :desc => "Broker name"
13
13
  input :url,
14
14
  :desc => "Broker URL"
15
- input :token,
16
- :desc => "Broker token"
15
+ input :username,
16
+ :desc => "Broker basic authentication username"
17
+ input :password,
18
+ :desc => "Broker basic authentication password"
17
19
 
18
20
  def add_service_broker
19
21
  broker = client.service_broker
@@ -22,7 +24,9 @@ module CFAdmin::ServiceBroker
22
24
  finalize
23
25
  broker.broker_url = input[:url]
24
26
  finalize
25
- broker.token = input[:token]
27
+ broker.auth_username = input[:username]
28
+ finalize
29
+ broker.auth_password = input[:password]
26
30
  finalize
27
31
 
28
32
  with_progress("Adding service broker #{c(broker.name, :name)}") do
@@ -39,8 +43,12 @@ module CFAdmin::ServiceBroker
39
43
  ask("URL")
40
44
  end
41
45
 
42
- def ask_token
43
- ask("Token")
46
+ def ask_username
47
+ ask("Username")
48
+ end
49
+
50
+ def ask_password
51
+ ask("Password")
44
52
  end
45
53
  end
46
54
  end
@@ -15,8 +15,10 @@ module CFAdmin::ServiceBroker
15
15
  :desc => "New name"
16
16
  input :url,
17
17
  :desc => "New URL"
18
- input :token,
19
- :desc => "New token"
18
+ input :username,
19
+ :desc => "New basic authentication username"
20
+ input :password,
21
+ :desc => "New basic authentication password"
20
22
 
21
23
  def update_service_broker
22
24
  @broker = input[:broker]
@@ -27,7 +29,9 @@ module CFAdmin::ServiceBroker
27
29
  finalize
28
30
  @broker.broker_url = input[:url]
29
31
  finalize
30
- @broker.token = input[:token]
32
+ @broker.auth_username = input[:username]
33
+ finalize
34
+ @broker.auth_password = input[:password]
31
35
  finalize
32
36
 
33
37
  with_progress("Updating service broker #{old_name}") do
@@ -45,8 +49,12 @@ module CFAdmin::ServiceBroker
45
49
  ask("URL", :default => @broker.broker_url)
46
50
  end
47
51
 
48
- def ask_token
49
- ask("Token", :default => @broker.token)
52
+ def ask_username
53
+ ask("Username", :default => @broker.auth_username)
54
+ end
55
+
56
+ def ask_password
57
+ ask("Password", :default => @broker.auth_password)
50
58
  end
51
59
  end
52
60
  end
data/lib/cf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "5.3.1".freeze
2
+ VERSION = "5.4.0".freeze
3
3
  end
@@ -17,11 +17,12 @@ describe CFAdmin::ServiceBroker::Add do
17
17
  it "creates a service broker when arguments are provided on the command line" do
18
18
  service_broker.stub(:create!)
19
19
 
20
- cf %W[add-service-broker --name cf-mysql --url http://cf-mysql.cfapp.io --token cfmysqlsecret]
20
+ cf %W[add-service-broker --name cf-mysql --url http://cf-mysql.cfapp.io --username cfmysqlusername --password cfmysqlsecret]
21
21
 
22
22
  service_broker.name.should == 'cf-mysql'
23
23
  service_broker.broker_url.should == 'http://cf-mysql.cfapp.io'
24
- service_broker.token.should == 'cfmysqlsecret'
24
+ service_broker.auth_username.should == 'cfmysqlusername'
25
+ service_broker.auth_password.should == 'cfmysqlsecret'
25
26
 
26
27
  service_broker.should have_received(:create!)
27
28
  end
@@ -30,13 +31,15 @@ describe CFAdmin::ServiceBroker::Add do
30
31
  service_broker.stub(:create!)
31
32
 
32
33
  stub_ask("URL").and_return("http://example.com")
33
- stub_ask("Token").and_return("token")
34
+ stub_ask("Username").and_return("username")
35
+ stub_ask("Password").and_return("password")
34
36
 
35
37
  cf %W[add-service-broker cf-mysql]
36
38
 
37
39
  service_broker.name.should == 'cf-mysql'
38
40
  service_broker.broker_url.should == 'http://example.com'
39
- service_broker.token.should == 'token'
41
+ service_broker.auth_username.should == 'username'
42
+ service_broker.auth_password.should == 'password'
40
43
 
41
44
  service_broker.should have_received(:create!)
42
45
  end
@@ -46,13 +49,15 @@ describe CFAdmin::ServiceBroker::Add do
46
49
 
47
50
  stub_ask("Name").and_return("cf-mysql")
48
51
  stub_ask("URL").and_return("http://example.com")
49
- stub_ask("Token").and_return("token")
52
+ stub_ask("Username").and_return("username")
53
+ stub_ask("Password").and_return("password")
50
54
 
51
55
  cf %W[add-service-broker]
52
56
 
53
57
  service_broker.name.should == 'cf-mysql'
54
58
  service_broker.broker_url.should == 'http://example.com'
55
- service_broker.token.should == 'token'
59
+ service_broker.auth_username.should == 'username'
60
+ service_broker.auth_password.should == 'password'
56
61
 
57
62
  service_broker.should have_received(:create!)
58
63
  end
@@ -11,7 +11,8 @@ describe CFAdmin::ServiceBroker::Update do
11
11
  before do
12
12
  service_broker.name = 'formername'
13
13
  service_broker.broker_url = 'http://former.example.com'
14
- service_broker.token = 'formertoken'
14
+ service_broker.auth_username = 'formerusername'
15
+ service_broker.auth_password = 'formerpassword'
15
16
 
16
17
  CFAdmin::ServiceBroker::Update.client = client
17
18
  client.stub(:service_broker_by_name).with('formername').and_return(service_broker)
@@ -20,11 +21,12 @@ describe CFAdmin::ServiceBroker::Update do
20
21
  it "updates a service broker when arguments are provided on the command line" do
21
22
  service_broker.stub(:update!)
22
23
 
23
- cf %W[update-service-broker --broker formername --name cf-othersql --url http://other.cfapp.io --token secret2]
24
+ cf %W[update-service-broker --broker formername --name cf-othersql --url http://other.cfapp.io --username username --password secret2]
24
25
 
25
26
  service_broker.name.should == 'cf-othersql'
26
27
  service_broker.broker_url.should == 'http://other.cfapp.io'
27
- service_broker.token.should == 'secret2'
28
+ service_broker.auth_username.should == 'username'
29
+ service_broker.auth_password.should == 'secret2'
28
30
 
29
31
  service_broker.should have_received(:update!)
30
32
  end
@@ -34,13 +36,15 @@ describe CFAdmin::ServiceBroker::Update do
34
36
 
35
37
  stub_ask("Name", :default => 'formername').and_return("cf-othersql")
36
38
  stub_ask("URL", :default => 'http://former.example.com').and_return("http://other.example.com")
37
- stub_ask("Token", :default => 'formertoken').and_return("token2")
39
+ stub_ask("Username", :default => 'formerusername').and_return("username2")
40
+ stub_ask("Password", :default => 'formerpassword').and_return("password2")
38
41
 
39
42
  cf %W[update-service-broker formername]
40
43
 
41
44
  service_broker.name.should == 'cf-othersql'
42
45
  service_broker.broker_url.should == 'http://other.example.com'
43
- service_broker.token.should == 'token2'
46
+ service_broker.auth_username.should == 'username2'
47
+ service_broker.auth_password.should == 'password2'
44
48
 
45
49
  service_broker.should have_received(:update!)
46
50
  end
@@ -70,7 +70,8 @@ end
70
70
 
71
71
  describe "Service Brokers" do
72
72
  let(:broker_url) { 'http://broker.example.com/' }
73
- let(:broker_token) { 'opensesame' }
73
+ let(:auth_username) { 'me' }
74
+ let(:auth_password) { 'opensesame' }
74
75
  let(:last_request) { FakeCloudController.last_request }
75
76
 
76
77
  before do
@@ -121,7 +122,7 @@ http://127.0.0.1:8181:
121
122
  end
122
123
 
123
124
  it "allows an admin user to add a service broker" do
124
- BlueShell::Runner.run("env HOME=#{@homedir} #{cf_bin} add-service-broker --name my-custom-service --url #{broker_url} --token #{broker_token}") do |runner|
125
+ BlueShell::Runner.run("env HOME=#{@homedir} #{cf_bin} add-service-broker --name my-custom-service --url #{broker_url} --username #{auth_username} --password #{auth_password}") do |runner|
125
126
  expect(runner).to say "Adding service broker my-custom-service... OK"
126
127
  end
127
128
 
@@ -130,7 +131,8 @@ http://127.0.0.1:8181:
130
131
  expect(JSON.load(last_request.body)).to eq(
131
132
  'name' => 'my-custom-service',
132
133
  'broker_url' => broker_url,
133
- 'token' => broker_token
134
+ 'auth_username' => auth_username,
135
+ 'auth_password' => auth_password,
134
136
  )
135
137
  end
136
138
 
@@ -155,11 +157,17 @@ http://127.0.0.1:8181:
155
157
  end
156
158
 
157
159
  it "allows an admin user to update a service broker" do
158
- BlueShell::Runner.run("env HOME=#{@homedir} #{cf_bin} update-service-broker my-custom-service --name cf-othersql --url http://other.example.com/ --token othertoken") do |runner|
160
+ BlueShell::Runner.run("env HOME=#{@homedir} #{cf_bin} update-service-broker my-custom-service --name cf-othersql --url http://other.example.com/ --username newusername --password newpassword") do |runner|
159
161
  expect(runner).to say "Updating service broker my-custom-service... OK"
160
162
  end
161
163
 
162
164
  expect(last_request).to be_put
163
165
  expect(last_request.path).to eq('/v2/service_brokers/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa')
166
+ expect(JSON.load(last_request.body)).to eq(
167
+ 'name' => 'cf-othersql',
168
+ 'broker_url' => 'http://other.example.com/',
169
+ 'auth_username' => 'newusername',
170
+ 'auth_password' => 'newpassword',
171
+ )
164
172
  end
165
173
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.1
4
+ version: 5.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-09-23 00:00:00.000000000 Z
13
+ date: 2013-10-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 4.3.9
54
+ version: 4.5.1
55
55
  type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  requirements:
60
60
  - - ~>
61
61
  - !ruby/object:Gem::Version
62
- version: 4.3.9
62
+ version: 4.5.1
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: interact
65
65
  requirement: !ruby/object:Gem::Requirement
@@ -677,21 +677,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
677
677
  - - ! '>='
678
678
  - !ruby/object:Gem::Version
679
679
  version: '0'
680
- segments:
681
- - 0
682
- hash: -1979987157650123631
683
680
  required_rubygems_version: !ruby/object:Gem::Requirement
684
681
  none: false
685
682
  requirements:
686
683
  - - ! '>='
687
684
  - !ruby/object:Gem::Version
688
685
  version: '0'
689
- segments:
690
- - 0
691
- hash: -1979987157650123631
692
686
  requirements: []
693
687
  rubyforge_project: cf
694
- rubygems_version: 1.8.25
688
+ rubygems_version: 1.8.23
695
689
  signing_key:
696
690
  specification_version: 3
697
691
  summary: Friendly command-line interface for Cloud Foundry.