Class: TentD::API::AuthenticationVerification

Inherits:
Middleware
  • Object
show all
Defined in:
lib/tentd/api/authentication_verification.rb

Instance Method Summary collapse

Methods inherited from Middleware

#call, #initialize

Methods included from Authorizable

#authorize_env!, #authorize_env?

Constructor Details

This class inherits a constructor from TentD::API::Middleware

Instance Method Details

#action(env) ⇒ Object



7
8
9
10
11
12
# File 'lib/tentd/api/authentication_verification.rb', line 7

def action(env)
  if env.hmac? && !(env.hmac.verified = verify_signature(env))
    env = [403, {}, ['Invalid MAC Signature']]
  end
  env
end