Commit 7543873a authored by Rémy Coutable's avatar Rémy Coutable

Remove explicit `require` calls, and use `require_dependency` when needed

See
http://guides.rubyonrails.org/autoloading_and_reloading_constants.html
for more info.
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 2d0af1f8
require 'omniauth/strategies/kerberos_spnego'
class OmniauthKerberosSpnegoController < ApplicationController
include KerberosSpnegoHelper
......@@ -15,11 +13,11 @@ class OmniauthKerberosSpnegoController < ApplicationController
# When the browser is Kerberos-aware, this response will make it try to
# get a Kerberos ticket and present it to us via an SPNEGO token.
#
#
# When the browser does not know Kerberos, or if it tried to
# authenticate with Kerberos but failed, it shows the special 'Kerberos
# denied' 401 page to the user.
#
#
# We cannot redirect the user to the sign-in page because we do not know
# when the browser has given up.
#
......
require 'project_wiki'
class Projects::WikisController < Projects::ApplicationController
before_action :authorize_read_wiki!
before_action :authorize_create_wiki!, only: [:edit, :create, :history]
......
......@@ -142,9 +142,9 @@ if Gitlab::Metrics.enabled?
# These are manually require'd so the classes are registered properly with
# ActiveSupport.
require 'gitlab/metrics/subscribers/action_view'
require 'gitlab/metrics/subscribers/active_record'
require 'gitlab/metrics/subscribers/rails_cache'
require_dependency 'gitlab/metrics/subscribers/action_view'
require_dependency 'gitlab/metrics/subscribers/active_record'
require_dependency 'gitlab/metrics/subscribers/rails_cache'
Gitlab::Application.configure do |config|
config.middleware.use(Gitlab::Metrics::RackMiddleware)
......
......@@ -25,11 +25,11 @@ end
if Gitlab.config.omniauth.enabled
provider_names = Gitlab.config.omniauth.providers.map(&:name)
require 'omniauth-kerberos' if provider_names.include?('kerberos')
require 'omniauth/strategies/kerberos_spnego' if provider_names.include?('kerberos_spnego')
require_dependency 'omni_auth/strategies/kerberos_spnego' if provider_names.include?('kerberos_spnego')
end
module OmniAuth
module Strategies
autoload :Bitbucket, Rails.root.join('lib', 'omniauth', 'strategies', 'bitbucket')
autoload :Bitbucket, Rails.root.join('lib', 'omni_auth', 'strategies', 'bitbucket')
end
end
require 'gitlab/o_auth/user'
# LDAP extension for User model
#
# * Find or create user from omniauth.auth data
......
require 'spec_helper'
require 'omniauth/strategies/kerberos_spnego'
describe OmniAuth::Strategies::KerberosSpnego do
subject { described_class.new(:app) }
......
require 'spec_helper'
require 'omniauth/strategies/kerberos_spnego'
describe 'OmniAuth Kerberos SPNEGO', lib: true do
describe 'OmniAuth Kerberos SPNEGO' do
let(:path) { '/users/auth/kerberos_spnego/negotiate' }
let(:controller_class) { OmniauthKerberosSpnegoController }
......
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