class ASF::Auth::Committers
‘use’ the following class in config.ru to limit access to the application to ASF
committers
Public Class Methods
Source
# File lib/whimsy/asf/rack.rb, line 36 def initialize(app) super(app, 'ASF Committers', &proc {}) end
Specify ‘ASF Committers’ as the HTTP auth Realm
Calls superclass method
Public Instance Methods
Source
# File lib/whimsy/asf/rack.rb, line 42 def call(env) authorized = ( ENV['RACK_ENV'] == 'test' ) # Must always call decode as it adds required accessors person = ASF::Auth.decode(env) authorized ||= person.asf_committer? if authorized @app.call(env) else unauthorized end end
Returns unauthorized
unless running in test mode or the authenticated user is an ASF
Committer