20230523082822_two_factor_security_key_setup.rb 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class TwoFactorSecurityKeySetup < ActiveRecord::Migration[6.1]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.create_if_not_exists(
  7. title: 'Security Keys',
  8. name: 'two_factor_authentication_method_security_keys',
  9. area: 'Security::TwoFactorAuthentication',
  10. description: 'Defines if the two-factor authentication method security keys is enabled or not.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: true,
  16. name: 'two_factor_authentication_method_security_keys',
  17. tag: 'boolean',
  18. options: {
  19. true => 'yes',
  20. false => 'no',
  21. },
  22. },
  23. ],
  24. },
  25. preferences: {
  26. controller: 'SettingsAreaSwitch',
  27. sub: {},
  28. permission: ['admin.security'],
  29. prio: 1000,
  30. display_name: 'Security Keys',
  31. help: 'Complete the sign-in with your security key.',
  32. icon: 'security-key',
  33. },
  34. state: false,
  35. frontend: true
  36. )
  37. end
  38. end