SDK/Core/Credential/StaticToken.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 95.3% 41 / 43 CC 3 SCAR 4.4
CC
3
Cov
97%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« SDK/Core/Context.pm ↑ Summary SDK/Core/Policy/Telemetry.pm »
1 2 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use feature 'class';
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶no warnings 'experimental::class';
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 2 ▶use Azure::SDK::Core::Credential;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 class Azure::SDK::Core::Credential::StaticToken
8 2 :isa(Azure::SDK::Core::Credential) {
9 2 ▶ use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶ use Azure::SDK::Core::SecretString;
Subroutine BEGIN: called CC=1 SCAR=0.0
11
12 2 field $token :param = undef;
13
14 6 ▶ ADJUST {
Subroutine __ANON__: called CC=3 SCAR=11.1
15 6 ▶ croak 'Azure::SDK::Core::Credential::StaticToken requires a token'
Branch: 1 branch
BranchTrueFalseTotal
unless defined $token and length $token 1 5 6
Condition66%2/3
defined $token and length $token
!ll&&!rl&&r
015
MC/DC50%1/2
defined $token and length $token
defined $token length $token
Truth table66%2/3
A and B
A= defined $tokenB= length $token
ABresult
0X0
100
111
16 unless defined $token && length $token;
17
18 5 $token = Azure::SDK::Core::SecretString->new(value => $token);
19 }
20
21 2 ▶ method applies_to_request () {
Subroutine applies_to_request: called CC=1 SCAR=0.0
Pod documented
22 2 return 1;
23 }
24
25 3 ▶ method apply ($request) {
Subroutine apply: called CC=1 SCAR=0.0
Pod documented
26 3 $request->set_header('Authorization', 'Bearer ' . $token->reveal);
27 3 return $request;
28 }
29 }
30
31 2 1;
32
33 __END__
« SDK/Core/Context.pm ↑ Summary SDK/Core/Policy/Telemetry.pm »