Throwable/Role/Status/ProxyAuthenticationRequired.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 94.4% 34 / 36 SCAR 6.9
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Throwable/Role/Status/ServiceUnavailable.pm ↑ Summary Throwable/Role/Status/Unauthorized.pm »
1 package HTTP::Throwable::Role::Status::ProxyAuthenticationRequired;
2 1 our $AUTHORITY = 'cpan:STEVAN';
3 1 $HTTP::Throwable::Role::Status::ProxyAuthenticationRequired::VERSION = '0.027';
4 1 ▶use Types::Standard qw(Str ArrayRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 with(
9 'HTTP::Throwable',
10 'HTTP::Throwable::Role::BoringText',
11 );
12  
13 4 ▶sub default_status_code { 407 }
Subroutine default_status_code: called CC=1 SCAR=0.0
Pod undocumented
14 4 ▶sub default_reason { 'Proxy Authentication Required' }
Subroutine default_reason: called CC=1 SCAR=0.0
Pod undocumented
15  
16 1 has 'proxy_authenticate' => (
17 is => 'ro',
18 isa => Str | ArrayRef[ Str ],
19 required => 1,
20 );
21  
22 around 'build_headers' => sub {
23 4 ▶ my $next = shift;
Subroutine __ANON__: called CC=2 SCAR=6.9
24 4 my $self = shift;
25 4 my $headers = $self->$next( @_ );
26 4 my $proxy_auth = $self->proxy_authenticate;
27 4 ▶ if ( ref $proxy_auth ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $proxy_auth) { } 2 2 4
28 2 push @$headers => (map { ('Proxy-Authenticate' => $_) } @$proxy_auth);
29 }
30 else {
31 2 push @$headers => ('Proxy-Authenticate' => $proxy_auth );
32 }
33 4 $headers;
34 1 };
35  
36 1 ▶no Moo::Role; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 =pod
39  
40 =encoding UTF-8
41  
42 =head1 NAME
43  
44 HTTP::Throwable::Role::Status::ProxyAuthenticationRequired - 407 Proxy Authentication Required
45  
46 =head1 VERSION
47  
48 version 0.027
49  
50 =head1 DESCRIPTION
51  
52 This code is similar to 401 (Unauthorized), but indicates that the
53 client must first authenticate itself with the proxy. The proxy MUST
54 return a Proxy-Authenticate header field containing a challenge applicable
55 to the proxy for the requested resource. The client MAY repeat the request
56 with a suitable Proxy-Authorization header field.
57  
58 =head1 ATTRIBUTES
59  
60 =head2 proxy_authenticate
61  
62 This is a required string or array of strings that will be used to populate
63 the 'Proxy-Authenticate' header(s) when creating a PSGI response.
64  
65 =head1 SEE ALSO
66  
67 HTTP Authentication: Basic and Digest Access Authentication - L<http://www.apps.ietf.org/rfc/rfc2617.html>
68  
69 Proxy-Authenticate Header - L<http://www.apps.ietf.org/rfc/rfc2617.html#sec-3.6>
70  
71 =head1 AUTHORS
72  
73 =over 4
74  
75 =item *
76  
77 Stevan Little <stevan.little@iinteractive.com>
78  
79 =item *
80  
81 Ricardo Signes <rjbs@cpan.org>
82  
83 =back
84  
85 =head1 COPYRIGHT AND LICENSE
86  
87 This software is copyright (c) 2011 by Infinity Interactive, Inc.
88  
89 This is free software; you can redistribute it and/or modify it under
90 the same terms as the Perl 5 programming language system itself.
91  
92 =cut
93  
94 __END__
« Throwable/Role/Status/ServiceUnavailable.pm ↑ Summary Throwable/Role/Status/Unauthorized.pm »