class FinAppsCore::Middleware::TenantAuthentication

Adds a custom header for tenant level authorization. If the value for this header already exists, it is not overriden.

Constants

KEY

Public Class Methods

new(app, token) click to toggle source
Calls superclass method
   # File lib/finapps_core/middleware/request/tenant_authentication.rb
10 def initialize(app, token)
11   super(app)
12   @header_value = token.to_s.strip
13 end

Public Instance Methods

call(env) click to toggle source
   # File lib/finapps_core/middleware/request/tenant_authentication.rb
15 def call(env)
16   env[:request_headers][KEY] ||= @header_value
17   @app.call(env)
18 end