NAME

MojoX::Authentication::Model::SAML2::Db

SYNOPSIS

use MojoX::MojoDbWrap;
use MojoX::Authentication::Model::SAML2::Db;

my $wrap MojoX::MojoDbWrap->new(...);
my $cache = MojoX::Authentication::Model::SAML2::Db->new(wmdb => $wrap);

my $data = {...};
$cache->set($data, $key, $expiration_time);

my $data_out = $cache->get($key);

$cache->wipe($key);

DESCRIPTION

Cache for data, based on a database wrapped by a MojoX::MojoDbWrap.

INTERFACE

get

my $data = $cache->get($key);

Retrieve an object from the cache, by key.

new

my $cache = MojoX::Authentication::Model::SAML2::Db->new(
   wmdb => $wrap, table => $table_name);

Constructor for an object.

"wmdb" is an instance of MojoX::MojoDbWrap object, or compatible.

"table" is the name of the table holding the cache items, defaulting to logged_in.

set

$cache->set($data, $key, $expiration_time);

Set an element in the cache, with expiration time (expressed as an epoch). Every call also removes the entries that have already expired, so that abandoned logins do not pile up.

table

my $string = $cache->table;

Accessor to the name of the table holding the cache.

wipe

$cache->wipe($key);

Permanently remove an item from the cache.

wmdb

my $wmdb = $cache->wmdb;

Accessor to the MojoX::MojoDbWrap object wrapping access to the database.

ANYTHING ELSE (INCLUDING AUTHOR, COPYRIGHT AND LICENSE)

See documentation for MojoX::Authentication.