keycloak-admin 1.2.0 → 2.0.0
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/.github/workflows/ci.yml +4 -2
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +17 -20
- data/README.md +9 -5
- data/keycloak-admin.gemspec +4 -3
- data/lib/keycloak-admin/client/attack_detection_client.rb +3 -3
- data/lib/keycloak-admin/client/client.rb +10 -6
- data/lib/keycloak-admin/client/client_authz_permission_client.rb +7 -7
- data/lib/keycloak-admin/client/client_authz_policy_client.rb +5 -5
- data/lib/keycloak-admin/client/client_authz_resource_client.rb +6 -6
- data/lib/keycloak-admin/client/client_authz_scope_client.rb +5 -5
- data/lib/keycloak-admin/client/client_client.rb +6 -6
- data/lib/keycloak-admin/client/client_role_client.rb +1 -1
- data/lib/keycloak-admin/client/client_role_mappings_client.rb +2 -2
- data/lib/keycloak-admin/client/client_scope_client.rb +5 -5
- data/lib/keycloak-admin/client/client_scope_protocol_mapper_client.rb +5 -5
- data/lib/keycloak-admin/client/configurable_token_client.rb +2 -2
- data/lib/keycloak-admin/client/group_client.rb +13 -13
- data/lib/keycloak-admin/client/identity_provider_client.rb +4 -4
- data/lib/keycloak-admin/client/organization_client.rb +18 -18
- data/lib/keycloak-admin/client/realm_client.rb +4 -4
- data/lib/keycloak-admin/client/role_client.rb +6 -6
- data/lib/keycloak-admin/client/role_mapper_client.rb +7 -7
- data/lib/keycloak-admin/client/token_client.rb +1 -3
- data/lib/keycloak-admin/client/user_client.rb +24 -24
- data/lib/keycloak-admin/configuration.rb +1 -1
- data/lib/keycloak-admin/version.rb +1 -1
- data/lib/keycloak-admin.rb +3 -1
- data/spec/client/attack_detection_client_spec.rb +3 -3
- data/spec/client/client_authz_permission_client_spec.rb +5 -5
- data/spec/client/client_authz_policy_client_spec.rb +5 -5
- data/spec/client/client_authz_resource_client_spec.rb +7 -7
- data/spec/client/client_authz_scope_client_spec.rb +5 -5
- data/spec/client/client_client_spec.rb +14 -14
- data/spec/client/client_role_mappings_client_spec.rb +10 -10
- data/spec/client/client_scope_client_spec.rb +7 -7
- data/spec/client/client_scope_protocol_mapper_client_spec.rb +7 -7
- data/spec/client/client_spec.rb +27 -7
- data/spec/client/group_client_spec.rb +47 -47
- data/spec/client/identity_provider_client_spec.rb +5 -5
- data/spec/client/organization_client_spec.rb +31 -31
- data/spec/client/realm_client_spec.rb +20 -20
- data/spec/client/role_client_spec.rb +10 -10
- data/spec/client/role_mapper_client_spec.rb +10 -10
- data/spec/client/token_client_spec.rb +5 -5
- data/spec/client/user_client_spec.rb +29 -29
- data/spec/configuration_spec.rb +2 -2
- data/spec/gemspec_spec.rb +25 -0
- data/spec/integration/client_authorization_spec.rb +4 -4
- data/spec/representation/client_authz_policy_representation_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -8
- metadata +22 -7
|
@@ -20,7 +20,7 @@ RSpec.describe KeycloakAdmin::RoleMapperClient do
|
|
|
20
20
|
@role_mapper_client = KeycloakAdmin.realm(realm_name).user(user_id).role_mapper
|
|
21
21
|
|
|
22
22
|
stub_token_client
|
|
23
|
-
allow_any_instance_of(
|
|
23
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:get)
|
|
24
24
|
.and_return '[{"id":"test_role_id","name":"test_role_name","composite": false}]'
|
|
25
25
|
end
|
|
26
26
|
|
|
@@ -48,7 +48,7 @@ RSpec.describe KeycloakAdmin::RoleMapperClient do
|
|
|
48
48
|
@role_mapper_client = KeycloakAdmin.realm(realm_name).user(user_id).role_mapper
|
|
49
49
|
|
|
50
50
|
stub_token_client
|
|
51
|
-
expect_any_instance_of(
|
|
51
|
+
expect_any_instance_of(KeycloakAdmin::Resource).to receive(:post).with(role_list.to_json, anything)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
it "saves realm-elevel role mappings" do
|
|
@@ -56,11 +56,11 @@ RSpec.describe KeycloakAdmin::RoleMapperClient do
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
it "passes rest client options" do
|
|
59
|
-
|
|
60
|
-
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:
|
|
59
|
+
faraday_options = {timeout: 10}
|
|
60
|
+
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:faraday_options).and_return faraday_options
|
|
61
61
|
|
|
62
|
-
expect(
|
|
63
|
-
"http://auth.service.io/auth/admin/realms/valid-realm/users/test_user/role-mappings/realm",
|
|
62
|
+
expect(KeycloakAdmin::Resource).to receive(:new).with(
|
|
63
|
+
"http://auth.service.io/auth/admin/realms/valid-realm/users/test_user/role-mappings/realm", faraday_options).and_call_original
|
|
64
64
|
|
|
65
65
|
@role_mapper_client.save_realm_level(role_list)
|
|
66
66
|
end
|
|
@@ -83,7 +83,7 @@ RSpec.describe KeycloakAdmin::RoleMapperClient do
|
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
it "removes realm-level role mappings" do
|
|
86
|
-
expect(
|
|
86
|
+
expect(KeycloakAdmin::Resource).to receive(:execute).with(
|
|
87
87
|
hash_including(
|
|
88
88
|
method: :delete,
|
|
89
89
|
url: expected_url,
|
|
@@ -95,10 +95,10 @@ RSpec.describe KeycloakAdmin::RoleMapperClient do
|
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
it "passes rest client options" do
|
|
98
|
-
|
|
99
|
-
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:
|
|
98
|
+
faraday_options = {timeout: 10}
|
|
99
|
+
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:faraday_options).and_return faraday_options
|
|
100
100
|
|
|
101
|
-
expect(
|
|
101
|
+
expect(KeycloakAdmin::Resource).to receive(:execute).with(
|
|
102
102
|
hash_including(
|
|
103
103
|
method: :delete,
|
|
104
104
|
url: expected_url,
|
|
@@ -49,12 +49,12 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
it "passes rest client options" do
|
|
52
|
-
|
|
53
|
-
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:
|
|
52
|
+
faraday_options = {timeout: 10}
|
|
53
|
+
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:faraday_options).and_return faraday_options
|
|
54
54
|
stub_post
|
|
55
55
|
|
|
56
|
-
expect(
|
|
57
|
-
"http://auth.service.io/auth/realms/valid-realm/protocol/openid-connect/token",
|
|
56
|
+
expect(KeycloakAdmin::Resource).to receive(:new).with(
|
|
57
|
+
"http://auth.service.io/auth/realms/valid-realm/protocol/openid-connect/token", faraday_options).and_call_original
|
|
58
58
|
|
|
59
59
|
@token_client.get
|
|
60
60
|
end
|
|
@@ -62,7 +62,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
62
62
|
def stub_post
|
|
63
63
|
response = double
|
|
64
64
|
allow(response).to receive(:body).and_return '{"access_token":"test_access_token"}'
|
|
65
|
-
allow_any_instance_of(
|
|
65
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:post).and_return response
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
68
|
end
|
|
@@ -133,7 +133,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
133
133
|
@user_client = KeycloakAdmin.realm(realm_name).users
|
|
134
134
|
|
|
135
135
|
stub_token_client
|
|
136
|
-
allow_any_instance_of(
|
|
136
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:post)
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
it "saves a user" do
|
|
@@ -141,11 +141,11 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
it "passes rest client options" do
|
|
144
|
-
|
|
145
|
-
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:
|
|
144
|
+
faraday_options = {timeout: 10}
|
|
145
|
+
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:faraday_options).and_return faraday_options
|
|
146
146
|
|
|
147
|
-
expect(
|
|
148
|
-
"http://auth.service.io/auth/admin/realms/valid-realm/users",
|
|
147
|
+
expect(KeycloakAdmin::Resource).to receive(:new).with(
|
|
148
|
+
"http://auth.service.io/auth/admin/realms/valid-realm/users", faraday_options).and_call_original
|
|
149
149
|
|
|
150
150
|
expect(@user_client.save(user)).to eq user
|
|
151
151
|
end
|
|
@@ -158,7 +158,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
158
158
|
@user_client = KeycloakAdmin.realm(realm_name).users
|
|
159
159
|
|
|
160
160
|
stub_token_client
|
|
161
|
-
allow_any_instance_of(
|
|
161
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:get).and_return '{"username":"test_username","createdTimestamp":1559347200, "requiredActions":["CONFIGURE_TOTP"], "totp": true}'
|
|
162
162
|
end
|
|
163
163
|
|
|
164
164
|
it "parses the response" do
|
|
@@ -167,11 +167,11 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
it "passes rest client options" do
|
|
170
|
-
|
|
171
|
-
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:
|
|
170
|
+
faraday_options = {timeout: 10}
|
|
171
|
+
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:faraday_options).and_return faraday_options
|
|
172
172
|
|
|
173
|
-
expect(
|
|
174
|
-
"http://auth.service.io/auth/admin/realms/valid-realm/users/test_user_id",
|
|
173
|
+
expect(KeycloakAdmin::Resource).to receive(:new).with(
|
|
174
|
+
"http://auth.service.io/auth/admin/realms/valid-realm/users/test_user_id", faraday_options).and_call_original
|
|
175
175
|
|
|
176
176
|
user = @user_client.get('test_user_id')
|
|
177
177
|
expect(user.username).to eq 'test_username'
|
|
@@ -191,7 +191,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
191
191
|
@user_client = KeycloakAdmin.realm(realm_name).users
|
|
192
192
|
|
|
193
193
|
stub_token_client
|
|
194
|
-
allow_any_instance_of(
|
|
194
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:get).and_return '[{"username":"test_username","createdTimestamp":1559347200}]'
|
|
195
195
|
end
|
|
196
196
|
|
|
197
197
|
it "finds a user using a string" do
|
|
@@ -213,11 +213,11 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
213
213
|
end
|
|
214
214
|
|
|
215
215
|
it "passes rest client options" do
|
|
216
|
-
|
|
217
|
-
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:
|
|
216
|
+
faraday_options = {timeout: 10}
|
|
217
|
+
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:faraday_options).and_return faraday_options
|
|
218
218
|
|
|
219
|
-
expect(
|
|
220
|
-
"http://auth.service.io/auth/admin/realms/valid-realm/users",
|
|
219
|
+
expect(KeycloakAdmin::Resource).to receive(:new).with(
|
|
220
|
+
"http://auth.service.io/auth/admin/realms/valid-realm/users", faraday_options).and_call_original
|
|
221
221
|
|
|
222
222
|
users = @user_client.search("test_username")
|
|
223
223
|
expect(users.length).to eq 1
|
|
@@ -236,7 +236,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
236
236
|
@user_client = KeycloakAdmin.realm(realm_name).users
|
|
237
237
|
|
|
238
238
|
stub_token_client
|
|
239
|
-
allow_any_instance_of(
|
|
239
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:get).and_return '[{"username":"test_username","createdTimestamp":1559347200}]'
|
|
240
240
|
end
|
|
241
241
|
|
|
242
242
|
it "lists users" do
|
|
@@ -246,11 +246,11 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
246
246
|
end
|
|
247
247
|
|
|
248
248
|
it "passes rest client options" do
|
|
249
|
-
|
|
250
|
-
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:
|
|
249
|
+
faraday_options = {timeout: 10}
|
|
250
|
+
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:faraday_options).and_return faraday_options
|
|
251
251
|
|
|
252
|
-
expect(
|
|
253
|
-
"http://auth.service.io/auth/admin/realms/valid-realm/users",
|
|
252
|
+
expect(KeycloakAdmin::Resource).to receive(:new).with(
|
|
253
|
+
"http://auth.service.io/auth/admin/realms/valid-realm/users", faraday_options).and_call_original
|
|
254
254
|
|
|
255
255
|
users = @user_client.list
|
|
256
256
|
expect(users.length).to eq 1
|
|
@@ -265,7 +265,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
265
265
|
@user_client = KeycloakAdmin.realm(realm_name).users
|
|
266
266
|
|
|
267
267
|
stub_token_client
|
|
268
|
-
allow_any_instance_of(
|
|
268
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:delete)
|
|
269
269
|
end
|
|
270
270
|
|
|
271
271
|
it "does not fail" do
|
|
@@ -273,11 +273,11 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
273
273
|
end
|
|
274
274
|
|
|
275
275
|
it "passes rest client options" do
|
|
276
|
-
|
|
277
|
-
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:
|
|
276
|
+
faraday_options = {timeout: 10}
|
|
277
|
+
allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:faraday_options).and_return faraday_options
|
|
278
278
|
|
|
279
|
-
expect(
|
|
280
|
-
"http://auth.service.io/auth/admin/realms/valid-realm/users/test_user_id",
|
|
279
|
+
expect(KeycloakAdmin::Resource).to receive(:new).with(
|
|
280
|
+
"http://auth.service.io/auth/admin/realms/valid-realm/users/test_user_id", faraday_options).and_call_original
|
|
281
281
|
|
|
282
282
|
@user_client.delete('test_user_id')
|
|
283
283
|
end
|
|
@@ -289,7 +289,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
289
289
|
@user_client = KeycloakAdmin.realm(realm_name).users
|
|
290
290
|
|
|
291
291
|
stub_token_client
|
|
292
|
-
|
|
292
|
+
allow(KeycloakAdmin::Resource).to receive(:execute).and_return "write a better test"
|
|
293
293
|
end
|
|
294
294
|
|
|
295
295
|
context 'when user_id is defined' do
|
|
@@ -328,7 +328,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
328
328
|
before(:each) do
|
|
329
329
|
@user_client = KeycloakAdmin.realm(realm_name).users
|
|
330
330
|
stub_token_client
|
|
331
|
-
allow_any_instance_of(
|
|
331
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:get).and_return '[{"id":"95985b21-d884-4bbd-b852-dsfsdfsd","username":"test_username", "ip_address":"0.0.0.0"}]'
|
|
332
332
|
end
|
|
333
333
|
|
|
334
334
|
context 'when user_id is defined' do
|
|
@@ -353,7 +353,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
353
353
|
before(:each) do
|
|
354
354
|
@user_client = KeycloakAdmin.realm(realm_name).users
|
|
355
355
|
stub_token_client
|
|
356
|
-
|
|
356
|
+
allow(KeycloakAdmin::Resource).to receive(:execute)
|
|
357
357
|
end
|
|
358
358
|
|
|
359
359
|
context 'when user_id is defined' do
|
|
@@ -395,7 +395,7 @@ RSpec.describe KeycloakAdmin::TokenClient do
|
|
|
395
395
|
}
|
|
396
396
|
]
|
|
397
397
|
payload
|
|
398
|
-
allow_any_instance_of(
|
|
398
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:get).and_return json_payload
|
|
399
399
|
end
|
|
400
400
|
|
|
401
401
|
context 'when user_id is defined' do
|
data/spec/configuration_spec.rb
CHANGED
|
@@ -6,7 +6,7 @@ RSpec.describe KeycloakAdmin::RealmClient do
|
|
|
6
6
|
let(:use_service_account) { true }
|
|
7
7
|
let(:username) { "a" }
|
|
8
8
|
let(:password) { "b" }
|
|
9
|
-
let(:
|
|
9
|
+
let(:faraday_options) { {timeout: 10 } }
|
|
10
10
|
|
|
11
11
|
before(:each) do
|
|
12
12
|
@configuration = KeycloakAdmin::Configuration.new
|
|
@@ -18,7 +18,7 @@ RSpec.describe KeycloakAdmin::RealmClient do
|
|
|
18
18
|
@configuration.use_service_account = use_service_account
|
|
19
19
|
@configuration.username = username
|
|
20
20
|
@configuration.password = password
|
|
21
|
-
@configuration.
|
|
21
|
+
@configuration.faraday_options = faraday_options
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
describe "#headers_for_token_retrieval" do
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
RSpec.describe "keycloak-admin.gemspec" do
|
|
2
|
+
let(:gemspec_path) { File.expand_path("../keycloak-admin.gemspec", __dir__) }
|
|
3
|
+
let(:gemspec) { Gem::Specification.load(gemspec_path) }
|
|
4
|
+
|
|
5
|
+
it "loads" do
|
|
6
|
+
expect(gemspec).to be_a(Gem::Specification)
|
|
7
|
+
expect(gemspec.name).to eq "keycloak-admin"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "declares Ruby 3.1 as the minimum supported version" do
|
|
11
|
+
expect(gemspec.required_ruby_version.to_s).to eq ">= 3.1"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The CI matrix runs the oldest supported Ruby. If `required_ruby_version` is
|
|
15
|
+
# ever raised without widening that matrix, or the matrix drops below what the
|
|
16
|
+
# gemspec promises, this fails on the offending job instead of silently
|
|
17
|
+
# shipping a gem that cannot install.
|
|
18
|
+
it "is installable on the Ruby running this suite" do
|
|
19
|
+
running_ruby = Gem::Version.new(RUBY_VERSION)
|
|
20
|
+
|
|
21
|
+
expect(gemspec.required_ruby_version.satisfied_by?(running_ruby)).to be(true),
|
|
22
|
+
"gemspec requires Ruby #{gemspec.required_ruby_version}, " \
|
|
23
|
+
"but the suite is running on #{RUBY_VERSION}"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -10,7 +10,7 @@ RSpec.describe 'ClientAuthorization' do
|
|
|
10
10
|
config.client_realm_name = "master"
|
|
11
11
|
config.username = "admin"
|
|
12
12
|
config.password = "admin"
|
|
13
|
-
config.
|
|
13
|
+
config.faraday_options = { request: { timeout: 5 }, ssl: { verify: false } }
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ RSpec.describe 'ClientAuthorization' do
|
|
|
27
27
|
KeycloakAdmin.realm(realm_name).clients.update(client)
|
|
28
28
|
|
|
29
29
|
expect(KeycloakAdmin.realm(realm_name).authz_scopes(client.id).list.size).to eql(0)
|
|
30
|
-
expect(KeycloakAdmin.realm(realm_name).authz_resources(client.id).list.size).to eql(
|
|
30
|
+
expect(KeycloakAdmin.realm(realm_name).authz_resources(client.id).list.size).to eql(0)
|
|
31
31
|
expect(KeycloakAdmin.realm(realm_name).authz_policies(client.id, 'role').list.size).to eql(0)
|
|
32
32
|
|
|
33
33
|
realm_role = KeycloakAdmin.realm(realm_name).roles.get("default-roles-dummy")
|
|
@@ -70,8 +70,8 @@ RSpec.describe 'ClientAuthorization' do
|
|
|
70
70
|
expect(KeycloakAdmin.realm(realm_name).authz_permissions(client.id, "resource").get(resource_permission.id).name).to eql("Dummy Resource Permission")
|
|
71
71
|
expect(KeycloakAdmin.realm(realm_name).authz_scopes(client.id, resource.id).list.size).to eql(2)
|
|
72
72
|
|
|
73
|
-
expect(KeycloakAdmin.realm(realm_name).authz_permissions(client.id, 'scope').list.size).to eql(
|
|
74
|
-
expect(KeycloakAdmin.realm(realm_name).authz_permissions(client.id, 'resource').list.size).to eql(
|
|
73
|
+
expect(KeycloakAdmin.realm(realm_name).authz_permissions(client.id, 'scope').list.size).to eql(2)
|
|
74
|
+
expect(KeycloakAdmin.realm(realm_name).authz_permissions(client.id, 'resource').list.size).to eql(2)
|
|
75
75
|
expect(KeycloakAdmin.realm(realm_name).authz_permissions(client.id, "resource").find_by(resource_permission.name, nil).first.name).to eql("Dummy Resource Permission")
|
|
76
76
|
expect(KeycloakAdmin.realm(realm_name).authz_permissions(client.id, "resource").find_by(resource_permission.name, resource.id).first.name).to eql("Dummy Resource Permission")
|
|
77
77
|
expect(KeycloakAdmin.realm(realm_name).authz_permissions(client.id, "scope").find_by(scope_permission.name, resource.id).first.name).to eql("Dummy Scope Permission")
|
|
@@ -30,7 +30,7 @@ RSpec.describe KeycloakAdmin::ClientAuthzPolicyRepresentation do
|
|
|
30
30
|
|
|
31
31
|
describe "#create!" do
|
|
32
32
|
before(:each) do
|
|
33
|
-
allow_any_instance_of(
|
|
33
|
+
allow_any_instance_of(KeycloakAdmin::Resource).to receive(:post).and_return policy.to_json
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
it "returns created authz policy" do
|
data/spec/spec_helper.rb
CHANGED
|
@@ -27,11 +27,3 @@ def stub_token_client
|
|
|
27
27
|
"refresh_expires_in", "id_token", "not_before_policy", "session_state"
|
|
28
28
|
)
|
|
29
29
|
end
|
|
30
|
-
|
|
31
|
-
def stub_net_http_res(res_class, code, message)
|
|
32
|
-
net_http_res = double(message: message, code: code)
|
|
33
|
-
allow(net_http_res).to receive(:is_a?) do |target_class|
|
|
34
|
-
target_class == res_class
|
|
35
|
-
end
|
|
36
|
-
allow(@response).to receive(:net_http_res).and_return(net_http_res)
|
|
37
|
-
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: keycloak-admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lorent Lempereur
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: http-cookie
|
|
@@ -30,7 +30,7 @@ dependencies:
|
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
31
|
version: 1.0.3
|
|
32
32
|
- !ruby/object:Gem::Dependency
|
|
33
|
-
name:
|
|
33
|
+
name: faraday
|
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
|
35
35
|
requirements:
|
|
36
36
|
- - "~>"
|
|
@@ -43,6 +43,20 @@ dependencies:
|
|
|
43
43
|
- - "~>"
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
45
|
version: '2.0'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: base64
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0'
|
|
53
|
+
type: :runtime
|
|
54
|
+
prerelease: false
|
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
46
60
|
- !ruby/object:Gem::Dependency
|
|
47
61
|
name: rspec
|
|
48
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -63,14 +77,14 @@ dependencies:
|
|
|
63
77
|
requirements:
|
|
64
78
|
- - '='
|
|
65
79
|
- !ruby/object:Gem::Version
|
|
66
|
-
version:
|
|
80
|
+
version: 12.0.0
|
|
67
81
|
type: :development
|
|
68
82
|
prerelease: false
|
|
69
83
|
version_requirements: !ruby/object:Gem::Requirement
|
|
70
84
|
requirements:
|
|
71
85
|
- - '='
|
|
72
86
|
- !ruby/object:Gem::Version
|
|
73
|
-
version:
|
|
87
|
+
version: 12.0.0
|
|
74
88
|
description: Keycloak Admin REST API client written in Ruby
|
|
75
89
|
email:
|
|
76
90
|
- lorent.lempereur.dev@gmail.com
|
|
@@ -162,6 +176,7 @@ files:
|
|
|
162
176
|
- spec/client/token_client_spec.rb
|
|
163
177
|
- spec/client/user_client_spec.rb
|
|
164
178
|
- spec/configuration_spec.rb
|
|
179
|
+
- spec/gemspec_spec.rb
|
|
165
180
|
- spec/integration/client_authorization_spec.rb
|
|
166
181
|
- spec/representation/attack_detection_representation_spec.rb
|
|
167
182
|
- spec/representation/client_authz_permission_representation_spec.rb
|
|
@@ -194,14 +209,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
194
209
|
requirements:
|
|
195
210
|
- - ">="
|
|
196
211
|
- !ruby/object:Gem::Version
|
|
197
|
-
version: '
|
|
212
|
+
version: '3.1'
|
|
198
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
214
|
requirements:
|
|
200
215
|
- - ">="
|
|
201
216
|
- !ruby/object:Gem::Version
|
|
202
217
|
version: '0'
|
|
203
218
|
requirements: []
|
|
204
|
-
rubygems_version:
|
|
219
|
+
rubygems_version: 4.0.17
|
|
205
220
|
specification_version: 4
|
|
206
221
|
summary: Keycloak Admin REST API client written in Ruby
|
|
207
222
|
test_files: []
|