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
7f23845d
Commit
7f23845d
authored
3 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Plain Diff
Merge branch '513-broken-get_-_scopes-api-for-oauth' into 'master'
Resolve "Broken get_*_scopes API for OAuth" Closes
#513
See merge request
!721
parents
eabf097d
09397b9f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!721
Resolve "Broken get_*_scopes API for OAuth"
Pipeline
#34165
passed
3 years ago
Stage: test
Stage: build
Stage: publish
Stage: docker
Stage: deploy
Pipeline: AlekSIS
#34170
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
aleksis/core/apps.py
+2
-1
2 additions, 1 deletion
aleksis/core/apps.py
aleksis/core/util/apps.py
+7
-4
7 additions, 4 deletions
aleksis/core/util/apps.py
with
10 additions
and
5 deletions
CHANGELOG.rst
+
1
−
0
View file @
7f23845d
...
...
@@ -18,6 +18,7 @@ Fixed
~~~~~
* Show link to imprint in footer
* Fix API for adding OAuth scopes in AppConfigs
Removed
~~~~~~~
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/apps.py
+
2
−
1
View file @
7f23845d
...
...
@@ -138,7 +138,8 @@ class CoreConfig(AppConfig):
# Save the associated person to pick up defaults
user
.
person
.
save
()
def
get_all_scopes
(
self
)
->
dict
[
str
,
str
]:
@classmethod
def
get_all_scopes
(
cls
)
->
dict
[
str
,
str
]:
scopes
=
{
"
read
"
:
"
Read anything the resource owner can read
"
,
"
write
"
:
"
Write anything the resource owner can write
"
,
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/util/apps.py
+
7
−
4
View file @
7f23845d
...
...
@@ -217,22 +217,25 @@ class AppConfig(django.apps.AppConfig):
"""
pass
def
get_all_scopes
(
self
)
->
dict
[
str
,
str
]:
@classmethod
def
get_all_scopes
(
cls
)
->
dict
[
str
,
str
]:
"""
Return all OAuth scopes and their descriptions for this app.
"""
return
{}
@classmethod
def
get_available_scopes
(
self
,
cls
,
application
:
Optional
[
"
AbstractApplication
"
]
=
None
,
request
:
Optional
[
HttpRequest
]
=
None
,
*
args
,
**
kwargs
,
)
->
list
[
str
]:
"""
Return a list of all OAuth scopes available to the request and application.
"""
return
list
(
self
.
get_all_scopes
().
keys
())
return
list
(
cls
.
get_all_scopes
().
keys
())
@classmethod
def
get_default_scopes
(
self
,
cls
,
application
:
Optional
[
"
AbstractApplication
"
]
=
None
,
request
:
Optional
[
HttpRequest
]
=
None
,
*
args
,
...
...
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