FederatedLogin/Gmail/Discoverer.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 80.7% 21 / 26 CC 1 SCAR 2.4
CC
1
Cov
81%
__ANON__
2.0
perform_discovery
1.1
BEGIN
1.0
CRAP 1.3
« FederatedLogin/Apps/Discoverer.pm ↑ Summary FederatedLogin/Role/Discoverer.pm »
1 package Net::Google::FederatedLogin::Gmail::Discoverer;
2 {
3 2 $Net::Google::FederatedLogin::Gmail::Discoverer::VERSION = '0.8.0';
4 }
5 # ABSTRACT: Find the OpenID endpoint for standard gmail accounts
6  
7 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 with 'Net::Google::FederatedLogin::Role::Discoverer';
10  
11 2 my $DISCOVERY_URL = 'https://www.google.com/accounts/o8/id';
12  
13  
14 2 ▶sub perform_discovery {
Subroutine perform_discovery: called CC=1 SCAR=0.8
Pod documented
15 2 my $self = shift;
16
17 2 my $ua = $self->ua;
18 2 my $response = $ua->get($DISCOVERY_URL,
19 Accept => 'application/xrds+xml');
20
21 2 my $open_id_endpoint;
22
23 2 require XML::Twig;
24 my $xt = XML::Twig->new(
25 0 ▶ twig_handlers => { URI => sub {$open_id_endpoint = $_->text}},
Subroutine __ANON__: not called CC=1 SCAR=6.9
26 0 );
27 0 $xt->parse($response->decoded_content);
28
29 0 return $open_id_endpoint;
30 }
31  
32 2 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 2 __PACKAGE__->meta->make_immutable;
34 2 1;
35  
36 __END__
« FederatedLogin/Apps/Discoverer.pm ↑ Summary FederatedLogin/Role/Discoverer.pm »