keycloak-admin 1.1.4 → 1.1.6

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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/Dockerfile +24 -24
  3. data/.github/workflows/ci.yml +80 -80
  4. data/.gitignore +9 -9
  5. data/.rspec +2 -2
  6. data/CHANGELOG.md +23 -0
  7. data/Dockerfile +12 -12
  8. data/Gemfile +3 -3
  9. data/Gemfile.lock +1 -1
  10. data/MIT-LICENSE +20 -20
  11. data/README.md +20 -1
  12. data/bin/console +9 -9
  13. data/keycloak-admin.gemspec +24 -24
  14. data/lib/keycloak-admin/client/attack_detection_client.rb +41 -41
  15. data/lib/keycloak-admin/client/client.rb +56 -56
  16. data/lib/keycloak-admin/client/client_authz_permission_client.rb +80 -80
  17. data/lib/keycloak-admin/client/client_authz_policy_client.rb +75 -75
  18. data/lib/keycloak-admin/client/client_authz_resource_client.rb +92 -92
  19. data/lib/keycloak-admin/client/client_authz_scope_client.rb +70 -70
  20. data/lib/keycloak-admin/client/client_client.rb +71 -71
  21. data/lib/keycloak-admin/client/client_role_client.rb +20 -20
  22. data/lib/keycloak-admin/client/client_role_mappings_client.rb +32 -32
  23. data/lib/keycloak-admin/client/configurable_token_client.rb +35 -35
  24. data/lib/keycloak-admin/client/group_client.rb +148 -148
  25. data/lib/keycloak-admin/client/identity_provider_client.rb +51 -51
  26. data/lib/keycloak-admin/client/organization_client.rb +245 -0
  27. data/lib/keycloak-admin/client/realm_client.rb +126 -122
  28. data/lib/keycloak-admin/client/role_client.rb +59 -59
  29. data/lib/keycloak-admin/client/role_mapper_client.rb +47 -47
  30. data/lib/keycloak-admin/client/token_client.rb +29 -29
  31. data/lib/keycloak-admin/client/user_client.rb +278 -266
  32. data/lib/keycloak-admin/configuration.rb +52 -52
  33. data/lib/keycloak-admin/representation/attack_detection_representation.rb +17 -17
  34. data/lib/keycloak-admin/representation/camel_json.rb +12 -12
  35. data/lib/keycloak-admin/representation/client_authz_permission_representation.rb +33 -33
  36. data/lib/keycloak-admin/representation/client_authz_policy_config_representation.rb +14 -14
  37. data/lib/keycloak-admin/representation/client_authz_policy_representation.rb +26 -26
  38. data/lib/keycloak-admin/representation/client_authz_resource_representation.rb +25 -25
  39. data/lib/keycloak-admin/representation/client_authz_scope_representation.rb +16 -16
  40. data/lib/keycloak-admin/representation/client_representation.rb +71 -71
  41. data/lib/keycloak-admin/representation/credential_representation.rb +71 -38
  42. data/lib/keycloak-admin/representation/federated_identity_representation.rb +15 -15
  43. data/lib/keycloak-admin/representation/group_representation.rb +21 -21
  44. data/lib/keycloak-admin/representation/identity_provider_mapper_representation.rb +19 -19
  45. data/lib/keycloak-admin/representation/identity_provider_representation.rb +71 -67
  46. data/lib/keycloak-admin/representation/impersonation_redirection_representation.rb +16 -16
  47. data/lib/keycloak-admin/representation/impersonation_representation.rb +43 -43
  48. data/lib/keycloak-admin/representation/member_representation.rb +11 -0
  49. data/lib/keycloak-admin/representation/organization_domain_representation.rb +18 -0
  50. data/lib/keycloak-admin/representation/organization_representation.rb +30 -0
  51. data/lib/keycloak-admin/representation/protocol_mapper_representation.rb +19 -19
  52. data/lib/keycloak-admin/representation/realm_representation.rb +14 -14
  53. data/lib/keycloak-admin/representation/representation.rb +23 -23
  54. data/lib/keycloak-admin/representation/role_representation.rb +19 -19
  55. data/lib/keycloak-admin/representation/session_representation.rb +22 -22
  56. data/lib/keycloak-admin/representation/token_representation.rb +39 -39
  57. data/lib/keycloak-admin/representation/user_representation.rb +47 -47
  58. data/lib/keycloak-admin/resource/base_role_containing_resource.rb +28 -28
  59. data/lib/keycloak-admin/resource/group_resource.rb +11 -11
  60. data/lib/keycloak-admin/resource/user_resource.rb +7 -7
  61. data/lib/keycloak-admin/version.rb +3 -3
  62. data/lib/keycloak-admin.rb +88 -84
  63. data/spec/client/attack_detection_client_spec.rb +102 -102
  64. data/spec/client/client_authz_permission_client_spec.rb +170 -170
  65. data/spec/client/client_authz_policy_client_spec.rb +169 -169
  66. data/spec/client/client_authz_resource_client_spec.rb +150 -150
  67. data/spec/client/client_authz_scope_client_spec.rb +133 -133
  68. data/spec/client/client_client_spec.rb +133 -133
  69. data/spec/client/client_role_mappings_client_spec.rb +82 -82
  70. data/spec/client/client_spec.rb +28 -28
  71. data/spec/client/configurable_token_client_spec.rb +34 -34
  72. data/spec/client/group_client_spec.rb +328 -328
  73. data/spec/client/identity_provider_client_spec.rb +92 -92
  74. data/spec/client/organization_client_spec.rb +595 -0
  75. data/spec/client/realm_client_spec.rb +155 -155
  76. data/spec/client/role_client_spec.rb +79 -79
  77. data/spec/client/role_mapper_client_spec.rb +113 -113
  78. data/spec/client/token_client_spec.rb +68 -68
  79. data/spec/client/user_client_spec.rb +418 -373
  80. data/spec/configuration_spec.rb +113 -113
  81. data/spec/integration/client_authorization_spec.rb +93 -93
  82. data/spec/representation/attack_detection_representation_spec.rb +15 -15
  83. data/spec/representation/client_authz_permission_representation_spec.rb +52 -52
  84. data/spec/representation/client_authz_policy_representation_spec.rb +46 -46
  85. data/spec/representation/client_authz_resource_representation_spec.rb +33 -33
  86. data/spec/representation/client_authz_scope_representation_spec.rb +18 -18
  87. data/spec/representation/client_representation_spec.rb +119 -119
  88. data/spec/representation/credential_representation_spec.rb +68 -0
  89. data/spec/representation/group_representation_spec.rb +22 -22
  90. data/spec/representation/identity_provider_mapper_representation_spec.rb +24 -24
  91. data/spec/representation/identity_provider_representation_spec.rb +113 -113
  92. data/spec/representation/impersonation_representation_spec.rb +163 -163
  93. data/spec/representation/organization_representation_spec.rb +64 -0
  94. data/spec/representation/protocol_mapper_representation_spec.rb +57 -57
  95. data/spec/representation/role_representation_spec.rb +37 -37
  96. data/spec/representation/session_representation_spec.rb +15 -15
  97. data/spec/representation/user_representation_spec.rb +15 -15
  98. data/spec/resource/group_resource_spec.rb +14 -14
  99. data/spec/resource/user_resource_spec.rb +14 -14
  100. data/spec/spec_helper.rb +37 -37
  101. metadata +13 -6
