cf-uaac 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99547295a5faebfa3f711aca3078f7b09af3c0c5
4
- data.tar.gz: 4edaa8921ff9e37db2b03e335dc99f7788f2726c
3
+ metadata.gz: 827ceb84606f676c8b5ed9ca4bcd21b83480bf8b
4
+ data.tar.gz: e4026f4b33775ecfdaa7c2aa0d41c23f394a989c
5
5
  SHA512:
6
- metadata.gz: b5f26510821f4815e381e765ad71970dba95a9b11cb023b1a5f1f390dddedaa7cbc2b544cb291f40cea71368794430c2d7d9ec9ef6118e41eed31d9dcd208681
7
- data.tar.gz: 7bdccc0fb5a696ca07d34a38351a1017a32e6ebb3ecd415ddc8424ac034a11deeda0b5fdc76312173bf6329d3b74b9f2e9deaade94d551cf21ef30572cf0b892
6
+ metadata.gz: f53de23a8a23d324eaa3979a81f73a077e001249c99ba1c407fcaeab2dde12a18f6b70d46ab43f56b551029872a7f1088a230ac19c7fd330763b6214d2d1551b
7
+ data.tar.gz: 15ff20c9f4ed4a3d787a0bfe4e52791f62f93bc1ef970b1c9271bdd44b058a02e791c7426f20045753ad72367e4078e5c7e8f77efcb089a792219c3100d6a13e
@@ -1,5 +1,9 @@
1
1
  language: ruby
2
2
 
3
+ before_install:
4
+ - gem update
5
+ - gem install bundler
6
+
3
7
  rvm:
4
8
  - 1.9.3
5
9
 
data/bin/uaas CHANGED
@@ -14,9 +14,9 @@
14
14
  #++
15
15
 
16
16
  $:.unshift File.expand_path File.join __FILE__, '..', '..', 'lib'
17
- require 'stub/uaa'
18
- require 'cli/base'
19
- require 'cli/version'
17
+ require 'uaa/stub/uaa'
18
+ require 'uaa/cli/base'
19
+ require 'uaa/cli/version'
20
20
 
21
21
  module CF::UAA
22
22
 
@@ -13,7 +13,7 @@
13
13
  #++
14
14
 
15
15
  $:.push File.expand_path("../lib", __FILE__)
16
- require "cli/version"
16
+ require "uaa/cli/version"
17
17
 
18
18
  Gem::Specification.new do |s|
19
19
  s.name = "cf-uaac"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+ token="$(uaac context | awk '/^ *access_token\: *([a-zA-Z0-9.\/+\-_]+) *$/ {print $2}' -)"
3
+ curl -H"Authorization: bearer $token" "$@"
File without changes
@@ -11,7 +11,7 @@
11
11
  # subcomponent's license, as noted in the LICENSE file.
12
12
  #++
13
13
 
14
- require 'cli/common'
14
+ require 'uaa/cli/common'
15
15
 
16
16
  module CF::UAA
17
17
 
@@ -11,8 +11,8 @@
11
11
  # subcomponent's license, as noted in the LICENSE file.
12
12
  #++
13
13
 
14
- require 'cli/base'
15
- require 'cli/config'
14
+ require 'uaa/cli/base'
15
+ require 'uaa/cli/config'
16
16
  require 'uaa'
17
17
 
18
18
  module CF::UAA
File without changes
@@ -11,7 +11,7 @@
11
11
  # subcomponent's license, as noted in the LICENSE file.
12
12
  #++
13
13
 
14
- require 'cli/common'
14
+ require 'uaa/cli/common'
15
15
  require 'rack'
16
16
  require 'net/http'
17
17
  require 'uaa/http'
File without changes
@@ -12,7 +12,7 @@
12
12
  #++
13
13
 
14
14
  require 'set'
15
- require 'cli/common'
15
+ require 'uaa/cli/common'
16
16
  require 'uaa'
17
17
 
18
18
  module CF::UAA
