line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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. |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
51
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
11
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use parent 'cPanel::APIClient::Authn'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
1
|
|
|
1
|
0
|
4
|
my ( $class, $username, $password ) = @_; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
13
|
return bless [ $username, $password ], $class; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub get_http_headers_for_service { |
22
|
1
|
|
|
1
|
0
|
3
|
my ( $self, $service_obj ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
478
|
require MIME::Base64; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
1096
|
my $b64 = MIME::Base64::encode( $self->[0] . ":" . $self->[1] ); |
27
|
1
|
|
|
|
|
4
|
$b64 =~ tr<\x0d\x0a><>d; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
9
|
return [ Authorization => "Basic $b64" ]; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |