keycloak-admin 1.0.18 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ace7d373b72f614c4bb9a1909c548a1d9331d3898793ee41dbf6466e0b7671ff
4
- data.tar.gz: 0e9a4b975452f558c229d5d692c15395283332180e4ff2ac282c2099f9b19fc8
3
+ metadata.gz: 67ccb78dc55dca61ad8dd44cb0f131dbe1b7a6b6c6449dd68c51fc981ef5439c
4
+ data.tar.gz: 7d3d483d4c1d26b430abc1accb326a7a371cc18c39fdde00845c2ed53dc79593
5
5
  SHA512:
6
- metadata.gz: 428d8cf27e776d7f50711d8a3ec79a0f718505e090a9057edb240fc781c5f56ddc61479159b0cf391d0e1009681cae3dd3bb466e77d28e2f6e1a6150e570bfa7
7
- data.tar.gz: b55e188ba286568cd34d5fbcd136f252997152cd89c85b7890b85fdf543b9f6e2f0392889c6abd420a0d2b3048f6a0530d4fa03630ba53d8b0d76894cdbc5a67
6
+ metadata.gz: 5ef5313937cb5b1442aaf182f10d020a893c86b6d5ce88950f9caa9bde8c115345c48b47b1a2598b49d85e76dbad1d7eea967a8dbc3655d07cfbf152d83471a9
7
+ data.tar.gz: a0373bba411c1e642220b61b25dc790727aad1738a60ca8e0141539eb7f8468eaae73d963255d7fd845072c9feca9530336da658c2a12e041c07218a61d1cf3a
data/CHANGELOG.md CHANGED
@@ -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
+ ## [1.0.19] - 2022-12-03
9
+
10
+ * Remove specific realm roles from user (thanks to @Kazhuu)
11
+ * Get role by name (thanks to @Kazhuu)
12
+
8
13
  ## [1.0.18] - 2022-11-24
9
14
 
10
15
  * List user realm-level role mappings (thanks to @Kazhuu)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keycloak-admin (1.0.18)
4
+ keycloak-admin (1.0.19)
5
5
  http-cookie (~> 1.0, >= 1.0.3)
6
6
  rest-client (~> 2.1)
7
7
 
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", "1.0.18"
15
+ gem "keycloak-admin", "1.0.19"
16
16
  ```
17
17
 
18
18
  ## Login
@@ -12,6 +12,13 @@ module KeycloakAdmin
12
12
  end
13
13
  JSON.parse(response).map { |role_as_hash| RoleRepresentation.from_hash(role_as_hash) }
14
14
  end
15
+
16
+ def get(name)
17
+ response = execute_http do
18
+ RestClient::Resource.new(role_name_url(name), @configuration.rest_client_options).get(headers)
19
+ end
20
+ RoleRepresentation.from_hash JSON.parse(response)
21
+ end
15
22
 
16
23
  def save(role_representation)
17
24
  execute_http do
@@ -28,5 +35,10 @@ module KeycloakAdmin
28
35
  "#{@realm_client.realm_admin_url}/roles"
29
36
  end
30
37
  end
38
+
39
+ def role_name_url(name)
40
+ "#{@realm_client.realm_admin_url}/roles/#{name}"
41
+ end
42
+
31
43
  end
32
44
  end
@@ -20,6 +20,17 @@ module KeycloakAdmin
20
20
  end
21
21
  end
22
22
 
23
+ def remove_realm_level(role_representation_list)
24
+ execute_http do
25
+ RestClient::Request.execute(
26
+ method: :delete,
27
+ url: realm_level_url,
28
+ payload: create_payload(role_representation_list),
29
+ headers: headers
30
+ )
31
+ end
32
+ end
33
+
23
34
  def remove_all_realm_roles
24
35
  execute_http do
25
36
  RestClient::Resource.new(realm_level_url, @configuration.rest_client_options).delete(headers)
@@ -1,3 +1,3 @@
1
1
  module KeycloakAdmin
2
- VERSION = "1.0.18"
2
+ VERSION = "1.0.19"
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: 1.0.18
4
+ version: 1.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorent Lempereur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-24 00:00:00.000000000 Z
11
+ date: 2022-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-cookie