@@ -52,9 +52,10 @@ class GroupCli < CommonCli
52
52
  response = scim_request { |scim| scim.list_group_mappings(start, count) }
53
53
 
54
54
  if response
55
- grouped_group_mappings = []
55
+ grouped_group_mappings = {}
56
56
  response["resources"].each do |resource|
57
- grouped_group_mappings << {resource['displayname'] => resource['externalgroup']}
57
+ grouped_group_mappings[resource['origin']] ||= Array.new
58
+ grouped_group_mappings[resource['origin']] << {resource['displayname'] => resource['externalgroup']}
58
59
  end
59
60
  response["resources"] = grouped_group_mappings
60
61
  pp response
@@ -11,7 +11,7 @@
11
11
  # subcomponent's license, as noted in the LICENSE file.
12
12
  #++
13
13
 
14
- require 'cli/common'
14
+ require 'uaa/cli/common'
15
15
  require 'uaa'
16
16
 
17
17
  module CF::UAA
@@ -11,13 +11,13 @@
11
11
  # subcomponent's license, as noted in the LICENSE file.
12
12
  #++
13
13
 
14
- require 'cli/common'
15
- require 'cli/token'
16
- require 'cli/user'
17
- require 'cli/group'
18
- require 'cli/info'
19
- require 'cli/client_reg'
20
- require 'cli/curl'
14
+ require 'uaa/cli/common'
15
+ require 'uaa/cli/token'
16
+ require 'uaa/cli/user'
17
+ require 'uaa/cli/group'
18
+ require 'uaa/cli/info'
19
+ require 'uaa/cli/client_reg'
20
+ require 'uaa/cli/curl'
21
21
 
22
22
  module CF::UAA
23
23
 
@@ -11,10 +11,10 @@
11
11
  # subcomponent's license, as noted in the LICENSE file.
12
12
  #++
13
13
 
14
- require 'cli/common'
14
+ require 'uaa/cli/common'
15
15
  require 'launchy'
16
16
  require 'uaa'
17
- require 'stub/server'
17
+ require 'uaa/stub/server'
18
18
 
19
19
  module CF::UAA
20
20
 
@@ -11,7 +11,7 @@
11
11
  # subcomponent's license, as noted in the LICENSE file.
12
12
  #++
13
13
 
14
- require 'cli/common'
14
+ require 'uaa/cli/common'
15
15
 
16
16
  module CF::UAA
17
17
 
@@ -14,6 +14,6 @@
14
14
  # Cloud Foundry namespace
15
15
  module CF
16
16
  module UAA
17
- CLI_VERSION = "3.2.0"
17
+ CLI_VERSION = "3.3.0"
18
18
  end
19
19
  end
@@ -288,7 +288,7 @@ class StubScim
288
288
  group = group_id ? ref_by_id(group_id, :group) : ref_by_name(group_name, :group)
289
289
  return unless group
290
290
  (group[:external_groups] ||= Hash.new)
291
- group[:external_groups][external_group] = 'ldap'
291
+ group[:external_groups][external_group] = origin
292
292
  group
293
293
  end
294
294
 
@@ -303,7 +303,7 @@ class StubScim
303
303
  @things_by_id.each do |id, thing|
304
304
  if thing[:rtype] == :group
305
305
  thing[:external_groups].each do |key, value|
306
- group_mappings << { groupid: thing[:id], displayname: thing[:displayname], externalgroup: key }
306
+ group_mappings << { groupid: thing[:id], displayname: thing[:displayname], externalgroup: key, origin: value }
307
307
  end if thing[:external_groups]
308
308
  end
309
309
  end unless @things_by_id.empty?
File without changes
@@ -12,9 +12,9 @@
12
12
  #++
13
13
 
14
14
  require 'uaa'
15
- require 'stub/server'
16
- require 'stub/scim'
17
- require 'cli/version'
15
+ require 'uaa/stub/server'
16
+ require 'uaa/stub/scim'
17
+ require 'uaa/cli/version'
18
18
  require 'pp'
