Class: ServerlessHub::Authorizer

Inherits:
Object
  • Object
show all
Defined in:
lib/serverless_hub/authorizer.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Authorizer

Returns a new instance of Authorizer.



58
59
60
# File 'lib/serverless_hub/authorizer.rb', line 58

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



62
63
64
65
66
67
68
# File 'lib/serverless_hub/authorizer.rb', line 62

def call(env)
  if env["lambda.event"] && env["lambda.event"]["requestContext"]
    env["authorizer"] = env["lambda.event"]["requestContext"]["authorizer"]
  end

  return @app.call(env)
end