Concierge::Auth

Concierge authorization using Crypt::Passphrase - a production-ready authentication and authorization framework.

VERSION

v0.3.2

DESCRIPTION

Concierge::Auth provides comprehensive user authentication and authorization capabilities using Crypt::Passphrase for secure password management. It supports file-based user storage, token generation, session management, and API key handling.

FEATURES

MODULE STRUCTURE

INSTALLATION

From source:

perl Makefile.PL
make
make test
make install

From CPAN:

cpanm Concierge::Auth

QUICK START

use Concierge::Auth;

# Initialize auth with a password file
my $auth = Concierge::Auth->new({
    file => '/path/to/users.passwd',
});

# Or initialize without a file (utilities only)
my $auth_util = Concierge::Auth->new({
    no_file => 1,
});

# Authenticate a user
my ($ok, $msg) = $auth->checkID($user_id);
my ($ok, $msg) = $auth->checkPwd($user_id, $password);

# Create a new user
($ok, $msg) = $auth->setPwd($user_id, $password);

# Change password
($ok, $msg) = $auth->resetPwd($user_id, $new_password);

# Delete a user
($ok, $msg) = $auth->deleteID($user_id);

# Generate a token
my ($token, $msg) = $auth->gen_crypt_token();

# Generate a random string
my ($random, $msg) = $auth->gen_random_string(16);

# Generate a UUID
my ($uuid, $msg) = $auth->gen_uuid();

DEVELOPMENT

Repository Structure

Concierge-Auth/
├── lib/Concierge/          # Source modules
│   ├── Auth.pm             # Main module
│   └── Auth/               # Submodules
│       └── Generators.pm   # Generator system
├── examples/               # Example scripts
│   ├── 01-basic-authentication.pl
│   ├── 02-user-management.pl
│   ├── 03-token-generation.pl
│   ├── 04-session-management.pl
│   ├── 05-api-keys.pl
│   ├── 06-file-management.pl
│   ├── 07-error-handling.pl
│   ├── 08-advanced-usage.pl
│   ├── 09-generators-architecture.pl
│   ├── 10-architecture-comparison.pl
│   └── README.md
├── t/                      # Test suite
│   ├── 00-load.t
│   ├── 01-constructor.t
│   ├── 02-validation.t
│   ├── 03-auth.t
│   └── 04-file-management.t
├── Changes                # Revision history
├── MANIFEST               # Distribution file list
├── Makefile.PL            # CPAN installation script
└── README.md              # This file

Development Workflow

  1. Edit files in the Git repository
  2. Test using blib (doesn't affect installed version):
    perl Makefile.PL
    make
    prove -blib t/*.t
    
  3. Commit changes to Git
  4. Install when ready for production:
    make install
    

This workflow lets you:

REQUIREMENTS

PASSWORD SECURITY

Concierge::Auth uses Crypt::Passphrase with:

PRODUCTION USE

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

INTEGRATION

Concierge::Auth integrates with the Concierge ecosystem:

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

EXAMPLES

The examples/ directory contains comprehensive examples covering:

  1. Basic authentication
  2. User management
  3. Token generation
  4. Session management
  5. API keys
  6. File management
  7. Error handling
  8. Advanced usage
  9. Generators architecture
  10. Architecture comparison

See examples/README.md for full 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.