Lite/RelyingParty/IDResHandler.pm

filter: Statementstmt 53.0% 26 / 49 Branchbran 0.0% 0 / 18 Conditioncond 0.0% 0 / 11 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 1 totaltotal 35.4% 33 / 93 CC 15 SCAR 51.0
CC
15
Cov
33%
idres
240.0
BEGIN
1.0
BEGIN
1.0
CRAP 164.0
↑ Summary Lite/RelyingParty/Associator/ParamExtractor.pm »
1 package OpenID::Lite::RelyingParty::IDResHandler;
2  
3 1 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 with 'OpenID::Lite::Role::ErrorHandler';
5 1 with 'OpenID::Lite::Role::AgentHandler';
6  
7 1 ▶use Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use OpenID::Lite::RelyingParty::CheckID::Result;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use OpenID::Lite::RelyingParty::IDResHandler::Verifier;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use OpenID::Lite::Constants::ModeType qw(ID_RES SETUP_NEEDED CANCEL ERROR_MODE);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use OpenID::Lite::Constants::CheckIDResponse qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 has 'store' => (
14 is => 'ro',
15 does => 'OpenID::Lite::Role::Storable',
16 );
17  
18 0 ▶sub idres {
Subroutine idres: not called CC=15 SCAR=54.8
Pod undocumented
19 0 my $self = shift;
20 0 my %args = Params::Validate::validate(
21 @_,
22 { current_url => 1,
23 params => {
24 isa => 'OpenID::Lite::Message',
25 },
26 service => {
27 isa => 'OpenID::Lite::RelyingParty::Discover::Service',
28 optional => 1
29 },
30 }
31 );
32  
33 0 my $params = $args{params};
34 0 my $service = $args{service};
35  
36 0 my $mode = $params->get('mode');
37 0 ▶ if ( !$mode ) {
Branch: 5 branches
BranchTrueFalseTotal
if (not $mode) { } 0 0 0
elsif ($mode eq 'id_res') { } 0 0 0
elsif ($mode eq 'setup_needed') { } 0 0 0
elsif ($mode eq 'cancel') { } 0 0 0
elsif ($mode eq 'error') { } 0 0 0
38 0 return OpenID::Lite::RelyingParty::CheckID::Result->new(
39 type => IS_NOT_OPENID,
40 params => $params,
41 message => sprintf(q{Unknown mode, "%s"}, $mode),
42 );
43 }
44 elsif ( $mode eq ID_RES ) {
45 0 ▶ if ( $params->is_openid1 && $params->get('user_setup_url') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($params->is_openid1 and $params->get("user_setup_url")) 0 0 0
Condition0%0/3
$params->is_openid1 and $params->get("user_setup_url")
!ll&&!rl&&r
000
MC/DC0%0/2
$params->is_openid1 and $params->get("user_setup_url")
$params->is_openid1 $params->get("user_setup_url")
Truth table0%0/3
A and B
A= $params->is_openid1B= $params->get("user_setup_url")
ABresult
0X0
100
111
46 0 return OpenID::Lite::RelyingParty::CheckID::Result->new(
47 type => IS_SETUP_NEEDED,
48 params => $params,
49 url => $params->get('user_setup_url'),
50 );
51 }
52 0 $args{agent} = $self->agent;
53 0 ▶ $args{store} = $self->store if $self->store;
Branch: 1 branch
BranchTrueFalseTotal
if $self->store 0 0 0
54 0 my $verifier = OpenID::Lite::RelyingParty::IDResHandler::Verifier->new(%args);
55 0 ▶ if ( $verifier->verify() ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($verifier->verify) { } 0 0 0
56 0 return OpenID::Lite::RelyingParty::CheckID::Result->new(
57 type => IS_SUCCESS,
58 params => $params,
59 service => $verifier->service,
60 );
61 } else {
62 0 return OpenID::Lite::RelyingParty::CheckID::Result->new(
63 type => IS_INVALID,
64 params => $params,
65 message => $verifier->errstr,
66 );
67 };
68 }
69 elsif ( $mode eq SETUP_NEEDED ) {
70 0 ▶ unless ( $params->is_openid1 ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($params->is_openid1) 0 0 0
71 0 ▶ return OpenID::Lite::RelyingParty::CheckID::Result->new(
Condition0%0/2
$params->get('user_setup_url') || ''
l!l
00
MC/DC0%0/1
$params->get('user_setup_url') || ''
$params->get('user_setup_url')
Truth table0%0/2
A
A= $params->get('user_setup_url')
Aresult
11
00
72 type => IS_SETUP_NEEDED,
73 params => $params,
74 url => $params->get('user_setup_url') || '',
75 );
76 }
77 }
78 elsif ( $mode eq CANCEL ) {
79 0 return OpenID::Lite::RelyingParty::CheckID::Result->new(
80 type => IS_CANCELED,
81 params => $params,
82 );
83 }
84 elsif ( $mode eq ERROR_MODE ) {
85 0 ▶ my $error = $params->get('error') || '';
Condition0%0/2
$params->get('error') || ''
l!l
00
MC/DC0%0/1
$params->get('error') || ''
$params->get('error')
Truth table0%0/2
A
A= $params->get('error')
Aresult
11
00
86 0 ▶ my $contact = $params->get('contact') || '';
Condition0%0/2
$params->get('contact') || ''
l!l
00
MC/DC0%0/1
$params->get('contact') || ''
$params->get('contact')
Truth table0%0/2
A
A= $params->get('contact')
Aresult
11
00
87 0 ▶ my $reference = $params->get('reference') || '';
Condition0%0/2
$params->get('reference') || ''
l!l
00
MC/DC0%0/1
$params->get('reference') || ''
$params->get('reference')
Truth table0%0/2
A
A= $params->get('reference')
Aresult
11
00
88 0 return OpenID::Lite::RelyingParty::CheckID::Result->new(
89 type => IS_ERROR,
90 message => $error,
91 contact => $contact,
92 reference => $reference,
93 params => $params,
94 );
95 }
96 0 return OpenID::Lite::RelyingParty::CheckID::Result->new(
97 type => IS_INVALID,
98 params => $params,
99 message => sprintf(q{Unknown mode, "%s"}, $mode),
100 );
101 }
102  
103 1 ▶no Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
104 1 __PACKAGE__->meta->make_immutable;
105 1 1;
106  
↑ Summary Lite/RelyingParty/Associator/ParamExtractor.pm »