keycloak-admin 0.6.2 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +11 -4
- data/lib/keycloak-admin/client/user_client.rb +9 -0
- data/lib/keycloak-admin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1514ae886ef6e9a3b7a0716ea6be8f472222fdd9
|
4
|
+
data.tar.gz: 1ba37cacfd7668d8c3d5b8f934f31de62c21b10d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bf9575e8155e8803d6675aa764ddd01bbc761c9a672f8ea0cab5974503b5d24cf1ea955fa25aa5b1a1619fd8063002f5d6802b9541bd93747378c46609f332a
|
7
|
+
data.tar.gz: f4ce9faf771762e2b319bb02bfbef51015f1971617f08c2673d2d235abace7427d8eebb1f8267f54a09b1475a60e9bdb9f0df4441b3bb5a923ba3f46b9e7760f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -12,7 +12,7 @@ This gem *does not* require Rails.
|
|
12
12
|
For example, using `bundle`, add this line to your Gemfile.
|
13
13
|
|
14
14
|
```ruby
|
15
|
-
gem "keycloak-admin", "0.6.
|
15
|
+
gem "keycloak-admin", "0.6.5"
|
16
16
|
```
|
17
17
|
|
18
18
|
## Login
|
@@ -83,7 +83,7 @@ All options have a default value. However, all of them can be changed in your in
|
|
83
83
|
### Supported features
|
84
84
|
|
85
85
|
* Get an access token
|
86
|
-
* Create/update a user
|
86
|
+
* Create/update/get a user
|
87
87
|
* Reset credentials
|
88
88
|
* Delete a user
|
89
89
|
* Impersonate a user
|
@@ -97,6 +97,15 @@ Returns an instance of `KeycloakAdmin::TokenRepresentation`.
|
|
97
97
|
KeycloakAdmin.realm("a_realm").token.get
|
98
98
|
```
|
99
99
|
|
100
|
+
### Get a user from its idenfier
|
101
|
+
|
102
|
+
Returns an instance of `KeycloakAdmin::UserRepresentation` or `nil` when this user does not exist.
|
103
|
+
|
104
|
+
```ruby
|
105
|
+
user_id = "95985b21-d884-4bbd-b852-cb8cd365afc2"
|
106
|
+
KeycloakAdmin.realm("a_realm").users.get(user_id)
|
107
|
+
```
|
108
|
+
|
100
109
|
### Search for users
|
101
110
|
|
102
111
|
Returns an array of `KeycloakAdmin::UserRepresentation`.
|
@@ -123,8 +132,6 @@ KeycloakAdmin.realm("a_realm").users.update("05c135c6-5ad8-4e17-b1fa-635fc089fd7
|
|
123
132
|
})
|
124
133
|
```
|
125
134
|
|
126
|
-
KeycloakAdmin.realm("commuty").users.update("05c135c6-5ad8-4e17-b1fa-635fc089fd71", { email: "hello@gmail.com" })
|
127
|
-
|
128
135
|
### Create and save a user with password and a locale
|
129
136
|
|
130
137
|
Returns the created user of type `KeycloakAdmin::UserRepresentation`.
|
@@ -22,6 +22,15 @@ module KeycloakAdmin
|
|
22
22
|
RestClient.put(users_url(user_id), user_representation_body.to_json, headers)
|
23
23
|
end
|
24
24
|
|
25
|
+
def get(user_id)
|
26
|
+
response = execute_http do
|
27
|
+
RestClient.get(users_url(user_id), headers)
|
28
|
+
end
|
29
|
+
UserRepresentation.from_hash(JSON.parse(response))
|
30
|
+
rescue
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
|
25
34
|
def search(query)
|
26
35
|
response = execute_http do
|
27
36
|
RestClient.get(users_url, headers.merge({params: { search: query }}))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keycloak-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorent Lempereur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-cookie
|