NAME

DBIx::Class::InflateColumn::Crypt::Passphrase - Inflate/deflate columns to passphrase objects

VERSION

version 0.008

SYNOPSIS

__PACKAGE__->load_components(qw(InflateColumn::Crypt::Passphrase));

__PACKAGE__->add_columns(
    id => {
        data_type         => 'integer',
        is_auto_increment => 1,
    },
    passphrase => {
        data_type          => 'text',
        inflate_passphrase => {
            encoder         => {
                module      => 'Argon2',
                memory_cost => '64M',
                time_cost   => 5,
                parallelism => 4,
            },
            validators => [
                'BCrypt',
            ],
        },
    },
);

__PACKAGE__->set_primary_key('id');


# in application code
$rs->create({ passphrase => 'password1' });

my $row = $rs->find({ id => $id });
if ($row->passphrase->verify_password($input)) { ...

DESCRIPTION

Provides inflation and deflation for Crypt::Passphrase instances from and to crypt encoding.

To enable both inflating and deflating, inflate_passphrase must be set to a Crypt::Passphrase construction hash.

METHODS

register_column

Chains with the register_column method in DBIx::Class::Row, and sets up passphrase columns appropriately. This would not normally be directly called by end users.

AUTHOR

Leon Timmermans <leont@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2023 by Leon Timmermans.

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