line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SAML2::Role::ProtocolMessage; |
2
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
17948
|
use Moose::Role; |
|
13
|
|
|
|
|
75942
|
|
|
13
|
|
|
|
|
60
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: Common behaviour for Protocol messages |
6
|
|
|
|
|
|
|
|
7
|
13
|
|
|
13
|
|
78317
|
use namespace::autoclean; |
|
13
|
|
|
|
|
35
|
|
|
13
|
|
|
|
|
136
|
|
8
|
|
|
|
|
|
|
|
9
|
13
|
|
|
13
|
|
15618
|
use DateTime; |
|
13
|
|
|
|
|
6212298
|
|
|
13
|
|
|
|
|
799
|
|
10
|
13
|
|
|
13
|
|
139
|
use MooseX::Types::URI qw/ Uri /; |
|
13
|
|
|
|
|
37
|
|
|
13
|
|
|
|
|
201
|
|
11
|
13
|
|
|
13
|
|
36797
|
use Net::SAML2::Util qw(generate_id); |
|
13
|
|
|
|
|
60
|
|
|
13
|
|
|
|
|
3862
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.41'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has id => ( |
17
|
|
|
|
|
|
|
isa => 'Str', |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
builder => "_build_id" |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has issue_instant => ( |
23
|
|
|
|
|
|
|
isa => 'Str', |
24
|
|
|
|
|
|
|
is => 'ro', |
25
|
|
|
|
|
|
|
builder => '_build_issue_instant', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has issuer => ( |
29
|
|
|
|
|
|
|
isa => Uri, |
30
|
|
|
|
|
|
|
is => 'rw', |
31
|
|
|
|
|
|
|
required => 1, |
32
|
|
|
|
|
|
|
coerce => 1, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has issuer_namequalifier => ( |
36
|
|
|
|
|
|
|
isa => 'Str', |
37
|
|
|
|
|
|
|
is => 'rw', |
38
|
|
|
|
|
|
|
predicate => 'has_issuer_namequalifier', |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
has issuer_format => ( |
42
|
|
|
|
|
|
|
isa => 'Str', |
43
|
|
|
|
|
|
|
is => 'rw', |
44
|
|
|
|
|
|
|
predicate => 'has_issuer_format', |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
has destination => ( |
48
|
|
|
|
|
|
|
isa => Uri, |
49
|
|
|
|
|
|
|
is => 'rw', |
50
|
|
|
|
|
|
|
coerce => 1, |
51
|
|
|
|
|
|
|
predicate => 'has_destination', |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _build_issue_instant { |
55
|
11
|
|
|
11
|
|
21345
|
return DateTime->now(time_zone => 'UTC')->strftime('%FT%TZ'); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _build_id { |
59
|
10
|
|
|
10
|
|
26212
|
return generate_id(); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub status_uri { |
64
|
0
|
|
|
0
|
1
|
|
my ($self, $status) = @_; |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
my $statuses = { |
67
|
|
|
|
|
|
|
success => 'urn:oasis:names:tc:SAML:2.0:status:Success', |
68
|
|
|
|
|
|
|
requester => 'urn:oasis:names:tc:SAML:2.0:status:Requester', |
69
|
|
|
|
|
|
|
responder => 'urn:oasis:names:tc:SAML:2.0:status:Responder', |
70
|
|
|
|
|
|
|
partial => 'urn:oasis:names:tc:SAML:2.0:status:PartialLogout', |
71
|
|
|
|
|
|
|
}; |
72
|
|
|
|
|
|
|
|
73
|
0
|
0
|
|
|
|
|
if (exists $statuses->{$status}) { |
74
|
0
|
|
|
|
|
|
return $statuses->{$status}; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=pod |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=encoding UTF-8 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 NAME |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Net::SAML2::Role::ProtocolMessage - Common behaviour for Protocol messages |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 VERSION |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
version 0.41 |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 DESCRIPTION |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Provides default ID and timestamp arguments for Protocol classes. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Provides a status-URI lookup method for the statuses used by this |
101
|
|
|
|
|
|
|
implementation. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 NAME |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Net::SAML2::Role::ProtocolMessage - the SAML2 ProtocolMessage Role object |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 CONSTRUCTOR ARGUMENTS |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=over |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=item B<issuer> |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
URI of issuer |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item B<issuer_namequalifier> |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
NameQualifier attribute for Issuer |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=item B<issuer_format> |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Format attribute for Issuer |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item B<destination> |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
URI of Destination |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=back |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 METHODS |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head2 status_uri( $status ) |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Provides a mapping from short names for statuses to the full status URIs. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
Legal short names for B<$status> are: |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=over |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item C<success> |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item C<requester> |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item C<responder> |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=back |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head1 AUTHOR |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Chris Andrews <chrisa@cpan.org> |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
This software is copyright (c) 2021 by Chris Andrews and Others, see the git log. |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
156
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=cut |