Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,12 @@ Valid values: `true`, `false`

multivalued

##### `aggregate_attrs`

Valid values: `true`, `false`

aggregate.attrs

##### `protocol`

Valid values: `openid-connect`, `saml`
Expand Down Expand Up @@ -3124,6 +3130,12 @@ Valid values: `true`, `false`

multivalued

##### `aggregate_attrs`

Valid values: `true`, `false`

aggregate.attrs

##### `protocol`

Valid values: `openid-connect`, `saml`
Expand Down
7 changes: 7 additions & 0 deletions lib/puppet/provider/keycloak_client_protocol_mapper/kcadm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def self.instances
protocol_mapper[:single] = d['config']['single'].to_s.to_sym
end
protocol_mapper[:multivalued] = d['config']['multivalued'].to_s.to_sym if d['config']['multivalued']
protocol_mapper[:aggregate_attrs] = d['config']['aggregate.attrs'].to_s.to_sym if d['config']['aggregate.attrs']
protocol_mappers << new(protocol_mapper)
end
end
Expand Down Expand Up @@ -144,6 +145,9 @@ def create
if resource[:multivalued]
data[:config][:multivalued] = resource[:multivalued].to_s
end
if resource[:aggregate_attrs]
data[:config][:'aggregate.attrs'] = resource[:aggregate_attrs].to_s
end

t = Tempfile.new('keycloak_protocol_mapper')
t.write(JSON.pretty_generate(data))
Expand Down Expand Up @@ -233,6 +237,9 @@ def flush
if resource[:multivalued]
config[:multivalued] = resource[:multivalued].to_s
end
if resource[:aggregate_attrs]
config[:'aggregate.attrs'] = resource[:aggregate_attrs].to_s
end
data[:config] = config unless config.empty?

t = Tempfile.new('keycloak_protocol_mapper')
Expand Down
7 changes: 7 additions & 0 deletions lib/puppet/provider/keycloak_protocol_mapper/kcadm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def self.instances
protocol_mapper[:single] = d['config']['single'].to_s.to_sym
end
protocol_mapper[:multivalued] = d['config']['multivalued'].to_s.to_sym if d['config']['multivalued']
protocol_mapper[:aggregate_attrs] = d['config']['aggregate.attrs'].to_s.to_sym if d['config']['aggregate.attrs']
protocol_mappers << new(protocol_mapper)
end
end
Expand Down Expand Up @@ -140,6 +141,9 @@ def create
if resource[:multivalued]
data[:config][:multivalued] = resource[:multivalued].to_s
end
if resource[:aggregate_attrs]
data[:config][:'aggregate.attrs'] = resource[:aggregate_attrs].to_s
end

t = Tempfile.new('keycloak_protocol_mapper')
t.write(JSON.pretty_generate(data))
Expand Down Expand Up @@ -227,6 +231,9 @@ def flush
if resource[:multivalued]
config[:multivalued] = resource[:multivalued].to_s
end
if resource[:aggregate_attrs]
config[:'aggregate.attrs'] = resource[:aggregate_attrs].to_s
end
data[:config] = config unless config.empty?

t = Tempfile.new('keycloak_protocol_mapper')
Expand Down
5 changes: 5 additions & 0 deletions lib/puppet/type/keycloak_client_protocol_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@
newvalues(:true, :false)
end

newproperty(:aggregate_attrs, boolean: true) do
desc 'aggregate.attrs'
newvalues(:true, :false)
end

newproperty(:included_client_audience) do
desc 'included.client.audience Required for `type` of `oidc-audience-mapper`'
end
Expand Down
5 changes: 5 additions & 0 deletions lib/puppet/type/keycloak_protocol_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@
newvalues(:true, :false)
end

newproperty(:aggregate_attrs, boolean: true) do
desc 'aggregate.attrs'
newvalues(:true, :false)
end

newproperty(:included_client_audience) do
desc 'included.client.audience Required for `type` of `oidc-audience-mapper`'
end
Expand Down
17 changes: 17 additions & 0 deletions spec/acceptance/7_client_protocol_mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ class { 'keycloak': }
multivalued => true,
usermodel_client_role_mapping_client_id => 'test.foo.bar',
}
keycloak_client_protocol_mapper { 'role mapper AA for test.foo.bar on test':
type => 'oidc-usermodel-client-role-mapper',
claim_name => 'permissions',
aggregate_attrs => true,
usermodel_client_role_mapping_client_id => 'test.foo.bar',
}
PUPPET_PP

