Scroll to navigation

CSAF::Validator::Base(3pm) User Contributed Perl Documentation CSAF::Validator::Base(3pm)

NAME

CSAF::Validator::Base - Base class for CSAF validation

SYNOPSIS

    use CSAF::Validator::Base;
    my $v = CSAF::Validator::Base->new( csaf => $csaf );

DESCRIPTION

ATTRIBUTES

ARRAY of validation messages.
ARRAY of test IDs.

METHODS

CSAF::Validator::Base inherits all methods from CSAF::Base and implements the following new ones.

Add new CSAF::Validator::Message item.

    $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'
    );
    
Execute a single validation test.

    $v->exec_test('6.2.5');
    
Check if validation have error messages

    my @messages = $v->validate;
    if ($v->has_error) {
        say "Invalid CSAF document";
        say $_ for (@messages);
    }
    
Check if validation have warning messages

    my @messages = $v->validate;
    if ($v->has_warning) {
        say "CSAF document with warnings";
        say $_ for (@messages);
    }
    
Execute all validation tests and return all validation messages.

    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.

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>

    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-2024 by Giuseppe Di Terlizzi.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2025-07-04 perl v5.40.1