cf-uaac 3.11.0 → 3.12.0

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: d82226a5579050e9e9fff98de302c291a96a7b05
4
- data.tar.gz: f868e74326c0140a5586257d184a95c27362974f
3
+ metadata.gz: abfe6eadf0fa01ba99d89a0eea473cbd0104338f
4
+ data.tar.gz: f2b20a9a55eff6d475e47521bfba5a0fa95ce85e
5
5
  SHA512:
6
- metadata.gz: a57c42af2d72f2b817c9ebeee3c2f5697c419e777596508dced216b6f4d9d90b1c3e91992e49ed789f4f612c14d45f2f565e8f43b1474269b219fb2bcfa7cc68
7
- data.tar.gz: 9cb180a3232a919f83d3e6bec490023b91062b9ec560cb789bfc6cce1cf982048952327390c7961dae14af4865f60514a349fb5ad26db4dc85a2d5f6122e64ff
6
+ metadata.gz: bd5e414a3b9d0339b945ee71133146329d398c3b3a66b0793bd32a47df4b02a51d44544705dd1109b20d0c622d8bd52068266a7c865614367aee84bb9c8eb783
7
+ data.tar.gz: 52d00507c138a3e95de5b1234d12d9e2ab1968a8a4d67c49d3e9d03a088725cd896ceda7c8faecba9957a1296fa99c5ad3fa5a2499f1f245a5ee691ea8041214
@@ -111,7 +111,6 @@ class CommonCli < Topic
111
111
  raise NotFound if info.length == 0
112
112
  if info.length >= 2
113
113
  info.each_with_index do |i, idx|
114
- puts "#{idx+1}: #{i['username']} from #{i['origin']}"
115
114
  end
116
115
 
117
116
  choice = @highline.ask("Select user: ").to_i
@@ -49,7 +49,7 @@ class UserCli < CommonCli
49
49
  end
50
50
 
51
51
  desc 'user add [name]', 'Add a user account', *USER_INFO_OPTS, :password do |name|
52
- info = {userName: username(name), password: verified_pwd('Password', opts[:password])}
52
+ info = {userName: username(name), password: ((opts[:origin] == nil || opts[:origin] =='uaa') ? verified_pwd('Password', opts[:password]): nil)}
53
53
  pp scim_request { |ua|
54
54
  ua.add(:user, user_opts(info))
55
55
  'user account successfully added'
@@ -14,6 +14,6 @@
14
14
  # Cloud Foundry namespace
15
15
  module CF
16
16
  module UAA
17
- CLI_VERSION = '3.11.0'
17
+ CLI_VERSION = '3.12.0'
18
18
  end
19
19
  end
@@ -52,6 +52,40 @@ describe UserCli do
52
52
  Cli.run("user delete #{user_with_origin}")
53
53
  end
54
54
 
55
+ it 'creates user without asking for password when origin is not uaa' do
56
+ user_with_origin = "#{@test_user}_with_origin_ldap"
57
+ Cli.run("user add #{user_with_origin} " +
58
+ '--emails sam@example.com --given_name SamueL ' +
59
+ "--phones 801-555-1212 --family_name jonES --origin ldap").should be
60
+
61
+ expect(Cli.output.string).to match 'user account successfully added'
62
+
63
+ Cli.run("user delete #{user_with_origin} --origin ldap")
64
+ expect(Cli.output.string).to match 'user account successfully deleted'
65
+ end
66
+
67
+ it 'create user prompts for password when origin is set to uaa explicitly' do
68
+ user_with_origin = "#{@test_user}_with_origin_ldap"
69
+ Cli.input = StringIO.new("password") # selecting first origin through stdin
70
+ Cli.run("user add #{user_with_origin} " +
71
+ '--emails sam@example.com --given_name SamueL ' +
72
+ "--phones 801-555-1212 --family_name jonES --origin uaa").should be
73
+
74
+ expect(Cli.output.string).to match 'Password:'
75
+ Cli.run("user delete #{user_with_origin}")
76
+ end
77
+
78
+ it 'create user prompts for password when origin is uaa implicitly' do
79
+ user_with_origin = "#{@test_user}_with_origin_ldap"
80
+ Cli.input = StringIO.new("password") # selecting first origin through stdin
81
+ Cli.run("user add #{user_with_origin} " +
82
+ '--emails sam@example.com --given_name SamueL ' +
83
+ "--phones 801-555-1212 --family_name jonES").should be
84
+
85
+ expect(Cli.output.string).to match 'Password:'
86
+ Cli.run("user delete #{user_with_origin}")
87
+ end
88
+
55
89
  it 'updates origin when specified' do
56
90
  user_with_origin = "#{@test_user}_with_origin"
57
91
  create_user_by_origin( user_with_origin, 'ldap')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf-uaac
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.0
4
+ version: 3.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Syer
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-05-08 00:00:00.000000000 Z
15
+ date: 2017-05-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: cf-uaa-lib