Skip to content

Commit

Permalink
Do not purge truststore.jks by default (#303)
Browse files Browse the repository at this point in the history
* Do not purge truststore.jks by default
Fixes #302

* PDK update to fix Puppet 7 tests
  • Loading branch information
treydock authored Sep 22, 2023
1 parent 2b6d491 commit 1efdca0
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "voxpupuli-test", '5.4.1', require: false
gem "voxpupuli-test", '7.0.0', require: false
gem "faraday", '~> 1.0', require: false
gem "github_changelog_generator", require: false
gem "puppet-blacksmith", require: false
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/type/keycloak_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def insync?(is)
autorequire(:keycloak_client_scope) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_client_scope'
next unless resource.instance_of?(Puppet::Type::Keycloak_client_scope)

if self[:default_client_scopes].include?(resource[:resource_name])
requires << resource.name
Expand All @@ -260,7 +260,7 @@ def insync?(is)
autorequire(:keycloak_protocol_mapper) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_protocol_mapper'
next unless resource.instance_of?(Puppet::Type::Keycloak_protocol_mapper)

if self[:default_client_scopes].include?(resource[:client_scope])
requires << resource.name
Expand All @@ -275,7 +275,7 @@ def insync?(is)
autorequire(:keycloak_flow) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_flow'
next unless resource.instance_of?(Puppet::Type::Keycloak_flow)
next if self[:realm] != resource[:realm]

if self[:browser_flow] == resource[:alias]
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/keycloak_client_protocol_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
autorequire(:keycloak_client) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_client'
next unless resource.instance_of?(Puppet::Type::Keycloak_client)

if resource[:client_id] == self[:client]
requires << resource.name
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/type/keycloak_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def self.title_patterns
autorequire(:keycloak_flow) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_flow'
next unless resource.instance_of?(Puppet::Type::Keycloak_flow)
next if self[:realm] != resource[:realm]
next if self[:top_level] == :true

Expand All @@ -158,7 +158,7 @@ def self.title_patterns
autorequire(:keycloak_flow_execution) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_flow_execution'
next unless resource.instance_of?(Puppet::Type::Keycloak_flow_execution)
next if self[:realm] != resource[:realm]
next if self[:top_level] == :true

Expand All @@ -172,7 +172,7 @@ def self.title_patterns
autorequire(:keycloak_resource_validator) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_resource_validator'
next unless resource.instance_of?(Puppet::Type::Keycloak_resource_validator)

resource[:dependent_resources].to_a.each do |dep|
requires << resource if dep == "Keycloak_flow[#{self[:name]}]"
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/type/keycloak_flow_execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def self.title_patterns
autorequire(:keycloak_flow) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_flow'
next unless resource.instance_of?(Puppet::Type::Keycloak_flow)
next if self[:realm] != resource[:realm]

if self[:flow_alias] == resource[:alias]
Expand All @@ -166,7 +166,7 @@ def self.title_patterns
autorequire(:keycloak_flow_execution) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_flow_execution'
next unless resource.instance_of?(Puppet::Type::Keycloak_flow_execution)
next if self[:realm] != resource[:realm]

if self[:flow_alias] == resource[:flow_alias] && !resource[:index].nil? && !self[:index].nil? && self[:index] > resource[:index]
Expand All @@ -179,7 +179,7 @@ def self.title_patterns
autorequire(:keycloak_resource_validator) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_resource_validator'
next unless resource.instance_of?(Puppet::Type::Keycloak_resource_validator)

resource[:dependent_resources].to_a.each do |dep|
requires << resource if dep == "Keycloak_flow_execution[#{self[:name]}]"
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/keycloak_identity_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def self.title_patterns
autorequire(:keycloak_flow) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_flow'
next unless resource.instance_of?(Puppet::Type::Keycloak_flow)
next if self[:realm] != resource[:realm]

if self[:first_broker_login_flow_alias] == resource[:alias]
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/keycloak_ldap_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
autorequire(:keycloak_ldap_user_provider) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_ldap_user_provider'
next unless resource.instance_of?(Puppet::Type::Keycloak_ldap_user_provider)

if self[:ldap] == resource[:resource_name] && self[:realm] == resource[:realm]
requires << resource.name
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/keycloak_protocol_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
autorequire(:keycloak_client_scope) do
requires = []
catalog.resources.each do |resource|
next unless resource.class.to_s == 'Puppet::Type::Keycloak_client_scope'
next unless resource.instance_of?(Puppet::Type::Keycloak_client_scope)

if resource[:resource_name] == self[:client_scope]
requires << resource.name
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet_x/keycloak/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def add_autorequires(realm = true)
autorequire(:keycloak_conn_validator) do
requires = []
catalog.resources.each do |resource|
if resource.class.to_s == 'Puppet::Type::Keycloak_conn_validator'
if resource.instance_of?(::Puppet::Type::Keycloak_conn_validator)
requires << resource.name
end
end
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
Optional[Stdlib::Absolutepath] $service_environment_file = undef,
Stdlib::Filemode $conf_dir_mode = '0755',
Boolean $conf_dir_purge = true,
Array $conf_dir_purge_ignore = ['cache-ispn.xml', 'README.md'],
Array $conf_dir_purge_ignore = ['cache-ispn.xml', 'README.md', 'truststore.jks'],
Keycloak::Configs $configs = {},
Hash[String, Variant[String[1],Boolean,Array]] $extra_configs = {},
Variant[Stdlib::Host, Enum['unset','UNSET']] $hostname = $facts['networking']['fqdn'],
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@
],
"pdk-version": "2.7.1",
"template-url": "https://github.com/treydock/pdk-templates.git#master",
"template-ref": "heads/master-0-g70732db"
"template-ref": "heads/master-0-g76f4dbb"
}
2 changes: 1 addition & 1 deletion spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

describe 'keycloak' do
on_supported_os.each do |os, facts|
context "on #{os}" do
context "when #{os}" do
let(:facts) do
facts.merge(concat_basedir: '/dne')
end
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/freeipa_ldap_mappers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

describe 'keycloak::freeipa_ldap_mappers' do
on_supported_os.each do |os, _facts|
context "on #{os}" do
context "when #{os}" do
let(:title) { 'ipa.example.org' }
let(:params) do
{
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/freeipa_user_provider_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

describe 'keycloak::freeipa_user_provider' do
on_supported_os.each do |os, _facts|
context "on #{os}" do
context "when #{os}" do
let(:title) { 'ipa.example.org' }
let(:default_params) do
{
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/partial_import_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

describe 'keycloak::partial_import' do
on_supported_os.each do |os, facts|
context "on #{os}" do # rubocop:disable RSpec/MultipleMemoizedHelpers
context "when #{os}" do # rubocop:disable RSpec/MultipleMemoizedHelpers
let(:facts) do
facts.merge(concat_basedir: '/dne')
end
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/spi_deployment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

describe 'keycloak::spi_deployment' do
on_supported_os.each do |os, facts|
context "on #{os}" do
context "when #{os}" do
let(:facts) do
facts.merge(concat_basedir: '/dne')
end
Expand Down

0 comments on commit 1efdca0

Please sign in to comment.