NAME

WWW::Suffit::Plugin::AuthDB - The Suffit plugin for Suffit Authorization Database

SYNOPSIS

sub startup {
    my $self = shift->SUPER::startup();
    $self->plugin('AuthDB', {
        ds => "sqlite:///tmp/auth.db?sqlite_unicode=1",
    });

    # . . .
}

DESCRIPTION

The Suffit plugin for Suffit Authorization Database

OPTIONS

This plugin supports the following options

cached

cached => 1
cached => 'yes'
cached => 'on'
cached => 'enable'

This option defines status of caching while establishing of connection to database

See "cached" in WWW::Suffit::AuthDB

Default: false (no caching connection)

ds

ds => "sqlite:///tmp/auth.db?sqlite_unicode=1"

Data source URI. See WWW::Suffit::AuthDB::Model

See "ds, dsuri" in WWW::Suffit::AuthDB

Default: 'sponge://'

expiration

expiration => 300

The expiration time

See "expiration" in WWW::Suffit::AuthDB

Default: 300 (5 min)

max_keys

max_keys => 1024

The maximum keys number in cache

See "max_keys" in WWW::Suffit::AuthDB

Default: 1024*1024 (1`048`576 keys max)

sourcefile

sourcefile => '/tmp/authdb.json'

Path to the source file in JSON format

See "sourcefile" in WWW::Suffit::AuthDB

Default: none

HELPERS

This plugin implements the following helpers

authdb

my $authdb = $self->authdb;

This helper returns the WWW::Suffit::AuthDB instance

METHODS

This plugin inherits all methods from Mojolicious::Plugin and implements the following new ones

register

This method register the plugin and helpers in Mojolicious application

$plugin->register(Mojolicious->new, {
    ds => "sqlite:///tmp/auth.db?sqlite_unicode=1",
});

Register plugin in Mojolicious application

SEE ALSO

Mojolicious, WWW::Suffit::Server, WWW::Suffit::AuthDB

AUTHOR

Serż Minus (Sergey Lepenkov) https://www.serzik.com <abalama@cpan.org>

COPYRIGHT

Copyright (C) 1998-2025 D&D Corporation. All Rights Reserved

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See LICENSE file and https://dev.perl.org/licenses/