hydra-keycloak-client 0.1.16 → 0.1.17

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: e21882cde2f44b50a21259216097d6f101429189476d7c8e672a45376445639e
4
- data.tar.gz: 109d00d611d0755b8a8ef9d1ddc564d0b05203bbf52fe09b2bf50d41c58cf62d
3
+ metadata.gz: 61046cc3cd3ab5bc987ab0769799054193795ad82fca2ca46450b3cd6a1d1c44
4
+ data.tar.gz: 408a84fdaa9a9d769e54a6bfb57fba5bcfdc9c74fe158e3062128b53a29e9a37
5
5
  SHA512:
6
- metadata.gz: 66ece7983e4ed5731233f41ad9d15e4bf6fcb1c55f8e2aa708b3317031ff89f201e9cdf3ec7bc94fc7e5855f9b95b78ed7c53ddfcac085108053893719072b27
7
- data.tar.gz: a1edbad85e6397ae3ea3f1f6e66c3f0cecc16648e4b344d900ac16c71a2904ac450041615cc022319421380b39837a93abd4e5765ec3c6dcc1e196e70483785e
6
+ metadata.gz: bd7d6888768745cc897b554ec7f8342e12ec879258eafe967a947a2c902af32ba0e7ba4b46b3dc1c7b826b2f99962f8112698fbb50484951100ab6ff4ed64f0c
7
+ data.tar.gz: e82f992be649e2d1923df2fdff0292a5b906e82c61082671f5fecb038c4dd3cd40d567e6f05b413d35b5ab8df99bf0d031c3e56b32ae2c0b8f435822a8734d86
data/.gitignore CHANGED
@@ -1,3 +1,6 @@
1
1
  .rspec_status
2
2
  coverage
3
3
  .bundle
4
+ .DS_Store
5
+ .idea
6
+ .ruby-version
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hydra-keycloak-client (0.1.16)
4
+ hydra-keycloak-client (0.1.17)
5
5
  dry-auto_inject
6
6
  dry-container
7
7
  dry-monads
@@ -127,7 +127,12 @@ module Hydra
127
127
  class Client
128
128
  extend ::Hydra::Keycloak::Mixin
129
129
  include ::Dry::Monads[:result, :do]
130
- inject['urls', 'tokens_repo', 'store', 'code_verifier']
130
+ inject[
131
+ 'urls',
132
+ 'tokens_repo',
133
+ 'store',
134
+ 'code_verifier'
135
+ ]
131
136
 
132
137
  def auth_url
133
138
  code_verifier.generate
@@ -196,11 +201,11 @@ module Hydra
196
201
  end
197
202
 
198
203
  def logout!(session_state)
199
- fetch_token(session_state, 'id_token').bind do |id_token|
200
- clear_tokens(session_state)
204
+ id_token = yield fetch_token(session_state, 'id_token')
201
205
 
202
- urls.end_session_url(id_token.source)
203
- end
206
+ yield clear_tokens(session_state)
207
+
208
+ Success(urls.end_session_url(id_token.source))
204
209
  end
205
210
 
206
211
  def introspect_token(token)
@@ -224,9 +229,14 @@ module Hydra
224
229
  end
225
230
 
226
231
  def clear_tokens(session_state)
227
- store.delete("#{session_state}_access_token")
228
- store.delete("#{session_state}_id_token")
229
- store.delete("#{session_state}_refresh_token")
232
+ Dry::Monads::List[
233
+ "#{session_state}_access_token",
234
+ "#{session_state}_id_token",
235
+ "#{session_state}_refresh_token"
236
+ ]
237
+ .fmap { |x| store.delete(x) }
238
+ .typed(Dry::Monads::Result)
239
+ .traverse
230
240
  end
231
241
 
232
242
  def token_expired?(token)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Hydra
4
4
  module Keycloak
5
- VERSION = '0.1.16'
5
+ VERSION = '0.1.17'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-keycloak-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fedor Kosolapov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-07 00:00:00.000000000 Z
11
+ date: 2023-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt