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