CSAF::...r::Base(3pm)

πŸ“¦
version 0.26 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

✨ 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>

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