keycloak 2.2.8 → 2.2.9

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: eeecfffa57b9de3fe7566983dc17b75b57c93944
4
- data.tar.gz: 6183f705d209a6dfef069312f2d750d4510b4b90
3
+ metadata.gz: 56a336f456ac6997524a6c4f7579ca04c6be6f27
4
+ data.tar.gz: e30bc3b08c799a7b76192bc08093ca0caa58f71e
5
5
  SHA512:
6
- metadata.gz: 5acbc28042256caa5cb7763ef48843d058670d8c04fd3e64443f6382b4344fd1bfbde6b8f602e6d53907cb6c67865fbb25dd1dc197d7bebd769dbd4e67817988
7
- data.tar.gz: 91f27e409f5a7bad6c3785c6aa6017ebb7ad564f0c3710eec9ce7f2bb90b7324672c5d00ed0ab530041549a95afa2967e7c05b4b8e3032e811db8479e98acc33
6
+ metadata.gz: 4f1f1adfc4d758cee7d2d4f4b258155a10191365a974e4ea0b5018d660441763394abe21974847f505f318bb44b58714951ce689b2dc4e593f1ba7abbf335692
7
+ data.tar.gz: 8441e469f2fd48df0d83298ab9e8a4b27dbca74b2d0f14fe1b25c1e3b1cf6b5a2bdcaacf189613453b4b77bf24e462c5bc5572505980d822230d3cf1a0d82c8a
data/lib/keycloak.rb CHANGED
@@ -625,39 +625,44 @@ module Keycloak
625
625
  Keycloak::Admin.full_url("clients/"),
626
626
  { clientId: Keycloak::Client.client_id }, nil, 'GET')
627
627
 
628
- roles = []
629
- client_roles_names.each do |r|
630
- if r.present?
631
- role = JSON Keycloak.generic_request(token["access_token"],
632
- Keycloak::Admin.full_url("clients/#{client[0]['id']}/roles/#{r}"),
633
- nil, nil, 'GET')
634
- roles.push(role)
628
+ if client_roles_names.count > 0
629
+ roles = []
630
+ client_roles_names.each do |r|
631
+ if r.present?
632
+ role = JSON Keycloak.generic_request(token["access_token"],
633
+ Keycloak::Admin.full_url("clients/#{client[0]['id']}/roles/#{r}"),
634
+ nil, nil, 'GET')
635
+ roles.push(role)
636
+ end
635
637
  end
636
- end
637
638
 
638
- if roles.count > 0
639
- Keycloak.generic_request(token["access_token"],
640
- Keycloak::Admin.full_url("users/#{user['id']}/role-mappings/clients/#{client[0]['id']}"),
641
- nil, roles, 'POST')
639
+ if roles.count > 0
640
+ Keycloak.generic_request(token["access_token"],
641
+ Keycloak::Admin.full_url("users/#{user['id']}/role-mappings/clients/#{client[0]['id']}"),
642
+ nil, roles, 'POST')
643
+ end
642
644
  end
643
645
 
644
- roles = []
645
- realm_roles_names.each do |r|
646
- if r.present?
647
- role = JSON Keycloak.generic_request(token["access_token"],
648
- Keycloak::Admin.full_url("roles/#{r}"),
649
- nil, nil, 'GET')
650
- roles.push(role)
646
+ if realm_roles_names.count > 0
647
+ roles = []
648
+ realm_roles_names.each do |r|
649
+ if r.present?
650
+ role = JSON Keycloak.generic_request(token["access_token"],
651
+ Keycloak::Admin.full_url("roles/#{r}"),
652
+ nil, nil, 'GET')
653
+ roles.push(role)
654
+ end
651
655
  end
652
- end
653
656
 
654
- if roles.count > 0
655
- Keycloak.generic_request(token["access_token"],
656
- Keycloak::Admin.full_url("users/#{user['id']}/role-mappings/realm"),
657
- nil, roles, 'POST')
657
+ if roles.count > 0
658
+ Keycloak.generic_request(token["access_token"],
659
+ Keycloak::Admin.full_url("users/#{user['id']}/role-mappings/realm"),
660
+ nil, roles, 'POST')
661
+ end
662
+ else
663
+ true
658
664
  end
659
665
  end
660
-
661
666
  end
662
667
  }
663
668
 
@@ -1,3 +1,3 @@
1
1
  module Keycloak
2
- VERSION = "2.2.8"
2
+ VERSION = "2.2.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keycloak
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Portugues
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-18 00:00:00.000000000 Z
11
+ date: 2017-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler