r38929 - in /trunk/libnet-oauth-perl: Changes META.yml debian/changelog lib/Net/OAuth.pm lib/Net/OAuth/Message.pm lib/Net/OAuth/Request.pm t/06-factory.t t/10-misc.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Mon Jun 29 16:06:10 UTC 2009


Author: gregoa
Date: Mon Jun 29 16:06:04 2009
New Revision: 38929

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=38929
Log:
New upstream release.

Modified:
    trunk/libnet-oauth-perl/Changes
    trunk/libnet-oauth-perl/META.yml
    trunk/libnet-oauth-perl/debian/changelog
    trunk/libnet-oauth-perl/lib/Net/OAuth.pm
    trunk/libnet-oauth-perl/lib/Net/OAuth/Message.pm
    trunk/libnet-oauth-perl/lib/Net/OAuth/Request.pm
    trunk/libnet-oauth-perl/t/06-factory.t
    trunk/libnet-oauth-perl/t/10-misc.t

Modified: trunk/libnet-oauth-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/Changes?rev=38929&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/Changes (original)
+++ trunk/libnet-oauth-perl/Changes Mon Jun 29 16:06:04 2009
@@ -67,3 +67,7 @@
 
 0.18   Thu, 25 Jun 2009 17:18:04 UTC
     Fixed accidental (though probably harmless) regression in 0.17
+
+0.19   Fri, 26 Jun 2009 17:30:06 UTC
+    Fixed https://rt.cpan.org/Ticket/Display.html?id=47369 - Don't automatically set oauth_version parameter when message is created via from_hash (or from_url, from_post_body, etc).  Thanks COSIMO!
+    

Modified: trunk/libnet-oauth-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/META.yml?rev=38929&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/META.yml (original)
+++ trunk/libnet-oauth-perl/META.yml Mon Jun 29 16:06:04 2009
@@ -1,6 +1,6 @@
 ---
 name: Net-OAuth
-version: 0.18
+version: 0.19
 author:
   - 'Keith Grennan <kgrennan at cpan.org>'
 abstract: An implementation of the OAuth protocol
@@ -17,7 +17,7 @@
 provides:
   Net::OAuth:
     file: lib/Net/OAuth.pm
-    version: 0.18
+    version: 0.19
   Net::OAuth::AccessTokenRequest:
     file: lib/Net/OAuth/AccessTokenRequest.pm
   Net::OAuth::AccessTokenResponse:
@@ -30,7 +30,7 @@
     file: lib/Net/OAuth/ProtectedResourceRequest.pm
   Net::OAuth::Request:
     file: lib/Net/OAuth/Request.pm
-    version: 0.18
+    version: 0.19
   Net::OAuth::RequestTokenRequest:
     file: lib/Net/OAuth/RequestTokenRequest.pm
   Net::OAuth::RequestTokenResponse:

