Catalyst-Authentication-Store-CouchDB
view release on metacpan or search on metacpan
[Catalyst::Authentication::Store::CouchDB::User](http://search.cpan.org/perldoc?Catalyst::Authentication::Store::CouchDB::User) to create the user object.
A suitable view map function is
function(doc) {
if (doc.username) {
emit(doc.username, null);
}
}
# METHODS
There are no publicly exported routines in the CouchDB authentication
store (or indeed in most authentication stores). However, below is a
description of the routines required by [Catalyst::Plugin::Authentication](http://search.cpan.org/perldoc?Catalyst::Plugin::Authentication)
for all authentication stores. Please see the documentation for
[Catalyst::Plugin::Authentication::Internals](http://search.cpan.org/perldoc?Catalyst::Plugin::Authentication::Internals) for more information.
## new ( $config, $app )
Constructs a new store object.
## find_user ( $authinfo, $c )
Finds a user using the information provided in the $authinfo hashref and
returns the user, or undef on failure. This is usually called from the
Credential. This translates directly to a call to the User object's
load() method.
## for_session ( $c, $user )
Prepares a user to be stored in the session. This is delegated to
the User obect for_session method.
## from_session ( $c, $frozenuser)
Revives a user from the session based on the info provided in $frozenuser.
This is delegated to the User object from_session method.
## user_supports
Provides information about what the user object supports.
# NOTES
This module is heavily based on [Catalyst::Authentication::Store::DBIx::Class](http://search.cpan.org/perldoc?Catalyst::Authentication::Store::DBIx::Class).
The test scripts use clear text passwords. __DO NOT DO THIS IN PRODUCTION.__
Use configuation as shown in the synopsis to use something stronger, such as
salted hash passwords.
The test scripts do not connect to a CouchDB instance as standard - they
mock the responses that CouchDB would send. To connect to a CouchDB instance,
set the `CATALYST_COUCHDB_LIVE` environment variable before running the test suite.
The test suite assumes that a `demouser` database exists, with a design document
called `user` that contains a `user` view, and that a document listing a test
user with username `test` and password `test` exists. To configure this,
run the `setup_database.pl` script in the `t/script` directory on the distribution.
__This script will remove any existing demouser database.__
# BUGS AND LIMITATIONS
There are bound to be bugs - please email the author if you find any.
# SEE ALSO
[Catalyst::Authentication::Store::DBIx::Class](http://search.cpan.org/perldoc?Catalyst::Authentication::Store::DBIx::Class).
[Catalyst::Plugin::Authentication](http://search.cpan.org/perldoc?Catalyst::Plugin::Authentication),
[Catalyst::Plugin::Authentication::Internals](http://search.cpan.org/perldoc?Catalyst::Plugin::Authentication::Internals),
and [Catalyst::Plugin::Authorization::Roles](http://search.cpan.org/perldoc?Catalyst::Plugin::Authorization::Roles)
# AUTHOR
Colin Bradford <cjbradford@gmail.com>
# COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Colin Bradford.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
( run in 2.132 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )