This method is deprecated or moved on the latest stable version.
The last existing version (v5.2.3) is shown here.
ensure_secret_secure(secret)
private
To prevent users from using something insecure like “Password” we make
sure that the secret they’ve provided is at least 30 characters in
length.
# File activesupport/lib/active_support/key_generator.rb, line 58
def ensure_secret_secure(secret)
if secret.blank?
raise ArgumentError, "A secret is required to generate an integrity hash " "for cookie session data. Set a secret_key_base of at least " "#{SECRET_MIN_LENGTH} characters in via `bin/rails credentials:edit`."
end
if secret.length < SECRET_MIN_LENGTH
raise ArgumentError, "Secret should be something secure, " "like \"#{SecureRandom.hex(16)}\". The value you " "provided, \"#{secret}\", is shorter than the minimum length " "of #{SECRET_MIN_LENGTH} characters."
end
end