hydra-keycloak-client 0.1.2 → 0.1.3

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: 93ed59551d635025a4a76ab967423d7e843d55b0bbf610031f9052beb2665025
4
- data.tar.gz: 145a8edd04df4e4b82390b416a95fc03b927912f7bf0d08c56277272d94c83c2
3
+ metadata.gz: f223d79f54e1baeb4726a523ddf35d9963669525eca5a157e0db756911b6b39d
4
+ data.tar.gz: f597be9a6d78329dbcce3d9d56bc427eedb1d7515fbadf89ea7c18029ff5613a
5
5
  SHA512:
6
- metadata.gz: 4697202b19f50c961d01af3e366400c1380d57012e978a183cd87b016d7b8e058450a0f557575077d83b63aeb29373e4475799f0c44bfa86b207fc9b94858fe4
7
- data.tar.gz: e6b43f7dcf759ec91c780cf92ba5ed682a6fcf2e3a7eb7fb0cf8b1fdcb35d82c7eb50e23d32aff2966c33c1af0c8751f462df3376d88d022fbb6b23724880276
6
+ metadata.gz: b58ef397bf37b9ef9ed755bfb1f8f4476c08533ffc3829e267feba9735e22602a4944f53b9abd66cf465d718758614120bf48d743a51ad2c857951ae4c78459c
7
+ data.tar.gz: 6b577ea62608e0afff43fe1600ac3eb6607510c423d8c60d093b2b472b6b2843bac765bb1ea4e6869f920fb4598066abd6b81c9c94bb6e23758c85722c47346b
@@ -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.2'
5
+ VERSION = '0.1.3'
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.2
4
+ version: 0.1.3
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