cf-uaac 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uaa/cli/common.rb +11 -9
- data/lib/uaa/cli/config.rb +7 -2
- data/lib/uaa/cli/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6736dcdfab81463608c3dede16c118c2ed06cc83
|
4
|
+
data.tar.gz: 424c951819105b0e41d422f81dec1ba75fd791e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b8f1aa2f4a4820cc844577a1bdac71ec80dabdf073aab63638a04b8138b1ce5492ff9c3f9927e30f00039eb05d4231170a9b627fada8ccb008eed29a5405ff9
|
7
|
+
data.tar.gz: bb291dfc11b15a31c98aa3510b76653c4cde56c2ab04b8cb2da462a3799c663722aa86cf805fe17f142cfdde53523094792b2ef8de1bcc6842ee8cbbb3d766ad
|
data/lib/uaa/cli/common.rb
CHANGED
@@ -88,11 +88,10 @@ class CommonCli < Topic
|
|
88
88
|
def scim_common_list(type, filter)
|
89
89
|
pp scim_request { |sr|
|
90
90
|
query = { attributes: opts[:attrs], filter: filter }
|
91
|
-
info =
|
92
|
-
|
93
|
-
info = sr.query(type, query.merge!(startIndex: opts[:start], count: opts[:count]))
|
91
|
+
info = if type == :user
|
92
|
+
sr.query(type, query.merge!(startIndex: opts[:start], count: opts[:count]))
|
94
93
|
else
|
95
|
-
|
94
|
+
opts[:start] || opts[:count] ?
|
96
95
|
sr.query(type, query.merge!(startIndex: opts[:start], count: opts[:count])):
|
97
96
|
sr.all_pages(type, query)
|
98
97
|
end
|
@@ -109,21 +108,24 @@ class CommonCli < Topic
|
|
109
108
|
info = scim.all_pages(type, query)
|
110
109
|
raise BadResponse unless info.is_a?(Array)
|
111
110
|
raise NotFound if info.length == 0
|
112
|
-
if info.length >= 2
|
111
|
+
chosen_info = if info.length >= 2
|
112
|
+
say 'Select an origin:'
|
113
113
|
info.each_with_index do |i, idx|
|
114
|
+
say "#{idx + 1}. #{i['origin']}"
|
114
115
|
end
|
115
116
|
|
116
117
|
choice = @highline.ask("Select user: ").to_i
|
117
118
|
if choice > info.length || choice <= 0
|
118
|
-
raise ArgumentError
|
119
|
+
raise ArgumentError.new('bad input')
|
119
120
|
end
|
120
|
-
info
|
121
|
+
info[choice - 1]
|
121
122
|
else
|
122
|
-
info
|
123
|
+
info[0]
|
123
124
|
end
|
124
125
|
|
126
|
+
|
125
127
|
# when getting whole object, handle case of UAA < 1.3 which did not return meta attr from query
|
126
|
-
attrs || !
|
128
|
+
attrs || !chosen_info["id"] || chosen_info["meta"] ? chosen_info : scim.get(type, chosen_info["id"])
|
127
129
|
end
|
128
130
|
|
129
131
|
def scim_get_object(scim, type, name, attrs = nil)
|
data/lib/uaa/cli/config.rb
CHANGED
@@ -46,14 +46,14 @@ class Config
|
|
46
46
|
exit 1
|
47
47
|
end
|
48
48
|
else # file doesn't exist, make sure we can write it now
|
49
|
-
|
49
|
+
self.write_file(@config_file, "--- {}\n\n")
|
50
50
|
end
|
51
51
|
Util.hash_keys!(@config, :sym)
|
52
52
|
@context = current_subhash(@config[@target][:contexts]) if @target = current_subhash(@config)
|
53
53
|
end
|
54
54
|
|
55
55
|
def self.save
|
56
|
-
|
56
|
+
self.write_file(@config_file, YAML.dump(Util.hash_keys(@config, :str))) if @config_file
|
57
57
|
true
|
58
58
|
end
|
59
59
|
|
@@ -134,6 +134,11 @@ class Config
|
|
134
134
|
# methods below here are not intended to be part of the public interface
|
135
135
|
private
|
136
136
|
|
137
|
+
def self.write_file(filename, content)
|
138
|
+
File.open(filename, 'w') { |f| f.write content }
|
139
|
+
File.chmod(0600, filename)
|
140
|
+
end
|
141
|
+
|
137
142
|
def self.current_subhash(hash)
|
138
143
|
return unless hash
|
139
144
|
key = nil
|
data/lib/uaa/cli/version.rb
CHANGED
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: 4.
|
4
|
+
version: 4.1.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-
|
15
|
+
date: 2017-11-01 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: cf-uaa-lib
|
@@ -331,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
331
331
|
version: '0'
|
332
332
|
requirements: []
|
333
333
|
rubyforge_project: cf-uaac
|
334
|
-
rubygems_version: 2.
|
334
|
+
rubygems_version: 2.5.1
|
335
335
|
signing_key:
|
336
336
|
specification_version: 4
|
337
337
|
summary: Command line interface for CloudFoundry UAA
|