APIClient/Authn/Password.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 91.6% 22 / 24 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« APIClient/Authn/Token.pm ↑ Summary APIClient/Transport.pm »
1 package cPanel::APIClient::Authn::Password;
2  
3 # Copyright 2020 cPanel, L. L. C.
4 # All rights reserved.
5 # http://cpanel.net
6 #
7 # This is free software; you can redistribute it and/or modify it under the
8 # same terms as Perl itself. See L<perlartistic>.
9  
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use parent 'cPanel::APIClient::Authn';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
16 1 my ( $class, $username, $password ) = @_;
17  
18 1 return bless [ $username, $password ], $class;
19 }
20  
21 1 ▶sub get_http_headers_for_service {
Subroutine get_http_headers_for_service: called CC=1 SCAR=0.0
Pod undocumented
22 1 my ( $self, $service_obj ) = @_;
23  
24 1 require MIME::Base64;
25  
26 1 my $b64 = MIME::Base64::encode( $self->[0] . ":" . $self->[1] );
27 1 $b64 =~ tr<\x0d\x0a><>d;
28  
29 1 return [ Authorization => "Basic $b64" ];
30 }
31  
32 1 1;
« APIClient/Authn/Token.pm ↑ Summary APIClient/Transport.pm »