cf-uaac 1.3.8 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/lib/cli/common.rb +7 -2
- data/lib/cli/version.rb +1 -1
- data/spec/group_spec.rb +0 -2
- data/spec/setup_helper.rb +1 -1
- metadata +5 -4
data/lib/cli/common.rb
CHANGED
@@ -83,9 +83,12 @@ class CommonCli < Topic
|
|
83
83
|
def scim_common_list(type, filter)
|
84
84
|
pp scim_request { |sr|
|
85
85
|
query = { attributes: opts[:attrs], filter: filter }
|
86
|
-
opts[:start] || opts[:count] ?
|
86
|
+
info = opts[:start] || opts[:count] ?
|
87
87
|
sr.query(type, query.merge!(startIndex: opts[:start], count: opts[:count])):
|
88
88
|
sr.all_pages(type, query)
|
89
|
+
nattr = sr.name_attr(type).downcase
|
90
|
+
info.is_a?(Array) && info.length > 0 && info[0][nattr] ?
|
91
|
+
info.each_with_object({}) { |v, h| h[v.delete(nattr)] = v } : info
|
89
92
|
}
|
90
93
|
end
|
91
94
|
|
@@ -94,7 +97,9 @@ class CommonCli < Topic
|
|
94
97
|
info = scim.all_pages(type, query)
|
95
98
|
raise BadResponse unless info.is_a?(Array) && info.length < 2
|
96
99
|
raise NotFound if info.length == 0
|
97
|
-
info[0]
|
100
|
+
info = info[0]
|
101
|
+
# when getting whole object, handle case of UAA < 1.3 which did not return meta attr from query
|
102
|
+
attrs || !info["id"] || info["meta"]? info : scim.get(type, info["id"])
|
98
103
|
end
|
99
104
|
end
|
100
105
|
|
data/lib/cli/version.rb
CHANGED
data/spec/group_spec.rb
CHANGED
@@ -54,7 +54,6 @@ describe GroupCli do
|
|
54
54
|
Cli.output.string.should include @test_group
|
55
55
|
Cli.run("group get #{@test_group.upcase}").should be
|
56
56
|
Cli.output.string.should include @test_group
|
57
|
-
pending "real uaa can't add members to scim.read group yet" unless @stub_uaa
|
58
57
|
Cli.run("member add scim.read #{@test_user}w").should be
|
59
58
|
end
|
60
59
|
|
@@ -109,7 +108,6 @@ describe GroupCli do
|
|
109
108
|
|
110
109
|
it "adds one writer to the group" do
|
111
110
|
Cli.run("group writer add #{@test_group} #{@test_user}w").should be
|
112
|
-
Cli.run("group reader add #{@test_group} #{@test_user}w").should be
|
113
111
|
Cli.output.string.should include "success"
|
114
112
|
end
|
115
113
|
|
data/spec/setup_helper.rb
CHANGED
@@ -18,7 +18,7 @@ require 'cli'
|
|
18
18
|
|
19
19
|
client = ENV["UAA_CLIENT_ID"] || "admin"
|
20
20
|
secret = ENV["UAA_CLIENT_SECRET"] || "adminsecret"
|
21
|
-
|
21
|
+
target = ENV["UAA_CLIENT_TARGET"] || "http://localhost:8080/uaa"
|
22
22
|
|
23
23
|
[
|
24
24
|
"target #{target}",
|
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: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2013-
|
16
|
+
date: 2013-02-12 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: bundler
|
@@ -234,6 +234,7 @@ extensions: []
|
|
234
234
|
extra_rdoc_files: []
|
235
235
|
files:
|
236
236
|
- .gitignore
|
237
|
+
- .travis.yml
|
237
238
|
- .yardopts
|
238
239
|
- Gemfile
|
239
240
|
- LICENSE.TXT
|
@@ -283,7 +284,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
283
284
|
version: '0'
|
284
285
|
segments:
|
285
286
|
- 0
|
286
|
-
hash:
|
287
|
+
hash: -1864592994044069234
|
287
288
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
288
289
|
none: false
|
289
290
|
requirements:
|
@@ -292,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
293
|
version: '0'
|
293
294
|
segments:
|
294
295
|
- 0
|
295
|
-
hash:
|
296
|
+
hash: -1864592994044069234
|
296
297
|
requirements: []
|
297
298
|
rubyforge_project: cf-uaac
|
298
299
|
rubygems_version: 1.8.23
|