From 24f4358d8b64031e0dbcfc69ba1ee6b7285b72e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=9F=D0=B0=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Tue, 23 Oct 2018 17:49:46 +0300 Subject: [PATCH 1/2] Extend Client.validate_scopes() to take request argument --- .eggs/README.txt | 6 ++++++ flask_oauthlib/provider/oauth2.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .eggs/README.txt diff --git a/.eggs/README.txt b/.eggs/README.txt new file mode 100644 index 00000000..5d016688 --- /dev/null +++ b/.eggs/README.txt @@ -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. + diff --git a/flask_oauthlib/provider/oauth2.py b/flask_oauthlib/provider/oauth2.py index d182f6ea..2bb84e79 100644 --- a/flask_oauthlib/provider/oauth2.py +++ b/flask_oauthlib/provider/oauth2.py @@ -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, From e3faff8012129bd1f33a528db2d06b942279e754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=9F=D0=B0=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Tue, 23 Oct 2018 17:53:35 +0300 Subject: [PATCH 2/2] Delete mistakenly committed file --- .eggs/README.txt | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .eggs/README.txt diff --git a/.eggs/README.txt b/.eggs/README.txt deleted file mode 100644 index 5d016688..00000000 --- a/.eggs/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -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. -