19
19
 
20
20
  module CF::UAA
@@ -11,5 +11,5 @@
11
11
  # subcomponent's license, as noted in the LICENSE file.
12
12
  #++
13
13
 
14
- require "cli/version"
15
- require "cli/runner"
14
+ require "uaa/cli/version"
15
+ require "uaa/cli/runner"
@@ -172,10 +172,11 @@ describe GroupCli do
172
172
  it "lists all the mappings between uaa scopes and external groups" do
173
173
  Cli.run "context #{@test_client}"
174
174
  Cli.run "group map ldap-id --name #{@test_group}"
175
- Cli.output.string.should include "Successfully mapped #{@test_group} to ldap-id"
176
-
175
+ Cli.output.string.should include("Successfully mapped")
176
+ Cli.run "group map ldap-id-2 --name #{@test_group}"
177
+ Cli.output.string.should include("Successfully mapped")
177
178
  Cli.run "group mappings"
178
- Cli.output.string.should include("#{@test_group}: ldap-id")
179
+ Cli.output.string.should include("ldap: \n -\n #{@test_group}: ldap-id\n -\n #{@test_group}: ldap-id-2")
179
180
  end
180
181
 
181
182
  it "lists mappings between uaa scopes and external groups with pagination" do
@@ -192,10 +193,15 @@ describe GroupCli do
192
193
  Cli.output.string.should include "Successfully mapped #{@test_group} to ldap-id"
193
194
 
194
195
  Cli.run "group mappings"
195
- Cli.output.string.should include("#{@test_group}: ldap-id", "#{@test_group}: ldap-id-2", "#{@test_group}: ldap-id-3", "#{@test_group}: ldap-id-4")
196
+ Cli.output.string.should include("#{@test_group}: ldap-id")
197
+ Cli.output.string.should include("#{@test_group}: ldap-id-2")
198
+ Cli.output.string.should include("#{@test_group}: ldap-id-3")
199
+ Cli.output.string.should include("#{@test_group}: ldap-id-4")
196
200
 
197
201
  Cli.run "group mappings --start 1 --count 3"
198
- Cli.output.string.should include("#{@test_group}: ldap-id", "#{@test_group}: ldap-id-2", "#{@test_group}: ldap-id-3")
202
+ Cli.output.string.should include("#{@test_group}: ldap-id")
203
+ Cli.output.string.should include("#{@test_group}: ldap-id-2")
204
+ Cli.output.string.should include("#{@test_group}: ldap-id-3")
199
205
  Cli.output.string.should_not include("ldap-id-4")
200
206
 
201
207
  Cli.run "group mappings --start 1 --count -3"
@@ -207,17 +213,22 @@ describe GroupCli do
207
213
  Cli.output.string.should include("Please enter a valid count")
208
214
 
209
215
  Cli.run "group mappings --start -1 --count 5"
210
- Cli.output.string.should include("#{@test_group}: ldap-id", "#{@test_group}: ldap-id-2", "#{@test_group}: ldap-id-3")
216
+ Cli.output.string.should include("#{@test_group}: ldap-id")
217
+ Cli.output.string.should include("#{@test_group}: ldap-id-2")
218
+ Cli.output.string.should include("#{@test_group}: ldap-id-3")
211
219
 
212
220
  Cli.run "group mappings --start a --count 1"
213
221
  Cli.output.string.should_not include("ldap-id", "ldap-id-2", "ldap-id-3")
214
222
  Cli.output.string.should include("Please enter a valid start index")
215
223
 
216
224
  Cli.run "group mappings --start 2"
217
- Cli.output.string.should include("#{@test_group}: ldap-id-2", "#{@test_group}: ldap-id-3", "#{@test_group}: ldap-id-4")
225
+ Cli.output.string.should include("#{@test_group}: ldap-id-2")
226
+ Cli.output.string.should include("#{@test_group}: ldap-id-3")
227
+ Cli.output.string.should include("#{@test_group}: ldap-id-4")
218
228
 
