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 +4 -4
- data/lib/hydra/keycloak/store/redis_client.rb +39 -0
- data/lib/hydra/keycloak/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f223d79f54e1baeb4726a523ddf35d9963669525eca5a157e0db756911b6b39d
|
4
|
+
data.tar.gz: f597be9a6d78329dbcce3d9d56bc427eedb1d7515fbadf89ea7c18029ff5613a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|