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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9db3ae9b9a24a9f298e24a2b6562e8df12b0123cbbe45f453fab19d8da7a8f10
4
- data.tar.gz: 4e245a23470730308895296e37e765a711186381820f2bf619e5091966cba6fc
3
+ metadata.gz: a28bd829a3004c62b0c2accffd12b9c089913e944c66f262c247fe9f529c898c
4
+ data.tar.gz: d884e158839f6c8418da92751a36fa0b4db642e8c3a7fce5b6c76dce966afe24
5
5
  SHA512:
6
- metadata.gz: 9d87f2aa53059a2c6129bc5cc1d5107009121d6c97f08b2b6e745c55132ac333be420d9ea9f82fe4441c9b59a447eafad3f4111b4a8109650935d958664e6cd2
7
- data.tar.gz: 9e7300a1819a26f7ca5dd4f8d59fa58abdb009dca12b045c963c0a0fdf10398bdeb403833fc7b021b4c93257ef7799f57210c6e8cda8755b350d3252f548d0e6
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
- client_data = Rails.cache.read(callback_url) || nil
8
- if client_data.nil?
9
- configuration = ForestLiana::OidcConfigurationRetriever.retrieve()
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
- else
18
- client_credentials = { 'client_id' => ForestLiana.forest_client_id }
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 => client_credentials['client_id'], :issuer => configuration['issuer'] }
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
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "6.3.0"
2
+ VERSION = "6.3.1"
3
3
  end
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.0
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-12 00:00:00.000000000 Z
11
+ date: 2021-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails