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