| 1 | package Catalyst::Authentication::Store::Model::KiokuDB::UserWrapper; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use namespace::clean -except => 'meta'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | # FIXME massively cargo culted | ||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | has directory => ( | |||||||||||||||||||||||||||
| 9 | isa => "KiokuDB", | ||||||||||||||||||||||||||||
| 10 | is => "ro", | ||||||||||||||||||||||||||||
| 11 | required => 1, | ||||||||||||||||||||||||||||
| 12 | ); | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 1 | has 'user_object' => ( | |||||||||||||||||||||||||||
| 15 | does => 'KiokuX::User', | ||||||||||||||||||||||||||||
| 16 | reader => 'get_object', | ||||||||||||||||||||||||||||
| 17 | required => 1, | ||||||||||||||||||||||||||||
| 18 | handles => [qw(id check_password)], | ||||||||||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub roles { @{ shift->get_object->roles } }; | ||||||||||||||||||||||||||
|
Subroutine
roles: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1 | has [qw(auth_realm store)] => ( | |||||||||||||||||||||||||||
| 24 | is => 'rw', | ||||||||||||||||||||||||||||
| 25 | ); | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 1 | my %supports = ( | |||||||||||||||||||||||||||
| 28 | password => 'self_check', | ||||||||||||||||||||||||||||
| 29 | roles => ["roles"], | ||||||||||||||||||||||||||||
| 30 | session => 1, | ||||||||||||||||||||||||||||
| 31 | ); | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub supports { | ||||||||||||||||||||||||||
|
Subroutine
supports: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | 0 | my ($self, @spec) = @_; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | my $cursor = \%supports; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | ▶ | return 1 if @spec == 1 and $self->can($spec[0]); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@spec == 1 and $self->can($spec[0])
MC/DC0%0/2
@spec == 1 and $self->can($spec[0])
@spec == 1
$self->can($spec[0])
Truth table0%0/3
A and B
A= @spec == 1B= $self->can($spec[0])
| |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | # XXX is this correct? | ||||||||||||||||||||||||||||
| 41 | 0 | for (@spec) { | |||||||||||||||||||||||||||
| 42 | 0 | ▶ | return if ref($cursor) ne "HASH"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 0 | $cursor = $cursor->{$_}; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | ▶ | if (ref $cursor) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | 0 | ▶ | die "Bad feature spec: '@spec'" unless ref $cursor eq "ARRAY"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | 0 | foreach my $key (@$cursor) { | |||||||||||||||||||||||||||
| 49 | 0 | ▶ | return undef unless $self->can($key); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||
| 51 | 0 | return 1; | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | else { | ||||||||||||||||||||||||||||
| 54 | 0 | return $cursor; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 0 | ▶ | sub for_session { | ||||||||||||||||||||||||||
|
Subroutine
for_session: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 59 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | # FIXME if session isa KiokuDB, no need to do anything | ||||||||||||||||||||||||||||
| 62 | 0 | return $self->directory->object_to_id($self->get_object); | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 1 | __PACKAGE__ | |||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | __END__ | ||||||||||||||||||||||||||||