Dancer2-Plugin-Auth-YARBAC
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/Auth/YARBAC/Provider/Base.pm view on Meta::CPAN
has pw_special_characters => ( is => 'ro', default => \&_pw_special_characters, lazy => 1 );
has pw_control_characters => ( is => 'ro', default => \&_pw_control_characters, lazy => 1 );
has pw_no_repeating => ( is => 'ro', default => \&_pw_no_repeating, lazy => 1 );
has pw_upper_case => ( is => 'ro', default => \&_pw_upper_case, lazy => 1 );
has pw_lower_case => ( is => 'ro', default => \&_pw_lower_case, lazy => 1 );
has pw_numbers => ( is => 'ro', default => \&_pw_numbers, lazy => 1 );
has pw_required_score => ( is => 'ro', default => \&_pw_required_score, lazy => 1 );
has pw_truncate => ( is => 'ro', default => \&_pw_truncate, lazy => 1 );
has hash_class => ( is => 'ro', default => sub { 'HMACSHA2' } );
has hash_args => ( is => 'ro', default => sub { { sha_size => 512, } } );
has iterations => ( is => 'ro', default => \&_iterations, lazy => 1 );
has output_len => ( is => 'ro', default => \&_output_len, lazy => 1 );
has salt_len => ( is => 'ro', default => \&_salt_len, lazy => 1 );
has pbkdf2 => ( is => 'ro', default => \&_pbkdf2, lazy => 1 );
sub _pw_min_length
{
my $self = shift;
return ( defined $self->settings->{password_strength}->{min_length}
&& $self->settings->{password_strength}->{min_length} =~ m{^\d$} )
lib/Dancer2/Plugin/Auth/YARBAC/Provider/Base.pm view on Meta::CPAN
sub _pw_truncate
{
my $self = shift;
return ( defined $self->settings->{password_strength}->{truncate}
&& $self->settings->{password_strength}->{truncate} =~ m{^\d$} )
? $self->settings->{password_strength}->{truncate}
: 1;
}
sub _iterations
{
my $self = shift;
return ( defined $self->settings->{PBKDF2}->{iterations}
&& $self->settings->{PBKDF2}->{iterations} =~ m{^\d^} )
? $self->settings->{PBKDF2}->{iterations}
: 4000;
}
sub _output_len
{
my $self = shift;
return ( defined $self->settings->{PBKDF2}->{output_len}
&& $self->settings->{PBKDF2}->{output_len} =~ m{^\d$} )
? $self->settings->{PBKDF2}->{output_len}
lib/Dancer2/Plugin/Auth/YARBAC/Provider/Base.pm view on Meta::CPAN
: 24;
}
sub _pbkdf2
{
my $self = shift;
return Crypt::PBKDF2->new(
hash_class => $self->hash_class,
hash_args => $self->hash_args,
iterations => $self->iterations,
output_len => $self->output_len,
salt_len => $self->salt_len,
);
}
sub generate_hash
{
my $self = shift;
my $params = shift;
my $opts = shift;
( run in 2.228 seconds using v1.01-cache-2.11-cpan-71847e10f99 )