apply_manifest(pp, catch_failures: true)
Expand Down Expand Up @@ -94,6 +100,17 @@ class { 'keycloak': }
expect(mapper['config']['usermodel.clientRoleMapping.clientId']).to eq('test.foo.bar')
end
end

it 'has created protocol mapper AA type=oidc-usermodel-client-role-mapper' do
on hosts, '/opt/keycloak/bin/kcadm-wrapper.sh get clients/test.foo.bar/protocol-mappers/models -r test' do
data = JSON.parse(stdout)
mapper = data.select { |d| d['name'] == 'role mapper AA' }[0]
expect(mapper['protocolMapper']).to eq('oidc-usermodel-client-role-mapper')
expect(mapper['config']['claim.name']).to eq('permissions')
expect(mapper['config']['aggregate.attrs']).to eq('true')
expect(mapper['config']['usermodel.clientRoleMapping.clientId']).to eq('test.foo.bar')
end
end
end

context 'when updates protocol_mapper' do
Expand Down
21 changes: 21 additions & 0 deletions spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,27 @@
}.to raise_error(%r{foo})
end

it 'accepts value for aggregate_attrs' do

Check failure on line 373 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper accepts value for aggregate_attrs Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 373 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper accepts value for aggregate_attrs Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 373 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper accepts value for aggregate_attrs Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 373 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper accepts value for aggregate_attrs Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'
config[:'aggregate.attrs'] = false
expect(resource[:aggregate_attrs]).to eq(:false)
end

it 'accepts value for aggregate_attrs string' do

Check failure on line 378 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper accepts value for aggregate_attrs string Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 378 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper accepts value for aggregate_attrs string Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 378 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper accepts value for aggregate_attrs string Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 378 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper accepts value for aggregate_attrs string Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'
config[:'aggregate.attrs'] = 'false'
expect(resource[:aggregate_attrs]).to eq(:false)
end

it 'has default for aggregate_attrs' do
expect(resource[:aggregate_attrs]).to be_nil
end

it 'does not accept invalid value for aggregate_attrs' do

Check failure on line 387 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper does not accept invalid value for aggregate_attrs Failure/Error: expect { resource }.to raise_error(%r{foo}) expected Exception with message matching /foo/, got #<Puppet::Error: no parameter named 'aggregate.attrs'> with backtrace: # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/util/errors.rb:157:in `fail' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:668:in `[]=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2499:in `block in set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2493:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2493:in `set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2389:in `initialize' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:17:in `new' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:17:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:390:in `block (3 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:389:in `block (2 levels) in <top (required)>'

Check failure on line 387 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper does not accept invalid value for aggregate_attrs Failure/Error: expect { resource }.to raise_error(%r{foo}) expected Exception with message matching /foo/, got #<Puppet::Error: no parameter named 'aggregate.attrs'> with backtrace: # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/util/errors.rb:159:in `fail' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:677:in `[]=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2451:in `block in set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2446:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2446:in `set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2343:in `initialize' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:17:in `new' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:17:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:390:in `block (3 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:389:in `block (2 levels) in <top (required)>'

Check failure on line 387 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper does not accept invalid value for aggregate_attrs Failure/Error: expect { resource }.to raise_error(%r{foo}) expected Exception with message matching /foo/, got #<Puppet::Error: no parameter named 'aggregate.attrs'> with backtrace: # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/util/errors.rb:157:in `fail' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:668:in `[]=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2499:in `block in set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2493:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2493:in `set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2389:in `initialize' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:17:in `new' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:17:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:390:in `block (3 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:389:in `block (2 levels) in <top (required)>'

Check failure on line 387 in spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_client_protocol_mapper does not accept invalid value for aggregate_attrs Failure/Error: expect { resource }.to raise_error(%r{foo}) expected Exception with message matching /foo/, got #<Puppet::Error: no parameter named 'aggregate.attrs'> with backtrace: # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/util/errors.rb:159:in `fail' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:677:in `[]=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2451:in `block in set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2446:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2446:in `set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2343:in `initialize' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:17:in `new' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:17:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:390:in `block (3 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_client_protocol_mapper_spec.rb:389:in `block (2 levels) in <top (required)>'
config[:'aggregate.attrs'] = 'foo'
expect {
resource
}.to raise_error(%r{foo})
end

