hydra-keycloak-client 0.1.15 → 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: e44c13e82949716bb5f91393dab600335b8c5d201065edff00b286084f15399d
4
- data.tar.gz: 23662cc9f3ffdd48f77c1d05baeff95ea72af6681a5813cd46f22d155c532b1d
3
+ metadata.gz: 61046cc3cd3ab5bc987ab0769799054193795ad82fca2ca46450b3cd6a1d1c44
4
+ data.tar.gz: 408a84fdaa9a9d769e54a6bfb57fba5bcfdc9c74fe158e3062128b53a29e9a37
5
5
  SHA512:
6
- metadata.gz: b9fb3fe92fc2c065ff622a5dcbea04541a94c2f9bb0bac1a3d0b7f34af058f1801869a068d8720937fbd38cb349fc3b4a707a72c7a9a43f0763aa74c3fe5fd33
7
- data.tar.gz: 0e5ec4ae6acfd1f9ca880f24741077cff808cd9a3d1ffdb1bc27c6db801f6b3d5c36864729401827d7918d341d5d3033e2ed2fe37e226cdc5f1a6522687aebf5
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/Dockerfile.release CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:2.7.4
1
+ FROM ruby:3.2.0
2
2
 
3
3
  COPY . /app
4
4
 
data/Dockerfile.test CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:2.7.4
1
+ FROM ruby:3.2.0
2
2
 
3
3
  COPY . /app
4
4
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hydra-keycloak-client (0.1.15)
4
+ hydra-keycloak-client (0.1.17)
5
5
  dry-auto_inject
6
6
  dry-container
7
7
  dry-monads
@@ -14,31 +14,34 @@ GEM
14
14
  specs:
15
15
  ast (2.4.2)
16
16
  coderay (1.1.3)
17
- concurrent-ruby (1.1.10)
17
+ concurrent-ruby (1.2.0)
18
18
  connection_pool (2.3.0)
19
- dalli (3.2.3)
20
- diff-lcs (1.4.4)
19
+ dalli (3.2.0)
20
+ diff-lcs (1.5.0)
21
21
  docile (1.4.0)
22
- dry-auto_inject (0.9.0)
22
+ dry-auto_inject (0.7.0)
23
23
  dry-container (>= 0.3.4)
24
- dry-configurable (0.15.0)
24
+ dry-configurable (0.12.1)
25
25
  concurrent-ruby (~> 1.0)
26
- dry-core (~> 0.6)
27
- dry-container (0.10.1)
26
+ dry-core (~> 0.5, >= 0.5.0)
27
+ dry-container (0.7.2)
28
28
  concurrent-ruby (~> 1.0)
29
- dry-core (0.8.1)
29
+ dry-configurable (~> 0.1, >= 0.1.3)
30
+ dry-core (0.6.0)
30
31
  concurrent-ruby (~> 1.0)
31
- dry-inflector (0.3.0)
32
- dry-initializer (3.1.1)
32
+ dry-equalizer (0.3.0)
33
+ dry-inflector (0.2.0)
34
+ dry-initializer (3.0.4)
33
35
  dry-logic (1.2.0)
34
36
  concurrent-ruby (~> 1.0)
35
37
  dry-core (~> 0.5, >= 0.5)
36
- dry-monads (1.4.0)
38
+ dry-monads (1.3.5)
37
39
  concurrent-ruby (~> 1.0)
38
- dry-core (~> 0.7)
39
- dry-schema (1.9.3)
40
+ dry-core (~> 0.4, >= 0.4.4)
41
+ dry-equalizer
42
+ dry-schema (1.6.2)
40
43
  concurrent-ruby (~> 1.0)
41
- dry-configurable (~> 0.13, >= 0.13.0)
44
+ dry-configurable (~> 0.8, >= 0.8.3)
42
45
  dry-core (~> 0.5, >= 0.5)
43
46
  dry-initializer (~> 3.0)
44
47
  dry-logic (~> 1.0)
@@ -54,17 +57,17 @@ GEM
54
57
  dry-inflector (~> 0.1, >= 0.1.2)
