Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
3aa86dee
Verified
Commit
3aa86dee
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Fix typos
parent
a64f45d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!759
Resolve "[OAuth] Allow limiting scopes per application"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/util/auth_helpers.py
+3
-3
3 additions, 3 deletions
aleksis/core/util/auth_helpers.py
with
3 additions
and
3 deletions
aleksis/core/util/auth_helpers.py
+
3
−
3
View file @
3aa86dee
...
...
@@ -10,7 +10,7 @@ from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
from
oauth2_provider.models
import
AbstractApplication
from
oauth2_provider.oauth2_validators
import
OAuth2Validator
from
oauth2_provider.scopes
import
BaseScopes
from
oauth2_provider.views.mixin
import
(
from
oauth2_provider.views.mixin
s
import
(
ClientProtectedResourceMixin
as
_ClientProtectedResourceMixin
,
)
from
oauthlib.common
import
Request
as
OauthlibRequest
...
...
@@ -112,7 +112,7 @@ class AppScopes(BaseScopes):
scopes
+=
app
.
get_available_scopes
()
# Filter by allowed scopes of requesting application
if
application
and
application
.
allowed_scopes
:
scopes
=
list
(
filter
(
lambda
scope
:
scope
in
application
.
allo
e
wd_scopes
,
scopes
))
scopes
=
list
(
filter
(
lambda
scope
:
scope
in
application
.
allow
e
d_scopes
,
scopes
))
return
scopes
def
get_default_scopes
(
...
...
@@ -127,7 +127,7 @@ class AppScopes(BaseScopes):
scopes
+=
app
.
get_default_scopes
()
# Filter by allowed scopes of requesting application
if
application
and
application
.
allowed_scopes
:
scopes
=
list
(
filter
(
lambda
scope
:
scope
in
application
.
allo
e
wd_scopes
,
scopes
))
scopes
=
list
(
filter
(
lambda
scope
:
scope
in
application
.
allow
e
d_scopes
,
scopes
))
return
scopes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment