| 1 | package PlugAuth::Role::Auth; | ||||||||||
| 2 | |||||||||||
| 3 | 9 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 9 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 9 | ▶ | use Role::Tiny; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | # ABSTRACT: Role for PlugAuth authentication plugins | ||||||||||
| 8 | 9 | our $VERSION = '0.39'; # VERSION | |||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | 9 | requires qw( check_credentials ); | |||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub all_users { () } | ||||||||
|
Subroutine
all_users: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | sub create_user | ||||||||||
| 18 | 0 | ▶ | { | ||||||||
|
Subroutine
create_user: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 19 | 0 | my $next_auth = shift->next_auth; | |||||||||
| 20 | 0 | ▶ | return 0 unless defined $next_auth; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 0 | $next_auth->create_user(@_); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | sub _find_create_user_cb | ||||||||||
| 26 | 0 | ▶ | { | ||||||||
|
Subroutine
_find_create_user_cb: not called CC=3 SCAR=24.8
| |||||||||||
| 27 | 0 | my $self = shift; | |||||||||
| 28 | 0 | ▶ | return $self if $self->can('create_user_cb'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | my $next = $self->next_auth; | |||||||||
| 30 | 0 | ▶ | return $next ? $next->_find_create_user_cb : (); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | |||||||||||
| 34 | sub change_password | ||||||||||
| 35 | 0 | ▶ | { | ||||||||
|
Subroutine
change_password: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 36 | 0 | my $next_auth = shift->next_auth; | |||||||||
| 37 | 0 | ▶ | return 0 unless defined $next_auth; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 0 | $next_auth->change_password(@_); | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | |||||||||||
| 42 | sub delete_user | ||||||||||
| 43 | 0 | ▶ | { | ||||||||
|
Subroutine
delete_user: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 44 | 0 | my $next_auth = shift->next_auth; | |||||||||
| 45 | 0 | ▶ | return 0 unless defined $next_auth; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 0 | $next_auth->delete_user(@_); | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | |||||||||||
| 50 | sub next_auth | ||||||||||
| 51 | 0 | ▶ | { | ||||||||
|
Subroutine
next_auth: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 52 | 0 | my($self, $new_value) = @_; | |||||||||
| 53 | 0 | ▶ | $self->{next_auth} = $new_value if defined $new_value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | 0 | $self->{next_auth}; | |||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | |||||||||||
| 58 | sub deligate_check_credentials | ||||||||||
| 59 | 0 | ▶ | { | ||||||||
|
Subroutine
deligate_check_credentials: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 60 | 0 | my($self, $user, $pass) = @_; | |||||||||
| 61 | 0 | my $next_auth = $self->next_auth; | |||||||||
| 62 | 0 | ▶ | return 0 unless defined $next_auth; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 63 | 0 | return $next_auth->check_credentials($user, $pass); | |||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 0 | ▶ | around all_users => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 67 | 0 | my($orig, $self) = @_; | |||||||||
| 68 | 0 | my $next_auth = $self->next_auth; | |||||||||
| 69 | 0 | ▶ | return $orig->($self) unless defined $next_auth; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 70 | 0 | return ($orig->($self), $next_auth->all_users); | |||||||||
| 71 | 9 | }; | |||||||||
| 72 | |||||||||||
| 73 | 9 | 1; | |||||||||
| 74 | |||||||||||
| 75 | __END__ | ||||||||||