Permalink
Browse files

Added module to support generic OAuth 1.0a authentication. Work still…

… needs to be done, but twitter functionality is present
  • Loading branch information...
1 parent 46dc63a commit c7ecce553796d587f4f2006499b3f4eadd85d4fd @solargroovy solargroovy committed Jul 7, 2011
View
@@ -52,6 +52,7 @@ use Kynetx::Console qw(:all);
use Kynetx::Version qw(:all);
use Kynetx::Configure qw(:all);
use Kynetx::Directives;
+use Kynetx::Modules::OAuthModule;
use constant DEFAULT_TEMPLATE_DIR => Kynetx::Configure::get_config('DEFAULT_TEMPLATE_DIR');
@@ -129,6 +130,10 @@ sub handler {
Kynetx::Modules::PDS::process_auth_callback($r, $method, $rid);
$r->status(Apache2::Const::REDIRECT);
return Apache2::Const::REDIRECT;
+ } elsif ($method eq 'oauth_callback') {
+ my $st = Kynetx::Modules::OAuthModule::oauth_callback_handler($r,$method,$rid);
+ $r->status($st);
+ return $st;
} elsif($method eq 'foo' ) {
my $uniq = int(rand 999999999);
$r->content_type('text/html');
View
@@ -68,6 +68,7 @@ use constant SEARCH_INDEX_FILE => 'searchindex.yml';
use constant FACEBOOK => '/web/etc/Facebook/facebook.yml';
use constant MODULES => '/web/etc/module_config.yml';
use constant SELENIUM => 'runtime_test/config/perl_selenium.yml';
+use constant OAUTH_CONFIG_FILE => '/web/etc/oauth.yml';
our $config;
@@ -120,6 +121,8 @@ sub configure {
# Selenium tests
$config->{'SELENIUM'} = read_config($config->{'KOBJ_ROOT'} .'/' . SELENIUM);
+ # OAuth URLS
+ $config->{'OAUTH'} = read_config(OAUTH_CONFIG_FILE);
return 1;
}
View
@@ -87,6 +87,7 @@ use Kynetx::Modules::URI;
use Kynetx::Modules::Address;
use Kynetx::Modules::PDS;
use Kynetx::Modules::This2That;
+use Kynetx::Modules::OAuthModule;
our $name_prefix = '@@module_';
@@ -370,6 +371,14 @@ sub eval_module {
} else {
$val = Kynetx::Modules::PDS::run_function( $req_info,$rule_env,$session,$rule_name,$function,$args );
}
+ } elsif ( $source eq 'oauthmodule' ) {
+ $preds = Kynetx::Modules::OAuthModule::get_predicates();
+ if ( defined $preds->{$function} ) {
+ $val = $preds->{$function}->( $req_info, $rule_env, $args );
+ $val ||= 0;
+ } else {
+ $val = Kynetx::Modules::OAuthModule::run_function( $req_info,$rule_env,$session,$rule_name,$function,$args );
+ }
} elsif ( $source eq 'keys' ) {
# return the right key if it exists
# my $ruleset = Kynetx::Repository::get_rules_from_repository($req_info->{'rid'}, $req_info);
Oops, something went wrong.

0 comments on commit c7ecce5

Please sign in to comment.