| 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
| |||||||||||
| 15 | |||||||||||
| 16 | 2 | $req->header($self->header_name => $self->header_value); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 2 | 1; | |||||||||
| 20 | |||||||||||
| 21 | __END__ | ||||||||||