forest_liana 6.3.0 → 6.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/forest_liana/oidc_client_manager.rb +9 -11
- data/lib/forest_liana/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: a28bd829a3004c62b0c2accffd12b9c089913e944c66f262c247fe9f529c898c
|
4
|
+
data.tar.gz: d884e158839f6c8418da92751a36fa0b4db642e8c3a7fce5b6c76dce966afe24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f2dd4cd85cd8040430a69a4459a98cb8f0a57a9e9177a82e6efc85e0716db7f837c9f7110f2e20ad4cfe76ac587257926cf94e932713d8e6d72670fb1d59faa
|
7
|
+
data.tar.gz: a99fce237e2a743237404aa613e1ae1eb65822427d2410c52bf81ebdd6470025e310e73e38b12bbc82357cfb074fef1091afb3a6e8be51596eeaabe12f7cda12
|
@@ -4,22 +4,20 @@ module ForestLiana
|
|
4
4
|
class OidcClientManager
|
5
5
|
def self.get_client_for_callback_url(callback_url)
|
6
6
|
begin
|
7
|
-
|
8
|
-
if
|
9
|
-
|
10
|
-
|
11
|
-
if ForestLiana.forest_client_id.nil?
|
7
|
+
configuration = ForestLiana::OidcConfigurationRetriever.retrieve()
|
8
|
+
if ForestLiana.forest_client_id.nil?
|
9
|
+
client_data = Rails.cache.read("#{callback_url}-#{ForestLiana.env_secret}-client-data") || nil
|
10
|
+
if client_data.nil?
|
12
11
|
client_credentials = ForestLiana::OidcDynamicClientRegistrator.register({
|
13
12
|
token_endpoint_auth_method: 'none',
|
14
13
|
redirect_uris: [callback_url],
|
15
14
|
registration_endpoint: configuration['registration_endpoint']
|
16
15
|
})
|
17
|
-
|
18
|
-
|
16
|
+
client_data = { :client_id => client_credentials['client_id'], :issuer => configuration['issuer'] }
|
17
|
+
Rails.cache.write("#{callback_url}-#{ForestLiana.env_secret}-client-data", client_data)
|
19
18
|
end
|
20
|
-
|
21
|
-
client_data = { :client_id =>
|
22
|
-
Rails.cache.write(callback_url, client_data)
|
19
|
+
else
|
20
|
+
client_data = { :client_id => ForestLiana.forest_client_id, :issuer => configuration['issuer'] }
|
23
21
|
end
|
24
22
|
|
25
23
|
OpenIDConnect::Client.new(
|
@@ -30,7 +28,7 @@ module ForestLiana
|
|
30
28
|
token_endpoint: '/oidc/token',
|
31
29
|
)
|
32
30
|
rescue => error
|
33
|
-
Rails.cache.delete(callback_url)
|
31
|
+
Rails.cache.delete("#{callback_url}-#{ForestLiana.env_secret}-client-data")
|
34
32
|
raise error
|
35
33
|
end
|
36
34
|
end
|
data/lib/forest_liana/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.3.
|
4
|
+
version: 6.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|