Description
The plan would be to use David Larlet's OAuth plus, and keep it as an external dependency for anyone requiring OAuth support.
See: https://bitbucket.org/david/django-oauth-plus/overview
At least as a first pass this oughta be pretty easy - most of the OAuth stuff is just down to oauth-plus to deal with and you only need to tie in the very last leg.
You'll want to start off looking at examples/provider in oauth-plus. You'll see the 'outh_providers.urls' views listed in there. Those don't need to tie in at all to begin with. They'll just need to be unprotected un-api'ed views that just work exactly as they do already.
(At some point it'd be really great to tie them in with the auto-documenting API - that'd really really improve the ease of use I think.)
So the part you do need to tie in is CheckOAuth. With oauth-plus you'd normally apply that check to a view as a simple decorator, and it'd ensure that:
- The request is signed with a valid OAuth token
- The OAuth tokens 'name' matches the view name (I think that'd right.)
We'll prob want pretty much the same thing eg.
- A .scope attribute gets put on any Resource you want to protect with OAuth.
- The OAuthAuthenticator gets added to the Resource's authenticators.
- The OAuthAuthenticator.authenticate(request) method uses CheckOAuth (or some equivalent) to ensure the token is valid and the token's name matches the Resource's 'scope', or raises an HttpException (PERMISSION DENIED).
I think it's that simple. (?)