Commit 4578b751 authored by Francisco Lopez's avatar Francisco Lopez

Fixing conflicts

parent ba5a4de3
......@@ -96,7 +96,6 @@ class ApplicationController < ActionController::Base
# (e.g. tokens) to authenticate the user, whereas Devise sets current_user
def auth_user
return current_user if current_user.present?
<<<<<<< HEAD
return try(:authenticated_user)
end
......@@ -110,17 +109,6 @@ class ApplicationController < ActionController::Base
def verify_namespace_plan_check_enabled
render_404 unless current_application_settings.should_check_namespace_plan?
=======
return try(:authenticated_user)
end
# This filter handles personal access tokens, and atom requests with rss tokens
def authenticate_sessionless_user!
user = Gitlab::Auth::RequestAuthenticator.new(request).find_sessionless_user
sessionless_sign_in(user) if user
>>>>>>> ce-com/master
end
def log_exception(exception)
......
......@@ -784,7 +784,6 @@
= link_to icon('question-circle'), help_page_path('administration/polling')
%fieldset
<<<<<<< HEAD
%legend Performance optimization
.form-group
.col-sm-offset-2.col-sm-10
......@@ -837,8 +836,6 @@
status will time out.
%fieldset
=======
>>>>>>> ce-com/master
%legend User and IP Rate Limits
.form-group
.col-sm-offset-2.col-sm-10
......
......@@ -39,10 +39,6 @@ module API
# Helper Methods for Grape Endpoint
module HelperMethods
<<<<<<< HEAD
include Gitlab::Utils::StrongMemoize
=======
>>>>>>> ce-com/master
include Gitlab::Auth::UserAuthFinders
def find_current_user!
......
......@@ -19,17 +19,12 @@ module Gitlab
end
module UserAuthFinders
<<<<<<< HEAD
PRIVATE_TOKEN_HEADER = 'HTTP_PRIVATE_TOKEN'.freeze
PRIVATE_TOKEN_PARAM = :private_token
JOB_TOKEN_HEADER = "HTTP_JOB_TOKEN".freeze
JOB_TOKEN_PARAM = :job_token
=======
include Gitlab::Utils::StrongMemoize
PRIVATE_TOKEN_HEADER = 'HTTP_PRIVATE_TOKEN'.freeze
PRIVATE_TOKEN_PARAM = :private_token
>>>>>>> ce-com/master
JOB_TOKEN_HEADER = "HTTP_JOB_TOKEN".freeze
JOB_TOKEN_PARAM = :job_token
# Check the Rails session for valid authentication details
def find_user_from_warden
......@@ -53,7 +48,6 @@ module Gitlab
access_token.user || raise(UnauthorizedError)
end
<<<<<<< HEAD
def find_user_from_job_token
return unless route_authentication_setting[:job_token_allowed]
......@@ -68,8 +62,6 @@ module Gitlab
job.user
end
=======
>>>>>>> ce-com/master
def validate_access_token!(scopes: [])
return unless access_token
......@@ -85,23 +77,16 @@ module Gitlab
private
<<<<<<< HEAD
def route_authentication_setting
return {} unless respond_to?(:route_setting)
route_setting(:authentication) || {}
end
def access_token
return @access_token if defined?(@access_token)
@access_token = find_oauth_access_token || find_personal_access_token
=======
def access_token
strong_memoize(:access_token) do
find_oauth_access_token || find_personal_access_token
end
>>>>>>> ce-com/master
end
def find_personal_access_token
......
......@@ -101,11 +101,7 @@ module Gitlab
end
end
<<<<<<< HEAD
def count_page_versions(page_path, options = {})
=======
def count_page_versions(page_path)
>>>>>>> ce-com/master
@repository.count_commits(ref: 'HEAD', path: page_path)
end
......
......@@ -10,10 +10,7 @@ describe Gitlab::Auth::UserAuthFinders do
}
end
let(:request) { Rack::Request.new(env)}
<<<<<<< HEAD
let(:params) { request.params }
=======
>>>>>>> ce-com/master
def set_param(key, value)
request.update_param(key, value)
......@@ -105,7 +102,6 @@ describe Gitlab::Auth::UserAuthFinders do
end
end
<<<<<<< HEAD
describe '#find_user_from_job_token' do
let(:job) { create(:ci_build, user: user) }
......@@ -155,8 +151,6 @@ describe Gitlab::Auth::UserAuthFinders do
end
end
=======
>>>>>>> ce-com/master
describe '#find_personal_access_token' do
let(:personal_access_token) { create(:personal_access_token, user: user) }
......
......@@ -23,10 +23,7 @@ describe API::Helpers do
}
end
let(:header) { }
<<<<<<< HEAD
let(:route_authentication_setting) { {} }
=======
>>>>>>> ce-com/master
let(:request) { Grape::Request.new(env)}
let(:params) { request.params }
......@@ -185,7 +182,6 @@ describe API::Helpers do
it 'does not allow expired tokens' do
personal_access_token.update_attributes!(expires_at: 1.day.ago)
env[Gitlab::Auth::UserAuthFinders::PRIVATE_TOKEN_HEADER] = personal_access_token.token
<<<<<<< HEAD
expect { current_user }.to raise_error Gitlab::Auth::ExpiredError
end
......@@ -233,14 +229,11 @@ describe API::Helpers do
expect(current_user).to be_nil
end
=======
expect { current_user }.to raise_error Gitlab::Auth::ExpiredError
>>>>>>> ce-com/master
end
end
end
describe '.handle_api_exception' do
before do
allow_any_instance_of(self.class).to receive(:sentry_enabled?).and_return(true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment