| 1 | package DBIx::Class::InflateColumn::Crypt::Passphrase; | ||||||||||
| 2 | 4 | $DBIx::Class::InflateColumn::Crypt::Passphrase::VERSION = '0.008'; | |||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use parent 'DBIx::Class'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 4 | ▶ | use Crypt::Passphrase 0.007; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 4 | ▶ | use Scalar::Util 'blessed'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 4 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | sub register_column { | ||||||||||
| 14 | 4 | ▶ | my ($self, $column, $info, @rest) = @_; | ||||||||
|
Subroutine
register_column: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 15 | |||||||||||
| 16 | 4 | $self->next::method($column, $info, @rest); | |||||||||
| 17 | 4 | ▶ | return unless my $encoding = $info->{inflate_passphrase}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | |||||||||||
| 19 | 2 | ▶ | my $crypt_passphrase = blessed($encoding) ? $encoding : Crypt::Passphrase->new(%{ $encoding }); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | |||||||||||
| 21 | $self->inflate_column( | ||||||||||
| 22 | $column => { | ||||||||||
| 23 | 3 | ▶ | inflate => sub { $crypt_passphrase->curry_with_hash(shift) }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 2 | ▶ | deflate => sub { shift->raw_hash }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 25 | }, | ||||||||||
| 26 | 2 | ); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 4 | 1; | |||||||||
| 30 | |||||||||||
| 31 | # ABSTRACT: Inflate/deflate columns to passphrase objects | ||||||||||
| 32 | |||||||||||
| 33 | __END__ | ||||||||||