keycloak 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/keycloak.rb +6 -4
- data/lib/keycloak/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c71e040ba83715ddd3e25671c1356402108fb1826954b0d8a0f939a071666fed
|
|
4
|
+
data.tar.gz: 5de8fa49fcd5adf2e9ffb14f45900bac80dad1c1d31a33f4c3bc6bcbdf76899b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83e956681efe0986abb87becc34f23101ae4eca113ec54b8aa872829f486ea2b829d5c1fb95553a3e3ebe2578e5fdf873e1ef2134d9f8dadc3522cbdc1f4bf40
|
|
7
|
+
data.tar.gz: d7b63fc19ca1d01ceacbe94cfbb7d58271ffd94a53863370b7066053d80991c3c972bc76b6d62657b35fcb8bf9b89641bd209837434894198185494e22bb0316
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
keycloak (2.
|
|
4
|
+
keycloak (2.5.0)
|
|
5
5
|
json
|
|
6
6
|
jwt
|
|
7
7
|
rest-client
|
|
@@ -14,11 +14,11 @@ GEM
|
|
|
14
14
|
unf (>= 0.0.5, < 1.0.0)
|
|
15
15
|
http-cookie (1.0.3)
|
|
16
16
|
domain_name (~> 0.5)
|
|
17
|
-
json (2.
|
|
18
|
-
jwt (2.1
|
|
17
|
+
json (2.2.0)
|
|
18
|
+
jwt (2.2.1)
|
|
19
19
|
mime-types (3.2.2)
|
|
20
20
|
mime-types-data (~> 3.2015)
|
|
21
|
-
mime-types-data (3.
|
|
21
|
+
mime-types-data (3.2019.0331)
|
|
22
22
|
netrc (0.11.0)
|
|
23
23
|
rake (10.5.0)
|
|
24
24
|
rest-client (2.0.2)
|
|
@@ -40,7 +40,7 @@ GEM
|
|
|
40
40
|
rspec-support (3.7.1)
|
|
41
41
|
unf (0.1.4)
|
|
42
42
|
unf_ext
|
|
43
|
-
unf_ext (0.0.7.
|
|
43
|
+
unf_ext (0.0.7.6)
|
|
44
44
|
|
|
45
45
|
PLATFORMS
|
|
46
46
|
ruby
|
data/lib/keycloak.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Keycloak
|
|
|
12
12
|
class << self
|
|
13
13
|
attr_accessor :proxy, :generate_request_exception, :keycloak_controller,
|
|
14
14
|
:proc_cookie_token, :proc_external_attributes,
|
|
15
|
-
:realm, :auth_server_url
|
|
15
|
+
:realm, :auth_server_url, :validate_token_when_call_has_role
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def self.explode_exception
|
|
@@ -253,7 +253,7 @@ module Keycloak
|
|
|
253
253
|
secret = @secret if secret.blank?
|
|
254
254
|
token_introspection_endpoint = @configuration['token_introspection_endpoint'] if token_introspection_endpoint.blank?
|
|
255
255
|
|
|
256
|
-
if user_signed_in?(access_token, client_id, secret, token_introspection_endpoint)
|
|
256
|
+
if !Keycloak.validate_token_when_call_has_role || user_signed_in?(access_token, client_id, secret, token_introspection_endpoint)
|
|
257
257
|
dt = decoded_access_token(access_token)[0]
|
|
258
258
|
dt = dt["resource_access"][client_id]
|
|
259
259
|
if dt != nil
|
|
@@ -351,6 +351,7 @@ module Keycloak
|
|
|
351
351
|
def self.setup_module
|
|
352
352
|
Keycloak.proxy ||= ''
|
|
353
353
|
Keycloak.keycloak_controller ||= KEYCLOACK_CONTROLLER_DEFAULT
|
|
354
|
+
Keycloak.validate_token_when_call_has_role ||= false
|
|
354
355
|
get_installation
|
|
355
356
|
end
|
|
356
357
|
|
|
@@ -836,14 +837,15 @@ module Keycloak
|
|
|
836
837
|
protected
|
|
837
838
|
|
|
838
839
|
def self.default_call(proc, client_id = '', secret = '')
|
|
839
|
-
client_id = Keycloak::Client.client_id if client_id.blank?
|
|
840
|
-
secret = Keycloak::Client.secret if secret.blank?
|
|
841
840
|
begin
|
|
842
841
|
tk = nil
|
|
843
842
|
resp = nil
|
|
844
843
|
|
|
845
844
|
Keycloak::Client.get_installation
|
|
846
845
|
|
|
846
|
+
client_id = Keycloak::Client.client_id if client_id.blank?
|
|
847
|
+
secret = Keycloak::Client.secret if secret.blank?
|
|
848
|
+
|
|
847
849
|
payload = { 'client_id' => client_id,
|
|
848
850
|
'client_secret' => secret,
|
|
849
851
|
'grant_type' => 'client_credentials' }
|
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.
|
|
4
|
+
version: 2.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Guilherme Portugues
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-06-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|