Skip to content

Commit

Permalink
Add default_locale property to keycloak_realm (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock authored Jul 14, 2023
1 parent 8815e47 commit 927454a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
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

0 comments on commit 927454a

Please sign in to comment.