Add authentication documentation for Blerg::Database
authorChip Black <bytex64@bytex64.net>
Thu, 19 Feb 2015 04:21:00 +0000 (22:21 -0600)
committerChip Black <bytex64@bytex64.net>
Thu, 19 Feb 2015 04:21:00 +0000 (22:21 -0600)
lib/perl/Blerg-Database/lib/Blerg/Database.pm

index bf41706..3c4ad12 100644 (file)
@@ -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