55
58
  dry-logic (~> 1.0, >= 1.0.2)
56
59
  ice_nine (0.11.2)
57
- jwt (2.4.1)
60
+ jwt (2.7.0)
58
61
  method_source (1.0.0)
59
62
  parallel (1.21.0)
60
63
  parser (3.1.1.0)
61
64
  ast (~> 2.4.1)
62
- pry (0.14.1)
65
+ pry (0.14.2)
63
66
  coderay (~> 1.1)
64
67
  method_source (~> 1.0)
65
68
  rainbow (3.1.1)
66
69
  rake (12.3.3)
67
- redis (5.0.5)
70
+ redis (5.0.6)
68
71
  redis-client (>= 0.9.0)
69
72
  redis-client (0.11.2)
70
73
  connection_pool
@@ -74,16 +77,16 @@ GEM
74
77
  rspec-core (~> 3.10.0)
75
78
  rspec-expectations (~> 3.10.0)
76
79
  rspec-mocks (~> 3.10.0)
77
- rspec-core (3.10.1)
80
+ rspec-core (3.10.2)
78
81
  rspec-support (~> 3.10.0)
79
- rspec-expectations (3.10.1)
82
+ rspec-expectations (3.10.2)
80
83
  diff-lcs (>= 1.2.0, < 2.0)
81
84
  rspec-support (~> 3.10.0)
82
- rspec-mocks (3.10.2)
85
+ rspec-mocks (3.10.3)
83
86
  diff-lcs (>= 1.2.0, < 2.0)
84
87
  rspec-support (~> 3.10.0)
85
88
  rspec-support (3.10.3)
86
- rubocop (1.26.0)
89
+ rubocop (1.27.0)
87
90
  parallel (~> 1.10)
88
91
  parser (>= 3.1.0.0)
89
92
  rainbow (>= 2.2.2, < 4.0)
@@ -95,7 +98,7 @@ GEM
95
98
  rubocop-ast (1.16.0)
96
99
  parser (>= 3.1.1.0)
97
100
  ruby-progressbar (1.11.0)
98
- simplecov (0.21.2)
101
+ simplecov (0.22.0)
99
102
  docile (~> 1.1)
100
103
  simplecov-html (~> 0.11)
101
104
  simplecov_json_formatter (~> 0.1)
@@ -104,7 +107,7 @@ GEM
104
107
  simplecov (~> 0.19)
105
108
  simplecov-html (0.12.3)
106
109
  simplecov_json_formatter (0.1.4)
107
- unicode-display_width (2.1.0)
110
+ unicode-display_width (2.4.2)
108
111
 
109
112
  PLATFORMS
110
113
  ruby
@@ -121,4 +124,4 @@ DEPENDENCIES
121
124
  simplecov-cobertura
122
125
 
123
126
  BUNDLED WITH
124
- 2.3.5
127
+ 2.3.26
@@ -73,9 +73,9 @@ module Hydra
73
73
  def register_store_client(config)
74
74
  case config.fetch(:store_client)
75
75
  when 'redis'
76
- register_redis_store(config.fetch(:store_client_options))
76
+ register_redis_store(**config.fetch(:store_client_options))
77
77
  when 'memcached'
78
- register_memcached_store(config.fetch(:store_client_options))
78
+ register_memcached_store(**config.fetch(:store_client_options))
79
79
  end
80
80
  end
81
81
 
@@ -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)
@@ -25,7 +25,7 @@ module Hydra
25
25
  Net::ProtocolError].freeze
26
26
 
27
27
  def post(path, body)
28
- response = http.post_form(URI(path), **body)
28
+ response = http.post_form(URI(path), body)
29
29
 
30
30
  if response.code == '200'
31
31
  json = JSON.parse(response.body)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Hydra
4
4
  module Keycloak
5
- VERSION = '0.1.15'
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.15
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: 2022-12-22 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
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
- rubygems_version: 3.1.6
157
+ rubygems_version: 3.4.1
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Keycloak client for SSO