keycloak-admin 0.7.2 → 0.7.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
  SHA1:
3
- metadata.gz: ef2112e82d91e64a41f612eb13dd37bbd6e7b09b
4
- data.tar.gz: 66218b9a1051a9d592d236235ddb1ac6e22161cf
3
+ metadata.gz: 8dc193e7b260cc860b03a8eaaa53180fc6944e71
4
+ data.tar.gz: 229097dbd02866fa93fa51b834b39dcfba7a97a9
5
5
  SHA512:
6
- metadata.gz: 8034f148b70ded3b877a486865eadec656bb6a551cc71630d326aa3f81c4bbf2ed87541e6aa7ec5528934cad3d1dab65cc9dbf8adf747e3bf9f5b61531b8a01c
7
- data.tar.gz: cd4abc841445b3e73b4ee385b2e0a762c27a927d02a6814752929650fe6ccc37e06c8ec8e1b73552ede40f1e1652571032ed0ede0fc107ca3eec49d69dcd1e36
6
+ metadata.gz: 084c52d8b2cdd9a38d68f01c1bba6db6ab6d0735efdef1a6d61af31fb248a1ce6d72d2b50e5bf8487edb60d6846d3b15fbdcb3e850202b5413632a26b83d1c50
7
+ data.tar.gz: 588b84ec13efd6538998bba3d0d7422bf3abdd03525f40e0860e84bc675afd7acd0856f0876f44d11cdb0c5bd2e1528df3c76e6b861ffbfa8c01e7f973d0571d
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.7.3] - 2019-07-11
9
+
10
+ Thanks to @cederigo=
11
+ * For a given user, get her list of groups
12
+
8
13
  ## [0.7.2] - 2019-06-17
9
14
 
10
15
  Thanks to @vlad-ro:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keycloak-admin (0.7.2)
4
+ keycloak-admin (0.7.3)
5
5
  http-cookie (~> 1.0, >= 1.0.3)
6
6
  rest-client (~> 2.0)
7
7
 
@@ -10,7 +10,7 @@ GEM
10
10
  specs:
11
11
  byebug (9.1.0)
12
12
  diff-lcs (1.3)
13
- domain_name (0.5.20180417)
13
+ domain_name (0.5.20190701)
14
14
  unf (>= 0.0.5, < 1.0.0)
15
15
  http-cookie (1.0.3)
16
16
  domain_name (~> 0.5)
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.7.2"
15
+ gem "keycloak-admin", "0.7.3"
16
16
  ```
17
17
 
18
18
  ## Login
@@ -50,6 +50,13 @@ module KeycloakAdmin
50
50
  true
51
51
  end
52
52
 
53
+ def groups(user_id)
54
+ response = execute_http do
55
+ RestClient::Resource.new(groups_url(user_id), @configuration.rest_client_options).get(headers)
56
+ end
57
+ JSON.parse(response).map { |group_as_hash| GroupRepresentation.from_hash(group_as_hash) }
58
+ end
59
+
53
60
  def update_password(user_id, new_password)
54
61
  execute_http do
55
62
  RestClient.put(reset_password_url(user_id), {
@@ -86,6 +93,11 @@ module KeycloakAdmin
86
93
  "#{users_url(user_id)}/reset-password"
87
94
  end
88
95
 
96
+ def groups_url(user_id)
97
+ raise ArgumentError.new("user_id must be defined") if user_id.nil?
98
+ "#{users_url(user_id)}/groups"
99
+ end
100
+
89
101
  def impersonation_url(user_id)
90
102
  raise ArgumentError.new("user_id must be defined") if user_id.nil?
91
103
  "#{users_url(user_id)}/impersonation"
@@ -1,3 +1,3 @@
1
1
  module KeycloakAdmin
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
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.7.2
4
+ version: 0.7.3
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-06-17 00:00:00.000000000 Z
11
+ date: 2019-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-cookie