Use `default: ...` assignment for Devise config, fixes `Style/ClassVars` cop (#30214)

This commit is contained in:
Matt Jankowski 2024-05-10 05:42:01 -04:00 committed by GitHub
parent c9557bdd3b
commit 040aaf3a48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 38 deletions

View File

@ -54,10 +54,6 @@ Style/ClassEqualityComparison:
- 'app/helpers/jsonld_helper.rb'
- 'app/serializers/activitypub/outbox_serializer.rb'
Style/ClassVars:
Exclude:
- 'config/initializers/devise.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedVars.
Style/FetchEnvVar:

View File

@ -38,42 +38,25 @@ Warden::Manager.before_logout do |_, warden|
end
module Devise
mattr_accessor :pam_authentication
@@pam_authentication = false
mattr_accessor :pam_controlled_service
@@pam_controlled_service = nil
mattr_accessor :pam_authentication, default: false
mattr_accessor :pam_controlled_service, default: nil
mattr_accessor :check_at_sign
@@check_at_sign = false
mattr_accessor :check_at_sign, default: false
mattr_accessor :ldap_authentication
@@ldap_authentication = false
mattr_accessor :ldap_host
@@ldap_host = nil
mattr_accessor :ldap_port
@@ldap_port = nil
mattr_accessor :ldap_method
@@ldap_method = nil
mattr_accessor :ldap_base
@@ldap_base = nil
mattr_accessor :ldap_uid
@@ldap_uid = nil
mattr_accessor :ldap_mail
@@ldap_mail = nil
mattr_accessor :ldap_bind_dn
@@ldap_bind_dn = nil
mattr_accessor :ldap_password
@@ldap_password = nil
mattr_accessor :ldap_tls_no_verify
@@ldap_tls_no_verify = false
mattr_accessor :ldap_search_filter
@@ldap_search_filter = nil
mattr_accessor :ldap_uid_conversion_enabled
@@ldap_uid_conversion_enabled = false
mattr_accessor :ldap_uid_conversion_search
@@ldap_uid_conversion_search = nil
mattr_accessor :ldap_uid_conversion_replace
@@ldap_uid_conversion_replace = nil
mattr_accessor :ldap_authentication, default: false
mattr_accessor :ldap_host, default: nil
mattr_accessor :ldap_port, default: nil
mattr_accessor :ldap_method, default: nil
mattr_accessor :ldap_base, default: nil
mattr_accessor :ldap_uid, default: nil
mattr_accessor :ldap_mail, default: nil
mattr_accessor :ldap_bind_dn, default: nil
mattr_accessor :ldap_password, default: nil
mattr_accessor :ldap_tls_no_verify, default: false
mattr_accessor :ldap_search_filter, default: nil
mattr_accessor :ldap_uid_conversion_enabled, default: false
mattr_accessor :ldap_uid_conversion_search, default: nil
mattr_accessor :ldap_uid_conversion_replace, default: nil
module Strategies
class PamAuthenticatable