| 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
| |||||||||||||||||||||||||||||
| 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
Condition0%0/3
$params->is_openid1 and $params->get("user_setup_url")
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")
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 54 | 0 | my $verifier = OpenID::Lite::RelyingParty::IDResHandler::Verifier->new(%args); | |||||||||||||||||||||||||||
| 55 | 0 | ▶ | if ( $verifier->verify() ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 71 | 0 | ▶ | return OpenID::Lite::RelyingParty::CheckID::Result->new( | ||||||||||||||||||||||||||
|
Condition0%0/2
$params->get('user_setup_url') || ''
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')
| |||||||||||||||||||||||||||||
| 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') || ''
MC/DC0%0/1
$params->get('error') || ''
$params->get('error')
Truth table0%0/2
A
A= $params->get('error')
| |||||||||||||||||||||||||||||
| 86 | 0 | ▶ | my $contact = $params->get('contact') || ''; | ||||||||||||||||||||||||||
|
Condition0%0/2
$params->get('contact') || ''
MC/DC0%0/1
$params->get('contact') || ''
$params->get('contact')
Truth table0%0/2
A
A= $params->get('contact')
| |||||||||||||||||||||||||||||
| 87 | 0 | ▶ | my $reference = $params->get('reference') || ''; | ||||||||||||||||||||||||||
|
Condition0%0/2
$params->get('reference') || ''
MC/DC0%0/1
$params->get('reference') || ''
$params->get('reference')
Truth table0%0/2
A
A= $params->get('reference')
| |||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||