line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
11848
|
use strict; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
259
|
|
2
|
5
|
|
|
5
|
|
40
|
use warnings; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
295
|
|
3
|
|
|
|
|
|
|
package Net::SAML2::Protocol::LogoutResponse; |
4
|
|
|
|
|
|
|
our $VERSION = '0.73'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
34
|
use Moose; |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
42
|
|
7
|
5
|
|
|
5
|
|
37892
|
use MooseX::Types::URI qw/ Uri /; |
|
5
|
|
|
|
|
21
|
|
|
5
|
|
|
|
|
68
|
|
8
|
5
|
|
|
5
|
|
10648
|
use Net::SAML2::XML::Util qw/ no_comments /; |
|
5
|
|
|
|
|
22
|
|
|
5
|
|
|
|
|
2310
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Net::SAML2::Role::ProtocolMessage'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# ABSTRACT: SAML2 LogoutResponse Protocol object |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'status' => (isa => 'Str', is => 'ro', required => 1); |
16
|
|
|
|
|
|
|
has 'substatus' => (isa => 'Str', is => 'ro', required => 0); |
17
|
|
|
|
|
|
|
has 'response_to' => (isa => 'Str', is => 'ro', required => 1); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new_from_xml { |
21
|
2
|
|
|
2
|
1
|
12
|
my ($class, %args) = @_; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
10
|
my $dom = no_comments($args{xml}); |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
27
|
my $xpath = XML::LibXML::XPathContext->new($dom); |
26
|
2
|
|
|
|
|
17
|
$xpath->registerNs('saml', 'urn:oasis:names:tc:SAML:2.0:assertion'); |
27
|
2
|
|
|
|
|
8
|
$xpath->registerNs('samlp', 'urn:oasis:names:tc:SAML:2.0:protocol'); |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
8
|
my $self = $class->new( |
30
|
|
|
|
|
|
|
id => $xpath->findvalue('/samlp:LogoutResponse/@ID'), |
31
|
|
|
|
|
|
|
response_to => $xpath->findvalue('/samlp:LogoutResponse/@InResponseTo'), |
32
|
|
|
|
|
|
|
destination => $xpath->findvalue('/samlp:LogoutResponse/@Destination'), |
33
|
|
|
|
|
|
|
session => $xpath->findvalue('/samlp:LogoutResponse/samlp:SessionIndex'), |
34
|
|
|
|
|
|
|
issuer => $xpath->findvalue('/samlp:LogoutResponse/saml:Issuer'), |
35
|
|
|
|
|
|
|
status => $xpath->findvalue('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode/@Value'), |
36
|
|
|
|
|
|
|
substatus => $xpath->findvalue('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode/samlp:StatusCode/@Value'), |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
|
|
15
|
return $self; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub as_xml { |
44
|
1
|
|
|
1
|
1
|
945
|
my ($self) = @_; |
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
|
|
10
|
my $x = XML::Generator->new(':pretty'); |
47
|
1
|
|
|
|
|
132
|
my $saml = ['saml' => 'urn:oasis:names:tc:SAML:2.0:assertion']; |
48
|
1
|
|
|
|
|
4
|
my $samlp = ['samlp' => 'urn:oasis:names:tc:SAML:2.0:protocol']; |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
5
|
$x->xml( |
51
|
|
|
|
|
|
|
$x->LogoutResponse( |
52
|
|
|
|
|
|
|
$samlp, |
53
|
|
|
|
|
|
|
{ ID => $self->id, |
54
|
|
|
|
|
|
|
Version => '2.0', |
55
|
|
|
|
|
|
|
IssueInstant => $self->issue_instant, |
56
|
|
|
|
|
|
|
Destination => $self->destination, |
57
|
|
|
|
|
|
|
InResponseTo => $self->response_to }, |
58
|
|
|
|
|
|
|
$x->Issuer( |
59
|
|
|
|
|
|
|
$saml, |
60
|
|
|
|
|
|
|
$self->issuer, |
61
|
|
|
|
|
|
|
), |
62
|
|
|
|
|
|
|
$x->Status( |
63
|
|
|
|
|
|
|
$samlp, |
64
|
|
|
|
|
|
|
$x->StatusCode( |
65
|
|
|
|
|
|
|
$samlp, |
66
|
|
|
|
|
|
|
{ Value => $self->status }, |
67
|
|
|
|
|
|
|
) |
68
|
|
|
|
|
|
|
) |
69
|
|
|
|
|
|
|
) |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub success { |
75
|
2
|
|
|
2
|
1
|
827
|
my ($self) = @_; |
76
|
2
|
50
|
|
|
|
79
|
return 1 if $self->status eq $self->status_uri('success'); |
77
|
0
|
|
|
|
|
|
return 0; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=pod |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=encoding UTF-8 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 NAME |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Net::SAML2::Protocol::LogoutResponse - SAML2 LogoutResponse Protocol object |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 VERSION |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
version 0.73 |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 SYNOPSIS |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
my $logout_req = Net::SAML2::Protocol::LogoutResponse->new( |
99
|
|
|
|
|
|
|
issuer => $issuer, |
100
|
|
|
|
|
|
|
destination => $destination, |
101
|
|
|
|
|
|
|
status => $status, |
102
|
|
|
|
|
|
|
response_to => $response_to, |
103
|
|
|
|
|
|
|
); |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 NAME |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Net::SAML2::Protocol::LogoutResponse - the SAML2 LogoutResponse object |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 METHODS |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 new( ... ) |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Constructor. Returns an instance of the LogoutResponse object. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Arguments: |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=over |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=item B<issuer> |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
SP's identity URI |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item B<destination> |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
IdP's identity URI |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item B<status> |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
response status |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=item B<response_to> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
request ID we're responding to |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=back |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head2 new_from_xml( ... ) |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Create a LogoutResponse object from the given XML. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Arguments: |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=over |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item B<xml> |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
XML data |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=back |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head2 as_xml( ) |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
Returns the LogoutResponse as XML. |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head2 success( ) |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
Returns true if the Response's status is Success. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head1 AUTHORS |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=over 4 |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item * |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
Chris Andrews <chrisa@cpan.org> |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=item * |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
Timothy Legge <timlegge@gmail.com> |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=back |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
This software is copyright (c) 2023 by Venda Ltd, see the CONTRIBUTORS file for others. |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
178
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=cut |