# Perform api_token checking very early in the request process. We want to do
# this in the Rack stack instead of in ApplicationController because
# websockets needs access to authentication but doesn't use any of the rails
# Perform api_token checking very early in the request process. We want to do
# this in the Rack stack instead of in ApplicationController because
# websockets needs access to authentication but doesn't use any of the rails
# Create a new ArvadosApiToken handler
# +app+ The next layer of the Rack stack.
def initialize(app = nil, options = nil)
# Create a new ArvadosApiToken handler
# +app+ The next layer of the Rack stack.
def initialize(app = nil, options = nil)
if supplied_token
api_client_auth = ApiClientAuthorization.
includes(:api_client, :user).
if supplied_token
api_client_auth = ApiClientAuthorization.
includes(:api_client, :user).
Thread.current[:api_client_uuid] = api_client.andand.uuid
Thread.current[:api_client] = api_client
Thread.current[:user] = user
Thread.current[:api_client_uuid] = api_client.andand.uuid
Thread.current[:api_client] = api_client
Thread.current[:user] = user