| 1 | package Net::OAuth::Request; | ||||||||||
| 2 | 11 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 11 | ▶ | use base qw/Net::OAuth::Message/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 11 | ▶ | use URI; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 11 | ▶ | use URI::QueryParam; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 11 | ▶ | use Net::OAuth; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 11 | our $VERSION = '0.32'; | |||||||||
| 10 | |||||||||||
| 11 | 11 | __PACKAGE__->mk_classdata(required_message_params => [qw/ | |||||||||
| 12 | consumer_key | ||||||||||
| 13 | signature_method | ||||||||||
| 14 | timestamp | ||||||||||
| 15 | nonce | ||||||||||
| 16 | /]); | ||||||||||
| 17 | |||||||||||
| 18 | 11 | __PACKAGE__->mk_classdata(optional_message_params => [qw/ | |||||||||
| 19 | version | ||||||||||
| 20 | signature | ||||||||||
| 21 | /]); | ||||||||||
| 22 | |||||||||||
| 23 | 11 | __PACKAGE__->mk_classdata(required_api_params => [qw/ | |||||||||
| 24 | request_method | ||||||||||
| 25 | request_url | ||||||||||
| 26 | consumer_secret | ||||||||||
| 27 | /]); | ||||||||||
| 28 | |||||||||||
| 29 | 11 | __PACKAGE__->mk_classdata(optional_api_params => [qw/ | |||||||||
| 30 | signature_key | ||||||||||
| 31 | token_secret | ||||||||||
| 32 | extra_params | ||||||||||
| 33 | protocol_version | ||||||||||
| 34 | /]); | ||||||||||
| 35 | |||||||||||
| 36 | 11 | __PACKAGE__->mk_classdata(signature_elements => [qw/ | |||||||||
| 37 | request_method | ||||||||||
| 38 | normalized_request_url | ||||||||||
| 39 | normalized_message_parameters | ||||||||||
| 40 | /]); | ||||||||||
| 41 | |||||||||||
| 42 | __PACKAGE__->mk_classdata(all_message_params => [ | ||||||||||
| 43 | 11 | @{__PACKAGE__->required_message_params}, | |||||||||
| 44 | 11 | @{__PACKAGE__->optional_message_params}, | |||||||||
| 45 | ]); | ||||||||||
| 46 | |||||||||||
| 47 | __PACKAGE__->mk_classdata(all_api_params => [ | ||||||||||
| 48 | 11 | @{__PACKAGE__->required_api_params}, | |||||||||
| 49 | 11 | @{__PACKAGE__->optional_api_params}, | |||||||||
| 50 | ]); | ||||||||||
| 51 | |||||||||||
| 52 | __PACKAGE__->mk_classdata(all_params => [ | ||||||||||
| 53 | 11 | @{__PACKAGE__->all_api_params}, | |||||||||
| 54 | 11 | @{__PACKAGE__->all_message_params}, | |||||||||
| 55 | ]); | ||||||||||
| 56 | |||||||||||
| 57 | __PACKAGE__->mk_accessors( | ||||||||||
| 58 | 11 | @{__PACKAGE__->all_params}, | |||||||||
| 59 | ); | ||||||||||
| 60 | |||||||||||
| 61 | sub signature_key { | ||||||||||
| 62 | 44 | ▶ | my $self = shift; | ||||||||
|
Subroutine
signature_key: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 63 | # For some sig methods (I.e. RSA), users will pass in their own key | ||||||||||
| 64 | 44 | my $key = $self->get('signature_key'); | |||||||||
| 65 | 44 | ▶ | unless (defined $key) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 66 | 43 | $key = Net::OAuth::Message::encode($self->consumer_secret) . '&'; | |||||||||
| 67 | 43 | ▶ | $key .= Net::OAuth::Message::encode($self->token_secret) if $self->can('token_secret'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | } | ||||||||||
| 69 | 44 | return $key; | |||||||||
| 70 | } | ||||||||||
| 71 | |||||||||||
| 72 | sub normalized_request_url { | ||||||||||
| 73 | 42 | ▶ | my $self = shift; | ||||||||
|
Subroutine
normalized_request_url: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 74 | 42 | my $url = $self->request_url; | |||||||||
| 75 | 42 | Net::OAuth::Message::_ensure_uri_object($url); | |||||||||
| 76 | 42 | $url = $url->clone; | |||||||||
| 77 | 42 | $url->query(undef); | |||||||||
| 78 | 42 | return $url; | |||||||||
| 79 | } | ||||||||||
| 80 | |||||||||||
| 81 | |||||||||||
| 82 | =head1 NAME | ||||||||||
| 83 | |||||||||||
| 84 | Net::OAuth::Request - base class for OAuth requests | ||||||||||
| 85 | |||||||||||
| 86 | =head1 SEE ALSO | ||||||||||
| 87 | |||||||||||
| 88 | L<Net::OAuth>, L<http://oauth.net> | ||||||||||
| 89 | |||||||||||
| 90 | =head1 AUTHOR | ||||||||||
| 91 | |||||||||||
| 92 | Originally by Keith Grennan <foss@nearlyfree.org> | ||||||||||
| 93 | |||||||||||
| 94 | Currently maintained by Robert Rothenberg <perl@rhizomnic.com> | ||||||||||
| 95 | |||||||||||
| 96 | =head1 COPYRIGHT & LICENSE | ||||||||||
| 97 | |||||||||||
| 98 | Copyright 2007-2012, 2024-2025 Keith Grennan | ||||||||||
| 99 | |||||||||||
| 100 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 101 | under the same terms as Perl itself. | ||||||||||
| 102 | |||||||||||
| 103 | =cut | ||||||||||
| 104 | |||||||||||
| 105 | 11 | 1; | |||||||||