[Jifty-commit] r5155 - in jifty/trunk: . lib/Jifty/Plugin lib/Jifty/Plugin/OAuth/Action t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth

Jifty commits jifty-commit at lists.jifty.org
Thu Feb 21 00:11:46 EST 2008


Author: sartak
Date: Thu Feb 21 00:11:14 2008
New Revision: 5155

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Plugin/OAuth.pm
   jifty/trunk/lib/Jifty/Plugin/OAuth/Action/AuthorizeRequestToken.pm
   jifty/trunk/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/Test.pm
   jifty/trunk/t/TestApp-Plugin-OAuth/t/03-authorize.t

Log:
 r51988 at onn:  sartak | 2008-02-21 00:10:54 -0500
 OAuth: Better allow/deny notifications


Modified: jifty/trunk/lib/Jifty/Plugin/OAuth.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OAuth.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/OAuth.pm	Thu Feb 21 00:11:14 2008
@@ -14,7 +14,6 @@
         my $right  = shift;
 
         # not oauthed? usual rules
-        warn $record->current_user->id;
         $record->current_user->is_oauthed
             or return 'ignore';
 

Modified: jifty/trunk/lib/Jifty/Plugin/OAuth/Action/AuthorizeRequestToken.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OAuth/Action/AuthorizeRequestToken.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/OAuth/Action/AuthorizeRequestToken.pm	Thu Feb 21 00:11:14 2008
@@ -98,11 +98,13 @@
             use_limit => $self->inflate_use_limit,
         });
 
-        $self->result->message("Allowing " . $token->consumer->name . " to access your stuff.");
+        my $right = $self->argument_value('can_write') ? "read and write" : "read";
+
+        $self->result->message("Allowing " . $token->consumer->name . " to $right your data for ". $self->argument_value('use_limit') .".");
     }
     else {
         $token->delete;
-        $self->result->message("Denying " . $token->consumer->name . " the right to access your stuff.");
+        $self->result->message("Denying " . $token->consumer->name . " the right to access your data.");
     }
 
     return 1;

Modified: jifty/trunk/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/Test.pm
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/Test.pm	(original)
+++ jifty/trunk/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/Test.pm	Thu Feb 21 00:11:14 2008
@@ -95,6 +95,11 @@
         );
 
         if ($params_in eq 'method') {
+            # avoid Encode complaining about undef
+            for (values %params) {
+                defined or $_ = '';
+            }
+
             my $content = Jifty->web->query_string(%params);
             $req->header('Content-type' => 'application/x-www-form-urlencoded');
             $req->content($content);
@@ -240,7 +245,7 @@
     ::fail($error), return if $error;
 
     my $name = $token_obj->consumer->name;
-    $umech->content_contains("Allowing $name to access your stuff");
+    $umech->content_contains("Allowing $name to read your data for 1 hour.");
 }
 
 sub deny_ok {
@@ -250,7 +255,7 @@
     ::fail($error), return if $error;
 
     my $name = $token_obj->consumer->name;
-    $umech->content_contains("Denying $name the right to access your stuff");
+    $umech->content_contains("Denying $name the right to access your data.");
 }
 
 sub _authorize_request_token {

Modified: jifty/trunk/t/TestApp-Plugin-OAuth/t/03-authorize.t
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-OAuth/t/03-authorize.t	(original)
+++ jifty/trunk/t/TestApp-Plugin-OAuth/t/03-authorize.t	Thu Feb 21 00:11:14 2008
@@ -147,7 +147,7 @@
 $umech->form_number(1);
 $umech->click_button(value => 'Deny');
 
-$umech->content_contains("Denying FooBar Industries the right to access your stuff");
+$umech->content_contains("Denying FooBar Industries the right to access your data.");
 $umech->content_contains("click here");
 $umech->content_contains("http://foo.bar.example.com?oauth_token=" . $token_obj->token);
 $umech->content_contains("To return to");
@@ -162,7 +162,7 @@
 $umech->form_number(1);
 $umech->click_button(value => 'Allow');
 
-$umech->content_contains("Allowing FooBar Industries to access your stuff");
+$umech->content_contains("Allowing FooBar Industries to read your data for 1 hour.");
 $umech->content_contains("click here");
 $umech->content_contains("http://foo.bar.example.com?oauth_token=" . $token_obj->token);
 $umech->content_contains("To return to");
@@ -176,7 +176,7 @@
 $umech->fill_in_action_ok($umech->moniker_for('TestApp::Plugin::OAuth::Action::AuthorizeRequestToken'), token => $token_obj->token);
 $umech->click_button(value => 'Deny');
 
-$umech->content_contains("Denying FooBar Industries the right to access your stuff");
+$umech->content_contains("Denying FooBar Industries the right to access your data.");
 $umech->content_contains("click here");
 $umech->content_contains("http://google.com?oauth_token=" . $token_obj->token);
 $umech->content_contains("To return to");
@@ -191,7 +191,7 @@
 $umech->form_number(1);
 $umech->click_button(value => 'Deny');
 
-$umech->content_contains("Denying FooBar Industries the right to access your stuff");
+$umech->content_contains("Denying FooBar Industries the right to access your data.");
 $umech->content_contains("click here");
 my $token = $token_obj->token;
 $umech->content_like(qr{http://google\.com/\?foo=bar&(?:amp;|#38;)?oauth_token=$token});


More information about the Jifty-commit mailing list