From 72efa38cba27304a12485b8ef1376c9a9a39a32c Mon Sep 17 00:00:00 2001 From: Chip Black Date: Wed, 18 Feb 2015 22:21:00 -0600 Subject: [PATCH] Add authentication documentation for Blerg::Database --- lib/perl/Blerg-Database/lib/Blerg/Database.pm | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/lib/perl/Blerg-Database/lib/Blerg/Database.pm b/lib/perl/Blerg-Database/lib/Blerg/Database.pm index bf41706..3c4ad12 100644 --- 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 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 -- 2.25.1