Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend_api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
videoag
backend_api
Commits
be08d6d9
Commit
be08d6d9
authored
Mar 3, 2024
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Added moderator logout
parent
f08ac0b8
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
api_specification.md
+17
-1
17 additions, 1 deletion
api_specification.md
src/api/authentication.py
+6
-0
6 additions, 0 deletions
src/api/authentication.py
src/api/routes/authentication.py
+8
-2
8 additions, 2 deletions
src/api/routes/authentication.py
with
31 additions
and
3 deletions
api_specification.md
+
17
−
1
View file @
be08d6d9
# Specification of the Web API for the Video-AG Website (v0.1
1
).
# Specification of the Web API for the Video-AG Website (v0.1
2
).
## Introduction
...
...
@@ -416,6 +416,18 @@ Also finishes the last authentication started with `/authentication/start`. If t
---
###### Request:
`POST /authentication/moderator_logout`
###### Response:
Only logs moderators out.
`200 OK`
if now logged out
---
### Objects
These routes allow moderators to change fields of objects. For most objects this is done indirectly. The API
...
...
@@ -928,6 +940,10 @@ Possible `error_code`:
## Changelog
### v0.12
*
`POST /authentication/moderator_logout`
### v0.11
*
Added Object Modification API
...
...
This diff is collapsed.
Click to expand it.
src/api/authentication.py
+
6
−
0
View file @
be08d6d9
...
...
@@ -264,6 +264,12 @@ def authenticate_fsmpi(username: str, password: str) -> {}:
return
get_user_info
()
def
logout_moderator
():
session
.
pop
(
"
user
"
,
None
)
session
.
pop
(
"
_csrf_token
"
,
None
)
session
.
permanent
=
False
def
__ldap_is_moderator
(
user_groups
:
[])
->
bool
:
for
group
in
server
.
config
[
"
LDAP_GROUPS
"
]:
if
group
in
user_groups
:
...
...
This diff is collapsed.
Click to expand it.
src/api/routes/authentication.py
+
8
−
2
View file @
be08d6d9
...
...
@@ -2,7 +2,7 @@ from flask import request
from
api.routes
import
*
from
api.authentication
import
(
is_lecture_authenticated
,
get_currently_authenticated_methods
,
authenticate_password
,
authenticate_fsmpi
,
authenticate_password
,
authenticate_fsmpi
,
logout_moderator
,
start_rwth_authentication
,
start_moodle_authentication
,
is_rwth_authentication_running
,
is_moodle_authentication_running
,
try_finish_running_authentication
,
...
...
@@ -16,7 +16,7 @@ def authentication_password():
username
:
str
=
json_request
.
get_string
(
"
username
"
,
max_length
=
128
)
password
:
str
=
json_request
.
get_string
(
"
password
"
,
max_length
=
128
)
authenticate_password
(
lecture_id
,
username
,
password
)
return
{}
return
None
@api_route
(
"
/authentication/fsmpi
"
,
[
"
POST
"
])
...
...
@@ -72,3 +72,9 @@ def authentication_status():
json_response
[
"
user_info
"
]
=
get_user_info
()
return
json_response
@api_route
(
"
/authentication/moderator_logout
"
,
[
"
POST
"
])
def
authentication_moderator_logout
():
logout_moderator
()
return
None
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