class Proxy::ContainerGateway::Api
Private Instance Methods
auth_header()
click to toggle source
# File lib/smart_proxy_container_gateway/container_gateway_api.rb, line 159 def auth_header AuthorizationHeader.new(request.env['HTTP_AUTHORIZATION']) end
handle_repo_auth(repository, auth_header, request)
click to toggle source
# File lib/smart_proxy_container_gateway/container_gateway_api.rb, line 137 def handle_repo_auth(repository, auth_header, request) user_token_is_valid = false # FIXME: Getting unauthenticated token here... if auth_header.present? && auth_header.valid_user_token? user_token_is_valid = true username = auth_header.user.name end username = request.params['account'] if username.nil? return if Proxy::ContainerGateway.authorized_for_repo?(repository, user_token_is_valid, username) redirect_authorization_headers halt 401, "unauthorized" end