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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 286ca6b3592ab7df61ec1f615a0acfa56936764b
4
- data.tar.gz: 19359845aa7f6605227a4af1a4455abf33490db1
3
+ metadata.gz: 1514ae886ef6e9a3b7a0716ea6be8f472222fdd9
4
+ data.tar.gz: 1ba37cacfd7668d8c3d5b8f934f31de62c21b10d
5
5
  SHA512:
6
- metadata.gz: 14b9a9e76f3d562f5bd6932f4690def61ac0fc520cf7a5a67d96f38cb58f3c0c2a37c488168f8c25601a4c0821081a4aa383542f2d3ede88afffd194524a7f64
7
- data.tar.gz: db0bb385796199b67460e3575b87f88d1d4a7d5818612c90ce673f593047cc34c18932d12785e533fa08dd438eb31f82dba52b3869b3c712a4d120968d412154
6
+ metadata.gz: 9bf9575e8155e8803d6675aa764ddd01bbc761c9a672f8ea0cab5974503b5d24cf1ea955fa25aa5b1a1619fd8063002f5d6802b9541bd93747378c46609f332a
7
+ data.tar.gz: f4ce9faf771762e2b319bb02bfbef51015f1971617f08c2673d2d235abace7427d8eebb1f8267f54a09b1475a60e9bdb9f0df4441b3bb5a923ba3f46b9e7760f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keycloak-admin (0.6.2)
4
+ keycloak-admin (0.6.5)
5
5
  http-cookie (~> 1.0, >= 1.0.3)
6
6
 
7
7
  GEM
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.2"
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 }}))
@@ -1,3 +1,3 @@
1
1
  module KeycloakAdmin
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.5"
3
3
  end
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.2
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-13 00:00:00.000000000 Z
11
+ date: 2019-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-cookie