Class: HTAuth::Plaintext

Inherits:
Algorithm show all
Defined in:
lib/htauth/plaintext.rb

Overview

Internal: the plaintext algorithm, which does absolutly nothing

Constant Summary collapse

ENTRY_REGEX =
/\A[^$:]*\Z/

Constants inherited from Algorithm

Algorithm::ARGON2, Algorithm::BCRYPT, Algorithm::CRYPT, Algorithm::DEFAULT, Algorithm::EXISTING, Algorithm::MD5, Algorithm::PLAINTEXT, Algorithm::SALT_CHARS, Algorithm::SALT_LENGTH, Algorithm::SHA1

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Algorithm

algorithm_from_field, algorithm_from_name, algorithm_name, #gen_salt, secure_compare, #to64, #verify_password?

Methods included from DescendantTracker

#children, #find_child, #inherited

Constructor Details

#initialize(_params = {}) ⇒ Plaintext

ignore parameters



19
20
21
# File 'lib/htauth/plaintext.rb', line 19

def initialize(_params = {})
  super()
end

Class Method Details

.entry_matches?(entry) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/htauth/plaintext.rb', line 10

def self.entry_matches?(entry)
  ENTRY_REGEX.match?(entry)
end

.handles?(_password_entry) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/htauth/plaintext.rb', line 14

def self.handles?(_password_entry)
  false
end

Instance Method Details

#encode(password) ⇒ Object



23
24
25
# File 'lib/htauth/plaintext.rb', line 23

def encode(password)
  password.to_s
end