keycloak-admin 1.0.15 → 1.0.17

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
  SHA256:
3
- metadata.gz: 045fe9f1da5f6db7c4c4fdf81292c622af6bf30150f0067f0c16266d73cd2aad
4
- data.tar.gz: 9124de4d0394b9a657365c622ee6a1142b060e22bf0730ce26cdeea3a9dba1d3
3
+ metadata.gz: 20b76c1bb1420309572914deaecf3bc3d56f44ceaf3b0b02b38f5f464eb5e66c
4
+ data.tar.gz: 94da4db63c8918619c813ee14ce9f6e2340a073124ad9746f86a817777b5e75a
5
5
  SHA512:
6
- metadata.gz: aab469430cbf4c63028dfe6d0ea0ddb1a809b88c285b43a2449a3b14f8667147b210590fcb28783fe228fa5b12a6326389354e35a102b1438f155461b7e048da
7
- data.tar.gz: 4072fcb6f9cfa4c7cd169bd78534eb774e1644a58690341ea5fa9abcf1003245d93a732bab1d32ced9b193f8765acb3f9fbb321943a40d41a0362a76a19057f5
6
+ metadata.gz: c75e35d6003d82710f80f5e462718bb8aec7bc28e1c1a722453e8b7044f006e4b0b22070ee1b6fb90d33d2e029c2fd295fc13828d8bc84a53d841273be3451dd
7
+ data.tar.gz: 140acb4be1a220f7decf254a9482d9b992400c70626833d8ba732e862adfd43e77c572daa204800c65a894ae7ba807905f656888e5faca6ce09acad46ab02143
data/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ 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.17] - 2022-11-02
9
+
10
+ * Delete `Client`
11
+
12
+ ## [1.0.16] - 2022-10-15
13
+
14
+ * Remove `rest-client` warning when adding a group (thanks to @tlloydthwaites)
15
+
8
16
  ## [1.0.15] - 2022-05-23
9
17
 
10
18
  * Delete all "realm" roles mapped to a user
data/Gemfile.lock CHANGED
@@ -1,19 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keycloak-admin (1.0.15)
4
+ keycloak-admin (1.0.17)
5
5
  http-cookie (~> 1.0, >= 1.0.3)
6
6
  rest-client (~> 2.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- byebug (9.1.0)
11
+ byebug (11.1.3)
12
12
  diff-lcs (1.5.0)
13
13
  domain_name (0.5.20190701)
14
14
  unf (>= 0.0.5, < 1.0.0)
15
15
  http-accept (1.7.0)
16
- http-cookie (1.0.4)
16
+ http-cookie (1.0.5)
17
17
  domain_name (~> 0.5)
18
18
  mime-types (3.4.1)
19
19
  mime-types-data (~> 3.2015)
@@ -24,30 +24,30 @@ GEM
24
24
  http-cookie (>= 1.0.2, < 2.0)
25
25
  mime-types (>= 1.16, < 4.0)
26
26
  netrc (~> 0.8)
27
- rspec (3.7.0)
28
- rspec-core (~> 3.7.0)
29
- rspec-expectations (~> 3.7.0)
30
- rspec-mocks (~> 3.7.0)
31
- rspec-core (3.7.1)
32
- rspec-support (~> 3.7.0)
33
- rspec-expectations (3.7.0)
27
+ rspec (3.12.0)
28
+ rspec-core (~> 3.12.0)
29
+ rspec-expectations (~> 3.12.0)
30
+ rspec-mocks (~> 3.12.0)
31
+ rspec-core (3.12.0)
32
+ rspec-support (~> 3.12.0)
33
+ rspec-expectations (3.12.0)
34
34
  diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.7.0)
36
- rspec-mocks (3.7.0)
35
+ rspec-support (~> 3.12.0)
36
+ rspec-mocks (3.12.0)
37
37
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.7.0)
39
- rspec-support (3.7.1)
38
+ rspec-support (~> 3.12.0)
39
+ rspec-support (3.12.0)
40
40
  unf (0.1.4)
41
41
  unf_ext
42
- unf_ext (0.0.8.1)
42
+ unf_ext (0.0.8.2)
43
43
 
44
44
  PLATFORMS
45
45
  ruby
46
46
 
47
47
  DEPENDENCIES
