Catalyst::Authentication::Credential::Testing
# Setup the auth in your config on your dev machines only __PACKAGE__->config( 'Plugin::Authentication' => { default_realm => 'your_realm', realms => { your_realm => { credential => { class => 'Testing', password_field => 'password', global_password => 'secret', # password for all users }, }, }, }, );
When your developing an app it is often convenient to be able to log in as any user. You can either achieve this by disabling authentication (but then you can't test failed logins) or by setting all the passwords to be the same (which is annoying).
Or you can use this module and set one password for all users at the authentication level. This leaves the rest of your code untouched.
This module is based on Catalyst::Authentication::Credential::Password and overides the new and check_password methods.
new
check_password
Checks that the config is complete.
Returns true if the password is the same as that set in the config, false otherwise.
Catalyst::Authentication::Credential::Password
Test suite is minimal.
Edmund von der Burg <evdb@ecclestoad.co.uk>
<evdb@ecclestoad.co.uk
Bug reports and suggestions very welcome.
Developed whilst working at Foxtons - http://www.foxtons.co.uk. Thank you for letting me open source this code.
Copyright (C) 2008 Edmund von der Burg. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
THERE IS NO WARRANTY.
To install Catalyst::Authentication::Credential::Testing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Authentication::Credential::Testing
CPAN shell
perl -MCPAN -e shell install Catalyst::Authentication::Credential::Testing
For more information on module installation, please visit the detailed CPAN module installation guide.