[Jifty-commit] r4351 - in jifty/trunk: lib/Jifty/Plugin/OAuth
lib/Jifty/Plugin/OAuth/Action lib/Jifty/Plugin/OAuth/Model
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Oct 31 17:15:52 EDT 2007
Author: sartak
Date: Wed Oct 31 17:15:50 2007
New Revision: 4351
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/OAuth/Action/AuthorizeRequestToken.pm
jifty/trunk/lib/Jifty/Plugin/OAuth/Dispatcher.pm
jifty/trunk/lib/Jifty/Plugin/OAuth/Model/AccessToken.pm
jifty/trunk/lib/Jifty/Plugin/OAuth/Model/RequestToken.pm
Log:
r44473 at onn: sartak | 2007-10-31 17:15:32 -0400
Whoops, committed in a subdirectory
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 Wed Oct 31 17:15:50 2007
@@ -39,7 +39,7 @@
my $request_token = Jifty::Plugin::OAuth::Model::RequestToken->new(current_user => Jifty::CurrentUser->superuser);
$request_token->load_by_cols(
token => $token,
- authorized => 'f',
+ authorized => '',
);
return $self->validation_error(token => "I don't know of that request token.") unless $request_token->id;
Modified: jifty/trunk/lib/Jifty/Plugin/OAuth/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OAuth/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OAuth/Dispatcher.pm Wed Oct 31 17:15:50 2007
@@ -14,6 +14,8 @@
on POST '/oauth/authorize' => \&authorize_post;
on POST '/oauth/access_token' => \&access_token;
+on '/oauth/authorized' => run { redirect '/oauth/authorize' };
+
=head2 abortmsg CODE, MSG
Helper function to abort with a debug message. Maybe should be factored into
@@ -101,7 +103,7 @@
if ($oauth_params{token}) {
my $request_token = Jifty::Plugin::OAuth::Model::RequestToken->new(current_user => Jifty::CurrentUser->superuser);
- $request_token->load_by_cols(token => $oauth_params{token}, authorized => 'f');
+ $request_token->load_by_cols(token => $oauth_params{token}, authorized => '');
if ($request_token->id) {
set consumer => $request_token->consumer;
Modified: jifty/trunk/lib/Jifty/Plugin/OAuth/Model/AccessToken.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OAuth/Model/AccessToken.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OAuth/Model/AccessToken.pm Wed Oct 31 17:15:50 2007
@@ -22,8 +22,13 @@
type is 'timestamp',
filters are 'Jifty::DBI::Filter::DateTime';
+ column token =>
+ type is 'varchar',
+ is required;
+
column secret =>
- type is 'varchar';
+ type is 'varchar',
+ is required;
column consumer =>
refers_to Jifty::Plugin::OAuth::Model::Consumer;
Modified: jifty/trunk/lib/Jifty/Plugin/OAuth/Model/RequestToken.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OAuth/Model/RequestToken.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OAuth/Model/RequestToken.pm Wed Oct 31 17:15:50 2007
@@ -20,7 +20,7 @@
column authorized =>
type is 'boolean',
- default is 'f';
+ default is '';
# kludge 2: this kind of plugin cannot yet casually refer_to app models
column authorized_by =>
@@ -31,9 +31,11 @@
refers_to Jifty::Plugin::OAuth::Model::Consumer,
is required;
+ # kludge 3: Jifty::DBI + SQLite = poor boolean handling
+ # so the empty string is the false value, 't' is the true value
column used =>
type is 'boolean',
- default is 'f';
+ default is '';
column token =>
type is 'varchar',
More information about the Jifty-commit
mailing list