Mojo/SAML/Document/KeyDescriptor.pm untested

filter: Statementstmt 0.0% 0 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod n/a totaltotal 0.0% 0 / 9 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
CRAP 2.0
1 package Mojo::SAML::Document::KeyDescriptor;
2  
3 use Mojo::Base 'Mojo::SAML::Document';
4  
5 has template => sub { shift->build_template(<<'XML') };
6 % my @attrs = (xmlns => 'urn:oasis:names:tc:SAML:2.0:metadata');
7 % if (my $use = $self->use) { push @attrs, (use => $use) }
8 %= tag KeyDescriptor => @attrs => begin
9 <%= $self->key_info %>
10 % end
11 XML
12  
13 has key_info => sub { Carp::croak 'key_info is required' };
14 has 'use';
15  
16 1;
17  
18 =head1 NAME
19  
20 Mojo::SAML::Document::KeyDescriptor
21  
22 =head1 DESCRIPTION
23  
24 Represents an KeyDescriptor SAML metadata tag
25  
26 =head1 ATTRIBUTES
27  
28 L<Mojo::SAML::Document::KeyDescriptor> inherits all attributes from L<Mojo::SAML::Document> and implements the following new ones.
29  
30 =head2 key_info
31  
32 Required.
33 An instance of L<Mojo::SAML::Document::KeyInfo> containing information about the relevant key.
34  
35 =head2 template
36  
37 A template specific to the document type.
38  
39 =head2 use
40  
41 A string indicating if this key is used for C<signing> or C<encryption>.
42 This field should be optional, and when omitted it should indicate that the key is used for both uses.
43 In practice, the author has seen services that require that if a key is used for both purposes, it should be specified twice, once for each use.
44