hydra-keycloak-client 0.1.1 → 0.1.4

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: c0702045813eaac89c7c6de7629d3b1df9704e230491c7ad138f1c9bab5f2b0c
4
- data.tar.gz: 0b40b85cb591c1f8a85d1689ce7d78d471c77053826604632b8fae0e90d37977
3
+ metadata.gz: 6aeae2261cdd736e31e48d59e3d97f8a26e2e88b4b4793cad7377aed52e8de1c
4
+ data.tar.gz: 29e84ab96e9f07e92dcfc150008ea627c843294e298e4f354884336ed903444d
5
5
  SHA512:
6
- metadata.gz: 7e297eeabbb1a26cfaa4299b9a76b963838eec4ef1e71ba7ab9d9195dd994d46db4eec80d2d8e525e3bbeed63e02ce11d7aaedb69e7bc309bab80acc3f760ae0
7
- data.tar.gz: 19f1c1fd13474f31e040f6802dd8459f0ab3d0dffabc083de1f749ec5b50e53951fbb1f87b32401bec61434ba06f5c58d6cb225061de2509b80fab4ea0d363d6
6
+ metadata.gz: a2fd68301e498dc7f69cc7193d177d3a025f8cf334af3f2b2bcea75f4d0bfa37c87511fc7e3eee5d1c19cc8138ff32bbf00f6f85fa2e94762e8f81d58f4694db
7
+ data.tar.gz: 59948ba16738ba3eb18968220d90faa81eeeb3a80bc1aac07fc6f0624cd519af76d198eaa1d160b0693d3bfb39d23789ef0e5c1fc3e3e91789f63f5edf2ad7f2
@@ -55,7 +55,7 @@ module Hydra
55
55
  ::Hydra::Keycloak::Queries::Gateway.new
56
56
  end
57
57
 
58
- if validated_config[:store_client] == :redis
58
+ if validated_config[:store_client] == 'redis'
59
59
  container.register :redis do
60
60
  require 'redis'
61
61
 
@@ -67,7 +67,7 @@ module Hydra
67
67
 
68
68
  ::Hydra::Keycloak::Store::RedisClient.new
69
69
  end
70
- else validated_config[:store_client] == :memcached
70
+ else validated_config[:store_client] == 'memcached'
71
71
  container.register :dalli do
72
72
  require 'dalli'
73
73
 
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'redis'
4
+ require 'dry/monads'
5
+ require 'dry/auto_inject'
6
+
7
+ module Hydra
8
+ module Keycloak
9
+ module Store
10
+ class RedisClient
11
+ extend ::Hydra::Keycloak::Mixin
12
+ include ::Dry::Monads[:result]
13
+ inject['redis']
14
+
15
+ def set(key, value)
16
+ redis.set(key, value)
17
+
18
+ Success(:ok)
19
+ rescue Redis::BaseError
20
+ Failure(status: 400, code: :redis_unavailable)
21
+ end
22
+
23
+ def get(key)
24
+ Success(redis.get(key))
25
+ rescue Redis::BaseError
26
+ Failure(status: 400, code: :redis_unavailable)
27
+ end
28
+
29
+ def delete(key)
30
+ redis.del(key)
31
+
32
+ Success(:ok)
33
+ rescue Redis::BaseError
34
+ Failure(status: 400, code: :redis_unavailable)
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Hydra
4
4
  module Keycloak
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-keycloak-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fedor Kosolapov
@@ -33,6 +33,7 @@ files:
33
33
  - lib/hydra/keycloak/queries/http_client.rb
34
34
  - lib/hydra/keycloak/store/gateway.rb
35
35
  - lib/hydra/keycloak/store/memcached_client.rb
36
+ - lib/hydra/keycloak/store/redis_client.rb
36
37
  - lib/hydra/keycloak/token.rb
37
38
  - lib/hydra/keycloak/urls.rb
38
39
  - lib/hydra/keycloak/user_data.rb
@@ -59,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
60
  - !ruby/object:Gem::Version
60
61
  version: '0'
61
62
  requirements: []
62
- rubygems_version: 3.1.6
63
+ rubygems_version: 3.2.3
63
64
  signing_key:
64
65
  specification_version: 4
65
66
  summary: Keycloak client for SSO