Skip to content

Commit

Permalink
Implement otp policy properties
Browse files Browse the repository at this point in the history
  • Loading branch information
TuningYourCode committed Jun 17, 2024
1 parent 897faab commit f3352cb
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions lib/puppet/type/keycloak_realm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,46 @@ def should_to_s(_newvalue)
defaultto(:true)
end

newproperty(:otp_policy_type) do
desc 'otpPolicyType'
newvalues('totp', 'hotp')
defaultto 'totp'
end

newproperty(:otp_policy_algorithm) do
desc 'otpPolicyAlgorithm'
newvalues('HmacSHA1', 'HmacSHA256', 'HmacSHA512')
defaultto 'HmacSHA1'
end

newproperty(:otp_policy_initial_counter, parent: PuppetX::Keycloak::IntegerProperty) do
desc 'otpPolicyInitialCounter'
defaultto 0
end

newproperty(:otp_policy_digits) do
desc 'otpPolicyDigits'
newvalues(6, 8)
defaultto 6
munge { |v| v.to_i }
end

newproperty(:otp_policy_look_ahead_window, parent: PuppetX::Keycloak::IntegerProperty) do
desc 'otpPolicyLookAheadWindow'
defaultto 1
end

newproperty(:otp_policy_period, parent: PuppetX::Keycloak::IntegerProperty) do
desc 'otpPolicyPeriod'
defaultto 30
end

newproperty(:otp_policy_code_reusable, boolean: true) do
desc 'otpPolicyCodeReusable'
newvalues(:true, :false)
defaultto :false
end

newproperty(:roles, array_matching: :all, parent: PuppetX::Keycloak::ArrayProperty) do
desc 'roles'
defaultto ['offline_access', 'uma_authorization']
Expand Down

0 comments on commit f3352cb

Please sign in to comment.