Skip to content

Commit

Permalink
Add unit tests for bruteforce and webauthn properties
Browse files Browse the repository at this point in the history
  • Loading branch information
TuningYourCode committed Jun 14, 2024
1 parent 31fdd37 commit 53ae965
Showing 1 changed file with 76 additions and 5 deletions.
81 changes: 76 additions & 5 deletions spec/unit/puppet/type/keycloak_realm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,68 @@
admin_events_enabled: :false,
admin_events_details_enabled: :false,
offline_session_max_lifespan_enabled: :false,
internationalization_enabled: :false
internationalization_enabled: :false,
permanent_lockout: :false,
max_failure_wait_seconds: 900,
minimum_quick_login_wait_seconds: 60,
wait_increment_seconds: 60,
quick_login_check_milli_seconds: 1_000,
max_delta_time_seconds: 43_200,
failure_factor: 30,
web_authn_policy_rp_entity_name: 'keycloak',
web_authn_policy_signature_algorithms: ['ES256'],
web_authn_policy_rp_id: '',
web_authn_policy_attestation_conveyance_preference: 'not specified',
web_authn_policy_authenticator_attachment: 'not specified',
web_authn_policy_require_resident_key: 'not specified',
web_authn_policy_user_verification_requirement: 'not specified',
web_authn_policy_create_timeout: 0,
web_authn_policy_avoid_same_authenticator_register: :false,
web_authn_policy_acceptable_aaguids: []
}

# Test enumerable properties
describe 'enumerable properties' do
{
web_authn_policy_attestation_conveyance_preference: ['none', 'indirect', 'direct'],
web_authn_policy_authenticator_attachment: ['platform', 'cross-platform'],
web_authn_policy_require_resident_key: ['Yes', 'No'],
web_authn_policy_user_verification_requirement: ['required', 'preferred', 'discouraged']
}.each do |p, values|
values.each do |v|
it "accepts #{v} for #{p}" do

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts none for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "none" got: :none (compared using ==) Diff: @@ -1 +1 @@ -"none" +:none

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts indirect for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "indirect" got: :indirect (compared using ==) Diff: @@ -1 +1 @@ -"indirect" +:indirect

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts direct for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "direct" got: :direct (compared using ==) Diff: @@ -1 +1 @@ -"direct" +:direct

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts platform for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(v) expected: "platform" got: :platform (compared using ==) Diff: @@ -1 +1 @@ -"platform" +:platform

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts cross-platform for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(v) expected: "cross-platform" got: :"cross-platform" (compared using ==) Diff: @@ -1 +1 @@ -"cross-platform" +:"cross-platform"

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts Yes for web_authn_policy_require_resident_key Failure/Error: expect(resource[p]).to eq(v) expected: "Yes" got: :Yes (compared using ==) Diff: @@ -1 +1 @@ -"Yes" +:Yes

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts none for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "none" got: :none (compared using ==) Diff: @@ -1 +1 @@ -"none" +:none

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts indirect for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "indirect" got: :indirect (compared using ==) Diff: @@ -1 +1 @@ -"indirect" +:indirect

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts direct for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "direct" got: :direct (compared using ==) Diff: @@ -1 +1 @@ -"direct" +:direct

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts platform for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(v) expected: "platform" got: :platform (compared using ==) Diff: @@ -1 +1 @@ -"platform" +:platform

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts cross-platform for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(v) expected: "cross-platform" got: :"cross-platform" (compared using ==) Diff: @@ -1 +1 @@ -"cross-platform" +:"cross-platform"

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts Yes for web_authn_policy_require_resident_key Failure/Error: expect(resource[p]).to eq(v) expected: "Yes" got: :Yes (compared using ==) Diff: @@ -1 +1 @@ -"Yes" +:Yes

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts none for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "none" got: :none (compared using ==) Diff: @@ -1 +1 @@ -"none" +:none

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts indirect for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "indirect" got: :indirect (compared using ==) Diff: @@ -1 +1 @@ -"indirect" +:indirect

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts direct for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "direct" got: :direct (compared using ==) Diff: @@ -1 +1 @@ -"direct" +:direct

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts platform for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(v) expected: "platform" got: :platform (compared using ==) Diff: @@ -1 +1 @@ -"platform" +:platform

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts cross-platform for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(v) expected: "cross-platform" got: :"cross-platform" (compared using ==) Diff: @@ -1 +1 @@ -"cross-platform" +:"cross-platform"

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts Yes for web_authn_policy_require_resident_key Failure/Error: expect(resource[p]).to eq(v) expected: "Yes" got: :Yes (compared using ==) Diff: @@ -1 +1 @@ -"Yes" +:Yes

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts none for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "none" got: :none (compared using ==) Diff: @@ -1 +1 @@ -"none" +:none

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts indirect for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "indirect" got: :indirect (compared using ==) Diff: @@ -1 +1 @@ -"indirect" +:indirect

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts direct for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(v) expected: "direct" got: :direct (compared using ==) Diff: @@ -1 +1 @@ -"direct" +:direct

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts platform for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(v) expected: "platform" got: :platform (compared using ==) Diff: @@ -1 +1 @@ -"platform" +:platform

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts cross-platform for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(v) expected: "cross-platform" got: :"cross-platform" (compared using ==) Diff: @@ -1 +1 @@ -"cross-platform" +:"cross-platform"

