keycloak-ruby-client 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/keycloak/api.rb +1 -0
- data/lib/keycloak/api/keycloak_api_extension_resources.rb +28 -0
- data/lib/keycloak/client.rb +1 -0
- data/lib/keycloak/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad0512b14993b6c29da87aacc53c064c926152bf
|
4
|
+
data.tar.gz: 683cc0dcd8ddf7f33744fb19398fdef2247ad4d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a60226b5ec10dd7cf6d33e6954d5e69851b713407ae71e4b7fbadd0fb31fa8920d4cd8a958d126e3552f388ef3ed679e90a4bfa91cffa1ed52dfef68cb82831b
|
7
|
+
data.tar.gz: a7918aec954a71d228d7c369d64f358631ea81bab2a7aa79ea090e2f66f017360fb0e3f2b9d6cac36dc62fbfa4a70964716182872ff8a031baf7079b69c98f91
|
data/lib/keycloak/api.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Keycloak API extension resource from https://github.com/FX-HAO/keycloak-api-extension
|
2
|
+
module Keycloak
|
3
|
+
module API
|
4
|
+
module KeycloakAPIExtensionResources
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
include Concerns::APIUtil
|
7
|
+
|
8
|
+
def api_extension_resources_url
|
9
|
+
realm_url + "/keycloak-api-extension/"
|
10
|
+
end
|
11
|
+
|
12
|
+
# @param user_id [String] user id
|
13
|
+
# @return Boolean
|
14
|
+
def if_otp_exists(user_id)
|
15
|
+
url = api_extension_resources_url + "users/#{user_id}/if-otp-exists"
|
16
|
+
JSON.parse(get(url))["status"]
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param user_id [String] user id
|
20
|
+
# @param otp [String] otp
|
21
|
+
# @return Boolean
|
22
|
+
def validate_otp(user_id, otp)
|
23
|
+
url = api_extension_resources_url + "users/#{user_id}/validate-otp"
|
24
|
+
JSON.parse(post(url, otp: otp))["status"]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/keycloak/client.rb
CHANGED
data/lib/keycloak/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keycloak-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fuxin Hao
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- lib/keycloak/api.rb
|
144
144
|
- lib/keycloak/api/client_resources.rb
|
145
145
|
- lib/keycloak/api/client_role_resources.rb
|
146
|
+
- lib/keycloak/api/keycloak_api_extension_resources.rb
|
146
147
|
- lib/keycloak/api/protection_resources.rb
|
147
148
|
- lib/keycloak/api/realm_resources.rb
|
148
149
|
- lib/keycloak/api/role_resources.rb
|