219
229
  Cli.run "group mappings --count 2"
220
- Cli.output.string.should include("#{@test_group}: ldap-id", "#{@test_group}: ldap-id-2")
230
+ Cli.output.string.should include("#{@test_group}: ldap-id")
231
+ Cli.output.string.should include("#{@test_group}: ldap-id-2")
221
232
  end
222
233
 
223
234
  it "maps a uaa scope to an external group" do
@@ -16,8 +16,8 @@ require 'fiber'
16
16
  require 'net/http'
17
17
  require 'em-http'
18
18
  require 'uaa/http'
19
- require 'cli/version'
20
- require 'stub/server'
19
+ require 'uaa/cli/version'
20
+ require 'uaa/stub/server'
21
21
 
22
22
  module CF::UAA
23
23
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  require 'spec_helper'
15
15
  require 'uaac_cli'
16
- require 'stub/uaa'
16
+ require 'uaa/stub/uaa'
17
17
 
18
18
  module CF::UAA
19
19
 
@@ -24,7 +24,7 @@ end
24
24
 
25
25
  require 'rspec'
26
26
  require 'eventmachine'
27
- require 'stub/uaa'
27
+ require 'uaa/stub/uaa'
28
28
 
29
29
  module CF::UAA
30
30
 
@@ -15,7 +15,7 @@ require 'spec_helper'
15
15
  require 'fiber'
16
16
  require 'em-http'
17
17
  require 'uaac_cli'
18
- require 'stub/server'
18
+ require 'uaa/stub/server'
19
19
 
20
20
  module CF::UAA
21
21
 
@@ -99,4 +99,4 @@ module CF::UAA
99
99
  end
100
100
 
101
101
  end
102
- end
102
+ end
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.2.0
4
+ version: 3.3.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: 2016-03-31 00:00:00.000000000 Z
15
+ date: 2016-06-24 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
@@ -229,21 +229,22 @@ files:
229
229
  - bin/uaac-completion.sh
230
230
  - bin/uaas
231
231
  - cf-uaac.gemspec
232
- - lib/cli/base.rb
233
- - lib/cli/client_reg.rb
234
- - lib/cli/common.rb
235
- - lib/cli/config.rb
236
- - lib/cli/curl.rb
237
- - lib/cli/favicon.ico
238
- - lib/cli/group.rb
239
- - lib/cli/info.rb
240
- - lib/cli/runner.rb
241
- - lib/cli/token.rb
242
- - lib/cli/user.rb
243
- - lib/cli/version.rb
244
- - lib/stub/scim.rb
245
- - lib/stub/server.rb
246
- - lib/stub/uaa.rb
232
+ - curl_auth.sh
233
+ - lib/uaa/cli/base.rb
234
+ - lib/uaa/cli/client_reg.rb
235
+ - lib/uaa/cli/common.rb
236
+ - lib/uaa/cli/config.rb
237
+ - lib/uaa/cli/curl.rb
238
+ - lib/uaa/cli/favicon.ico
239
+ - lib/uaa/cli/group.rb
240
+ - lib/uaa/cli/info.rb
241
+ - lib/uaa/cli/runner.rb
242
+ - lib/uaa/cli/token.rb
243
+ - lib/uaa/cli/user.rb
244
+ - lib/uaa/cli/version.rb
245
+ - lib/uaa/stub/scim.rb
246
+ - lib/uaa/stub/server.rb
247
+ - lib/uaa/stub/uaa.rb
247
248
  - lib/uaac_cli.rb
248
249
  - spec/client_reg_spec.rb
249
250
  - spec/common_spec.rb
@@ -276,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
277
  version: '0'
277
278
  requirements: []
278
279
  rubyforge_project: cf-uaac
279
- rubygems_version: 2.2.2
280
+ rubygems_version: 2.4.5
280
281
  signing_key:
281
282
  specification_version: 4
282
283
  summary: Command line interface for CloudFoundry UAA