Check failure on line 89 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties accepts Yes for web_authn_policy_require_resident_key Failure/Error: expect(resource[p]).to eq(v) expected: "Yes" got: :Yes (compared using ==) Diff: @@ -1 +1 @@ -"Yes" +:Yes
config[p] = v
expect(resource[p]).to eq(v)
end
end

it "does not accept foo for #{p}" do
config[p] = 'foo'
expect {
resource
}.to raise_error(%r{foo})
end

it "does not accept empty for #{p}" do

Check failure on line 102 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties does not accept empty for web_authn_policy_attestation_conveyance_preference Failure/Error: expect { resource }.to raise_error(%r{''}) expected Exception with message matching /''/, got #<Puppet::ResourceError: Parameter web_authn_policy_attestation_conveyance_preference failed on Keycloak_realm[test]: Invalid value "". Valid values are none, direct, indirect, not specified.> with backtrace: # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter/value_collection.rb:191:in `validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter.rb:464:in `unsafe_validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:579:in `unsafe_validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter.rb:479:in `validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `block in should=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `should=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:608:in `value=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:690:in `[]=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2451:in `block in set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2446:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2446:in `set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2343:in `initialize' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `new' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:105:in `block (5 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:104:in `block (4 levels) in <top (required)>'

Check failure on line 102 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties does not accept empty for web_authn_policy_authenticator_attachment Failure/Error: expect { resource }.to raise_error(%r{''}) expected Exception with message matching /''/, got #<Puppet::ResourceError: Parameter web_authn_policy_authenticator_attachment failed on Keycloak_realm[test]: Invalid value "". Valid values are platform, cross-platform, not specified.> with backtrace: # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter/value_collection.rb:191:in `validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter.rb:464:in `unsafe_validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:579:in `unsafe_validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter.rb:479:in `validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `block in should=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `should=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:608:in `value=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:690:in `[]=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2451:in `block in set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2446:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2446:in `set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2343:in `initialize' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `new' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:105:in `block (5 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:104:in `block (4 levels) in <top (required)>'

Check failure on line 102 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties does not accept empty for web_authn_policy_attestation_conveyance_preference Failure/Error: expect { resource }.to raise_error(%r{''}) expected Exception with message matching /''/, got #<Puppet::ResourceError: Parameter web_authn_policy_attestation_conveyance_preference failed on Keycloak_realm[test]: Invalid value "". Valid values are none, direct, indirect, not specified.> with backtrace: # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter/value_collection.rb:190:in `validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter.rb:463:in `unsafe_validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:580:in `unsafe_validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter.rb:478:in `validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `block in should=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `should=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:609:in `value=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:681:in `[]=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2499:in `block in set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2493:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2493:in `set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2389:in `initialize' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `new' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:105:in `block (5 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:104:in `block (4 levels) in <top (required)>'

