File Coverage

blib/lib/SBOM/CycloneDX/Declarations/Attestation.pm
Criterion Covered Total %
statement 23 31 74.1
branch 0 8 0.0
condition n/a
subroutine 8 9 88.8
pod 1 1 100.0
total 32 49 65.3


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Declarations::Attestation;
2              
3 1     1   2732 use 5.010001;
  1         5  
4 1     1   9 use strict;
  1         3  
  1         30  
5 1     1   6 use warnings;
  1         3  
  1         85  
6 1     1   8 use utf8;
  1         3  
  1         10  
7              
8 1     1   46 use Types::Standard qw(Str InstanceOf HashRef);
  1         2  
  1         25  
9 1     1   2648 use Types::TypeTiny qw(ArrayLike);
  1         4  
  1         10  
10              
11 1     1   781 use Moo;
  1         6  
  1         16  
12 1     1   705 use namespace::autoclean;
  1         4  
  1         26  
13              
14             extends 'SBOM::CycloneDX::Base';
15              
16             has summary => (is => 'rw', isa => Str);
17             has assessor => (is => 'rw', isa => Str); # Like bom-ref
18             has map => (is => 'rw', isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Declarations::Map']]);
19             has signature => (is => 'rw', isa => HashRef);
20              
21             sub TO_JSON {
22              
23 0     0 1   my $self = shift;
24              
25 0           my $json = {};
26              
27 0 0         $json->{summary} = $self->summary if $self->summary;
28 0 0         $json->{assessor} = $self->assessor if $self->assessor;
29 0 0         $json->{map} = $self->map if @{$self->map};
  0            
30 0 0         $json->{signature} = $self->signature if $self->signature;
31              
32 0           return $json;
33              
34             }
35              
36             1;
37              
38             =encoding utf-8
39              
40             =head1 NAME
41              
42             SBOM::CycloneDX::Declarations::Attestation - Attestation
43              
44             =head1 SYNOPSIS
45              
46             SBOM::CycloneDX::Declarations::Attestation->new();
47              
48              
49             =head1 DESCRIPTION
50              
51             L provides the attestation asserted
52             by an assessor that maps requirements to claims.
53              
54             =head2 METHODS
55              
56             L inherits all methods from L
57             and implements the following new ones.
58              
59             =over
60              
61             =item SBOM::CycloneDX::Declarations::Attestation->new( %PARAMS )
62              
63             Properties:
64              
65             =over
66              
67             =item * C, The `bom-ref` to the assessor asserting the attestation.
68              
69             =item * C, The grouping of requirements to claims and the attestors
70             declared conformance and confidence thereof.
71              
72             =item * C, Enveloped signature in JSON Signature Format (JSF)
73             (L).
74              
75             =item * C, The short description explaining the main points of the
76             attestation.
77              
78             =back
79              
80             =item $attestation->assessor
81              
82             =item $attestation->map
83              
84             =item $attestation->signature
85              
86             =item $attestation->summary
87              
88             =back
89              
90              
91             =head1 SUPPORT
92              
93             =head2 Bugs / Feature Requests
94              
95             Please report any bugs or feature requests through the issue tracker
96             at L.
97             You will be notified automatically of any progress on your issue.
98              
99             =head2 Source Code
100              
101             This is open source software. The code repository is available for
102             public review and contribution under the terms of the license.
103              
104             L
105              
106             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
107              
108              
109             =head1 AUTHOR
110              
111             =over 4
112              
113             =item * Giuseppe Di Terlizzi
114              
115             =back
116              
117              
118             =head1 LICENSE AND COPYRIGHT
119              
120             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
121              
122             This is free software; you can redistribute it and/or modify it under
123             the same terms as the Perl 5 programming language system itself.
124              
125             =cut