| 1 | package OpenID::Lite::Provider::Discover; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use Any::Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use OpenID::Lite::Provider::Discover::Parser; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use OpenID::Lite::RelyingParty::Discover::Fetcher::Yadis; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | with 'OpenID::Lite::Role::AgentHandler'; | |||||||||||||||||||||||||||
| 7 | 2 | with 'OpenID::Lite::Role::ErrorHandler'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | has '_fetcher' => ( | |||||||||||||||||||||||||||
| 10 | is => 'ro', | ||||||||||||||||||||||||||||
| 11 | lazy_build => 1, | ||||||||||||||||||||||||||||
| 12 | ); | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 2 | has '_parser' => ( | |||||||||||||||||||||||||||
| 15 | is => 'ro', | ||||||||||||||||||||||||||||
| 16 | lazy_build => 1, | ||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub discover { | ||||||||||||||||||||||||||
|
Subroutine
discover: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 20 | 0 | my ( $self, $rp_realm_url, $not_allow_redirection ) = @_; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | my $result = $self->_fetcher->fetch($rp_realm_url) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | or return $self->ERROR( $self->_fetcher->errstr ); | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | # when discovery is carried out for validating realm, | ||||||||||||||||||||||||||||
| 26 | # must not allow redirection. | ||||||||||||||||||||||||||||
| 27 | 0 | ▶ | return $self->ERROR(q{redirected.}) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$not_allow_redirection and $rp_realm_url ne $result->final_url
MC/DC0%0/2
$not_allow_redirection and $rp_realm_url ne $result->final_url
$not_allow_redirection
$rp_realm_url ne $result->final_url
Truth table0%0/3
A and B
A= $not_allow_redirectionB= $rp_realm_url ne $result->final_url
| |||||||||||||||||||||||||||||
| 28 | if ( $not_allow_redirection && $rp_realm_url ne $result->final_url ); | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | my $return_to_urls = $self->_parser->parse($result) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | or return $self->ERROR( $self->_parser->errstr ); | ||||||||||||||||||||||||||||
| 32 | 0 | return $return_to_urls; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | ▶ | sub _build__fetcher { | ||||||||||||||||||||||||||
|
Subroutine
_build__fetcher: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 37 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 38 | 0 | my $fetcher = OpenID::Lite::RelyingParty::Discover::Fetcher::Yadis->new( | |||||||||||||||||||||||||||
| 39 | agent => $self->agent ); | ||||||||||||||||||||||||||||
| 40 | 0 | return $fetcher; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | sub _build__parser { | ||||||||||||||||||||||||||
|
Subroutine
_build__parser: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 44 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 45 | 0 | my $parser = OpenID::Lite::Provider::Discover::Parser->new; | |||||||||||||||||||||||||||
| 46 | 0 | return $parser; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 2 | ▶ | no Any::Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 50 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 51 | 2 | 1; | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||