| 1 | package HTTP::Headers::ActionPack::Core::BaseAuthHeader; | ||||||||||
| 2 | # ABSTRACT: The base Auth Header | ||||||||||
| 3 | |||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 4 | our $VERSION = '0.10'; | |||||||||
| 8 | |||||||||||
| 9 | 4 | ▶ | use Carp qw[ confess ]; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 4 | ▶ | use HTTP::Headers::ActionPack::Util qw[ | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | join_header_params | ||||||||||
| 12 | 4 | ]; | |||||||||
| 13 | |||||||||||
| 14 | 4 | ▶ | use parent 'HTTP::Headers::ActionPack::Core::BaseHeaderWithParams'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 10 | ▶ | sub BUILDARGS { | ||||||||
|
Subroutine
BUILDARGS: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 17 | 10 | my $class = shift; | |||||||||
| 18 | 10 | my ($type, @params) = @_; | |||||||||
| 19 | |||||||||||
| 20 | 10 | ▶ | confess "You must specify an auth-type" unless $type; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | |||||||||||
| 22 | return +{ | ||||||||||
| 23 | auth_type => $type, | ||||||||||
| 24 | 10 | %{ $class->_prepare_params( @params ) } | |||||||||
| 25 | }; | ||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 5 | ▶ | sub new_from_string { | ||||||||
|
Subroutine
new_from_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 29 | 5 | my ($class, $header_string) = @_; | |||||||||
| 30 | |||||||||||
| 31 | 5 | my @parts = HTTP::Headers::Util::_split_header_words( $header_string ); | |||||||||
| 32 | 5 | splice @{ $parts[0] }, 1, 1; | |||||||||
| 33 | |||||||||||
| 34 | 5 | $class->new( map { @$_ } @parts ); | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 20 | ▶ | sub auth_type { (shift)->{'auth_type'} } | ||||||||
|
Subroutine
auth_type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 38 | |||||||||||
| 39 | 10 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 40 | 10 | my $self = shift; | |||||||||
| 41 | 10 | $self->auth_type . ' ' . join_header_params( ', ' => $self->params_in_order ); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 4 | 1; | |||||||||
| 45 | |||||||||||
| 46 | __END__ | ||||||||||