Module: Octo::Sinatra::Helper

Defined in:
lib/octocore/helpers/sinatra_helper.rb

Constant Summary collapse

KONG_AUTH_HEADERS =

The headers on which kong sends the authenticated details

%w(HTTP_X_CONSUMER_ID HTTP_X_CONSUMER_CUSTOM_ID HTTP_X_CONSUMER_USERNAME)

Instance Method Summary collapse

Instance Method Details

#enterprise_detailsObject

Finds the enterprise details #return [Array<String>] Enterprise’s Id, Custom Name and User Name



12
13
14
15
16
# File 'lib/octocore/helpers/sinatra_helper.rb', line 12

def enterprise_details
  KONG_AUTH_HEADERS.collect do |prop|
    request.env.fetch(prop, nil)
  end
end