Module: ActiveModel::SecurePassword
| Relationships & Source Files | |
| Namespace Children | |
|
Modules:
| |
|
Classes:
| |
| Extension / Inclusion / Inheritance Descendants | |
|
Included In:
| |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
::ActiveSupport::Concern
|
|
| Defined in: | activemodel/lib/active_model/secure_password.rb, activemodel/lib/active_model/secure_password/argon2_password.rb, activemodel/lib/active_model/secure_password/bcrypt_password.rb |
Constant Summary
-
DEFAULT_RESET_TOKEN_EXPIRES_IN =
# File 'activemodel/lib/active_model/secure_password.rb', line 1115.minutes
Class Attribute Summary
- .min_cost rw Internal use only
Class Method Summary
-
.algorithm_registry
Returns the registry of password algorithms.
-
.lookup_algorithm(name)
Looks up a registered algorithm by name.
-
.register_algorithm(name, algorithm_class)
Registers a password algorithm for use with has_secure_password.
::ActiveSupport::Concern - Extended
| class_methods | Define class methods from given block. |
| included | Evaluate given block in context of base class, so that you can write class macros here. |
| prepended | Evaluate given block in context of base class, so that you can write class macros here. |
| append_features, prepend_features | |
Class Attribute Details
.min_cost (rw)
This method is for internal use only.
[ GitHub ]
# File 'activemodel/lib/active_model/secure_password.rb', line 14
attr_accessor :min_cost # :nodoc:
Class Method Details
.algorithm_registry
Returns the registry of password algorithms
# File 'activemodel/lib/active_model/secure_password.rb', line 17
def algorithm_registry @algorithm_registry ||= {} end
.lookup_algorithm(name)
Looks up a registered algorithm by name
# File 'activemodel/lib/active_model/secure_password.rb', line 31
def lookup_algorithm(name) algorithm_registry[name.to_sym] end
.register_algorithm(name, algorithm_class)
Registers a password algorithm for use with has_secure_password
ActiveModel::SecurePassword.register_algorithm :argon2, Argon2Password
The algorithm class will be instantiated when used.
# File 'activemodel/lib/active_model/secure_password.rb', line 26
def register_algorithm(name, algorithm_class) algorithm_registry[name.to_sym] = algorithm_class end