line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OpenID::Lite::RelyingParty::Associator::ParamExtractor; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use Any::Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
1
|
|
|
1
|
|
500
|
use OpenID::Lite::Association; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
5
|
1
|
|
|
1
|
|
25
|
use OpenID::Lite::SessionHandler::NoEncryption; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
6
|
1
|
|
|
1
|
|
29
|
use OpenID::Lite::Constants::SessionType qw(NO_ENCRYPTION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
790
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'session' => ( |
9
|
|
|
|
|
|
|
is => 'rw', |
10
|
|
|
|
|
|
|
isa => 'OpenID::Lite::SessionHandler', |
11
|
|
|
|
|
|
|
required => 1, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'OpenID::Lite::Role::ErrorHandler'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub extract_params { |
17
|
0
|
|
|
0
|
0
|
|
my ( $self, $params ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
my $assoc_handle = $params->get('assoc_handle') |
20
|
|
|
|
|
|
|
or return $self->ERROR(q{Missing parameter, "assoc_handle".}); |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
my $expires_in = $params->get('expires_in') |
23
|
|
|
|
|
|
|
or return $self->ERROR(q{Missing parameter, "expires_in".}); |
24
|
0
|
0
|
|
|
|
|
unless ( $expires_in =~ /^\d+$/ ) { |
25
|
0
|
|
|
|
|
|
return $self->ERROR( sprintf q{Invalid expires_in, "%s"}, |
26
|
|
|
|
|
|
|
$expires_in ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $session_type = $params->get('session_type'); |
30
|
0
|
0
|
|
|
|
|
unless ($session_type) { |
31
|
0
|
0
|
|
|
|
|
unless ( $params->is_openid2 ) { |
32
|
0
|
|
|
|
|
|
$session_type = NO_ENCRYPTION; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
else { |
35
|
0
|
|
|
|
|
|
return $self->ERROR(q{Missing parameter, "session_type"}); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
0
|
0
|
|
|
|
|
unless ( $self->session->match($session_type) ) { |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# found session mismatch |
42
|
|
|
|
|
|
|
|
43
|
0
|
0
|
0
|
|
|
|
if ( $params->is_openid1 && $session_type eq NO_ENCRYPTION ) { |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
my $no_encryption_handler |
46
|
|
|
|
|
|
|
= OpenID::Lite::SessionHandler::NoEncryption->new; |
47
|
0
|
|
|
|
|
|
$self->session($no_encryption_handler); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
else { |
51
|
0
|
|
|
|
|
|
return $self->ERROR( |
52
|
|
|
|
|
|
|
sprintf |
53
|
|
|
|
|
|
|
q{Session Type Mismatch: server response includes session type "%s"}, |
54
|
|
|
|
|
|
|
$session_type |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
my $assoc_type = $params->get('assoc_type') |
60
|
|
|
|
|
|
|
or return $self->ERROR(q{Missing paramter, "assoc_type".}); |
61
|
0
|
0
|
|
|
|
|
unless ( $self->session->can_handle_assoc_type($assoc_type) ) { |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# protocol error |
64
|
0
|
|
|
|
|
|
return $self->ERROR( |
65
|
|
|
|
|
|
|
sprintf q{Server responds with unsupported assoc_type, "%s" }, |
66
|
|
|
|
|
|
|
$assoc_type ); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
my $secret = $self->session->extract_secret($params) |
70
|
|
|
|
|
|
|
or return $self->ERROR( $self->session->errstr ); |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
my $association = OpenID::Lite::Association->new( |
73
|
|
|
|
|
|
|
type => $assoc_type, |
74
|
|
|
|
|
|
|
handle => $assoc_handle, |
75
|
|
|
|
|
|
|
expires_in => $expires_in, |
76
|
|
|
|
|
|
|
secret => $secret, |
77
|
|
|
|
|
|
|
issued => time(), |
78
|
|
|
|
|
|
|
); |
79
|
0
|
|
|
|
|
|
return $association; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
1
|
|
|
1
|
|
7
|
no Any::Moose; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
6
|
|
83
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
84
|
|
|
|
|
|
|
1; |