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

Fixing conflicts

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