root/branches/release-39/extlib/Net/OAuth/Request.pm @ 2528

Revision 2528, 1.9 kB (checked in by fumiakiy, 18 months ago)

Updated Net::OAuth modules to the latest version. BugId:80041

Line 
1package Net::OAuth::Request;
2use warnings;
3use strict;
4use base qw/Net::OAuth::Message/;
5
6our $VERSION = '0.1';
7
8__PACKAGE__->mk_classdata(required_message_params => [qw/
9    consumer_key
10    signature_method
11    timestamp
12    nonce
13    /]);
14
15__PACKAGE__->mk_classdata(optional_message_params => [qw/
16    version
17        signature
18    /]);
19
20__PACKAGE__->mk_classdata(required_api_params => [qw/
21    request_method
22    request_url
23    consumer_secret
24    /]);
25
26__PACKAGE__->mk_classdata(optional_api_params => [qw/
27    signature_key
28    token_secret
29    extra_params
30    /]);
31
32__PACKAGE__->mk_classdata(signature_elements => [qw/
33    request_method
34    request_url
35    normalized_message_parameters
36    /]);
37
38__PACKAGE__->mk_classdata(all_message_params => [
39    @{__PACKAGE__->required_message_params},
40    @{__PACKAGE__->optional_message_params},
41        ]);
42
43__PACKAGE__->mk_classdata(all_api_params => [
44    @{__PACKAGE__->required_api_params},
45    @{__PACKAGE__->optional_api_params},       
46        ]);
47
48__PACKAGE__->mk_classdata(all_params => [
49    @{__PACKAGE__->all_api_params},
50    @{__PACKAGE__->all_message_params}, 
51        ]);
52
53__PACKAGE__->mk_accessors(
54    @{__PACKAGE__->all_params},
55    );
56
57sub signature_key {
58    my $self = shift;
59    # For some sig methods (I.e. RSA), users will pass in their own key
60    my $key = $self->get('signature_key');
61    unless (defined $key) {
62        $key = Net::OAuth::Message::encode($self->consumer_secret) . '&';
63        $key .= Net::OAuth::Message::encode($self->token_secret) if $self->can('token_secret');
64    }
65    return $key;
66}
67
68=head1 NAME
69
70Net::OAuth::Request - base class for OAuth requests
71
72=head1 SEE ALSO
73
74L<http://oauth.net>
75
76=head1 AUTHOR
77
78Keith Grennan, C<< <kgrennan at cpan.org> >>
79
80=head1 COPYRIGHT & LICENSE
81
82Copyright 2007 Keith Grennan, all rights reserved.
83
84This program is free software; you can redistribute it and/or modify it
85under the same terms as Perl itself.
86
87=cut
88
891;
Note: See TracBrowser for help on using the browser.