Class: Steppe::Auth::Bearer::HashTokenStore
- Inherits:
-
Object
- Object
- Steppe::Auth::Bearer::HashTokenStore
- Defined in:
- lib/steppe/auth/bearer.rb
Overview
Simple hash-based token store implementation. Stores tokens in memory with their associated scopes.
Defined Under Namespace
Classes: AccessToken
Constant Summary collapse
- Interface =
Interface for hash-based token stores (Hash[String => Array]). Maps token strings to arrays of scope strings.
Types::Hash[String, Types::Array[String]]
Instance Method Summary collapse
-
#get(token) ⇒ AccessToken?
Retrieve an access token by its token string.
-
#initialize(hash) ⇒ HashTokenStore
constructor
A new instance of HashTokenStore.
Constructor Details
#initialize(hash) ⇒ HashTokenStore
Returns a new instance of HashTokenStore.
56 57 58 |
# File 'lib/steppe/auth/bearer.rb', line 56 def initialize(hash) @lookup = hash.transform_values { |scopes| AccessToken.new(scopes) } end |
Instance Method Details
#get(token) ⇒ AccessToken?
Retrieve an access token by its token string.
64 65 66 |
# File 'lib/steppe/auth/bearer.rb', line 64 def get(token) @lookup[token] end |