keycloak-admin 1.1.2 → 1.1.3
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/Dockerfile +24 -0
- data/.github/workflows/ci.yml +83 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +3 -3
- data/README.md +267 -1
- data/lib/keycloak-admin/client/client_authz_permission_client.rb +81 -0
- data/lib/keycloak-admin/client/client_authz_policy_client.rb +76 -0
- data/lib/keycloak-admin/client/client_authz_resource_client.rb +93 -0
- data/lib/keycloak-admin/client/client_authz_scope_client.rb +71 -0
- data/lib/keycloak-admin/client/realm_client.rb +16 -0
- data/lib/keycloak-admin/representation/client_authz_permission_representation.rb +34 -0
- data/lib/keycloak-admin/representation/client_authz_policy_config_representation.rb +15 -0
- data/lib/keycloak-admin/representation/client_authz_policy_representation.rb +27 -0
- data/lib/keycloak-admin/representation/client_authz_resource_representation.rb +26 -0
- data/lib/keycloak-admin/representation/client_authz_scope_representation.rb +17 -0
- data/lib/keycloak-admin/version.rb +1 -1
- data/lib/keycloak-admin.rb +9 -0
- data/spec/client/client_authz_permission_client_spec.rb +170 -0
- data/spec/client/client_authz_policy_client_spec.rb +170 -0
- data/spec/client/client_authz_resource_client_spec.rb +150 -0
- data/spec/client/client_authz_scope_client_spec.rb +134 -0
- data/spec/integration/client_authorization_spec.rb +95 -0
- data/spec/representation/client_authz_permission_representation_spec.rb +52 -0
- data/spec/representation/client_authz_policy_representation_spec.rb +47 -0
- data/spec/representation/client_authz_resource_representation_spec.rb +33 -0
- data/spec/representation/client_authz_scope_representation_spec.rb +19 -0
- metadata +23 -3
@@ -0,0 +1,33 @@
|
|
1
|
+
RSpec.describe KeycloakAdmin::ClientAuthzResourceRepresentation do
|
2
|
+
describe '.from_hash' do
|
3
|
+
it 'converts json response to class structure' do
|
4
|
+
rep = described_class.from_hash({
|
5
|
+
"name" => "Default Resource",
|
6
|
+
"type" => "urn:delme-client-id:resources:default",
|
7
|
+
"owner" => {
|
8
|
+
"id" => "d259b451-371b-432a-a526-3508f3a36f3b",
|
9
|
+
"name" => "delme-client-id"
|
10
|
+
},
|
11
|
+
"ownerManagedAccess" => true,
|
12
|
+
"displayName" => "Display Name",
|
13
|
+
"attributes" => { "a" => ["b"]},
|
14
|
+
"_id" => "385966a2-14b9-4cc4-9539-5f2fe1008222",
|
15
|
+
"uris" => ["/*"],
|
16
|
+
"scopes" => [{"id"=>"c0779ce3-0900-4ea3-b1d6-b23e1f19c662",
|
17
|
+
"name" => "GET",
|
18
|
+
"iconUri" => "http=>//asdfasdf"}],
|
19
|
+
"icon_uri" => "http://icon"
|
20
|
+
})
|
21
|
+
expect(rep.id).to eq "385966a2-14b9-4cc4-9539-5f2fe1008222"
|
22
|
+
expect(rep.name).to eq "Default Resource"
|
23
|
+
expect(rep.type).to eq "urn:delme-client-id:resources:default"
|
24
|
+
expect(rep.uris).to eq ["/*"]
|
25
|
+
expect(rep.owner_managed_access).to eq true
|
26
|
+
expect(rep.attributes).to eq({ :"a" => ["b"]})
|
27
|
+
expect(rep.display_name).to eq "Display Name"
|
28
|
+
expect(rep.scopes[0].id).to eq "c0779ce3-0900-4ea3-b1d6-b23e1f19c662"
|
29
|
+
expect(rep.scopes[0].name).to eq "GET"
|
30
|
+
expect(rep).to be_a described_class
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe KeycloakAdmin::ClientAuthzScopeRepresentation do
|
4
|
+
describe '.from_hash' do
|
5
|
+
it 'converts json response to class structure' do
|
6
|
+
rep = described_class.from_hash({
|
7
|
+
"id" =>"c0779ce3-0900-4ea3-b1d6-b23e1f19c662",
|
8
|
+
"name" => "GET",
|
9
|
+
"iconUri" => "http://asdfasdf/image.png",
|
10
|
+
"displayName" => "GET authz scope"
|
11
|
+
})
|
12
|
+
expect(rep.id).to eq "c0779ce3-0900-4ea3-b1d6-b23e1f19c662"
|
13
|
+
expect(rep.name).to eq "GET"
|
14
|
+
expect(rep.icon_uri).to eq "http://asdfasdf/image.png"
|
15
|
+
expect(rep.display_name).to eq "GET authz scope"
|
16
|
+
expect(rep).to be_a described_class
|
17
|
+
end
|
18
|
+
end
|
19
|
+
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.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorent Lempereur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-cookie
|
@@ -79,6 +79,8 @@ executables: []
|
|
79
79
|
extensions: []
|
80
80
|
extra_rdoc_files: []
|
81
81
|
files:
|
82
|
+
- ".github/workflows/Dockerfile"
|
83
|
+
- ".github/workflows/ci.yml"
|
82
84
|
- ".gitignore"
|
83
85
|
- ".rspec"
|
84
86
|
- CHANGELOG.md
|
@@ -92,6 +94,10 @@ files:
|
|
92
94
|
- lib/keycloak-admin.rb
|
93
95
|
- lib/keycloak-admin/client/attack_detection_client.rb
|
94
96
|
- lib/keycloak-admin/client/client.rb
|
97
|
+
- lib/keycloak-admin/client/client_authz_permission_client.rb
|
98
|
+
- lib/keycloak-admin/client/client_authz_policy_client.rb
|
99
|
+
- lib/keycloak-admin/client/client_authz_resource_client.rb
|
100
|
+
- lib/keycloak-admin/client/client_authz_scope_client.rb
|
95
101
|
- lib/keycloak-admin/client/client_client.rb
|
96
102
|
- lib/keycloak-admin/client/client_role_client.rb
|
97
103
|
- lib/keycloak-admin/client/client_role_mappings_client.rb
|
@@ -106,6 +112,11 @@ files:
|
|
106
112
|
- lib/keycloak-admin/configuration.rb
|
107
113
|
- lib/keycloak-admin/representation/attack_detection_representation.rb
|
108
114
|
- lib/keycloak-admin/representation/camel_json.rb
|
115
|
+
- lib/keycloak-admin/representation/client_authz_permission_representation.rb
|
116
|
+
- lib/keycloak-admin/representation/client_authz_policy_config_representation.rb
|
117
|
+
- lib/keycloak-admin/representation/client_authz_policy_representation.rb
|
118
|
+
- lib/keycloak-admin/representation/client_authz_resource_representation.rb
|
119
|
+
- lib/keycloak-admin/representation/client_authz_scope_representation.rb
|
109
120
|
- lib/keycloak-admin/representation/client_representation.rb
|
110
121
|
- lib/keycloak-admin/representation/credential_representation.rb
|
111
122
|
- lib/keycloak-admin/representation/federated_identity_representation.rb
|
@@ -126,6 +137,10 @@ files:
|
|
126
137
|
- lib/keycloak-admin/resource/user_resource.rb
|
127
138
|
- lib/keycloak-admin/version.rb
|
128
139
|
- spec/client/attack_detection_client_spec.rb
|
140
|
+
- spec/client/client_authz_permission_client_spec.rb
|
141
|
+
- spec/client/client_authz_policy_client_spec.rb
|
142
|
+
- spec/client/client_authz_resource_client_spec.rb
|
143
|
+
- spec/client/client_authz_scope_client_spec.rb
|
129
144
|
- spec/client/client_client_spec.rb
|
130
145
|
- spec/client/client_role_mappings_client_spec.rb
|
131
146
|
- spec/client/client_spec.rb
|
@@ -138,7 +153,12 @@ files:
|
|
138
153
|
- spec/client/token_client_spec.rb
|
139
154
|
- spec/client/user_client_spec.rb
|
140
155
|
- spec/configuration_spec.rb
|
156
|
+
- spec/integration/client_authorization_spec.rb
|
141
157
|
- spec/representation/attack_detection_representation_spec.rb
|
158
|
+
- spec/representation/client_authz_permission_representation_spec.rb
|
159
|
+
- spec/representation/client_authz_policy_representation_spec.rb
|
160
|
+
- spec/representation/client_authz_resource_representation_spec.rb
|
161
|
+
- spec/representation/client_authz_scope_representation_spec.rb
|
142
162
|
- spec/representation/client_representation_spec.rb
|
143
163
|
- spec/representation/group_representation_spec.rb
|
144
164
|
- spec/representation/identity_provider_mapper_representation_spec.rb
|
@@ -170,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
190
|
- !ruby/object:Gem::Version
|
171
191
|
version: '0'
|
172
192
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
193
|
+
rubygems_version: 3.5.11
|
174
194
|
signing_key:
|
175
195
|
specification_version: 4
|
176
196
|
summary: Keycloak Admin REST API client written in Ruby
|