Skip to content

Commit

Permalink
Add duplicate_emails_allowed to keycloak_realm (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock authored Oct 26, 2022
1 parent 49e87cf commit 3d4bf4e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/puppet/type/keycloak_realm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@
defaultto :true
end

newproperty(:duplicate_emails_allowed, boolean: true) do
desc 'duplicateEmailsAllowed'
newvalues(:true, :false)
defaultto :false
end

newproperty(:offline_session_max_lifespan_enabled, boolean: true) do
desc 'offlineSessionMaxLifespanEnabled'
newvalues(:true, :false)
Expand Down
4 changes: 4 additions & 0 deletions spec/acceptance/2_realm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ class { 'keycloak': }
ensure => 'present',
remember_me => true,
registration_allowed => true,
login_with_email_allowed => false,
duplicate_emails_allowed => true,
reset_password_allowed => true,
verify_email => true,
user_managed_access_allowed => true,
Expand Down Expand Up @@ -204,6 +206,8 @@ class { 'keycloak': }
data = JSON.parse(stdout)
expect(data['rememberMe']).to eq(true)
expect(data['registrationAllowed']).to eq(true)
expect(data['loginWithEmailAllowed']).to eq(false)
expect(data['duplicateEmailsAllowed']).to eq(true)
expect(data['resetPasswordAllowed']).to eq(true)
expect(data['verifyEmail']).to eq(true)
expect(data['userManagedAccessAllowed']).to eq(true)
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/puppet/type/keycloak_realm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
enabled: :true,
remember_me: :false,
login_with_email_allowed: :true,
duplicate_emails_allowed: :false,
ssl_required: 'external',
registration_allowed: :false,
edit_username_allowed: :false,
Expand Down Expand Up @@ -131,6 +132,7 @@
:reset_password_allowed,
:verify_email,
:login_with_email_allowed,
:duplicate_emails_allowed,
:edit_username_allowed,
:internationalization_enabled,
:manage_roles,
Expand Down

0 comments on commit 3d4bf4e

Please sign in to comment.