| 1 | package Langertha::Skeid::CapacityProbe::Registry; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 2 | our $VERSION = '0.003'; | |||||||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Capacity probe reading a downstream Skeid's signed registry snapshot | ||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Mojo::UserAgent; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use JSON::MaybeXS qw(decode_json); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Scalar::Util qw(looks_like_number); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Time::HiRes (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use Langertha::Skeid::Registry; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | extends 'Langertha::Skeid::CapacityProbe'; | |||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | my %KNOWN = map { $_ => 1 } qw(probe type url path read_key_env admin_key_env secret_env interval_ms tags max_skew_s); | |||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 12 | ▶ | sub validate_config { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
validate_config: called CC=23 SCAR=38.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 12 | my ($class, $cfg, $node_id) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 21 | 12 | ▶ | my $where = "node '" . ($node_id // '?') . "' capacity (registry)"; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node_id // "?"
MC/DC0%0/1
$node_id // "?"
$node_id
Truth table50%1/2
A
A= $node_id
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 12 | ▶ | croak "$where must be a hashref" unless ref($cfg) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 12 | for my $key (sort keys %$cfg) { | |||||||||||||||||||||||||||||||||||||||||
| 24 | croak "$where: unknown key '$key' (secrets are named by read_key_env / admin_key_env / " | ||||||||||||||||||||||||||||||||||||||||||
| 25 | . 'secret_env, never ' | ||||||||||||||||||||||||||||||||||||||||||
| 26 | . 'written into the config)' | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 37 | ▶ | unless $KNOWN{$key}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 11 | ▶ | my $named = sub { my $value = $cfg->{$_[0]}; defined($value) && !ref($value) && length($value) }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
Condition66%2/3
defined $value and not ref $value
MC/DC50%1/2
defined $value and not ref $value
defined $value
not ref $value
Truth table66%2/3
A and not(B)
A= defined $valueB= not ref $value
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 11 | ▶ | croak "$where: secret_env is required" unless $named->('secret_env'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | 9 | for my $key (qw(read_key_env admin_key_env)) { | |||||||||||||||||||||||||||||||||||||||||
| 32 | croak "$where: $key must name an environment variable" | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 18 | ▶ | if defined($cfg->{$key}) && !$named->($key); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $cfg->{$key} and not &$named($key)
MC/DC0%0/2
defined $cfg->{$key} and not &$named($key)
defined $cfg->{$key}
not &$named($key)
Truth table66%2/3
A and not(B)
A= defined $cfg->{$key}B= not &$named($key)
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 9 | ▶ | croak "$where: read_key_env (or admin_key_env) is required" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
&$named("read_key_env") or &$named("admin_key_env")
MC/DC100%2/2
&$named("read_key_env") or &$named("admin_key_env")
&$named("read_key_env")
&$named("admin_key_env")
Truth table100%3/3
A or B
A= &$named("read_key_env")B= &$named("admin_key_env")
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | unless $named->('read_key_env') || $named->('admin_key_env'); | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 8 | ▶ | if (defined $cfg->{url}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | croak "$where: url must be an absolute http(s) URL" | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | ▶ | if ref($cfg->{url}) || $cfg->{url} !~ m{\Ahttps?://[^/?#]+}i; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $cfg->{"url"} or not $cfg->{"url"} =~ m[\Ahttps?://[^/?#]+]i
MC/DC0%0/2
ref $cfg->{"url"} or not $cfg->{"url"} =~ m[\Ahttps?://[^/?#]+]i
ref $cfg->{"url"}
not $cfg->{"url"} =~ m[\Ahttps?://[^/?#]+]i
Truth table33%1/3
A or not(B)
A= ref $cfg->{"url"}B= not $cfg->{"url"} =~ m[\Ahttps?://[^/?#]+]i
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||
| 41 | 7 | ▶ | if (defined $cfg->{interval_ms}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | croak "$where: interval_ms must be a positive number" | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 2 | ▶ | unless looks_like_number($cfg->{interval_ms}) && $cfg->{interval_ms} > 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
&looks_like_number($cfg->{"interval_ms"}) and $cfg->{"interval_ms"} > 0
MC/DC0%0/2
&looks_like_number($cfg->{"interval_ms"}) and $cfg->{"interval_ms"} > 0
&looks_like_number($cfg->{"interval_ms"})
$cfg->{"interval_ms"} > 0
Truth table33%1/3
A and B
A= &looks_like_number($cfg->{"interval_ms"})B= $cfg->{"interval_ms"} > 0
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 7 | ▶ | if (defined $cfg->{max_skew_s}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | croak "$where: max_skew_s must be a number >= 0" | ||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | unless looks_like_number($cfg->{max_skew_s}) && $cfg->{max_skew_s} >= 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
&looks_like_number($cfg->{"max_skew_s"}) and $cfg->{"max_skew_s"} >= 0
MC/DC0%0/2
&looks_like_number($cfg->{"max_skew_s"}) and $cfg->{"max_skew_s"} >= 0
&looks_like_number($cfg->{"max_skew_s"})
$cfg->{"max_skew_s"} >= 0
Truth table0%0/3
A and B
A= &looks_like_number($cfg->{"max_skew_s"})B= $cfg->{"max_skew_s"} >= 0
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 7 | ▶ | if (defined $cfg->{tags}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | croak "$where: tags must be a list or a string" | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | if ref($cfg->{tags}) && ref($cfg->{tags}) ne 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $cfg->{"tags"} and ref $cfg->{"tags"} ne "ARRAY"
MC/DC0%0/2
ref $cfg->{"tags"} and ref $cfg->{"tags"} ne "ARRAY"
ref $cfg->{"tags"}
ref $cfg->{"tags"} ne "ARRAY"
Truth table0%0/3
A and B
A= ref $cfg->{"tags"}B= ref $cfg->{"tags"} ne "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | 7 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | has _ua => ( | ||||||||||||||||||||||||||||||||||||||||||
| 57 | is => 'lazy', | ||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | builder => sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
Subroutine
_build__ua: called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | my $ua = Mojo::UserAgent->new; | |||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | $ua->connect_timeout(2); | |||||||||||||||||||||||||||||||||||||||||
| 61 | # Shorter than the poll interval, for the reason the Prometheus probe gives: a poll still | ||||||||||||||||||||||||||||||||||||||||||
| 62 | # out when the next tick fires is a probe queueing on itself. | ||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | $ua->request_timeout(3); | |||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | return $ua; | |||||||||||||||||||||||||||||||||||||||||
| 65 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 2 | ); | |||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | has _inflight_poll => ( | ||||||||||||||||||||||||||||||||||||||||||
| 69 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 70 | 7 | ▶ | default => sub { 0 }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | 2 | ); | |||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | has state => ( | ||||||||||||||||||||||||||||||||||||||||||
| 75 | is => 'rwp', | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 7 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | 2 | ); | |||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||
| 79 | # generated_at of the last accepted snapshot; nothing older is believed after it. | ||||||||||||||||||||||||||||||||||||||||||
| 80 | has _last_generated_at => ( | ||||||||||||||||||||||||||||||||||||||||||
| 81 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 7 | ▶ | default => sub { undef }, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | 2 | ); | |||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||
| 86 | 28 | ▶ | sub url { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
url: called CC=8 SCAR=22.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | 28 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 88 | 28 | my $cfg = $self->config; | |||||||||||||||||||||||||||||||||||||||||
| 89 | 28 | ▶ | return $cfg->{url} if defined($cfg->{url}) && length($cfg->{url}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $cfg->{"url"} and length $cfg->{"url"}
MC/DC0%0/2
defined $cfg->{"url"} and length $cfg->{"url"}
defined $cfg->{"url"}
length $cfg->{"url"}
Truth table33%1/3
A and B
A= defined $cfg->{"url"}B= length $cfg->{"url"}
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||
| 91 | 28 | ▶ | my ($node) = grep { ($_->{id} // '') eq $self->node_id } @{$self->skeid->nodes}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$_->{"id"} // ""
MC/DC0%0/1
$_->{"id"} // ""
$_->{"id"}
Truth table50%1/2
A
A= $_->{"id"}
| |||||||||||||||||||||||||||||||||||||||||||
| 92 | 28 | ▶ | my $base = $node ? ($node->{url} // '') : ''; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$node->{"url"} // ""
MC/DC0%0/1
$node->{"url"} // ""
$node->{"url"}
Truth table50%1/2
A
A= $node->{"url"}
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | 28 | $base =~ s{/v\d+/?$}{}; | |||||||||||||||||||||||||||||||||||||||||
| 94 | 28 | $base =~ s{/+$}{}; | |||||||||||||||||||||||||||||||||||||||||
| 95 | 28 | ▶ | my $path = $cfg->{path} // '/skeid/registry/snapshot'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$cfg->{"path"} // "/skeid/registry/snapshot"
MC/DC0%0/1
$cfg->{"path"} // "/skeid/registry/snapshot"
$cfg->{"path"}
Truth table50%1/2
A
A= $cfg->{"path"}
| |||||||||||||||||||||||||||||||||||||||||||
| 96 | 28 | ▶ | $path = "/$path" unless $path =~ m{^/}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | 28 | return $base . $path; | |||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | 19 | ▶ | sub _tags { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_tags: called CC=3 SCAR=14.2
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | 19 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 102 | 19 | my $tags = $self->config->{tags}; | |||||||||||||||||||||||||||||||||||||||||
| 103 | 19 | ▶ | return [] unless defined $tags; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | return [ ref($tags) eq 'ARRAY' ? @$tags : split(/[,\s]+/, "$tags") ]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 37 | ▶ | sub source { 'registry' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
source: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||
| 111 | 31 | ▶ | sub poll { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
poll: called CC=10 SCAR=23.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | 31 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 113 | 31 | ▶ | return if $self->_inflight_poll; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | 31 | my $cfg = $self->config; | |||||||||||||||||||||||||||||||||||||||||
| 116 | 31 | ▶ | my $secret = defined($cfg->{secret_env}) ? ($ENV{$cfg->{secret_env}} // '') : ''; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$ENV{$cfg->{"secret_env"}} // ""
MC/DC0%0/1
$ENV{$cfg->{"secret_env"}} // ""
$ENV{$cfg->{"secret_env"}}
Truth table50%1/2
A
A= $ENV{$cfg->{"secret_env"}}
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | # The read key when configured, never falling back to the admin key: an operator who named | ||||||||||||||||||||||||||||||||||||||||||
| 118 | # a read key does not want the admin key on the wire (skeid #49). | ||||||||||||||||||||||||||||||||||||||||||
| 119 | 31 | ▶ | my $key_env = defined($cfg->{read_key_env}) ? 'read_key_env' : 'admin_key_env'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 31 | ▶ | my $bearer = defined($cfg->{$key_env}) ? ($ENV{$cfg->{$key_env}} // '') : ''; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$ENV{$cfg->{$key_env}} // ""
MC/DC0%0/1
$ENV{$cfg->{$key_env}} // ""
$ENV{$cfg->{$key_env}}
Truth table50%1/2
A
A= $ENV{$cfg->{$key_env}}
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | 31 | ▶ | unless (length($secret) && length($bearer)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
length $secret and length $bearer
MC/DC100%2/2
length $secret and length $bearer
length $secret
length $bearer
Truth table100%3/3
A and B
A= length $secretB= length $bearer
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | 4 | return $self->_reject(missing_secret => "$key_env or secret_env is not set"); | |||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||
| 124 | # The downstream refuses to publish with a shorter secret, so no snapshot could verify. | ||||||||||||||||||||||||||||||||||||||||||
| 125 | 27 | ▶ | if (length($secret) < Langertha::Skeid::Registry->MIN_SECRET_BYTES) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | return $self->_reject(missing_secret => 'secret_env is shorter than ' | |||||||||||||||||||||||||||||||||||||||||
| 127 | . Langertha::Skeid::Registry->MIN_SECRET_BYTES . ' bytes'); | ||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | 27 | $self->_inflight_poll(1); | |||||||||||||||||||||||||||||||||||||||||
| 131 | 27 | ▶ | $self->_ua->get($self->url => { Authorization => "Bearer $bearer" } => sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 27 | my (undef, $tx) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 133 | 27 | $self->_inflight_poll(0); | |||||||||||||||||||||||||||||||||||||||||
| 134 | # Stopped while the request was out: this answer belongs to no running probe. | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 27 | ▶ | return if $self->is_stopped; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 136 | 27 | $self->_consume($tx->res, $secret); | |||||||||||||||||||||||||||||||||||||||||
| 137 | 27 | }); | |||||||||||||||||||||||||||||||||||||||||
| 138 | 27 | return; | |||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | 27 | ▶ | sub _consume { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_consume: called CC=16 SCAR=28.8
| |||||||||||||||||||||||||||||||||||||||||||
| 142 | 27 | my ($self, $res, $secret) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 143 | 27 | ▶ | my $status = $res->code // 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$res->code // 0
MC/DC0%0/1
$res->code // 0
$res->code
Truth table50%1/2
A
A= $res->code
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | 27 | ▶ | return $self->_reject(unreachable => "HTTP $status") | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$status >= 200 and $status < 300
MC/DC50%1/2
$status >= 200 and $status < 300
$status >= 200
$status < 300
Truth table66%2/3
A and B
A= $status >= 200B= $status < 300
| |||||||||||||||||||||||||||||||||||||||||||
| 145 | unless $status >= 200 && $status < 300; | ||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||
| 147 | 26 | my $body = $res->body; | |||||||||||||||||||||||||||||||||||||||||
| 148 | 26 | my $signature = $res->headers->header(Langertha::Skeid::Registry->SIGNATURE_HEADER); | |||||||||||||||||||||||||||||||||||||||||
| 149 | 26 | ▶ | return $self->_reject(bad_signature => 'signature missing or not valid for this body') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 150 | unless Langertha::Skeid::Registry->verify($body, $signature, $secret); | ||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | 22 | my $snapshot = eval { decode_json($body) }; | |||||||||||||||||||||||||||||||||||||||||
| 153 | 22 | ▶ | return $self->_reject(malformed => 'body is not a JSON object') unless ref($snapshot) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 154 | return $self->_reject(malformed => 'unknown schema version') | ||||||||||||||||||||||||||||||||||||||||||
| 155 | 22 | ▶ | unless ($snapshot->{version} // '') eq Langertha::Skeid::Registry->SCHEMA_VERSION; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$snapshot->{"version"} // ""
MC/DC0%0/1
$snapshot->{"version"} // ""
$snapshot->{"version"}
Truth table50%1/2
A
A= $snapshot->{"version"}
| |||||||||||||||||||||||||||||||||||||||||||
| 156 | 22 | my ($generated_at, $ttl) = @{$snapshot}{qw(generated_at ttl)}; | |||||||||||||||||||||||||||||||||||||||||
| 157 | 22 | ▶ | return $self->_reject(malformed => 'generated_at / ttl missing') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
&looks_like_number($generated_at) and &looks_like_number($ttl) and $ttl > 0
&looks_like_number($generated_at) and &looks_like_number($ttl)
MC/DC0%0/3
&looks_like_number($generated_at) and &looks_like_number($ttl) and $ttl > 0
&looks_like_number($generated_at)
&looks_like_number($ttl)
$ttl > 0
Truth table25%1/4
A and B and C
A= &looks_like_number($generated_at)B= &looks_like_number($ttl)C= $ttl > 0
| |||||||||||||||||||||||||||||||||||||||||||
| 158 | unless looks_like_number($generated_at) && looks_like_number($ttl) && $ttl > 0; | ||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||
| 160 | 22 | my $now = Time::HiRes::time(); | |||||||||||||||||||||||||||||||||||||||||
| 161 | 22 | ▶ | my $skew = defined($self->config->{max_skew_s}) ? 0 + $self->config->{max_skew_s} : 5; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | 22 | ▶ | return $self->_reject(future => 'generated_at is ahead of this clock by more than max_skew_s') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 163 | if $generated_at > $now + $skew; | ||||||||||||||||||||||||||||||||||||||||||
| 164 | 21 | ▶ | return $self->_reject(stale => 'older than its ttl') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 165 | if $now - $generated_at > $ttl; | ||||||||||||||||||||||||||||||||||||||||||
| 166 | 20 | my $last = $self->_last_generated_at; | |||||||||||||||||||||||||||||||||||||||||
| 167 | 20 | ▶ | return $self->_reject(replayed => 'older than the last snapshot accepted') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $last and $generated_at < $last
MC/DC100%2/2
defined $last and $generated_at < $last
defined $last
$generated_at < $last
Truth table100%3/3
A and B
A= defined $lastB= $generated_at < $last
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | if defined($last) && $generated_at < $last; | ||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | 19 | $self->_last_generated_at(0 + $generated_at); | |||||||||||||||||||||||||||||||||||||||||
| 171 | 19 | my $reading = Langertha::Skeid::Registry->reading_from_snapshot($snapshot, tags => $self->_tags); | |||||||||||||||||||||||||||||||||||||||||
| 172 | $self->skeid->set_capacity_reading( | ||||||||||||||||||||||||||||||||||||||||||
| 173 | $self->node_id, | ||||||||||||||||||||||||||||||||||||||||||
| 174 | source => $self->source, | ||||||||||||||||||||||||||||||||||||||||||
| 175 | used => $reading->{used}, | ||||||||||||||||||||||||||||||||||||||||||
| 176 | limit => $reading->{limit}, | ||||||||||||||||||||||||||||||||||||||||||
| 177 | 19 | at => 0 + $generated_at, | |||||||||||||||||||||||||||||||||||||||||
| 178 | expires_at => $generated_at + $ttl, | ||||||||||||||||||||||||||||||||||||||||||
| 179 | interval_ms => $self->poll_interval_seconds * 1000, | ||||||||||||||||||||||||||||||||||||||||||
| 180 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 181 | 19 | $self->_enter('accepted'); | |||||||||||||||||||||||||||||||||||||||||
| 182 | 19 | return; | |||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||
| 185 | # Unknown means inflight decides -- but only this probe's reading is dropped. A backoff another | ||||||||||||||||||||||||||||||||||||||||||
| 186 | # source recorded is still true whatever this snapshot was. | ||||||||||||||||||||||||||||||||||||||||||
| 187 | 12 | ▶ | sub _reject { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_reject: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 188 | 12 | my ($self, $state, $detail) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 189 | 12 | $self->_forget_own; | |||||||||||||||||||||||||||||||||||||||||
| 190 | 12 | $self->_enter($state, $detail); | |||||||||||||||||||||||||||||||||||||||||
| 191 | 12 | return; | |||||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||
| 194 | 31 | ▶ | sub _enter { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_enter: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 195 | 31 | my ($self, $state, $detail) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 196 | 31 | my $was = $self->state; | |||||||||||||||||||||||||||||||||||||||||
| 197 | 31 | $self->_set_state($state); | |||||||||||||||||||||||||||||||||||||||||
| 198 | 31 | ▶ | return if defined($was) && $was eq $state; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $was and $was eq $state
MC/DC100%2/2
defined $was and $was eq $state
defined $was
$was eq $state
Truth table100%3/3
A and B
A= defined $wasB= $was eq $state
| |||||||||||||||||||||||||||||||||||||||||||
| 199 | # The first success is the expected case and not worth a line; everything else is. | ||||||||||||||||||||||||||||||||||||||||||
| 200 | 17 | ▶ | return if !defined($was) && $state eq 'accepted'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not defined $was and $state eq "accepted"
MC/DC100%2/2
not defined $was and $state eq "accepted"
not defined $was
$state eq "accepted"
Truth table100%3/3
not(A) and B
A= not defined $wasB= $state eq "accepted"
| |||||||||||||||||||||||||||||||||||||||||||
| 201 | 13 | ▶ | warn "registry probe for '" . $self->node_id . "': $state" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 202 | . (defined $detail ? " ($detail)" : '') . "\n"; | ||||||||||||||||||||||||||||||||||||||||||
| 203 | 13 | return; | |||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||
| 207 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | __END__ | ||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||
| 211 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||
| 213 | =encoding UTF-8 | ||||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||||
| 215 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||
| 217 | Langertha::Skeid::CapacityProbe::Registry - Capacity probe reading a downstream Skeid's signed registry snapshot | ||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||
| 219 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||||||||||
| 221 | version 0.003 | ||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||
| 223 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||
| 225 | # fronting tier: one node per downstream Skeid | ||||||||||||||||||||||||||||||||||||||||||
| 226 | nodes: | ||||||||||||||||||||||||||||||||||||||||||
| 227 | - id: skeid-b | ||||||||||||||||||||||||||||||||||||||||||
| 228 | url: http://skeid-b:8090/v1 | ||||||||||||||||||||||||||||||||||||||||||
| 229 | model: qwen3-32b | ||||||||||||||||||||||||||||||||||||||||||
| 230 | max_conns: 64 | ||||||||||||||||||||||||||||||||||||||||||
| 231 | capacity: | ||||||||||||||||||||||||||||||||||||||||||
| 232 | probe: registry # or type: registry | ||||||||||||||||||||||||||||||||||||||||||
| 233 | read_key_env: SKEID_B_READ_KEY # the downstream's registry read key (preferred) | ||||||||||||||||||||||||||||||||||||||||||
| 234 | # admin_key_env: SKEID_B_ADMIN_KEY # or its admin API key, when it has no read key | ||||||||||||||||||||||||||||||||||||||||||
| 235 | secret_env: SKEID_REGISTRY_SECRET | ||||||||||||||||||||||||||||||||||||||||||
| 236 | interval_ms: 2000 | ||||||||||||||||||||||||||||||||||||||||||
| 237 | # url: http://skeid-b:8090/skeid/registry/snapshot (default: derived from the node URL) | ||||||||||||||||||||||||||||||||||||||||||
| 238 | # tags: [local] # count only downstream nodes carrying these tags | ||||||||||||||||||||||||||||||||||||||||||
| 239 | # max_skew_s: 5 # how far in the future a snapshot may claim to be | ||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||
| 241 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||
| 243 | When the node is another Skeid, the number C<inflight> keeps trying to reconstruct already | ||||||||||||||||||||||||||||||||||||||||||
| 244 | exists over there, in memory: per upstream node, what is in flight and what that process may | ||||||||||||||||||||||||||||||||||||||||||
| 245 | admit. This probe pulls it from the downstream's C<GET /skeid/registry/snapshot> (published | ||||||||||||||||||||||||||||||||||||||||||
| 246 | when the downstream sets C<registry.enabled>) and turns it into the node's capacity reading. | ||||||||||||||||||||||||||||||||||||||||||
| 247 | See ADR 0017. | ||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||
| 249 | A snapshot is believed only when all of this holds; otherwise the probe forgets its reading | ||||||||||||||||||||||||||||||||||||||||||
| 250 | and admission falls back to C<inflight>: | ||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||
| 252 | =over 4 | ||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||
| 254 | =item * the answer is C<200> and its C<X-Skeid-Registry-Signature> verifies against the exact | ||||||||||||||||||||||||||||||||||||||||||
| 255 | body with the secret from C<secret_env>; | ||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||
| 257 | =item * the schema C<version> is 1; | ||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||
| 259 | =item * it is fresh -- not older than its own C<ttl>, not more than C<max_skew_s> in the future; | ||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||
| 261 | =item * it is not older than the last snapshot this probe accepted (a replay). | ||||||||||||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||||||||||||
| 263 | =back | ||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||
| 265 | The bearer token is the downstream's registry read key from C<read_key_env> when that is | ||||||||||||||||||||||||||||||||||||||||||
| 266 | configured -- it opens the snapshot route and nothing else -- and its admin API key from | ||||||||||||||||||||||||||||||||||||||||||
| 267 | C<admin_key_env> only otherwise (skeid #49). With C<read_key_env> set the admin key is never | ||||||||||||||||||||||||||||||||||||||||||
| 268 | sent, not even when the read key variable is empty. | ||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||
| 270 | A missing C<secret_env> value or bearer key value forgets too, and so does a secret shorter | ||||||||||||||||||||||||||||||||||||||||||
| 271 | than 32 bytes (the downstream would refuse to publish with it). The probe forgets only its own | ||||||||||||||||||||||||||||||||||||||||||
| 272 | reading, so a C<429> backoff recorded from a response survives a rejected snapshot. The | ||||||||||||||||||||||||||||||||||||||||||
| 273 | reading is stamped with the snapshot's C<generated_at> and expires at C<generated_at + ttl>. | ||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||
| 275 | How the snapshot becomes C<used> and C<limit> is | ||||||||||||||||||||||||||||||||||||||||||
| 276 | L<Langertha::Skeid::Registry/reading_from_snapshot>. It is never added to this process's own | ||||||||||||||||||||||||||||||||||||||||||
| 277 | C<inflight>; the node's C<max_conns> stays the guardrail and the reading can only narrow it | ||||||||||||||||||||||||||||||||||||||||||
| 278 | (ADR 0009). Where another probe reads the same node, the tighter reading wins while it is | ||||||||||||||||||||||||||||||||||||||||||
| 279 | current (L<Langertha::Skeid/set_capacity_reading>). | ||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||
| 281 | Every change of state -- accepted, unreachable, bad signature, malformed, stale, from the | ||||||||||||||||||||||||||||||||||||||||||
| 282 | future, replayed, missing secret -- is warned once, not on every poll. | ||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||
| 284 | =head2 validate_config | ||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||
| 286 | Langertha::Skeid::CapacityProbe::Registry->validate_config($capacity_block, $node_id); | ||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||
| 288 | Croaks on a block this probe cannot work with: no C<secret_env>, neither C<read_key_env> nor | ||||||||||||||||||||||||||||||||||||||||||
| 289 | C<admin_key_env>, an unknown | ||||||||||||||||||||||||||||||||||||||||||
| 290 | key (a secret written into the config instead of named by variable is the one that matters), a | ||||||||||||||||||||||||||||||||||||||||||
| 291 | non-http(s) C<url>, a non-positive C<interval_ms>. Called when a node is added, so a bad block | ||||||||||||||||||||||||||||||||||||||||||
| 292 | fails the config load or the admin API call instead of forgetting silently on every poll. | ||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||
| 294 | =head2 state | ||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||
| 296 | The probe's last state: C<accepted>, C<unreachable>, C<bad_signature>, C<malformed>, C<stale>, | ||||||||||||||||||||||||||||||||||||||||||
| 297 | C<future>, C<replayed> or C<missing_secret>; undef before the first answer. | ||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||
| 299 | =head2 url | ||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||
| 301 | The snapshot endpoint: C<url> from the C<capacity> block, else the node's URL with a trailing | ||||||||||||||||||||||||||||||||||||||||||
| 302 | C</v1> removed plus C</skeid/registry/snapshot> (C<path> overrides that suffix). | ||||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||
| 304 | =head2 source | ||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||
| 306 | C<registry>. | ||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||
| 308 | =head2 poll | ||||||||||||||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||||||||||||||
| 310 | Fetches the snapshot from L</url> without blocking, one request at a time, with the bearer | ||||||||||||||||||||||||||||||||||||||||||
| 311 | token described above, and checks and maps it as described above. Reports nothing (and forgets | ||||||||||||||||||||||||||||||||||||||||||
| 312 | its own reading, setting L</state> to C<missing_secret>) when the secret or bearer variable is | ||||||||||||||||||||||||||||||||||||||||||
| 313 | empty or the secret is too short. | ||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||
| 315 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||
| 317 | L<Langertha::Skeid::Registry>, L<Langertha::Skeid/registry_enabled> (the publishing side), | ||||||||||||||||||||||||||||||||||||||||||
| 318 | L<Langertha::Skeid::CapacityProbe> | ||||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||
| 320 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||
| 322 | =head2 Issues | ||||||||||||||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||||||||||||||
| 324 | Please report bugs and feature requests on GitHub at | ||||||||||||||||||||||||||||||||||||||||||
| 325 | L<https://github.com/Getty/langertha-skeid/issues>. | ||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||
| 327 | =head2 IRC | ||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||
| 329 | Join C<#langertha> on C<irc.perl.org> or message Getty directly. | ||||||||||||||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||||||||||||||
| 331 | =head1 CONTRIBUTING | ||||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||
| 333 | Contributions are welcome! Please fork the repository and submit a pull request. | ||||||||||||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||||||||||
| 335 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||
| 337 | Torsten Raudssus <torsten@raudssus.de> L<https://raudssus.de/> | ||||||||||||||||||||||||||||||||||||||||||
| 338 | |||||||||||||||||||||||||||||||||||||||||||
| 339 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||||||||||||||
| 341 | This software is copyright (c) 2026 by Torsten Raudssus. | ||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||
| 343 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||
| 344 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||
| 346 | =cut | ||||||||||||||||||||||||||||||||||||||||||