Registry/Azure.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 86.2% 25 / 29 CC 3 SCAR 5.6
CC
3
Cov
84%
__ANON__
2.2
__ANON__
2.0
BEGIN
1.0
CRAP 1.7
« Registry/Auth/ECR.pm ↑ Summary Registry/V2.pm »
1 package Docker::Registry::Azure;
2 1 ▶ use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶ use Types::Standard qw/Str/;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 extends 'Docker::Registry::V2';
6  
7 1 ▶ has '+url' => (lazy => 1, default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.1
8 1 my $self = shift;
9 1 ▶ die "Must specify name" if (not defined $self->name);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->name 0 1 1
10 1 sprintf 'https://%s.azurecr.io', $self->name;
11 1 });
12  
13 1 ▶ around build_auth => sub {
Subroutine __ANON__: called CC=2 SCAR=7.9
14 1 my ($orig, $self) = @_;
15 1 ▶ if (defined $self->password) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->password) { } 1 0 1
16 # We're using the "Admin Account" mode
17 # https://docs.microsoft.com/en-us/azure/container-registry/container-registry-authentication#admin-account
18 1 require Docker::Registry::Auth::Basic;
19 1 Docker::Registry::Auth::Basic->new(
20 username => $self->name,
21 password => $self->password,
22 );
23 } else {
24 # We're using Service Principal mode
25 0 require Docker::Registry::Auth::AzureServicePrincipal;
26 0 Docker::Registry::Auth::AzureServicePrincipal->new;
27 }
28 1 };
29  
30 1 has name => (is => 'ro', isa => Str);
31 1 has password => (is => 'ro', isa => Str);
32  
33 1 1;
« Registry/Auth/ECR.pm ↑ Summary Registry/V2.pm »