File Coverage

blib/lib/RT/Client/REST/HTTPClient.pm
Criterion Covered Total %
statement 13 17 76.4
branch 1 4 25.0
condition n/a
subroutine 4 5 80.0
pod 2 2 100.0
total 20 28 71.4


line stmt bran cond sub pod time code
1             #!perl
2             # PODNAME: RT::Client::REST::HTTPClient
3             # ABSTRACT: Subclass LWP::UserAgent in order to support basic authentication.
4              
5 21     21   284 use strict;
  21         120  
  21         580  
6 21     21   104 use warnings;
  21         46  
  21         835  
7              
8             $RT::Client::REST::HTTPClient::VERSION = '0.70';
9             use parent 'LWP::UserAgent';
10 21     21   118  
  21         34  
  21         137  
11              
12             my $self = shift;
13              
14 0     0 1 0 if ($self->basic_auth_cb) {
15             return $self->basic_auth_cb->(@_);
16 0 0       0 }
17 0         0 else {
18             return;
19             }
20 0         0 }
21              
22              
23             my $self = shift;
24              
25             if (@_) {
26 3     3 1 7 $self->{basic_auth_cb} = shift;
27             }
28 3 50       19  
29 3         18 return $self->{basic_auth_cb};
30             }
31              
32 3         12  
33             1;
34              
35              
36             =pod
37              
38             =encoding UTF-8
39              
40             =head1 NAME
41              
42             RT::Client::REST::HTTPClient - Subclass LWP::UserAgent in order to support basic authentication.
43              
44             =head1 VERSION
45              
46             version 0.70
47              
48             =head1 METHODS
49              
50             =over 4
51              
52             =item get_basic_credentials
53              
54             Returns basic authentication credentials
55              
56             =item basic_auth_cb
57              
58             Gets/sets basic authentication callback
59              
60             =back
61              
62             =head1 AUTHOR
63              
64             Dean Hamstead <dean@fragfest.com.au>
65              
66             =head1 COPYRIGHT AND LICENSE
67              
68             This software is copyright (c) 2022, 2020 by Dmitri Tikhonov.
69              
70             This is free software; you can redistribute it and/or modify it under
71             the same terms as the Perl 5 programming language system itself.
72              
73             =cut