Class: CasrackTheAuthenticator::Fake
- Inherits:
-
Object
- Object
- CasrackTheAuthenticator::Fake
- Defined in:
- lib/casrack_the_authenticator/fake.rb
Overview
A fake CAS authenticator. Good for disconnected-mode development.
Constant Summary collapse
- BASIC_AUTH_401 =
[ 401, { 'Content-Type' => 'text/plain', 'Content-Length' => '0', 'WWW-Authenticate' => 'Basic realm="CasrackTheAuthenticator::Fake"' }, [] ]
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, *usernames) ⇒ Fake
constructor
A new instance of Fake.
Constructor Details
#initialize(app, *usernames) ⇒ Fake
Returns a new instance of Fake.
24 25 26 27 |
# File 'lib/casrack_the_authenticator/fake.rb', line 24 def initialize(app, *usernames) @app, @usernames = app, usernames raise "Why would you create a Fake CAS authenticator but not let anyone use it?" if usernames.empty? end |
Instance Method Details
#call(env) ⇒ Object
29 30 31 32 |
# File 'lib/casrack_the_authenticator/fake.rb', line 29 def call(env) process_basic_auth(env) basic_auth_on_401(@app.call(env)) end |