Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default_locale property to keycloak_realm #294

Merged
merged 1 commit into from
Jul 14, 2023
Merged
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
4 changes: 4 additions & 0 deletions lib/puppet/type/keycloak_realm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
defaultto :false
end

newproperty(:default_locale) do
desc 'defaultLocale'
end

newproperty(:sso_session_idle_timeout_remember_me, parent: PuppetX::Keycloak::IntegerProperty) do
desc 'ssoSessionIdleTimeoutRememberMe'
end
Expand Down
7 changes: 7 additions & 0 deletions spec/acceptance/2_realm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class { 'keycloak': }
expect(data['verifyEmail']).to eq(false)
expect(data['sslRequired']).to eq('external')
expect(data['editUsernameAllowed']).to eq(false)
expect(data['internationalizationEnabled']).to eq(false)
end
end

Expand Down Expand Up @@ -196,6 +197,9 @@ class { 'keycloak': }
account_theme => 'keycloak.v2',
admin_theme => 'keycloak.v2',
email_theme => 'keycloak.v2',
internationalization_enabled => true,
default_locale => 'en',
supported_locales => ['en','de'],
custom_properties => {
'failureFactor' => 60,
'revokeRefreshToken' => true,
Expand Down Expand Up @@ -247,6 +251,9 @@ class { 'keycloak': }
expect(data['emailTheme']).to eq('keycloak.v2')
expect(data['failureFactor']).to eq(60)
expect(data['revokeRefreshToken']).to eq(true)
expect(data['internationalizationEnabled']).to eq(true)
expect(data['defaultLocale']).to eq('en')
expect(data['supportedLocales']).to eq(['de', 'en'])
end
end

Expand Down
6 changes: 4 additions & 2 deletions spec/unit/puppet/type/keycloak_realm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
events_listeners: ['jboss-logging'],
admin_events_enabled: :false,
admin_events_details_enabled: :false,
offline_session_max_lifespan_enabled: :false
offline_session_max_lifespan_enabled: :false,
internationalization_enabled: :false
}

describe 'basic properties' do
Expand All @@ -83,7 +84,8 @@
:smtp_server_from,
:smtp_server_from_display_name,
:smtp_server_reply_to,
:smtp_server_reply_to_display_name
:smtp_server_reply_to_display_name,
:default_locale
].each do |p|
it "accepts a #{p}" do
config[p] = 'foo'
Expand Down
Loading