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