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, #to_64, #verify_password?

Methods included from DescendantTracker

#children, #find_child, #inherited

Constructor Details

#initialize(params = {}) ⇒ Plaintext

ignore parameters



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

def initialize(params = {})
end

Class Method Details

.entry_matches?(entry) ⇒ Boolean

Returns:

  • (Boolean)


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

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

.handles?(password_entry) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.handles?(password_entry)
  false
end

Instance Method Details

#encode(password) ⇒ Object



21
22
23
# File 'lib/htauth/plaintext.rb', line 21

def encode(password)
  "#{password}"
end