diff options
author | Joar Wandborg <git@wandborg.com> | 2012-09-15 15:25:26 +0200 |
---|---|---|
committer | Joar Wandborg <git@wandborg.com> | 2012-09-15 15:25:26 +0200 |
commit | 42c837523e5ac70a03fb310dbb15bec03d4108cd (patch) | |
tree | 08c5b454065e7823adc10fc1a6cd4d919362b3c3 /mediagoblin/plugins/oauth/__init__.py | |
parent | a062149e90731cfd730d8a539a32354065a8c9e8 (diff) | |
download | mediagoblin-42c837523e5ac70a03fb310dbb15bec03d4108cd.tar.lz mediagoblin-42c837523e5ac70a03fb310dbb15bec03d4108cd.tar.xz mediagoblin-42c837523e5ac70a03fb310dbb15bec03d4108cd.zip |
Added /api/entries view
Diffstat (limited to 'mediagoblin/plugins/oauth/__init__.py')
-rw-r--r-- | mediagoblin/plugins/oauth/__init__.py | 22 |
1 files changed, 2 insertions, 20 deletions
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 |