keycloak-admin 1.0.23 → 1.0.24
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/keycloak-admin/client/user_client.rb +8 -11
- data/lib/keycloak-admin/version.rb +1 -1
- data/spec/client/user_client_spec.rb +15 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6bc5dc390440dedbf6a682c53717e334e4f174b31e43b7990dae87bed2e0bbf
|
4
|
+
data.tar.gz: b37367aaa9726b48a266b55baf7fcebf772f302c18f215ad0e694d6e60421608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 869a2108bbffcdc242a438a20b6d8c06fa907354e2d0648cac91920d08ba070b2bf9cc35d710f1a1fcb40691176b84b515372af540bdc7383d4835217e9ce989
|
7
|
+
data.tar.gz: ed68ed6de159d1d0bf87c298b49fab7fc94cc1d5f563ef25a2b56e922807ddb98b9fba69f189bc7ccc843380595afce42cc202e14b53f07fcc97f7c141145e43
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,9 @@ 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.24] - 2023-06-07
|
9
|
+
|
10
|
+
* Revert the modifications on the feature 'Update a User' introduced in `1.0.22`. This implementation had breaking changes such as not being able to update several attributes (`first_name`, `email`, etc).
|
8
11
|
|
9
12
|
## [1.0.23] - 2023-06-01
|
10
13
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -20,19 +20,16 @@ module KeycloakAdmin
|
|
20
20
|
user_representation
|
21
21
|
end
|
22
22
|
|
23
|
-
def update(user_id,
|
23
|
+
def update(user_id, user_representation_body)
|
24
24
|
raise ArgumentError.new("user_id must be defined") if user_id.nil?
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
RestClient::Resource.new(users_url(user_id), @configuration.rest_client_options).put(
|
32
|
-
create_payload(user), headers
|
25
|
+
RestClient::Request.execute(
|
26
|
+
@configuration.rest_client_options.merge(
|
27
|
+
method: :put,
|
28
|
+
url: users_url(user_id),
|
29
|
+
payload: create_payload(user_representation_body),
|
30
|
+
headers: headers
|
33
31
|
)
|
34
|
-
|
35
|
-
true
|
32
|
+
)
|
36
33
|
end
|
37
34
|
|
38
35
|
def add_group(user_id, group_id)
|
@@ -289,15 +289,26 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
289
289
|
@user_client = KeycloakAdmin.realm(realm_name).users
|
290
290
|
|
291
291
|
stub_token_client
|
292
|
-
allow_any_instance_of(RestClient::
|
292
|
+
allow_any_instance_of(RestClient::Request).to receive(:execute).and_return "write a better test"
|
293
293
|
end
|
294
294
|
|
295
295
|
context 'when user_id is defined' do
|
296
296
|
let(:user_id) { '95985b21-d884-4bbd-b852-cb8cd365afc2' }
|
297
297
|
|
298
298
|
it 'updates the user details' do
|
299
|
-
|
300
|
-
|
299
|
+
## TODO use this expected payload to check whether it has been sent or not
|
300
|
+
expected_payload = {
|
301
|
+
method: :put,
|
302
|
+
url: "http://auth.service.io/auth/admin/realms/valid-realm/users/95985b21-d884-4bbd-b852-cb8cd365afc2",
|
303
|
+
payload: '{"firstName":"Test","enabled":false}',
|
304
|
+
headers: {
|
305
|
+
Authorization: "Bearer test_access_token",
|
306
|
+
content_type: :json,
|
307
|
+
accept: :json
|
308
|
+
}
|
309
|
+
}
|
310
|
+
response = @user_client.update(user_id, { firstName: 'Test', enabled: false })
|
311
|
+
expect(response).to eq "write a better test"
|
301
312
|
end
|
302
313
|
end
|
303
314
|
|
@@ -306,7 +317,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
306
317
|
|
307
318
|
let(:user_id) { nil }
|
308
319
|
it 'raise argument error' do
|
309
|
-
expect { @user_client.update(user_id, {
|
320
|
+
expect { @user_client.update(user_id, { firstName: 'Test', enabled: false }) }.to raise_error(ArgumentError)
|
310
321
|
end
|
311
322
|
end
|
312
323
|
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.
|
4
|
+
version: 1.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorent Lempereur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-cookie
|