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 +4 -4
- data/lib/keycloak.rb +30 -25
- data/lib/keycloak/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56a336f456ac6997524a6c4f7579ca04c6be6f27
|
4
|
+
data.tar.gz: e30bc3b08c799a7b76192bc08093ca0caa58f71e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
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
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
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
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
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
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
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
|
|
data/lib/keycloak/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|