Skip to content

Commit 3b639d2

Browse files
Implement webauthn extra origins & Raise KeyCloak version to 24.0.5 in acceptance tests (#313)
* Raise KeyCloak version for acceptance testing to 24.0.5 as minimal version * Implement webauthn & webauthn passwordless extra origins property * Add tests for webauthn & webauthn passwordless extra origins property * Fix keycloak version to module version table in README.md
1 parent 28470a3 commit 3b639d2

File tree

11 files changed

+38
-36
lines changed

11 files changed

+38
-36
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,17 @@ jobs:
6565
- "puppet7"
6666
- "puppet8"
6767
keycloak_version:
68-
- "22.0.0"
69-
- "24.0.3"
68+
- "24.0.5"
7069
keycloak_full:
7170
- "no"
7271
include:
7372
- set: "el8"
7473
puppet: "puppet7"
75-
keycloak_version: "22.0.0"
74+
keycloak_version: "24.0.5"
7675
keycloak_full: "yes"
7776
- set: "el8"
7877
puppet: "puppet8"
79-
keycloak_version: "22.0.0"
80-
keycloak_full: "yes"
81-
- set: "el8"
82-
puppet: "puppet7"
83-
keycloak_version: "24.0.3"
84-
keycloak_full: "yes"
85-
- set: "el8"
86-
puppet: "puppet8"
87-
keycloak_version: "24.0.3"
78+
keycloak_version: "24.0.5"
8879
keycloak_full: "yes"
8980
env:
9081
BUNDLE_WITHOUT: development:release

.sync.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,16 @@ Rakefile:
2525
- puppet7
2626
- puppet8
2727
keycloak_version:
28-
- '22.0.0'
29-
- '24.0.3'
28+
- '24.0.5'
3029
keycloak_full: ['no']
3130
acceptance_includes:
3231
- set: el8
3332
puppet: puppet7
34-
keycloak_version: '22.0.0'
33+
keycloak_version: '24.0.5'
3534
keycloak_full: 'yes'
3635
- set: el8
3736
puppet: puppet8
38-
keycloak_version: '22.0.0'
39-
keycloak_full: 'yes'
40-
- set: el8
41-
puppet: puppet7
42-
keycloak_version: '24.0.3'
43-
keycloak_full: 'yes'
44-
- set: el8
45-
puppet: puppet8
46-
keycloak_version: '24.0.3'
37+
keycloak_version: '24.0.5'
4738
keycloak_full: 'yes'
4839
.gitignore:
4940
paths:

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ For `keycloak_ldap_mapper` ensure the `parent_id` property is set to point to ol
162162

163163
### Supported Versions of Keycloak
164164

165-
Currently this module supports Keycloak version 12.x.
165+
Currently this module supports Keycloak version 24.x.
166166
This module may work on earlier versions but this is the only version tested.
167167

168168
| Keycloak Version | Keycloak Puppet module versions |
169-
| ---------------- | ------------------------------- |
169+
|------------------|---------------------------------|
170170
| 3.x | 2.x |
171171
| 4.x - 6.x | 3.x |
172172
| 6.x - 8.x | 4.x - 5.x |
@@ -176,6 +176,8 @@ This module may work on earlier versions but this is the only version tested.
176176
| 19.x - 21.x | 9.x |
177177
| 21.x | 10.x |
178178
| 22.x - 24.x | 11.x |
179+
| 24.x | 12.x |
180+
| -----------------|---------------------------------|
179181

180182
## Usage
181183

@@ -191,18 +193,18 @@ Install a specific version of Keycloak.
191193

192194
```puppet
193195
class { 'keycloak':
194-
version => '22.0.0',
196+
version => '24.0.0',
195197
db => 'mariadb',
196198
}
197199
```
198200

199201
Upgrading Keycloak version works by changing `version` parameter as long as the `db` parameter is not the default of `dev-file`. An upgrade involves installing the new version without touching the old version, updating the symlink which defaults to `/opt/keycloak`, applying all changes to new version and then restarting the `keycloak` service.
200202

201-
If the previous `version` was `22.0.0` using the following will upgrade to `23.0.0`:
203+
If the previous `version` was `22.0.0` using the following will upgrade to `24.0.0`:
202204

203205
```puppet
204206
class { 'keycloak':
205-
version => '23.0.0',
207+
version => '24.0.0',
206208
db => 'mariadb',
207209
}
208210
```

lib/puppet/type/keycloak_realm.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,11 @@ def insync?(is)
492492
defaultto []
493493
end
494494

495+
newproperty(:web_authn_policy_extra_origins, array_matching: :all, parent: PuppetX::Keycloak::ArrayProperty) do
496+
desc 'webAuthnPolicyExtraOrigins'
497+
defaultto []
498+
end
499+
495500
newproperty(:web_authn_policy_passwordless_rp_entity_name) do
496501
desc 'webAuthnPolicyPasswordlessRpEntityName'
497502
defaultto 'keycloak'
@@ -547,6 +552,11 @@ def insync?(is)
547552
defaultto []
548553
end
549554

555+
newproperty(:web_authn_policy_passwordless_extra_origins, array_matching: :all, parent: PuppetX::Keycloak::ArrayProperty) do
556+
desc 'webAuthnPolicyPasswordlessExtraOrigins'
557+
defaultto []
558+
end
559+
550560
newproperty(:custom_properties) do
551561
desc 'custom properties to pass as realm configurations'
552562
defaultto {}

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
# Only necessary to set if the URL path to Keycloak is modified
223223
class keycloak (
224224
Boolean $manage_install = true,
225-
String $version = '22.0.0',
225+
String $version = '24.0.5',
226226
Optional[Variant[Stdlib::HTTPUrl, Stdlib::HTTPSUrl, Stdlib::Absolutepath]] $package_url= undef,
227227
Optional[Stdlib::Absolutepath] $install_dir = undef,
228228
Array[String[1]] $java_package_dependencies = [],

spec/acceptance/2_realm_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ class { 'keycloak': }
240240
web_authn_policy_create_timeout => 600,
241241
web_authn_policy_avoid_same_authenticator_register => true,
242242
web_authn_policy_acceptable_aaguids => ['d1d1d1d1-d1d1-d1d1-d1d1-d1d1d1d1d1d1'],
243+
web_authn_policy_extra_origins => ['https://example.com'],
243244
web_authn_policy_passwordless_rp_entity_name => 'Keycloak',
244245
web_authn_policy_passwordless_signature_algorithms => ['ES256', 'ES384', 'ES512', 'RS256', 'RS384', 'RS512'],
245246
web_authn_policy_passwordless_rp_id => 'https://example.com',
@@ -250,6 +251,7 @@ class { 'keycloak': }
250251
web_authn_policy_passwordless_create_timeout => 600,
251252
web_authn_policy_passwordless_avoid_same_authenticator_register => true,
252253
web_authn_policy_passwordless_acceptable_aaguids => ['d1d1d1d1-d1d1-d1d1-d1d1-d1d1d1d1d1d1'],
254+
web_authn_policy_passwordless_extra_origins => ['https://example.com'],
253255
}
254256
PUPPET_PP
255257

@@ -337,6 +339,7 @@ class { 'keycloak': }
337339
expect(data['webAuthnPolicyCreateTimeout']).to eq(600)
338340
expect(data['webAuthnPolicyAvoidSameAuthenticatorRegister']).to eq(true)
339341
expect(data['webAuthnPolicyAcceptableAaguids']).to eq(['d1d1d1d1-d1d1-d1d1-d1d1-d1d1d1d1d1d1'])
342+
expect(data['webAuthnPolicyExtraOrigins']).to eq(['https://example.com'])
340343
expect(data['webAuthnPolicyPasswordlessRpEntityName']).to eq('Keycloak')
341344
expect(data['webAuthnPolicyPasswordlessSignatureAlgorithms']).to eq(['ES256', 'ES384', 'ES512', 'RS256', 'RS384', 'RS512'])
342345
expect(data['webAuthnPolicyPasswordlessRpId']).to eq('https://example.com')
@@ -347,6 +350,7 @@ class { 'keycloak': }
347350
expect(data['webAuthnPolicyPasswordlessCreateTimeout']).to eq(600)
348351
expect(data['webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister']).to eq(true)
349352
expect(data['webAuthnPolicyPasswordlessAcceptableAaguids']).to eq(['d1d1d1d1-d1d1-d1d1-d1d1-d1d1d1d1d1d1'])
353+
expect(data['webAuthnPolicyPasswordlessExtraOrigins']).to eq(['https://example.com'])
350354
end
351355
end
352356

spec/classes/init_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
let(:facts) do
99
facts.merge(concat_basedir: '/dne')
1010
end
11-
let(:version) { '22.0.0' }
11+
let(:version) { '24.0.5' }
1212

1313
case facts[:osfamily]
1414
when %r{RedHat}

spec/defines/partial_import_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
let(:facts) do
99
facts.merge(concat_basedir: '/dne')
1010
end
11-
let(:version) { '22.0.0' }
11+
let(:version) { '24.0.5' }
1212
let(:title) { 'test' }
1313
let(:params) do
1414
{

spec/defines/spi_deployment_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
let(:facts) do
99
facts.merge(concat_basedir: '/dne')
1010
end
11-
let(:version) { '22.0.0' }
11+
let(:version) { '24.0.5' }
1212
let(:title) { 'duo-spi' }
1313
let(:params) { { deployed_name: 'keycloak-duo-spi-jar-with-dependencies.jar', source: 'https://example.com/files/keycloak-duo-spi-jar-with-dependencies.jar' } }
1414

spec/spec_helper_acceptance_setup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RSpec.configure do |c|
44
c.add_setting :keycloak_version
55
keycloak_version = if ENV['BEAKER_keycloak_version'].nil? || ENV['BEAKER_keycloak_version'].empty?
6-
'22.0.0'
6+
'24.0.5'
77
else
88
ENV['BEAKER_keycloak_version']
99
end

0 commit comments

Comments
 (0)