@@ -1,155 +1,155 @@
1
- RSpec.describe KeycloakAdmin::RealmClient do
2
- describe "#realm_url" do
3
-
4
- let(:realm_name) { nil }
5
-
6
- before(:each) do
7
- @built_url = KeycloakAdmin.realm(realm_name).realm_url
8
- end
9
-
10
- context "when realm_name is defined" do
11
- let(:realm_name) { "master2" }
12
- it "return a proper url with realm_name" do
13
- expect(@built_url).to eq "http://auth.service.io/auth/realms/master2"
14
- end
15
- end
16
-
17
- context "when realm_name is not defined" do
18
- let(:realm_name) { nil }
19
- it "return a proper url without realm_name" do
20
- expect(@built_url).to eq "http://auth.service.io/auth/realms"
21
- end
22
- end
23
- end
24
-
25
- describe "#admin_realm_url" do
26
-
27
- let(:realm_name) { nil }
28
-
29
- before(:each) do
30
- @built_url = KeycloakAdmin.realm(realm_name).realm_admin_url
31
- end
32
-
33
- context "when realm_name is defined" do
34
- let(:realm_name) { "master2" }
35
- it "return a proper url with realm_name" do
36
- expect(@built_url).to eq "http://auth.service.io/auth/admin/realms/master2"
37
- end
38
- end
39
-
40
- context "when realm_name is not defined" do
41
- let(:realm_name) { nil }
42
- it "return a proper url without realm_name" do
43
- expect(@built_url).to eq "http://auth.service.io/auth/admin/realms"
44
- end
45
- end
46
- end
47
-
48
- describe "#list" do
49
- before(:each) do
50
- @realm_client = KeycloakAdmin.realm('master')
51
-
52
- stub_token_client
53
- allow_any_instance_of(RestClient::Resource).to receive(:get).and_return '[{"id":"test_realm","realm":"test_realm"}]'
54
- end
55
-
56
- it "lists realms" do
57
- realms = @realm_client.list
58
- expect(realms.length).to eq 1
59
- expect(realms[0].realm).to eq "test_realm"
60
- end
61
-
62
- it "passes rest client options" do
63
- rest_client_options = {timeout: 10}
64
- allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
65
-
66
- expect(RestClient::Resource).to receive(:new).with(
67
- "http://auth.service.io/auth/admin/realms", rest_client_options).and_call_original
68
-
69
- realms = @realm_client.list
70
- expect(realms.length).to eq 1
71
- expect(realms[0].realm).to eq "test_realm"
72
- end
73
- end
74
-
75
- describe "#delete" do
76
- let(:realm_name) { "valid-realm" }
77
-
78
- before(:each) do
79
- @realm_client = KeycloakAdmin.realm(realm_name)
80
-
81
- stub_token_client
82
- allow_any_instance_of(RestClient::Resource).to receive(:delete)
83
- end
84
-
85
- it "delete realm" do
86
- expect(@realm_client.delete).to be_truthy
87
- end
88
-
89
- it "passes rest client options" do
90
- rest_client_options = {timeout: 10}
91
- allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
92
-
93
- expect(RestClient::Resource).to receive(:new).with(
94
- "http://auth.service.io/auth/admin/realms/valid-realm", rest_client_options).and_call_original
95
-
96
- expect(@realm_client.delete).to be_truthy
97
- end
98
- end
99
-
100
- describe "#save" do
101
- let(:realm_name) { "valid-realm" }
102
- let(:realm) { KeycloakAdmin::RealmRepresentation.from_hash(
103
- "id" => realm_name,
104
- "realm" => realm_name
105
- )}
106
-
107
- before(:each) do
108
- @realm_client = KeycloakAdmin.realm(nil)
109
-
110
- stub_token_client
111
-
112
- expect_any_instance_of(RestClient::Resource).to receive(:post).with(realm.to_json, anything)
113
- end
114
-
115
- it "saves a realm" do
116
- @realm_client.save(realm)
117
- end
118
-
119
- it "passes rest client options" do
120
- rest_client_options = {timeout: 10}
121
- allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
122
-
123
- expect(RestClient::Resource).to receive(:new).with(
124
- "http://auth.service.io/auth/admin/realms", rest_client_options).and_call_original
125
-
126
- @realm_client.save(realm)
127
- end
128
- end
129
-
130
- describe "#update" do
131
- let(:realm_name) { "valid-realm" }
132
- let(:realm_json) { { smtpServer: { host: 'test_host' } } }
133
-
134
- before(:each) do
135
- @realm_client = KeycloakAdmin.realm(realm_name)
136
-
137
- stub_token_client
138
- expect_any_instance_of(RestClient::Resource).to receive(:put).with(realm_json.to_json, anything)
139
- end
140
-
141
- it "updates a realm" do
142
- @realm_client.update(realm_json)
143
- end
144
-
145
- it "passes rest client options" do
146
- rest_client_options = {timeout: 10}
147
- allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
148
-
149
- expect(RestClient::Resource).to receive(:new).with(
150
- "http://auth.service.io/auth/admin/realms/valid-realm", rest_client_options).and_call_original
151
-
152
- @realm_client.update(realm_json)
153
- end
154
- end
155
- end
1
+ RSpec.describe KeycloakAdmin::RealmClient do
2
+ describe "#realm_url" do
3
+
4
+ let(:realm_name) { nil }
5
+
6
+ before(:each) do
7
+ @built_url = KeycloakAdmin.realm(realm_name).realm_url
8
+ end
9
+
10
+ context "when realm_name is defined" do
11
+ let(:realm_name) { "master2" }
12
+ it "return a proper url with realm_name" do
13
+ expect(@built_url).to eq "http://auth.service.io/auth/realms/master2"
14
+ end
15
+ end
16
+
17
+ context "when realm_name is not defined" do
18
+ let(:realm_name) { nil }
19
+ it "return a proper url without realm_name" do
20
+ expect(@built_url).to eq "http://auth.service.io/auth/realms"
21
+ end
22
+ end
23
+ end
24
+
25
+ describe "#admin_realm_url" do
26
+
27
+ let(:realm_name) { nil }
28
+
29
+ before(:each) do
30
+ @built_url = KeycloakAdmin.realm(realm_name).realm_admin_url
31
+ end
32
+
33
+ context "when realm_name is defined" do
34
+ let(:realm_name) { "master2" }
35
+ it "return a proper url with realm_name" do
36
+ expect(@built_url).to eq "http://auth.service.io/auth/admin/realms/master2"
37
+ end
38
+ end
39
+
40
+ context "when realm_name is not defined" do
41
+ let(:realm_name) { nil }
42
+ it "return a proper url without realm_name" do
43
+ expect(@built_url).to eq "http://auth.service.io/auth/admin/realms"
44
+ end
45
+ end
46
+ end
47
+
48
+ describe "#list" do
49
+ before(:each) do
50
+ @realm_client = KeycloakAdmin.realm('master')
51
+
52
+ stub_token_client
53
+ allow_any_instance_of(RestClient::Resource).to receive(:get).and_return '[{"id":"test_realm","realm":"test_realm"}]'
54
+ end
55
+
56
+ it "lists realms" do
57
+ realms = @realm_client.list
58
+ expect(realms.length).to eq 1
59
+ expect(realms[0].realm).to eq "test_realm"
60
+ end
61
+
62
+ it "passes rest client options" do
63
+ rest_client_options = {timeout: 10}
64
+ allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
65
+
66
+ expect(RestClient::Resource).to receive(:new).with(
67
+ "http://auth.service.io/auth/admin/realms", rest_client_options).and_call_original
68
+
69
+ realms = @realm_client.list
70
+ expect(realms.length).to eq 1
71
+ expect(realms[0].realm).to eq "test_realm"
72
+ end
73
+ end
74
+
75
+ describe "#delete" do
76
+ let(:realm_name) { "valid-realm" }
77
+
78
+ before(:each) do
79
+ @realm_client = KeycloakAdmin.realm(realm_name)
80
+
81
+ stub_token_client
82
+ allow_any_instance_of(RestClient::Resource).to receive(:delete)
83
+ end
84
+
85
+ it "delete realm" do
86
+ expect(@realm_client.delete).to be_truthy
87
+ end
88
+
89
+ it "passes rest client options" do
90
+ rest_client_options = {timeout: 10}
91
+ allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
92
+
93
+ expect(RestClient::Resource).to receive(:new).with(
94
+ "http://auth.service.io/auth/admin/realms/valid-realm", rest_client_options).and_call_original
95
+
96
+ expect(@realm_client.delete).to be_truthy
97
+ end
98
+ end
99
+
100
+ describe "#save" do
101
+ let(:realm_name) { "valid-realm" }
102
+ let(:realm) { KeycloakAdmin::RealmRepresentation.from_hash(
103
+ "id" => realm_name,
104
+ "realm" => realm_name
105
+ )}
106
+
107
+ before(:each) do
108
+ @realm_client = KeycloakAdmin.realm(nil)
109
+
110
+ stub_token_client
111
+
112
+ expect_any_instance_of(RestClient::Resource).to receive(:post).with(realm.to_json, anything)
113
+ end
114
+
115
+ it "saves a realm" do
116
+ @realm_client.save(realm)
117
+ end
118
+
119
+ it "passes rest client options" do
120
+ rest_client_options = {timeout: 10}
121
+ allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
122
+
123
+ expect(RestClient::Resource).to receive(:new).with(
124
+ "http://auth.service.io/auth/admin/realms", rest_client_options).and_call_original
125
+
126
+ @realm_client.save(realm)
127
+ end
128
+ end
129
+
130
+ describe "#update" do
131
+ let(:realm_name) { "valid-realm" }
132
+ let(:realm_json) { { smtpServer: { host: 'test_host' } } }
133
+
134
+ before(:each) do
135
+ @realm_client = KeycloakAdmin.realm(realm_name)
136
+
137
+ stub_token_client
138
+ expect_any_instance_of(RestClient::Resource).to receive(:put).with(realm_json.to_json, anything)
139
+ end
140
+
141
+ it "updates a realm" do
142
+ @realm_client.update(realm_json)
143
+ end
144
+
145
+ it "passes rest client options" do
146
+ rest_client_options = {timeout: 10}
147
+ allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
148
+
149
+ expect(RestClient::Resource).to receive(:new).with(
150
+ "http://auth.service.io/auth/admin/realms/valid-realm", rest_client_options).and_call_original
151
+
152
+ @realm_client.update(realm_json)
153
+ end
154
+ end
155
+ end
@@ -1,79 +1,79 @@
1
- RSpec.describe KeycloakAdmin::RoleClient do
2
- describe "#roles_url" do
3
- let(:realm_name) { "valid-realm" }
4
-
5
- it "return a proper url without role id" do
6
- @built_url = KeycloakAdmin.realm(realm_name).roles.roles_url
7
- expect(@built_url).to eq "http://auth.service.io/auth/admin/realms/valid-realm/roles"
8
- end
9
- end
10
-
11
- describe "#role_id_url" do
12
- let(:realm_name) { "valid-realm" }
13
- let(:role_id) { "95985b21-d884-4bbd-b852-cb8cd365afc2" }
14
-
15
- it "return a proper url with the role id" do
16
- @built_url = KeycloakAdmin.realm(realm_name).roles.role_id_url(role_id)
17
- expect(@built_url).to eq "http://auth.service.io/auth/admin/realms/valid-realm/roles-by-id/95985b21-d884-4bbd-b852-cb8cd365afc2"
18
- end
19
- end
20
-
21
- describe "#list" do
22
- let(:realm_name) { "valid-realm" }
23
-
24
- before(:each) do
25
- @role_client = KeycloakAdmin.realm(realm_name).roles
26
-
27
- stub_token_client
28
- allow_any_instance_of(RestClient::Resource).to receive(:get).and_return '[{"id":"test_role_id","name":"test_role_name"}]'
29
- end
30
-
31
- it "lists roles" do
32
- roles = @role_client.list
33
- expect(roles.length).to eq 1
34
- expect(roles[0].name).to eq "test_role_name"
35
- end
36
-
37
- it "passes rest client options" do
38
- rest_client_options = {timeout: 10}
39
- allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
40
-
41
- expect(RestClient::Resource).to receive(:new).with(
42
- "http://auth.service.io/auth/admin/realms/valid-realm/roles", rest_client_options).and_call_original
43
-
44
- roles = @role_client.list
45
- expect(roles.length).to eq 1
46
- expect(roles[0].name).to eq "test_role_name"
47
- end
48
- end
49
-
50
- describe "#save" do
51
- let(:realm_name) { "valid-realm" }
52
- let(:role) { KeycloakAdmin::RoleRepresentation.from_hash(
53
- "name" => "test_role_name",
54
- "composite" => false,
55
- "clientRole" => false
56
- )}
57
-
58
- before(:each) do
59
- @role_client = KeycloakAdmin.realm(realm_name).roles
60
-
61
- stub_token_client
62
- expect_any_instance_of(RestClient::Resource).to receive(:post).with(role.to_json, anything)
63
- end
64
-
65
- it "saves a role" do
66
- @role_client.save(role)
67
- end
68
-
69
- it "passes rest client options" do
70
- rest_client_options = {timeout: 10}
71
- allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
72
-
73
- expect(RestClient::Resource).to receive(:new).with(
74
- "http://auth.service.io/auth/admin/realms/valid-realm/roles", rest_client_options).and_call_original
75
-
76
- @role_client.save(role)
77
- end
78
- end
79
- end
1
+ RSpec.describe KeycloakAdmin::RoleClient do
2
+ describe "#roles_url" do
3
+ let(:realm_name) { "valid-realm" }
4
+
5
+ it "return a proper url without role id" do
6
+ @built_url = KeycloakAdmin.realm(realm_name).roles.roles_url
7
+ expect(@built_url).to eq "http://auth.service.io/auth/admin/realms/valid-realm/roles"
8
+ end
9
+ end
10
+
11
+ describe "#role_id_url" do
12
+ let(:realm_name) { "valid-realm" }
13
+ let(:role_id) { "95985b21-d884-4bbd-b852-cb8cd365afc2" }
14
+
15
+ it "return a proper url with the role id" do
16
+ @built_url = KeycloakAdmin.realm(realm_name).roles.role_id_url(role_id)
17
+ expect(@built_url).to eq "http://auth.service.io/auth/admin/realms/valid-realm/roles-by-id/95985b21-d884-4bbd-b852-cb8cd365afc2"
18
+ end
19
+ end
20
+
21
+ describe "#list" do
22
+ let(:realm_name) { "valid-realm" }
23
+
24
+ before(:each) do
25
+ @role_client = KeycloakAdmin.realm(realm_name).roles
26
+
27
+ stub_token_client
28
+ allow_any_instance_of(RestClient::Resource).to receive(:get).and_return '[{"id":"test_role_id","name":"test_role_name"}]'
29
+ end
30
+
31
+ it "lists roles" do
32
+ roles = @role_client.list
33
+ expect(roles.length).to eq 1
34
+ expect(roles[0].name).to eq "test_role_name"
35
+ end
36
+
37
+ it "passes rest client options" do
38
+ rest_client_options = {timeout: 10}
39
+ allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
40
+
41
+ expect(RestClient::Resource).to receive(:new).with(
42
+ "http://auth.service.io/auth/admin/realms/valid-realm/roles", rest_client_options).and_call_original
43
+
44
+ roles = @role_client.list
45
+ expect(roles.length).to eq 1
46
+ expect(roles[0].name).to eq "test_role_name"
47
+ end
48
+ end
49
+
50
+ describe "#save" do
51
+ let(:realm_name) { "valid-realm" }
52
+ let(:role) { KeycloakAdmin::RoleRepresentation.from_hash(
53
+ "name" => "test_role_name",
54
+ "composite" => false,
55
+ "clientRole" => false
56
+ )}
57
+
58
+ before(:each) do
59
+ @role_client = KeycloakAdmin.realm(realm_name).roles
60
+
61
+ stub_token_client
62
+ expect_any_instance_of(RestClient::Resource).to receive(:post).with(role.to_json, anything)
63
+ end
64
+
65
+ it "saves a role" do
66
+ @role_client.save(role)
67
+ end
68
+
69
+ it "passes rest client options" do
70
+ rest_client_options = {timeout: 10}
71
+ allow_any_instance_of(KeycloakAdmin::Configuration).to receive(:rest_client_options).and_return rest_client_options
72
+
73
+ expect(RestClient::Resource).to receive(:new).with(
74
+ "http://auth.service.io/auth/admin/realms/valid-realm/roles", rest_client_options).and_call_original
75
+
76
+ @role_client.save(role)
77
+ end
78
+ end
79
+ end