Mojo/SAML/Document/AssertionConsumerService.pm

filter: Statementstmt 100% 3 / 3 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 4 / 4 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« Mojo/SAML.pm ↑ Summary
1 package Mojo::SAML::Document::AssertionConsumerService;
2  
3 1 ▶use Mojo::Base 'Mojo::SAML::Document';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 use Mojo::SAML::Names;
6  
7 has template => sub { shift->build_template(<<'XML') };
8 %= tag AssertionConsumerService => $self->tag_attrs
9 XML
10  
11 has binding => sub { Carp::croak 'binding is required' };
12 has index => sub { Carp::croak 'index is required' };
13 has location => sub { Carp::croak 'location is required' };
14 has [qw/is_default response_location/];
15  
16 sub tag_attrs {
17 my $self = shift;
18 my $binding = $self->binding;
19 my @attrs = (
20 xmlns => 'urn:oasis:names:tc:SAML:2.0:metadata',
21 index => $self->index,
22 Location => $self->location,
23 Binding => Mojo::SAML::Names::binding($binding),
24 );
25  
26 if (defined(my $res = $self->response_location)) {
27 push @attrs, ResponseLocation => $res;
28 }
29  
30 if (defined(my $default = $self->is_default)) {
31 push @attrs, isDefault => $default ? 'true' : 'false';
32 }
33  
34 return @attrs;
35 }
36  
37 1;
38  
39 =head1 NAME
40  
41 Mojo::SAML::Document::AssertionConsumerService
42  
43 =head1 DESCRIPTION
44  
45 Represents an AssertionConsumerService SAML metadata tag
46  
47 =head1 ATTRIBUTES
48  
49 L<Mojo::SAML::Document::AssertionConsumerService> inherits all attributes from L<Mojo::SAML::Document> and implements the following new ones.
50  
51 =head2 binding
52  
53 Required.
54 The name of the binding to be used.
55 Can use a shortened form expanded via L<Mojo::SAML::Names/binding>.
56  
57 =head2 index
58  
59 Required.
60 The numerical index of the endpoint for reference at a later time.
61  
62 =head2 location
63  
64 Required.
65 The location of the endpoint itself.
66  
67 =head2 is_default
68  
69 A boolean indicating whether this endpoint should be considered the default endpoint.
70 May be omitted, but assumed false if not given.
71  
72 =head2 response_location
73  
74 Optional.
75 Allows specifying a different location to send the response.
76  
77 =head2 template
78  
79 A template specific to the document type.
80  
81 =head1 METHODS
82  
83 L<Mojo::SAML::Document::AssertionConsumerService> inherits all methods from L<Mojo::SAML::Document> and implements the following new ones.
84  
85 =head2 tag_attrs
86  
87 Generates a list of attributes for the tag.
88  
« Mojo/SAML.pm ↑ Summary