Modified: trunk/libnet-oauth-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/debian/changelog?rev=38929&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/debian/changelog (original)
+++ trunk/libnet-oauth-perl/debian/changelog Mon Jun 29 16:06:04 2009
@@ -1,3 +1,9 @@
+libnet-oauth-perl (0.19-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Mon, 29 Jun 2009 18:05:21 +0200
+
 libnet-oauth-perl (0.18-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libnet-oauth-perl/lib/Net/OAuth.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/lib/Net/OAuth.pm?rev=38929&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/lib/Net/OAuth.pm (original)
+++ trunk/libnet-oauth-perl/lib/Net/OAuth.pm Mon Jun 29 16:06:04 2009
@@ -6,7 +6,9 @@
 sub PROTOCOL_VERSION_1_0() {1}
 sub PROTOCOL_VERSION_1_0A() {1.001}
 
-our $VERSION = '0.18';
+sub OAUTH_VERSION() {'1.0'}
+
+our $VERSION = '0.19';
 our $SKIP_UTF8_DOUBLE_ENCODE_CHECK = 0;
 our $PROTOCOL_VERSION = PROTOCOL_VERSION_1_0;
 
@@ -361,7 +363,7 @@
 
 =head2 I18N
 
-Per the OAuth spec, when making the signature Net::OAuth first encodes parameters to UTF-8. This means that any parameters you pass to Net::OAuth, if they are outside of ASCII character set, should be run through Encode::decode() (or an equivalent PerlIO layer) first to decode them to perl's internal character sructure.
+Per the OAuth spec, when making the signature Net::OAuth first encodes parameters to UTF-8. This means that any parameters you pass to Net::OAuth, if they are outside of ASCII character set, should be run through Encode::decode() (or an equivalent PerlIO layer) first to decode them to Perl's internal character sructure.
 
 There is a check in Net::OAuth's parameter encoding function that guesses if the data you are passing in looks like it is already UTF-8 and warns that you should decode it first. This accidental double-encoding of UTF-8 may be a source of headaches - if you find that the signature check is failing when you send non-ASCII data, that is a likely cause. 
 

Modified: trunk/libnet-oauth-perl/lib/Net/OAuth/Message.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/lib/Net/OAuth/Message.pm?rev=38929&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/lib/Net/OAuth/Message.pm (original)
+++ trunk/libnet-oauth-perl/lib/Net/OAuth/Message.pm Mon Jun 29 16:06:04 2009
@@ -75,7 +75,7 @@
 sub set_defaults {
     my $self = shift;
     $self->{extra_params} ||= {};
-    $self->{version} ||= '1.0';
+    $self->{version} ||= Net::OAuth::OAUTH_VERSION unless $self->{from_hash};
 }
 
 sub is_extension_param {
@@ -136,7 +136,8 @@
     foreach my $k (@{$self->required_message_params}, @{$self->optional_message_params}, @{$opts{add}}) {
         next if $k eq 'signature' and (!$self->sign_message or !grep ($_ eq 'signature', @{$opts{add}}));
         my $message_key = $self->is_extension_param($k) ? $k : OAUTH_PREFIX . $k;
-        $params{$message_key} = $self->$k;
+        my $v = $self->$k;
+        $params{$message_key} = $v if defined $v;
     }
     if ($self->{extra_params} and !$opts{no_extra} and $self->allow_extra_params) {
         foreach my $k (keys %{$self->{extra_params}}) {
@@ -157,7 +158,7 @@
     while (my ($k,$v) = each %params) {
         push @pairs, join('=', encode($k), $opts{quote} . encode($v) . $opts{quote});
     }
-    return sort(@pairs); # sort not required here but makes module more testable
+    return sort(@pairs);
 }
 
 sub normalized_message_parameters {
@@ -266,6 +267,7 @@
             $msg_params{extra_params}->{$k} = $hash->{$k};
         }
     }
+    $api_params{from_hash} = 1;
     return $class->new(%msg_params, %api_params);
 }
 

Modified: trunk/libnet-oauth-perl/lib/Net/OAuth/Request.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/lib/Net/OAuth/Request.pm?rev=38929&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/lib/Net/OAuth/Request.pm (original)
+++ trunk/libnet-oauth-perl/lib/Net/OAuth/Request.pm Mon Jun 29 16:06:04 2009
@@ -5,7 +5,7 @@
 use URI;
 use URI::QueryParam;
 
-our $VERSION = '0.18';
+our $VERSION = '0.19';
 
 __PACKAGE__->mk_classdata(required_message_params => [qw/
     consumer_key

Modified: trunk/libnet-oauth-perl/t/06-factory.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/t/06-factory.t?rev=38929&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/t/06-factory.t (original)
+++ trunk/libnet-oauth-perl/t/06-factory.t Mon Jun 29 16:06:04 2009
@@ -49,7 +49,8 @@
 			oauth_consumer_key => 'dpf43f3p2l4k3l03',
         	oauth_signature_method => 'PLAINTEXT',
         	oauth_timestamp => '1191242090',
-        	oauth_nonce => 'hsu94j3884jdopsl'
+        	oauth_nonce => 'hsu94j3884jdopsl',
+        	oauth_version => '1.0',
 		},
     	consumer_secret => 'kd94hf93k423kf44',
     	request_url => 'https://photos.example.net/request_token',
@@ -70,6 +71,7 @@
         oauth_nonce => 'kllo9940pd9333jh',
         oauth_token => 'nnch734d00sl2jdk',
 		oauth_signature => 'tR3+Ty81lMeYAr/Fid0kMTYa/WM=',
+    	oauth_version => '1.0',
         file => 'vacation.jpg',
         size => 'original',
 	},

Modified: trunk/libnet-oauth-perl/t/10-misc.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/t/10-misc.t?rev=38929&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/t/10-misc.t (original)
+++ trunk/libnet-oauth-perl/t/10-misc.t Mon Jun 29 16:06:04 2009
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use Test::More tests => 4;
+use Test::More tests => 5;
 
 BEGIN {
     use Net::OAuth;
@@ -35,5 +35,24 @@
     	},
 );
 
+$request->sign;
 
-is($request->to_url(), 'https://photos.example.net/request_token?foo=this%20value%20contains%20spaces&oauth_consumer_key=dpf43f3p2l4k3l03&oauth_nonce=hsu94j3884jdopsl&oauth_signature=&oauth_signature_method=PLAINTEXT&oauth_timestamp=1191242090&oauth_version=1.0');
+is($request->to_url(), 'https://photos.example.net/request_token?foo=this%20value%20contains%20spaces&oauth_consumer_key=dpf43f3p2l4k3l03&oauth_nonce=hsu94j3884jdopsl&oauth_signature=kd94hf93k423kf44%26&oauth_signature_method=PLAINTEXT&oauth_timestamp=1191242090&oauth_version=1.0');
+
+
+# https://rt.cpan.org/Ticket/Display.html?id=47369
+# Make sure signature works without oauth_version
+$request = Net::OAuth->request('request_token')->from_hash(
+  {
+      "oauth_signature" => "lcdJGdH4NRntuelnX+pAoxtIcLY=",
+      "oauth_timestamp" => "1246037243",
+      "oauth_nonce" => "288f21",
+      "oauth_consumer_key" => "myKey",
+      "oauth_signature_method" => "HMAC-SHA1"  
+  },
+  consumer_secret => 'mySecret',
+  request_method => 'POST',
+  request_url => 'http://localhost/provider/request-token.cgi',
+);
+
+ok($request->verify);




More information about the Pkg-perl-cvs-commits mailing list