commit:72efa38cba27304a12485b8ef1376c9a9a39a32c
author:Chip Black
committer:Chip Black
date:Wed Feb 18 22:21:00 2015 -0600
parents:35f91ea7421eb9bb1e6d024086be46eb0d7befb0
Add authentication documentation for Blerg::Database
diff --git a/lib/perl/Blerg-Database/lib/Blerg/Database.pm b/lib/perl/Blerg-Database/lib/Blerg/Database.pm
line changes: +35/-0
index bf41706..3c4ad12
--- a/lib/perl/Blerg-Database/lib/Blerg/Database.pm
+++ b/lib/perl/Blerg-Database/lib/Blerg/Database.pm
@@ -206,6 +206,8 @@ provides nicer OO wrappers around the core C library that powers Blërg!.
 
 =head1 MODULE FUNCTIONS
 
+=head2 GENERAL
+
 =over
 
 =item exists(name)
@@ -244,6 +246,39 @@ Validates that C<name> is a valid username.
 
 =back
 
+=head2 AUTHENTICATION
+
+=over
+
+=item auth_set_password(username, password)
+
+Sets the password for the given username.  Returns 1 on success, 0 otherwise.
+
+=item auth_check_password(username, password)
+
+Checks the password for the given username.  Returns 1 on successful
+authentication, 0 on failed authentication or error.
+
+=item auth_login(username, password)
+
+Authenticates and logs the user in.  Returns the authentication token if
+successful, or undef on failure or error.
+
+=item auth_logout(username, token)
+
+Logs the given user out if the token represents a valid session.  Returns 1 on
+success, or 0 on failure.  Failure can happen if the token is no longer valid
+(meaning the user has been automatically logged out), so the return status is
+probably best ignored..
+
+=item auth_check_token(username, token)
+
+Checks that the token represents a valid session for the given username.
+Returns 1 if the session is valid, 0 otherwise.  Also resets the expiration
+time of the session.
+
+=back
+
 =head1 CONSTRUCTOR
 
 =over