Class: Gollum::Auth::App
- Inherits:
-
Object
- Object
- Gollum::Auth::App
- Defined in:
- lib/gollum/auth.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, users, opts = { }) ⇒ App
constructor
A new instance of App.
Constructor Details
Instance Method Details
#call(env) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/gollum/auth.rb', line 21 def call(env) request = Request.new(env) if request.requires_authentication?(@opts[:allow_unauthenticated_readonly]) auth = Rack::Auth::Basic::Request.new(env) if auth.provided? && auth.basic? && user = User.find_by_credentials(auth.credentials) request.(user) else return end end @app.call(env) end |