Skip to content

Commit

Permalink
Merge pull request #326 from CoolGoose/patch-2
Browse files Browse the repository at this point in the history
fix method params and clarify oauth_protected
  • Loading branch information
thedrow committed Jul 19, 2015
2 parents e1191fa + 4f913c6 commit 3df94af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/oauth1/server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,13 @@ Let's define a decorator we can use to protect the views.
def wrapper(f):
@functools.wraps(f)
def verify_oauth(*args, **kwargs):
validator = OAuthValidator() # your validator class
provider = ResourceEndpoint(validator)
v, r = provider.validate_protected_resource_request(request.url,
http_method=request.method,
body=request.data,
headers=request.headers,
valid_realms=realms or [])
realms=realms or [])
if v:
return f(*args, **kwargs)
else:
Expand Down

0 comments on commit 3df94af

Please sign in to comment.