| 1 | package SBOM::CycloneDX::Source; | ||
| 2 | |||
| 3 | use 5.010001; | ||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | use utf8; | ||
| 7 | |||
| 8 | use Types::Standard qw(Str); | ||
| 9 | |||
| 10 | use Moo; | ||
| 11 | use namespace::autoclean; | ||
| 12 | |||
| 13 | extends 'SBOM::CycloneDX::Base'; | ||
| 14 | |||
| 15 | has name => (is => 'rw', isa => Str); | ||
| 16 | has url => (is => 'rw', isa => Str); | ||
| 17 | |||
| 18 | sub TO_JSON { | ||
| 19 | |||
| 20 | my $self = shift; | ||
| 21 | |||
| 22 | my $json = {}; | ||
| 23 | |||
| 24 | $json->{url} = $self->url if $self->url; | ||
| 25 | $json->{name} = $self->name if $self->name; | ||
| 26 | |||
| 27 | return $json; | ||
| 28 | |||
| 29 | } | ||
| 30 | |||
| 31 | 1; | ||
| 32 | |||
| 33 | =encoding utf-8 | ||
| 34 | |||
| 35 | =head1 NAME | ||
| 36 | |||
| 37 | SBOM::CycloneDX::Source - Source of the issue/vulnerability where it is documented | ||
| 38 | |||
| 39 | =head1 SYNOPSIS | ||
| 40 | |||
| 41 | $issue->source( | ||
| 42 | SBOM::CycloneDX::Source->new( name => 'NVD', url => 'https://nvd.nist.gov/vuln/detail/CVE-2019-9997' ) | ||
| 43 | ); | ||
| 44 | |||
| 45 | |||
| 46 | =head1 DESCRIPTION | ||
| 47 | |||
| 48 | L<SBOM::CycloneDX::Source> of the issue/vulnerability where it is documented. | ||
| 49 | |||
| 50 | =head2 METHODS | ||
| 51 | |||
| 52 | L<SBOM::CycloneDX::Source> inherits all methods from L<SBOM::CycloneDX::Base> | ||
| 53 | and implements the following new ones. | ||
| 54 | |||
| 55 | =over | ||
| 56 | |||
| 57 | =item SBOM::CycloneDX::Source->new( %PARAMS ) | ||
| 58 | |||
| 59 | Properties: | ||
| 60 | |||
| 61 | =over | ||
| 62 | |||
| 63 | =item * C<name>, The name of the source. | ||
| 64 | |||
| 65 | =item * C<url>, The url of the issue/vulnerability documentation as provided by the source. | ||
| 66 | |||
| 67 | =back | ||
| 68 | |||
| 69 | =item $source->name | ||
| 70 | |||
| 71 | =item $source->url | ||
| 72 | |||
| 73 | =back | ||
| 74 | |||
| 75 | =head1 SUPPORT | ||
| 76 | |||
| 77 | =head2 Bugs / Feature Requests | ||
| 78 | |||
| 79 | Please report any bugs or feature requests through the issue tracker | ||
| 80 | at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>. | ||
| 81 | You will be notified automatically of any progress on your issue. | ||
| 82 | |||
| 83 | =head2 Source Code | ||
| 84 | |||
| 85 | This is open source software. The code repository is available for | ||
| 86 | public review and contribution under the terms of the license. | ||
| 87 | |||
| 88 | L<https://github.com/giterlizzi/perl-SBOM-CycloneDX> | ||
| 89 | |||
| 90 | git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git | ||
| 91 | |||
| 92 | |||
| 93 | =head1 AUTHOR | ||
| 94 | |||
| 95 | =over 4 | ||
| 96 | |||
| 97 | =item * Giuseppe Di Terlizzi <gdt@cpan.org> | ||
| 98 | |||
| 99 | =back | ||
| 100 | |||
| 101 | |||
| 102 | =head1 LICENSE AND COPYRIGHT | ||
| 103 | |||
| 104 | This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi. | ||
| 105 | |||
| 106 | This is free software; you can redistribute it and/or modify it under | ||
| 107 | the same terms as the Perl 5 programming language system itself. | ||
| 108 | |||
| 109 | =cut |