line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OAuth::Lite2::Server::GrantHandlers; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
406
|
use OAuth::Lite2::Server::GrantHandler::AuthorizationCode; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
7
|
1
|
|
|
1
|
|
353
|
use OAuth::Lite2::Server::GrantHandler::Password; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
8
|
1
|
|
|
1
|
|
356
|
use OAuth::Lite2::Server::GrantHandler::RefreshToken; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
9
|
1
|
|
|
1
|
|
387
|
use OAuth::Lite2::Server::GrantHandler::ClientCredentials; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
117
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my %HANDLERS; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub add_handler { |
14
|
4
|
|
|
4
|
1
|
5
|
my ($class, $type, $handler) = @_; |
15
|
4
|
|
|
|
|
7
|
$HANDLERS{$type} = $handler; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
__PACKAGE__->add_handler( 'authorization_code' => |
19
|
|
|
|
|
|
|
OAuth::Lite2::Server::GrantHandler::AuthorizationCode->new ); |
20
|
|
|
|
|
|
|
__PACKAGE__->add_handler( 'password' => |
21
|
|
|
|
|
|
|
OAuth::Lite2::Server::GrantHandler::Password->new ); |
22
|
|
|
|
|
|
|
__PACKAGE__->add_handler( 'refresh_token' => |
23
|
|
|
|
|
|
|
OAuth::Lite2::Server::GrantHandler::RefreshToken->new ); |
24
|
|
|
|
|
|
|
__PACKAGE__->add_handler( 'client_credentials' => |
25
|
|
|
|
|
|
|
OAuth::Lite2::Server::GrantHandler::ClientCredentials->new ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#__PACKAGE__->add_handler( 'assertion' => ); |
28
|
|
|
|
|
|
|
#__PACKAGE__->add_handler( 'none' => ); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub get_handler { |
31
|
0
|
|
|
0
|
1
|
|
my ($class, $type) = @_; |
32
|
0
|
|
|
|
|
|
return $HANDLERS{$type}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
OAuth::Lite2::Server::GrantHandlers - store of handlers for each grant_type. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SYNOPSIS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $handler = OAuth::Lite2::Server::GrantHandlers->get_handler( $grant_type ); |
42
|
|
|
|
|
|
|
$handler->handle_request( $ctx ); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
store of handlers for each grant_type. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 METHODS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 add_handler( $grant_type, $handler ) |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 get_handler( $grant_type ) |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 SEE ALSO |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
L |
57
|
|
|
|
|
|
|
L |
58
|
|
|
|
|
|
|
L |
59
|
|
|
|
|
|
|
L |
60
|
|
|
|
|
|
|
L |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Lyo Kato, Elyo.kato@gmail.comE |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Copyright (C) 2010 by Lyo Kato |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
71
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.8 or, |
72
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|