Class: TentClient::Middleware::MacAuth

Inherits:
Object
  • Object
show all
Defined in:
lib/tent-client/middleware/mac_auth.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ MacAuth

Returns a new instance of MacAuth.



8
9
10
# File 'lib/tent-client/middleware/mac_auth.rb', line 8

def initialize(app, options={})
  @app, @mac_key_id, @mac_key, @mac_algorithm = app, options[:mac_key_id], options[:mac_key], options[:mac_algorithm]
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
# File 'lib/tent-client/middleware/mac_auth.rb', line 12

def call(env)
  sign_request(env) if auth_enabled?
  @app.call(env)
end