From 42c837523e5ac70a03fb310dbb15bec03d4108cd Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Sat, 15 Sep 2012 15:25:26 +0200 Subject: Added /api/entries view --- mediagoblin/plugins/oauth/__init__.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'mediagoblin/plugins/oauth/__init__.py') diff --git a/mediagoblin/plugins/oauth/__init__.py b/mediagoblin/plugins/oauth/__init__.py index 04aa7815..95919728 100644 --- a/mediagoblin/plugins/oauth/__init__.py +++ b/mediagoblin/plugins/oauth/__init__.py @@ -23,6 +23,7 @@ from webob import exc from mediagoblin.tools import pluginapi from mediagoblin.tools.response import render_to_response from mediagoblin.plugins.oauth.models import OAuthToken +from mediagoblin.plugins.api.tools import Auth _log = logging.getLogger(__name__) @@ -45,26 +46,7 @@ def setup_plugin(): pluginapi.register_template_path(os.path.join(PLUGIN_DIR, 'templates')) -class OAuthAuth(object): - ''' - An object with two significant methods, 'trigger' and 'run'. - - Using a similar object to this, plugins can register specific - authentication logic, for example the GET param 'access_token' for OAuth. - - - trigger: Analyze the 'request' argument, return True if you think you - can handle the request, otherwise return False - - run: The authentication logic, set the request.user object to the user - you intend to authenticate and return True, otherwise return False. - - If run() returns False, an HTTP 403 Forbidden error will be shown. - - You may also display custom errors, just raise them within the run() - method. - ''' - def __init__(self): - pass - +class OAuthAuth(Auth): def trigger(self, request): return True -- cgit v1.2.3