r38708 - 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/11-spec-1.0a.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Fri Jun 26 14:15:00 UTC 2009


Author: gregoa
Date: Fri Jun 26 14:14:52 2009
New Revision: 38708

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=38708
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/11-spec-1.0a.t

Modified: trunk/libnet-oauth-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/Changes?rev=38708&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/Changes (original)
+++ trunk/libnet-oauth-perl/Changes Fri Jun 26 14:14:52 2009
@@ -61,3 +61,9 @@
 
 0.16   Mon, 15 Jun 2009 18:36:17 UTC
   Added support for OAuth 1.0A - see POD section 'OAUTH 1.0A' for details - Net::OAuth still defaults to 1.0 for now
+
+0.17   Thu, 25 Jun 2009 16:59:50 UTC
+  Fixed https://rt.cpan.org/Public/Bug/Display.html?id=47293 - Message->from_hash was validating using the incorrect class, causing a 'Parameter X not valid for a message of type Y' message on V1.0a messages.  Thanks Jeff Dairiki!
+
+0.18   Thu, 25 Jun 2009 17:18:04 UTC
+    Fixed accidental (though probably harmless) regression in 0.17

Modified: trunk/libnet-oauth-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/META.yml?rev=38708&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/META.yml (original)
+++ trunk/libnet-oauth-perl/META.yml Fri Jun 26 14:14:52 2009
@@ -1,6 +1,6 @@
 ---
 name: Net-OAuth
-version: 0.16
+version: 0.18
 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.16
+    version: 0.18
   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.16
+    version: 0.18
   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=38708&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/debian/changelog (original)
+++ trunk/libnet-oauth-perl/debian/changelog Fri Jun 26 14:14:52 2009
@@ -1,3 +1,9 @@
+libnet-oauth-perl (0.18-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Fri, 26 Jun 2009 16:14:04 +0200
+
 libnet-oauth-perl (0.16-1) unstable; urgency=low
 
   [ Nathan Handler ]

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=38708&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/lib/Net/OAuth.pm (original)
+++ trunk/libnet-oauth-perl/lib/Net/OAuth.pm Fri Jun 26 14:14:52 2009
@@ -6,7 +6,7 @@
 sub PROTOCOL_VERSION_1_0() {1}
 sub PROTOCOL_VERSION_1_0A() {1.001}
 
-our $VERSION = '0.16';
+our $VERSION = '0.18';
 our $SKIP_UTF8_DOUBLE_ENCODE_CHECK = 0;
 our $PROTOCOL_VERSION = PROTOCOL_VERSION_1_0;
 

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=38708&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/lib/Net/OAuth/Message.pm (original)
+++ trunk/libnet-oauth-perl/lib/Net/OAuth/Message.pm Fri Jun 26 14:14:52 2009
@@ -63,7 +63,7 @@
     my $class = shift;
     my $params = shift;
     my $protocol_version = $params->{protocol_version} || $Net::OAuth::PROTOCOL_VERSION;
-    if (defined $protocol_version and $protocol_version == Net::OAuth::PROTOCOL_VERSION_1_0A) {
+    if (defined $protocol_version and $protocol_version == Net::OAuth::PROTOCOL_VERSION_1_0A and $class !~ /\::V1_0A\::/) {
         (my $versioned_class = $class) =~ s/::(\w+)$/::V1_0A::$1/;
         if ($versioned_class->require) {
             return $versioned_class;
@@ -240,11 +240,15 @@
 		die 'Expected a hash!';
 	}
     my %api_params = @_;
+    # need to do this earlier than Message->new because
+    # the below validation step needs the correct class.
+    # https://rt.cpan.org/Public/Bug/Display.html?id=47293
+    $class = get_versioned_class($class, \%api_params);
     my %msg_params;
     foreach my $k (keys %$hash) {
         if ($k =~ s/$OAUTH_PREFIX_RE//) {
             if (!grep ($_ eq $k, @{$class->all_message_params})) {
-                die "Parameter ". OAUTH_PREFIX ."$k not valid for a message of type $class\n";
+               die "Parameter ". OAUTH_PREFIX ."$k not valid for a message of type $class\n";
             }
             else {
                 $msg_params{$k} = $hash->{OAUTH_PREFIX . $k};

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=38708&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/lib/Net/OAuth/Request.pm (original)
+++ trunk/libnet-oauth-perl/lib/Net/OAuth/Request.pm Fri Jun 26 14:14:52 2009
@@ -5,7 +5,7 @@
 use URI;
 use URI::QueryParam;
 
-our $VERSION = '0.16';
+our $VERSION = '0.18';
 
 __PACKAGE__->mk_classdata(required_message_params => [qw/
     consumer_key

Modified: trunk/libnet-oauth-perl/t/11-spec-1.0a.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-oauth-perl/t/11-spec-1.0a.t?rev=38708&op=diff
==============================================================================
--- trunk/libnet-oauth-perl/t/11-spec-1.0a.t (original)
+++ trunk/libnet-oauth-perl/t/11-spec-1.0a.t Fri Jun 26 14:14:52 2009
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 25;
+use Test::More tests => 28;
 
 BEGIN {
     use Net::OAuth;
@@ -188,3 +188,23 @@
 is($request->signature_base_string, 'GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal');
 
 is($request->signature, 'tR3+Ty81lMeYAr/Fid0kMTYa/WM=');
+
+# Message->from_hash should validate the message using the correct class
+# https://rt.cpan.org/Public/Bug/Display.html?id=47293
+
+$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0;
+
+my $response = eval { Net::OAuth->response('request token')
+                ->from_post_body('oauth_token=abc&oauth_token_secret=def&oauth_callback_confirmed=true') };
+ok($@);
+
+$response = Net::OAuth->response('request token')
+                ->from_post_body('oauth_token=abc&oauth_token_secret=def&oauth_callback_confirmed=true',
+                    protocol_version => Net::OAuth::PROTOCOL_VERSION_1_0A
+                );
+ok($response);
+
+$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0A;
+$response = Net::OAuth->response('request token')
+                ->from_post_body('oauth_token=abc&oauth_token_secret=def&oauth_callback_confirmed=true');
+ok($response);




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