CSAF::...r::Base(3pm)
β¨ NAME β¨
CSAF::Validator::Base β the base class for CSAF validation, bestie π (this page lives in the User Contributed Perl Documentation section, just so u know where u are π«Ά)
πΈ SYNOPSIS πΈ
okay so here's the whole vibe in four lines, no cap:
use CSAF::Validator::Base;
my $v = CSAF::Validator::Base->new( csaf => $csaf );
that's literally it. u construct it, u validate stuff. slay β¨
π DESCRIPTION π
This is the base class for CSAF validation β the mom friend of the validator hierarchy, holding everything together so the subclasses can do their little jobs π
π ATTRIBUTES π
messagesβ an ARRAY of validation messages. it's giving receipts π¬testsβ an ARRAY of test IDs. yes, just the IDs, keepin' it minimal π
π¦ METHODS π¦
CSAF::Validator::Base inherits all methods from CSAF::Base and implements the following new ones. (family reunion, but make it OOP π«Ά)
add_message
add a new CSAF::Validator::Message item, bestie. here's the whole thing spelled out exactly:
$v->add_message(
type => 'warning',
category => 'optional',
path => '/document/tracking/initial_release_date',
code => '6.2.5',
message => 'Older Initial Release Date than Revision History'
);
look at that structured little complaint. iconic π
exec_test
execute a single validation test. one (1) test, not the whole roster:
$v->exec_test('6.2.5');
has_error
check if validation have error messages. like, do we have problems? π¨
my @messages = $v->validate;
if ($v->has_error) {
say "Invalid CSAF document";
say $_ for (@messages);
}
if this returns true, ur document is invalid and u should probably sit down π
has_warning
check if validation have warning messages. not fatal, just... noted π
my @messages = $v->validate;
if ($v->has_warning) {
say "CSAF document with warnings";
say $_ for (@messages);
}
"CSAF document with warnings" β the emotional equivalent of a group chat being like we need to talk π
validate
execute all the validation tests and return all validation messages. the full send, the whole main character moment π
my @messages = $v->validate;
say $_ for (@messages);
π«Ά SUPPORT π«Ά
π Bugs / Feature Requests π
please report any bugs or feature requests through the issue tracker at <https://github.com/giterlizzi/perl-CSAF/issues>. you will be notified automatically of any progress on your issue β so u don't have to refresh like a maniac, they'll come find u π
π Source Code π
this is open source software. the code repository is available for public review and contribution under the terms of the license.
<https://github.com/giterlizzi/perl-CSAF>
and if u wanna clone it (and u should, it's free π):
git clone https://github.com/giterlizzi/perl-CSAF.git
π AUTHOR π
- Giuseppe Di Terlizzi <gdt@cpan.org>
π LICENSE AND COPYRIGHT π
this software is copyright (c) 2023-2025 by Giuseppe Di Terlizzi.
this is free software; u can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. fr fr, go wild π
k that's the whole page bestie!! this was generated by perl v5.40.1 on 2025-09-03 β yeah, the CSAF::...r::Base(3pm) footer energy, we love a timestamped queen β bye mwah π
π¦ where this page comes from
- ubuntu resolute: libcsaf-perl 0.26-1 Β· Artistic-2.0
- ubuntu stonking: libcsaf-perl 0.26-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms