Renamed protect_resque.rb => resque_authentication
Integrated resque web with the rest of gitlab
This commit is contained in:
gleb 2012-06-29 13:44:55 +02:00
parent 3a4aff6934
commit 2da45e9cbf
7 changed files with 28 additions and 11 deletions

View file

@ -1,5 +0,0 @@
require 'resque/server'
Resque::Server.use(Rack::Auth::Basic) do |user, password|
user == "gitlab"
password == "5iveL!fe"
end

View file

@ -0,0 +1,14 @@
require 'resque/server'
class Authentication
def initialize(app)
@app = app
end
def call(env)
account = env['warden'].authenticate!(:database_authenticatable, :rememberable, scope: :user)
raise "Access denied" if !account.admin?
@app.call(env)
end
end
Resque::Server.use Authentication