it 'accepts script' do
config[:protocol] = 'saml'
config[:type] = 'script-foo.js'
Expand Down
21 changes: 21 additions & 0 deletions spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,27 @@
}.to raise_error(%r{foo})
end

it 'accepts value for aggregate_attrs' do

Check failure on line 365 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper accepts value for aggregate_attrs Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 365 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper accepts value for aggregate_attrs Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 365 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper accepts value for aggregate_attrs Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 365 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper accepts value for aggregate_attrs Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'
config[:'aggregate.attrs'] = false
expect(resource[:aggregate_attrs]).to eq(:false)
end

it 'accepts value for aggregate_attrs string' do

Check failure on line 370 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper accepts value for aggregate_attrs string Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 370 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper accepts value for aggregate_attrs string Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 370 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper accepts value for aggregate_attrs string Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'

Check failure on line 370 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper accepts value for aggregate_attrs string Failure/Error: described_class.new(config) Puppet::Error: no parameter named 'aggregate.attrs'
config[:'aggregate.attrs'] = 'false'
expect(resource[:aggregate_attrs]).to eq(:false)
end

it 'has default for aggregate_attrs' do
expect(resource[:aggregate_attrs]).to be_nil
end

it 'does not accept invalid value for aggregate_attrs' do

Check failure on line 379 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper does not accept invalid value for aggregate_attrs Failure/Error: expect { resource }.to raise_error(%r{foo}) expected Exception with message matching /foo/, got #<Puppet::Error: no parameter named 'aggregate.attrs'> with backtrace: # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/util/errors.rb:157:in `fail' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:668:in `[]=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2499:in `block in set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2493:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2493:in `set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2389:in `initialize' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:17:in `new' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:17:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:382:in `block (3 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:381:in `block (2 levels) in <top (required)>'

Check failure on line 379 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper does not accept invalid value for aggregate_attrs Failure/Error: expect { resource }.to raise_error(%r{foo}) expected Exception with message matching /foo/, got #<Puppet::Error: no parameter named 'aggregate.attrs'> with backtrace: # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/util/errors.rb:159:in `fail' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:677:in `[]=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2451:in `block in set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2446:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2446:in `set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2343:in `initialize' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:17:in `new' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:17:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:382:in `block (3 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:381:in `block (2 levels) in <top (required)>'

Check failure on line 379 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper does not accept invalid value for aggregate_attrs Failure/Error: expect { resource }.to raise_error(%r{foo}) expected Exception with message matching /foo/, got #<Puppet::Error: no parameter named 'aggregate.attrs'> with backtrace: # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/util/errors.rb:157:in `fail' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:668:in `[]=' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2499:in `block in set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2493:in `each' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2493:in `set_parameters' # ./vendor/bundle/ruby/2.7.0/gems/puppet-7.34.0/lib/puppet/type.rb:2389:in `initialize' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:17:in `new' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:17:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:382:in `block (3 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:381:in `block (2 levels) in <top (required)>'

Check failure on line 379 in spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb

View workflow job for this annotation

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

Puppet::Type::Keycloak_protocol_mapper does not accept invalid value for aggregate_attrs Failure/Error: expect { resource }.to raise_error(%r{foo}) expected Exception with message matching /foo/, got #<Puppet::Error: no parameter named 'aggregate.attrs'> with backtrace: # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/util/errors.rb:159:in `fail' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:677:in `[]=' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2451:in `block in set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2446:in `each' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2446:in `set_parameters' # ./vendor/bundle/ruby/3.2.0/gems/puppet-8.10.0/lib/puppet/type.rb:2343:in `initialize' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:17:in `new' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:17:in `block (2 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:382:in `block (3 levels) in <top (required)>' # ./spec/unit/puppet/type/keycloak_protocol_mapper_spec.rb:381:in `block (2 levels) in <top (required)>'
config[:'aggregate.attrs'] = 'foo'
expect {
resource
}.to raise_error(%r{foo})
end

it 'accepts script' do
config[:protocol] = 'saml'
config[:type] = 'script-foo.js'
Expand Down
Loading