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 +4 -4
- data/.gitignore +3 -0
- data/Gemfile.lock +1 -1
- data/lib/hydra/keycloak/client.rb +18 -8
- data/lib/hydra/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: 61046cc3cd3ab5bc987ab0769799054193795ad82fca2ca46450b3cd6a1d1c44
|
4
|
+
data.tar.gz: 408a84fdaa9a9d769e54a6bfb57fba5bcfdc9c74fe158e3062128b53a29e9a37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd7d6888768745cc897b554ec7f8342e12ec879258eafe967a947a2c902af32ba0e7ba4b46b3dc1c7b826b2f99962f8112698fbb50484951100ab6ff4ed64f0c
|
7
|
+
data.tar.gz: e82f992be649e2d1923df2fdff0292a5b906e82c61082671f5fecb038c4dd3cd40d567e6f05b413d35b5ab8df99bf0d031c3e56b32ae2c0b8f435822a8734d86
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -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[
|
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')
|
200
|
-
clear_tokens(session_state)
|
204
|
+
id_token = yield fetch_token(session_state, 'id_token')
|
201
205
|
|
202
|
-
|
203
|
-
|
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
|
-
|
228
|
-
|
229
|
-
|
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)
|
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.
|
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-
|
11
|
+
date: 2023-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|