Skip to content

Commit

Permalink
Extend Client.validate_scopes() to take request argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Андрей Парамонов committed Oct 23, 2018
1 parent 3735210 commit 24f4358
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .eggs/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins.

This directory caches those eggs to prevent repeated downloads.

However, it is safe to delete this directory.

2 changes: 1 addition & 1 deletion flask_oauthlib/provider/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ def validate_scopes(self, client_id, scopes, client, request,
*args, **kwargs):
"""Ensure the client is authorized access to requested scopes."""
if hasattr(client, 'validate_scopes'):
return client.validate_scopes(scopes)
return client.validate_scopes(scopes, request, *args, **kwargs)
return set(client.default_scopes).issuperset(set(scopes))

def validate_user(self, username, password, client, request,
Expand Down

0 comments on commit 24f4358

Please sign in to comment.