Class: HonestRenter::SecretKeyMemberIdAuthenticator
- Inherits:
-
Authenticator
- Object
- Authenticator
- HonestRenter::SecretKeyMemberIdAuthenticator
- Defined in:
- lib/authenticator.rb
Constant Summary collapse
- ONE_HOUR =
3600
Instance Method Summary collapse
Methods inherited from Authenticator
from_address_and_password, from_secret_key_member_id, #initialize, #renew!, #session
Constructor Details
This class inherits a constructor from HonestRenter::Authenticator
Instance Method Details
#after_initialize(secret_key, member_id) ⇒ Object
32 33 34 35 |
# File 'lib/authenticator.rb', line 32 def after_initialize(secret_key, member_id) @secret_key = secret_key @member_id = member_id end |
#build_session ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/authenticator.rb', line 37 def build_session json_hash = JSON(raw_hash) digest = OpenSSL::Digest.new('sha256') encoded = OpenSSL::HMAC.hexdigest(digest, @secret_key, json_hash) HonestRenter::Session.new(encoded, json_hash) end |