Concierge::Auth

Concierge authorization framework - production-ready authentication and authorization with substitutable backends.

VERSION

v0.5.2

DESCRIPTION

Concierge::Auth provides comprehensive user authentication and authorization capabilities through a substitutable backend architecture — any backend implementing the same contract (LDAP, OAuth, etc.) can be swapped in. Token generation is available independent of the backend in use. The bundled Concierge::Auth::Pwd backend implements file-based password authentication using Crypt::Passphrase; see "Built-in Authentication" below.

FEATURES

MODULE STRUCTURE

INSTALLATION

From source:

perl Makefile.PL
make
make test
make install

From CPAN:

cpanm Concierge::Auth

QUICK START

use Concierge::Auth;

my $auth = Concierge::Auth->new(
    backend_class => 'Concierge::Auth::Pwd',
    file          => '/path/to/users.passwd',
);

my $result = $auth->enroll($user_id, $password);
my $result = $auth->authenticate($user_id, $password);
my $result = $auth->is_id_known($user_id);
my $result = $auth->change_credentials($user_id, $new_password);
my $result = $auth->revoke($user_id);

# Generators -- work with or without a file
# (backend_class => 'Concierge::Auth::Pwd', no_file => 1)
my $token = $auth->gen_random_token();
my $uuid  = $auth->gen_uuid();

Each of the five core methods above returns a hashref: { success => 1, ... } on success, or { success => 0, message => '...' } on failure. See Concierge::Auth::Base for the full contract.

Built-in Authentication (Concierge::Auth::Pwd)

Concierge::Auth::Pwd is the password-file backend bundled with this distribution — the backend_class used in the example above.

Password security defaults:

See perldoc Concierge::Auth::Pwd for the full backend documentation.

The generator methods (gen_random_token, gen_uuid, etc.) are different: they follow a wantarray (value) / (value, message) dual-return convention rather than returning a hashref, so context matters:

my ($token, $msg) = $auth->gen_random_token();  # list context
my $token          = $auth->gen_random_token();  # scalar context: $msg discarded

REQUIREMENTS

PRODUCTION USE

Concierge::Auth is actively used in production environments. Key features for production:

See "Built-in Authentication" above for production-hardening details specific to the bundled Concierge::Auth::Pwd backend (file locking, secure password defaults).

INTEGRATION

Concierge::Auth also integrates with the Concierge ecosystem:

These modules together form the core of the Concierge service layer, providing:

EXAMPLES

The examples/ directory currently contains one example:

More examples covering the built-in Concierge::Auth::Pwd backend and generator usage are planned. See examples/README.md for details.

ARCHITECTURE

Concierge::Auth follows a service layer pattern:

The module uses modern Perl practices:

AUTHOR

Bruce Van Allen bva@cruzio.com

LICENSE

Artistic License 2.0

SEE ALSO

CHANGES

See Changes file for revision history.