| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package SBOM::CycloneDX::Standard::Requirement; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1469
|
use 5.010001; |
|
|
1
|
|
|
|
|
4
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
33
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
49
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
41
|
use SBOM::CycloneDX::BomRef; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
31
|
|
|
9
|
1
|
|
|
1
|
|
5
|
use SBOM::CycloneDX::List; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
5
|
use Types::Standard qw(InstanceOf Str StrMatch); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
9
|
|
|
12
|
1
|
|
|
1
|
|
3181
|
use Types::TypeTiny qw(ArrayLike); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
7
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
513
|
use Moo; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
9
|
|
|
15
|
1
|
|
|
1
|
|
420
|
use namespace::autoclean; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
11
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
extends 'SBOM::CycloneDX::Base'; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has bom_ref => ( |
|
20
|
|
|
|
|
|
|
is => 'rw', |
|
21
|
|
|
|
|
|
|
isa => InstanceOf ['SBOM::CycloneDX::BomRef'], |
|
22
|
|
|
|
|
|
|
coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::BomRef->new($_[0]) } |
|
23
|
|
|
|
|
|
|
); |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has identifier => (is => 'rw', isa => Str); |
|
26
|
|
|
|
|
|
|
has title => (is => 'rw', isa => Str); |
|
27
|
|
|
|
|
|
|
has text => (is => 'rw', isa => Str); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has descriptions => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new }); |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has open_cre => ( |
|
32
|
|
|
|
|
|
|
is => 'rw', |
|
33
|
|
|
|
|
|
|
isa => ArrayLike [StrMatch [qr{^CRE:[0-9]+-[0-9]+$}]], |
|
34
|
|
|
|
|
|
|
default => sub { SBOM::CycloneDX::List->new } |
|
35
|
|
|
|
|
|
|
); |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has parent => (is => 'rw', isa => Str); # Like bom-ref |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
has properties => ( |
|
40
|
|
|
|
|
|
|
is => 'rw', |
|
41
|
|
|
|
|
|
|
isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Property']], |
|
42
|
|
|
|
|
|
|
default => sub { SBOM::CycloneDX::List->new } |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has external_references => ( |
|
46
|
|
|
|
|
|
|
is => 'rw', |
|
47
|
|
|
|
|
|
|
isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::ExternalReference']], |
|
48
|
|
|
|
|
|
|
default => sub { SBOM::CycloneDX::List->new } |
|
49
|
|
|
|
|
|
|
); |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub TO_JSON { |
|
52
|
|
|
|
|
|
|
|
|
53
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
54
|
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
my $json = {}; |
|
56
|
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
$json->{'bom-ref'} = $self->bom_ref if $self->bom_ref; |
|
58
|
0
|
0
|
|
|
|
|
$json->{identifier} = $self->identifier if $self->identifier; |
|
59
|
0
|
0
|
|
|
|
|
$json->{title} = $self->title if $self->title; |
|
60
|
0
|
0
|
|
|
|
|
$json->{text} = $self->text if $self->text; |
|
61
|
0
|
0
|
|
|
|
|
$json->{descriptions} = $self->descriptions if $self->descriptions; |
|
62
|
0
|
0
|
|
|
|
|
$json->{openCre} = $self->open_cre if $self->open_cre; |
|
63
|
0
|
0
|
|
|
|
|
$json->{parent} = $self->parent if $self->parent; |
|
64
|
0
|
0
|
|
|
|
|
$json->{properties} = $self->properties if $self->properties; |
|
65
|
0
|
0
|
|
|
|
|
$json->{externalReferences} = $self->external_references if @{$self->external_references}; |
|
|
0
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
return $json; |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=encoding utf-8 |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 NAME |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
SBOM::CycloneDX::Standard::Requirement - Requirement |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
SBOM::CycloneDX::Standard::Requirement->new(); |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
L provides the requirement comprising the standard. |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 METHODS |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
L inherits all methods from L |
|
91
|
|
|
|
|
|
|
and implements the following new ones. |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=over |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item SBOM::CycloneDX::Standard::Requirement->new( %PARAMS ) |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Properties: |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=over |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * C, An identifier which can be used to reference the |
|
102
|
|
|
|
|
|
|
object elsewhere in the BOM. Every bom-ref must be unique within the BOM. |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * C, The supplemental text that provides additional |
|
105
|
|
|
|
|
|
|
guidance or context to the requirement, but is not directly part of the |
|
106
|
|
|
|
|
|
|
requirement. |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item * C, External references provide a way to document |
|
109
|
|
|
|
|
|
|
systems, sites, and information that may be relevant, but are not included |
|
110
|
|
|
|
|
|
|
with the BOM. They may also establish specific relationships within or |
|
111
|
|
|
|
|
|
|
external to the BOM. |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=item * C, The unique identifier used in the standard to identify |
|
114
|
|
|
|
|
|
|
a specific requirement. This should match what is in the standard and |
|
115
|
|
|
|
|
|
|
should not be the requirements bom-ref. |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item * C, The Common Requirements Enumeration (CRE) identifier(s). |
|
118
|
|
|
|
|
|
|
CRE is a structured and standardized framework for uniting security |
|
119
|
|
|
|
|
|
|
standards and guidelines. CRE links each section of a resource to a shared |
|
120
|
|
|
|
|
|
|
topic identifier (a Common Requirement). Through this shared topic link, |
|
121
|
|
|
|
|
|
|
all resources map to each other. Use of CRE promotes clear and unambiguous |
|
122
|
|
|
|
|
|
|
communication among stakeholders. |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item * C, The optional `bom-ref` to a parent requirement. This |
|
125
|
|
|
|
|
|
|
establishes a hierarchy of requirements. Top-level requirements must not |
|
126
|
|
|
|
|
|
|
define a parent. Only child requirements should define parents. |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item * C, Provides the ability to document properties in a |
|
129
|
|
|
|
|
|
|
name-value store. This provides flexibility to include data not officially |
|
130
|
|
|
|
|
|
|
supported in the standard without having to use additional namespaces or |
|
131
|
|
|
|
|
|
|
create extensions. Unlike key-value stores, properties support duplicate |
|
132
|
|
|
|
|
|
|
names, each potentially having different values. Property names of interest |
|
133
|
|
|
|
|
|
|
to the general public are encouraged to be registered in the [CycloneDX |
|
134
|
|
|
|
|
|
|
Property |
|
135
|
|
|
|
|
|
|
Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal |
|
136
|
|
|
|
|
|
|
registration is optional. |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=item * C, The textual content of the requirement. |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item * C, The title of the requirement. |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=back |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=item $requirement->bom_ref |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item $requirement->descriptions |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=item $requirement->external_references |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=item $requirement->identifier |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=item $requirement->open_cre |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=item $requirement->parent |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=item $requirement->properties |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=item $requirement->text |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=item $requirement->title |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=back |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=head1 SUPPORT |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head2 Bugs / Feature Requests |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
Please report any bugs or feature requests through the issue tracker |
|
170
|
|
|
|
|
|
|
at L. |
|
171
|
|
|
|
|
|
|
You will be notified automatically of any progress on your issue. |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head2 Source Code |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
This is open source software. The code repository is available for |
|
176
|
|
|
|
|
|
|
public review and contribution under the terms of the license. |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
L |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head1 AUTHOR |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=over 4 |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=item * Giuseppe Di Terlizzi |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=back |
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi. |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
197
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=cut |