48
- byebug (= 9.1.0)
48
+ byebug (= 11.1.3)
49
49
  keycloak-admin!
50
- rspec (= 3.7.0)
50
+ rspec (= 3.12.0)
51
51
 
52
52
  BUNDLED WITH
53
53
  2.1.4
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.15"
15
+ gem "keycloak-admin", "1.0.17"
16
16
  ```
17
17
 
18
18
  ## Login
@@ -388,6 +388,6 @@ From the `keycloak-admin-api` directory:
388
388
 
389
389
  ```
390
390
  $ docker build . -t keycloak-admin:test
391
- $ docker run -v `pwd`:/usr/src/app/ keycloak-admin:test bundle exec rspec spec
391
+ $ docker run -v `pwd`:/usr/src/app/ keycloak-admin:test rspec spec
392
392
  ```
393
393
 
@@ -19,6 +19,6 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_dependency "http-cookie", "~> 1.0", ">= 1.0.3"
21
21
  spec.add_dependency "rest-client", "~> 2.1"
22
- spec.add_development_dependency "rspec", "3.7.0"
23
- spec.add_development_dependency "byebug", "9.1.0"
22
+ spec.add_development_dependency "rspec", "3.12.0"
23
+ spec.add_development_dependency "byebug", "11.1.3"
24
24
  end
@@ -21,6 +21,13 @@ module KeycloakAdmin
21
21
  JSON.parse(response).map { |client_as_hash| ClientRepresentation.from_hash(client_as_hash) }
22
22
  end
23
23
 
24
+ def delete(id)
25
+ execute_http do
26
+ RestClient::Resource.new(clients_url(id), @configuration.rest_client_options).delete(headers)
27
+ end
28
+ true
29
+ end
30
+
24
31
  def get_service_account_user(client_id)
25
32
  response = execute_http do
26
33
  RestClient::Resource.new(service_account_user_url(client_id), @configuration.rest_client_options).get(headers)
@@ -36,7 +36,7 @@ module KeycloakAdmin
36
36
  @configuration.rest_client_options.merge(
37
37
  method: :put,
38
38
  url: "#{users_url(user_id)}/groups/#{group_id}",
39
- payload: {},
39
+ payload: create_payload({}),
40
40
  headers: headers
41
41
  )
42
42
  )
@@ -1,3 +1,3 @@
1
1
  module KeycloakAdmin
2
- VERSION = "1.0.15"
2
+ VERSION = "1.0.17"
3
3
  end
@@ -50,4 +50,22 @@ RSpec.describe KeycloakAdmin::ClientClient do
50
50
  expect(clients[0].name).to eq "test_client_name"
51
51
  end
52
52
  end
53
+
54
+ describe "#delete" do
55
+ let(:realm_name) { "valid-realm" }
56
+
57
+ before(:each) do
58
+ @client_client = KeycloakAdmin.realm(realm_name).clients
59
+ stub_token_client
60
+ allow_any_instance_of(RestClient::Resource).to receive(:delete).and_return ''
61
+ end
62
+
63
+ it "passes rest client options" do
64
+ rest_client_options = {verify_ssl: OpenSSL::SSL::VERIFY_NONE}
65
+ allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
66
+ expect(RestClient::Resource).to receive(:new).with(
67
+ "http://auth.service.io/auth/admin/realms/valid-realm/clients/95b45037-3980-404c-ba12-784fa1baf2c2", rest_client_options).and_call_original
68
+ @client_client.delete("95b45037-3980-404c-ba12-784fa1baf2c2")
69
+ end
70
+ end
53
71
  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.15
4
+ version: 1.0.17
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-05-23 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-cookie
@@ -50,28 +50,28 @@ dependencies:
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 3.7.0
53
+ version: 3.12.0
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - '='
59
59
  - !ruby/object:Gem::Version
60
- version: 3.7.0
60
+ version: 3.12.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: byebug
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - '='
66
66
  - !ruby/object:Gem::Version
67
- version: 9.1.0
67
+ version: 11.1.3
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - '='
73
73
  - !ruby/object:Gem::Version
74
- version: 9.1.0
74
+ version: 11.1.3
75
75
  description: Keycloak Admin REST API client written in Ruby
76
76
  email:
77
77
  - lorent.lempereur.dev@gmail.com