line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Docker::Registry::Auth::Basic; |
2
|
1
|
|
|
1
|
|
8
|
use Moo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
3
|
1
|
|
|
1
|
|
381
|
use Types::Standard qw/Str/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
4
|
|
|
|
|
|
|
with 'Docker::Registry::Auth'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1428
|
use MIME::Base64 qw/encode_base64/; |
|
1
|
|
|
|
|
808
|
|
|
1
|
|
|
|
|
192
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has username => (is => 'ro', isa => Str, required => 1); |
9
|
|
|
|
|
|
|
has password => (is => 'ro', isa => Str, required => 1); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub authorize { |
12
|
3
|
|
|
3
|
0
|
2458
|
my ($self, $request) = @_; |
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
|
|
25
|
my $auth_header = "Basic " . encode_base64(sprintf("%s:%s", $self->username, $self->password), ''); |
15
|
3
|
|
|
|
|
16
|
$request->header('Authorization', $auth_header); |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
|
|
99
|
return $request; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
1; |