blib/lib/WWW/JSON/Role/Authentication/Header.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 3 | 7 | 42.8 |
branch | 0 | 2 | 0.0 |
condition | n/a | ||
subroutine | 1 | 3 | 33.3 |
pod | n/a | ||
total | 4 | 12 | 33.3 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package WWW::JSON::Role::Authentication::Header; | ||||||
2 | 8 | 8 | 3231 | use Moo::Role; | |||
8 | 14 | ||||||
8 | 37 | ||||||
3 | requires 'authentication'; | ||||||
4 | requires 'ua'; | ||||||
5 | |||||||
6 | sub _validate_Header { | ||||||
7 | 0 | 0 | my ( $self, $auth ) = @_; | ||||
8 | 0 | 0 | die "Required header string missing for " . __PACKAGE__ . " authentication" | ||||
9 | unless defined($auth); | ||||||
10 | } | ||||||
11 | |||||||
12 | sub _auth_Header { | ||||||
13 | 0 | 0 | my ( $self, $auth, $req ) = @_; | ||||
14 | 0 | $req->header( Authorization => $auth ); | |||||
15 | } | ||||||
16 | |||||||
17 | 1; |