Class: Steppe::Auth::Basic::SimpleUserPasswordStore
- Inherits:
-
Object
- Object
- Steppe::Auth::Basic::SimpleUserPasswordStore
- Defined in:
- lib/steppe/auth/basic.rb
Overview
Simple hash-based credentials store implementation. Stores username/password pairs in memory.
Constant Summary collapse
- HashInterface =
Interface for hash-based credentials stores (Hash[String => String]). Maps username strings to password strings.
Types::Hash[String, String]
Instance Method Summary collapse
-
#initialize(hash) ⇒ SimpleUserPasswordStore
constructor
A new instance of SimpleUserPasswordStore.
-
#lookup(username) ⇒ String?
Retrieve a password by username.
Constructor Details
#initialize(hash) ⇒ SimpleUserPasswordStore
Returns a new instance of SimpleUserPasswordStore.
60 61 62 |
# File 'lib/steppe/auth/basic.rb', line 60 def initialize(hash) @lookup = hash end |
Instance Method Details
#lookup(username) ⇒ String?
Retrieve a password by username.
68 |
# File 'lib/steppe/auth/basic.rb', line 68 def lookup(username) = @lookup[username.strip] |