Check failure on line 102 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties does not accept empty for web_authn_policy_authenticator_attachment Failure/Error: expect { resource }.to raise_error(%r{''}) expected Exception with message matching /''/, got #<Puppet::ResourceError: Parameter web_authn_policy_authenticator_attachment failed on Keycloak_realm[test]: Invalid value "". Valid values are platform, cross-platform, not specified.> with backtrace: # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter/value_collection.rb:190:in `validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter.rb:463:in `unsafe_validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:580:in `unsafe_validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter.rb:478:in `validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `block in should=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `should=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:609:in `value=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:681:in `[]=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2499:in `block in set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2493:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2493:in `set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2389:in `initialize' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `new' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:105:in `block (5 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:104:in `block (4 levels) in <top (required)>'

Check failure on line 102 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties does not accept empty for web_authn_policy_attestation_conveyance_preference Failure/Error: expect { resource }.to raise_error(%r{''}) expected Exception with message matching /''/, got #<Puppet::ResourceError: Parameter web_authn_policy_attestation_conveyance_preference failed on Keycloak_realm[test]: Invalid value "". Valid values are none, direct, indirect, not specified.> with backtrace: # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter/value_collection.rb:191:in `validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter.rb:464:in `unsafe_validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:579:in `unsafe_validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter.rb:479:in `validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `block in should=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `should=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:608:in `value=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:690:in `[]=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2451:in `block in set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2446:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2446:in `set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2343:in `initialize' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `new' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:105:in `block (5 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:104:in `block (4 levels) in <top (required)>'

Check failure on line 102 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties does not accept empty for web_authn_policy_authenticator_attachment Failure/Error: expect { resource }.to raise_error(%r{''}) expected Exception with message matching /''/, got #<Puppet::ResourceError: Parameter web_authn_policy_authenticator_attachment failed on Keycloak_realm[test]: Invalid value "". Valid values are platform, cross-platform, not specified.> with backtrace: # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter/value_collection.rb:191:in `validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter.rb:464:in `unsafe_validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:579:in `unsafe_validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/parameter.rb:479:in `validate' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `block in should=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:549:in `should=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/property.rb:608:in `value=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:690:in `[]=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2451:in `block in set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2446:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2446:in `set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.7.0/lib/puppet/type.rb:2343:in `initialize' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `new' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:105:in `block (5 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:104:in `block (4 levels) in <top (required)>'

Check failure on line 102 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties does not accept empty for web_authn_policy_attestation_conveyance_preference Failure/Error: expect { resource }.to raise_error(%r{''}) expected Exception with message matching /''/, got #<Puppet::ResourceError: Parameter web_authn_policy_attestation_conveyance_preference failed on Keycloak_realm[test]: Invalid value "". Valid values are none, direct, indirect, not specified.> with backtrace: # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter/value_collection.rb:190:in `validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter.rb:463:in `unsafe_validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:580:in `unsafe_validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter.rb:478:in `validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `block in should=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `should=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:609:in `value=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:681:in `[]=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2499:in `block in set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2493:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2493:in `set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2389:in `initialize' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `new' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:105:in `block (5 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:104:in `block (4 levels) in <top (required)>'

Check failure on line 102 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties does not accept empty for web_authn_policy_authenticator_attachment Failure/Error: expect { resource }.to raise_error(%r{''}) expected Exception with message matching /''/, got #<Puppet::ResourceError: Parameter web_authn_policy_authenticator_attachment failed on Keycloak_realm[test]: Invalid value "". Valid values are platform, cross-platform, not specified.> with backtrace: # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter/value_collection.rb:190:in `validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter.rb:463:in `unsafe_validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:580:in `unsafe_validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/parameter.rb:478:in `validate' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `block in should=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:550:in `should=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/property.rb:609:in `value=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:681:in `[]=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2499:in `block in set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2493:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2493:in `set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.31.0/lib/puppet/type.rb:2389:in `initialize' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `new' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:105:in `block (5 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_realm_spec.rb:104:in `block (4 levels) in <top (required)>'
config[p] = ''
expect {
resource
}.to raise_error(%r{''})
end

