File Coverage

blib/lib/SBOM/CycloneDX/Declarations/Affirmation.pm
Criterion Covered Total %
statement 26 33 78.7
branch 0 6 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 50 72.0


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Declarations::Affirmation;
2              
3 1     1   18541 use 5.010001;
  1         4  
4 1     1   7 use strict;
  1         3  
  1         27  
5 1     1   5 use warnings;
  1         40  
  1         73  
6 1     1   6 use utf8;
  1         3  
  1         10  
7              
8 1     1   62 use SBOM::CycloneDX::List;
  1         3  
  1         38  
9              
10 1     1   5 use Types::Standard qw(InstanceOf HashRef Str);
  1         12  
  1         13  
11 1     1   2485 use Types::TypeTiny qw(ArrayLike);
  1         3  
  1         7  
12              
13 1     1   660 use Moo;
  1         2  
  1         10  
14 1     1   477 use namespace::autoclean;
  1         3  
  1         12  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has statement => (is => 'rw', isa => Str);
19              
20             has signatories => (
21             is => 'rw',
22             isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Declarations::Signatory']],
23             default => sub { SBOM::CycloneDX::List->new }
24             );
25              
26             has signature => (is => 'rw', isa => HashRef);
27              
28             sub TO_JSON {
29              
30 0     0 1   my $self = shift;
31              
32 0           my $json = {};
33              
34 0 0         $json->{statement} = $self->statement if $self->statement;
35 0 0         $json->{signatories} = $self->signatories if @{$self->signatories};
  0            
36 0 0         $json->{signature} = $self->signature if $self->signature;
37              
38 0           return $json;
39              
40             }
41              
42             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 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 inherits all methods from L
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, The list of signatories authorized on behalf of an
77             organization to assert validity of this document.
78              
79             =item * C, Enveloped signature in JSON Signature Format (JSF)
80             (L).
81              
82             =item * C, 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.
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
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
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