line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OAuth::Lite2::ParamMethod; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
3374
|
use strict; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
211
|
|
4
|
10
|
|
|
10
|
|
30
|
use warnings; |
|
10
|
|
|
|
|
13
|
|
|
10
|
|
|
|
|
1060
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
49
|
|
|
49
|
1
|
120
|
bless {}, $_[0]; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub match { |
11
|
0
|
|
|
0
|
1
|
|
my ($self, $req) = @_; |
12
|
0
|
|
|
|
|
|
die "abstract method"; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub parse { |
16
|
0
|
|
|
0
|
1
|
|
my ($self, $req) = @_; |
17
|
0
|
|
|
|
|
|
die "abstract method"; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub build_request { |
21
|
0
|
|
|
0
|
1
|
|
my ($self, %params) = @_; |
22
|
0
|
|
|
|
|
|
die "abstract method"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
OAuth::Lite2::ParamMethod - base class of builder/parser for OAuth 2.0 parameters |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $meth = OAuth::Lite2::ParamMethod::Foo->new; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# server side |
34
|
|
|
|
|
|
|
if ($meth->match( $plack_request )) { |
35
|
|
|
|
|
|
|
my ($token, $params) = $meth->parse( $plack_request ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# client side |
39
|
|
|
|
|
|
|
my $http_req = $meth->request_builder(...); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
base class of builder/parser for OAuth 2.0 parameters |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 METHODS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 new |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Constructor |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 match( $plack_request ) |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Returns true if passed L object is matched for the type of this method. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
if ( $meth->match( $plack_request ) ) { |
56
|
|
|
|
|
|
|
... |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 parse( $plack_request ) |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Parse the L, and returns access token and oauth parameters. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
my ($token, $params) = $meth->parse( $plack_request ); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 build_request( %params ) |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Build L object. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
my $req = $meth->build_request( |
70
|
|
|
|
|
|
|
url => $url, |
71
|
|
|
|
|
|
|
method => $http_method, |
72
|
|
|
|
|
|
|
token => $access_token, |
73
|
|
|
|
|
|
|
oauth_params => $oauth_params, |
74
|
|
|
|
|
|
|
params => $params, |
75
|
|
|
|
|
|
|
content => $content, |
76
|
|
|
|
|
|
|
headers => $headers, |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 SEE ALSO |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
L |
82
|
|
|
|
|
|
|
L |
83
|
|
|
|
|
|
|
L |
84
|
|
|
|
|
|
|
L |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 AUTHOR |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Lyo Kato, Elyo.kato@gmail.comE |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Copyright (C) 2010 by Lyo Kato |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
95
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.8 or, |
96
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1; |
101
|
|
|
|
|
|
|
|