it "does not accept nil for #{p}" do
config[p] = nil
expect {
resource
}.to raise_error(%r{nil})
end

it "has default for #{p}" do

Check failure on line 116 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties has default for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(defaults[p]) expected: "not specified" got: :"not specified" (compared using ==) Diff: @@ -1 +1 @@ -"not specified" +:"not specified"

Check failure on line 116 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties has default for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(defaults[p]) expected: "not specified" got: :"not specified" (compared using ==) Diff: @@ -1 +1 @@ -"not specified" +:"not specified"

Check failure on line 116 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties has default for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(defaults[p]) expected: "not specified" got: :"not specified" (compared using ==) Diff: @@ -1 +1 @@ -"not specified" +:"not specified"

Check failure on line 116 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures.yml)

Puppet::Type::Keycloak_realm enumerable properties has default for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(defaults[p]) expected: "not specified" got: :"not specified" (compared using ==) Diff: @@ -1 +1 @@ -"not specified" +:"not specified"

Check failure on line 116 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties has default for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(defaults[p]) expected: "not specified" got: :"not specified" (compared using ==) Diff: @@ -1 +1 @@ -"not specified" +:"not specified"

Check failure on line 116 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties has default for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(defaults[p]) expected: "not specified" got: :"not specified" (compared using ==) Diff: @@ -1 +1 @@ -"not specified" +:"not specified"

Check failure on line 116 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties has default for web_authn_policy_attestation_conveyance_preference Failure/Error: expect(resource[p]).to eq(defaults[p]) expected: "not specified" got: :"not specified" (compared using ==) Diff: @@ -1 +1 @@ -"not specified" +:"not specified"

Check failure on line 116 in spec/unit/puppet/type/keycloak_realm_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7 fixtures=.fixtures-latest.yml)

Puppet::Type::Keycloak_realm enumerable properties has default for web_authn_policy_authenticator_attachment Failure/Error: expect(resource[p]).to eq(defaults[p]) expected: "not specified" got: :"not specified" (compared using ==) Diff: @@ -1 +1 @@ -"not specified" +:"not specified"
expect(resource[p]).to eq(defaults[p])
end
end
end

describe 'basic properties' do
# Test basic properties
[
Expand All @@ -85,7 +144,9 @@
:smtp_server_from_display_name,
:smtp_server_reply_to,
:smtp_server_reply_to_display_name,
:default_locale
:default_locale,
:web_authn_policy_rp_entity_name,
:web_authn_policy_rp_id
].each do |p|
it "accepts a #{p}" do
config[p] = 'foo'
Expand Down Expand Up @@ -116,7 +177,14 @@
:action_token_generated_by_user_lifespan,
:offline_session_idle_timeout,
:offline_session_max_lifespan,
:smtp_server_port
:smtp_server_port,
:max_failure_wait_seconds,
:minimum_quick_login_wait_seconds,
:wait_increment_seconds,
:quick_login_check_milli_seconds,
:max_delta_time_seconds,
:failure_factor,
:web_authn_policy_create_timeout
].each do |p|
it "accepts a #{p}" do
config[p] = 100
Expand Down Expand Up @@ -151,7 +219,8 @@
:smtp_server_starttls,
:smtp_server_ssl,
:brute_force_protected,
:offline_session_max_lifespan_enabled
:offline_session_max_lifespan_enabled,
:permanent_lockout
].each do |p|
it "accepts true for #{p}" do
config[p] = true
Expand Down Expand Up @@ -195,7 +264,9 @@
:optional_client_scopes,
:events_listeners,
:supported_locales,
:roles
:roles,
:web_authn_policy_create_timeout,
:web_authn_policy_acceptable_aaguids
].each do |p|
it "accepts array for #{p}" do
config[p] = ['foo', 'bar']
Expand Down

0 comments on commit 53ae965

Please sign in to comment.