class
Kemal::BasicAuth::BcryptVerifier
- Kemal::BasicAuth::BcryptVerifier
- Kemal::BasicAuth::Verifier
- Reference
- Object
Overview
Verifier backed by bcrypt-hashed passwords.
Entries map a username to an existing bcrypt hash string (e.g. produced via
Crypto::Bcrypt::Password.create("plain").to_s). Verification always
performs a bcrypt computation (real or dummy) so that response time does
not reveal whether the username exists.
hash = Crypto::Bcrypt::Password.create("xyz").to_s
verifier = Kemal::BasicAuth::BcryptVerifier.new({"admin" => hash})
Defined in:
kemal-basic-auth/bcrypt_verifier.crConstructors
Class Method Summary
Instance Method Summary
-
#authorize?(username : String, password : String) : String | Nil
Returns the authorized username on success, or
nilotherwise.
Instance methods inherited from class Kemal::BasicAuth::Verifier
authorize?(username : String, password : String) : String | Nil
authorize?
Constructor Detail
Class Method Detail
Instance Method Detail
def authorize?(username : String, password : String) : String | Nil
#
Description copied from class Kemal::BasicAuth::Verifier
Returns the authorized username on success, or nil otherwise.