CycloneDX/Declarations/Affirmation.pm

filter: Statementstmt 79.4% 31 / 39 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.8% 9 / 11 Podpod 100% 1 / 1 totaltotal 71.9% 41 / 57 CC 4 SCAR 18.7
CC
4
Cov
69%
TO_JSON
20.0
__ANON__
2.0
BEGIN
1.0
CRAP 6.5
« CycloneDX/Component/Patch.pm ↑ Summary CycloneDX/Declarations/Conformance.pm »
1 package SBOM::CycloneDX::Declarations::Affirmation;
2  
3 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use SBOM::CycloneDX::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Types::Standard qw(InstanceOf HashRef Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Types::TypeTiny qw(ArrayLike);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 extends 'SBOM::CycloneDX::Base';
17  
18 1 has statement => (is => 'rw', isa => Str);
19  
20 has signatories => (
21 is => 'rw',
22 isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Declarations::Signatory']],
23 0 ▶ default => sub { SBOM::CycloneDX::List->new }
Subroutine __ANON__: not called CC=1 SCAR=6.9
24 1 );
25  
26 1 has signature => (is => 'rw', isa => HashRef);
27  
28 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=4 SCAR=30.0
Pod documented
29  
30 0 my $self = shift;
31  
32 0 my $json = {};
33  
34 0 ▶ $json->{statement} = $self->statement if $self->statement;
Branch: 1 branch
BranchTrueFalseTotal
if $self->statement 0 0 0
35 0 ▶ $json->{signatories} = $self->signatories if @{$self->signatories};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->signatories;} 0 0 0
36 0 ▶ $json->{signature} = $self->signature if $self->signature;
Branch: 1 branch
BranchTrueFalseTotal
if $self->signature 0 0 0
37  
38 0 return $json;
39  
40 }
41  
42 1 1;
43  
44 =encoding utf-8
45  
46 =head1 NAME
47  
48 SBOM::CycloneDX::Declarations::Affirmation - Affirmation
49  
50 =head1 SYNOPSIS
51  
52 SBOM::CycloneDX::Declarations::Affirmation->new();
53  
54  
55 =head1 DESCRIPTION
56  
57 L<SBOM::CycloneDX::Declarations::Affirmation> provides a concise statement affirmed
58 by an individual regarding all declarations, often used for third-party
59 auditor acceptance or recipient acknowledgment. It includes a list of
60 authorized signatories who assert the validity of the document on behalf of
61 the organization.
62  
63 =head2 METHODS
64  
65 L<SBOM::CycloneDX::Declarations::Affirmation> inherits all methods from L<SBOM::CycloneDX::Base>
66 and implements the following new ones.
67  
68 =over
69  
70 =item SBOM::CycloneDX::Declarations::Affirmation->new( %PARAMS )
71  
72 Properties:
73  
74 =over
75  
76 =item * C<signatories>, The list of signatories authorized on behalf of an
77 organization to assert validity of this document.
78  
79 =item * C<signature>, Enveloped signature in JSON Signature Format (JSF)
80 (L<https://cyberphone.github.io/doc/security/jsf.html>).
81  
82 =item * C<statement>, The brief statement affirmed by an individual regarding
83 all declarations.
84 *- Notes This could be an affirmation of acceptance by a third-party
85 auditor or receiving individual of a file.
86  
87 =back
88  
89 =item $affirmation->signatories
90  
91 =item $affirmation->signature
92  
93 =item $affirmation->statement
94  
95 =back
96  
97  
98 =head1 SUPPORT
99  
100 =head2 Bugs / Feature Requests
101  
102 Please report any bugs or feature requests through the issue tracker
103 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
104 You will be notified automatically of any progress on your issue.
105  
106 =head2 Source Code
107  
108 This is open source software. The code repository is available for
109 public review and contribution under the terms of the license.
110  
111 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
112  
113 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
114  
115  
116 =head1 AUTHOR
117  
118 =over 4
119  
120 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
121  
122 =back
123  
124  
125 =head1 LICENSE AND COPYRIGHT
126  
127 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
128  
129 This is free software; you can redistribute it and/or modify it under
130 the same terms as the Perl 5 programming language system itself.
131  
132 =cut
« CycloneDX/Component/Patch.pm ↑ Summary CycloneDX/Declarations/Conformance.pm »