| 1 | 3 | ▶ | use v5.36; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use feature 'class'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | no warnings 'experimental::class'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | class Azure::SDK::Storage::Queues::ConnectionString { | |||||||||||||||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use bytes (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 3 | ▶ | use MIME::Base64 qw(decode_base64); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 3 | ▶ | use Azure::SDK::Core::Credential::Sas; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use Azure::SDK::Core::Credential::SharedKey; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 3 | ▶ | use Azure::SDK::Core::SecretString; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 3 | ▶ | use Azure::SDK::Storage::Queues::Uri; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 3 | ▶ | use constant MAX_LENGTH => 8 * 1024; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 3 | ▶ | use constant DEFAULT_ENDPOINT_SUFFIX => 'core.windows.net'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 3 | ▶ | use constant MAX_ENDPOINT_SUFFIX_LENGTH => 253; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 3 | my $DNS_LABEL = qr/[A-Za-z0-9](?:[A-Za-z0-9\-]*[A-Za-z0-9])?/; | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 3 | field $queue_endpoint :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||
| 21 | 3 | field $account_name :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 3 | field $account_key :param = undef; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 3 | field $shared_access_signature :param = undef; | |||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | 3 | field $endpoint_path :reader = undef; | |||||||||||||||||||||||||||||||||||||||||
| 26 | 3 | field $credential = undef; | |||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 27 | ▶ | ADJUST { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=16 SCAR=30.5
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 27 | ▶ | croak 'AccountKey cannot be combined with SharedAccessSignature' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $account_key and defined $shared_access_signature
MC/DC100%2/2
defined $account_key and defined $shared_access_signature
defined $account_key
defined $shared_access_signature
Truth table100%3/3
A and B
A= defined $account_keyB= defined $shared_access_signature
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | if defined $account_key && defined $shared_access_signature; | ||||||||||||||||||||||||||||||||||||||||||
| 31 | 25 | ▶ | croak 'Azure::SDK::Storage::Queues::ConnectionString requires an account_key or SharedAccessSignature' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $account_key or defined $shared_access_signature
MC/DC0%0/2
defined $account_key or defined $shared_access_signature
defined $account_key
defined $shared_access_signature
Truth table66%2/3
A or B
A= defined $account_keyB= defined $shared_access_signature
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | unless defined $account_key || defined $shared_access_signature; | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 25 | ▶ | croak 'Azure::SDK::Storage::Queues::ConnectionString requires an account_name for Shared Key' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
defined $account_key and not defined $account_name && length $account_name
defined $account_name && length $account_name
MC/DC0%0/3
defined $account_key and not defined $account_name && length $account_name
defined $account_key
defined $account_name
length $account_name
Truth table50%2/4
A and not(B && C)
A= defined $account_keyB= defined $account_nameC= length $account_name
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | if defined $account_key && !(defined $account_name && length $account_name); | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 25 | ▶ | croak 'Azure::SDK::Storage::Queues::ConnectionString requires a queue_endpoint' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $queue_endpoint and length $queue_endpoint
MC/DC0%0/2
defined $queue_endpoint and length $queue_endpoint
defined $queue_endpoint
length $queue_endpoint
Truth table33%1/3
A and B
A= defined $queue_endpointB= length $queue_endpoint
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | unless defined $queue_endpoint && length $queue_endpoint; | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 25 | ▶ | croak 'AccountName must be 3-24 alphanumeric characters' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $account_name and not $account_name =~ /\A[A-Za-z0-9]{3,24}\z/u
MC/DC0%0/2
defined $account_name and not $account_name =~ /\A[A-Za-z0-9]{3,24}\z/u
defined $account_name
not $account_name =~ /\A[A-Za-z0-9]{3,24}\z/u
Truth table66%2/3
A and not(B)
A= defined $account_nameB= not $account_name =~ /\A[A-Za-z0-9]{3,24}\z/u
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | if defined $account_name && $account_name !~ /\A[A-Za-z0-9]{3,24}\z/; | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 25 | ▶ | croak 'AccountKey is not valid base64' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $account_key and not _looks_like_base64($account_key)
MC/DC0%0/2
defined $account_key and not _looks_like_base64($account_key)
defined $account_key
not _looks_like_base64($account_key)
Truth table66%2/3
A and not(B)
A= defined $account_keyB= not _looks_like_base64($account_key)
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | if defined $account_key && !_looks_like_base64($account_key); | ||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | 25 | ( $queue_endpoint, $endpoint_path ) | |||||||||||||||||||||||||||||||||||||||||
| 43 | = Azure::SDK::Storage::Queues::Uri->normalize_endpoint($queue_endpoint); | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 22 | ▶ | $account_key = Azure::SDK::Core::SecretString->new(value => $account_key) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | if defined $account_key; | ||||||||||||||||||||||||||||||||||||||||||
| 46 | 22 | ▶ | if (defined $shared_access_signature) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | 5 | $credential = Azure::SDK::Core::Credential::Sas->new( | |||||||||||||||||||||||||||||||||||||||||
| 48 | token => $shared_access_signature, | ||||||||||||||||||||||||||||||||||||||||||
| 49 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 50 | 4 | $shared_access_signature = Azure::SDK::Core::SecretString->new( | |||||||||||||||||||||||||||||||||||||||||
| 51 | value => $shared_access_signature, | ||||||||||||||||||||||||||||||||||||||||||
| 52 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | 32 | ▶ | sub parse ( $class, $text ) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse: called CC=19 SCAR=31.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | 32 | ▶ | croak 'Azure::SDK::Storage::Queues::ConnectionString->parse requires a connection string' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $text and length $text
MC/DC0%0/2
defined $text and length $text
defined $text
length $text
Truth table33%1/3
A and B
A= defined $textB= length $text
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | unless defined $text && length $text; | ||||||||||||||||||||||||||||||||||||||||||
| 59 | 32 | ▶ | croak 'Connection string exceeds ' . MAX_LENGTH . ' bytes' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | if bytes::length($text) > MAX_LENGTH; | ||||||||||||||||||||||||||||||||||||||||||
| 61 | 32 | ▶ | croak 'Connection string contains control characters' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | if $text =~ /[\x00-\x08\x0a-\x1f\x7f]/; | ||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 31 | my %fields; | |||||||||||||||||||||||||||||||||||||||||
| 65 | 31 | for my $segment (split /;/, $text, -1) { | |||||||||||||||||||||||||||||||||||||||||
| 66 | 89 | ▶ | next unless $segment =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 89 | my ($name, $value) = $segment =~ /\A\s*([^=]+?)\s*=(.*)\z/s; | |||||||||||||||||||||||||||||||||||||||||
| 68 | 89 | ▶ | croak 'Connection string segment is not a name=value pair' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $name and length $name
MC/DC0%0/2
defined $name and length $name
defined $name
length $name
Truth table33%1/3
A and B
A= defined $nameB= length $name
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | unless defined $name && length $name; | ||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 89 | my $key = lc $name; | |||||||||||||||||||||||||||||||||||||||||
| 72 | croak "Connection string repeats the '$name' field" | ||||||||||||||||||||||||||||||||||||||||||
| 73 | 89 | ▶ | if exists $fields{$key}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | 88 | $fields{$key} = $value; | |||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | croak 'UseDevelopmentStorage is not supported; supply AccountName and ' | ||||||||||||||||||||||||||||||||||||||||||
| 78 | . 'AccountKey explicitly, plus QueueEndpoint when targeting an emulator' | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 30 | ▶ | if exists $fields{usedevelopmentstorage}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | 29 | ▶ | if (!defined $fields{sharedaccesssignature}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 82 | 21 | for my $required (qw(accountname accountkey)) { | |||||||||||||||||||||||||||||||||||||||||
| 83 | croak "Connection string is missing the required '$required' field" | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 42 | ▶ | unless defined $fields{$required} && length $fields{$required}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $fields{$required} and length $fields{$required}
MC/DC50%1/2
defined $fields{$required} and length $fields{$required}
defined $fields{$required}
length $fields{$required}
Truth table66%2/3
A and B
A= defined $fields{$required}B= length $fields{$required}
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||
| 87 | ▶ | elsif (!defined $fields{queueendpoint} && !defined $fields{accountname}) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
defined $fields{'queueendpoint'} || defined $fields{'accountname'}
MC/DC0%0/2
defined $fields{'queueendpoint'} || defined $fields{'accountname'}
defined $fields{'queueendpoint'}
defined $fields{'accountname'}
Truth table66%2/3
A || B
A= defined $fields{'queueendpoint'}B= defined $fields{'accountname'}
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | croak 'SAS connection string requires QueueEndpoint or AccountName'; | |||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||
| 91 | 28 | my $endpoint = $fields{queueendpoint}; | |||||||||||||||||||||||||||||||||||||||||
| 92 | $endpoint = _derive_endpoint( | ||||||||||||||||||||||||||||||||||||||||||
| 93 | $fields{defaultendpointsprotocol}, | ||||||||||||||||||||||||||||||||||||||||||
| 94 | $fields{accountname}, | ||||||||||||||||||||||||||||||||||||||||||
| 95 | $fields{endpointsuffix}, | ||||||||||||||||||||||||||||||||||||||||||
| 96 | 28 | ▶ | ) unless defined $endpoint && length $endpoint; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $endpoint and length $endpoint
MC/DC50%1/2
defined $endpoint and length $endpoint
defined $endpoint
length $endpoint
Truth table66%2/3
A and B
A= defined $endpointB= length $endpoint
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | return $class->new( | ||||||||||||||||||||||||||||||||||||||||||
| 99 | account_name => $fields{accountname}, | ||||||||||||||||||||||||||||||||||||||||||
| 100 | account_key => $fields{accountkey}, | ||||||||||||||||||||||||||||||||||||||||||
| 101 | queue_endpoint => $endpoint, | ||||||||||||||||||||||||||||||||||||||||||
| 102 | shared_access_signature => $fields{sharedaccesssignature}, | ||||||||||||||||||||||||||||||||||||||||||
| 103 | 27 | ); | |||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | 20 | ▶ | method credential () { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
credential: called CC=3 SCAR=11.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | 20 | ▶ | return $credential if defined $credential; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 108 | 15 | ▶ | $credential //= Azure::SDK::Core::Credential::SharedKey->new( | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$credential //= "Azure::SDK::Core::Credential::SharedKey"->new("account_name", $account_name, "account_key", $account_key->reveal)
MC/DC0%0/2
$credential //= "Azure::SDK::Core::Credential::SharedKey"->new("account_name", $account_name, "account_key", $account_key->reveal)
$credential
"Azure::SDK::Core::Credential::SharedKey"->new("account_name", $account_name, "account_key", $account_key->reveal)
Truth table33%1/3
A //= B
A= $credentialB= "Azure::SDK::Core::Credential::SharedKey"->new("account_name", $account_name, "account_key", $account_key->reveal)
| |||||||||||||||||||||||||||||||||||||||||||
| 109 | account_name => $account_name, | ||||||||||||||||||||||||||||||||||||||||||
| 110 | account_key => $account_key->reveal, | ||||||||||||||||||||||||||||||||||||||||||
| 111 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 112 | 15 | return $credential; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | 3 | ▶ | method to_string () { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_string: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | 3 | ▶ | return "QueueEndpoint=$queue_endpoint;SharedAccessSignature=[REDACTED]" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | if defined $shared_access_signature; | ||||||||||||||||||||||||||||||||||||||||||
| 118 | 2 | return "AccountName=$account_name;QueueEndpoint=$queue_endpoint;AccountKey=[REDACTED]"; | |||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||
| 121 | 19 | ▶ | sub _looks_like_base64 ($value) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_looks_like_base64: called CC=4 SCAR=15.2
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | 19 | ▶ | return 0 unless $value =~ m{\A[A-Za-z0-9+/]+={0,2}\z}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 123 | 19 | ▶ | return 0 if length($value) % 4; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | 19 | ▶ | return length decode_base64($value) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||
| 127 | 3 | ▶ | sub _derive_endpoint ( $protocol, $account, $suffix ) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_derive_endpoint: called CC=8 SCAR=22.8
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | 3 | ▶ | $protocol = defined $protocol && length $protocol ? lc $protocol : 'https'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $protocol and length $protocol
MC/DC50%1/2
defined $protocol and length $protocol
defined $protocol
length $protocol
Truth table66%2/3
A and B
A= defined $protocolB= length $protocol
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | 3 | ▶ | croak 'DefaultEndpointsProtocol must be http or https' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$protocol eq "http" or $protocol eq "https"
MC/DC0%0/2
$protocol eq "http" or $protocol eq "https"
$protocol eq "http"
$protocol eq "https"
Truth table33%1/3
A or B
A= $protocol eq "http"B= $protocol eq "https"
| |||||||||||||||||||||||||||||||||||||||||||
| 130 | unless $protocol eq 'http' || $protocol eq 'https'; | ||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | 3 | ▶ | if (defined $suffix) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 1 | ▶ | croak 'EndpointSuffix must be a bare DNS suffix' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
length $suffix <= 253 and $suffix =~ /\A$DNS_LABEL(?:\.$DNS_LABEL)*\z/u
MC/DC0%0/2
length $suffix <= 253 and $suffix =~ /\A$DNS_LABEL(?:\.$DNS_LABEL)*\z/u
length $suffix <= 253
$suffix =~ /\A$DNS_LABEL(?:\.$DNS_LABEL)*\z/u
Truth table33%1/3
A and B
A= length $suffix <= 253B= $suffix =~ /\A$DNS_LABEL(?:\.$DNS_LABEL)*\z/u
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | unless length($suffix) <= MAX_ENDPOINT_SUFFIX_LENGTH | ||||||||||||||||||||||||||||||||||||||||||
| 135 | && $suffix =~ /\A$DNS_LABEL(?:\.$DNS_LABEL)*\z/; | ||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||
| 137 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 138 | 2 | $suffix = DEFAULT_ENDPOINT_SUFFIX; | |||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | 2 | return "$protocol://$account.queue.$suffix"; | |||||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||
| 145 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||
| 147 | __END__ | ||||||||||||||||||||||||||||||||||||||||||