| 1 | package URL::Signature::Query; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use parent 'URL::Signature'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use Params::Util qw( _STRING ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | our $VERSION = '0.03'; | |||||||||
| 9 | |||||||||||
| 10 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 11 | 0 | my ($class, %attrs) = @_; | |||||||||
| 12 | 0 | return $class->SUPER::new( %attrs, format => 'query' ); | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | 1 | ▶ | sub BUILD { | ||||||||
|
Subroutine
BUILD: called CC=3 SCAR=11.4
Pod
documented
| |||||||||||
| 17 | 1 | my $self = shift; | |||||||||
| 18 | 1 | ▶ | $self->{'as'} = 'k' unless exists $self->{'as'}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | Carp::croak(q[in 'query' format, 'as' needs to be a valid string]) | ||||||||||
| 20 | 1 | ▶ | unless defined _STRING($self->{'as'}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 1 | return; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | 2 | ▶ | sub extract { | ||||||||
|
Subroutine
extract: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 26 | 2 | my ($self, $uri) = @_; | |||||||||
| 27 | 2 | my $code = $uri->query_param_delete( $self->{as} ); | |||||||||
| 28 | 2 | return ($code, $uri); | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | |||||||||||
| 32 | 2 | ▶ | sub append { | ||||||||
|
Subroutine
append: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 33 | 2 | my ($self, $uri, $code) = @_; | |||||||||
| 34 | 2 | my $varname = $self->{as}; | |||||||||
| 35 | 2 | my $code_check = $uri->query_param_delete($varname); | |||||||||
| 36 | 2 | ▶ | Carp::croak("variable '$varname' (reserved for auth code) found in path") | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | if $code_check; | ||||||||||
| 38 | |||||||||||
| 39 | 2 | $uri->query_param_append( $varname => $code ); | |||||||||
| 40 | 2 | return $uri; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | |||||||||||
| 44 | 1 | 42; | |||||||||
| 45 | __END__ | ||||||||||