Spore/Middleware/Auth/Header.pm

filter: Statementstmt 100% 11 / 11 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 0.0% 0 / 1 totaltotal 87.5% 14 / 16 CC 2 SCAR 5.2
CC
2
Cov
92%
call
2.0
BEGIN
1.0
CRAP 1.7
« Spore/Meta/Method/Spore.pm ↑ Summary Spore/Middleware.pm »
1 package Net::HTTP::Spore::Middleware::Auth::Header;
2 2 $Net::HTTP::Spore::Middleware::Auth::Header::VERSION = '0.09';
3 # ABSTRACT: middleware for authentication with specific header
4  
5 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 extends 'Net::HTTP::Spore::Middleware::Auth';
7  
8 2 has header_name => (isa => 'Str', is => 'rw', required => 1);
9 2 has header_value => (isa => 'Str', is => 'rw', required => 1);
10  
11 2 ▶sub call {
Subroutine call: called CC=2 SCAR=7.1
Pod undocumented
12 2 my ($self, $req) = @_;
13  
14 2 ▶ return unless $self->should_authenticate($req);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->should_authenticate($req) 0 2 2
15  
16 2 $req->header($self->header_name => $self->header_value);
17 }
18  
19 2 1;
20  
21 __END__
« Spore/Meta/Method/Spore.pm ↑ Summary Spore/Middleware.pm »