mirror of
https://github.com/clearml/clearml-server
synced 2025-01-31 10:56:48 +00:00
Add missing login.logout endpoint
This commit is contained in:
parent
8ebc334889
commit
9beefa7473
@ -93,3 +93,19 @@ supported_modes {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logout {
|
||||
authorize: false
|
||||
allow_roles = [ "*" ]
|
||||
"2.13" {
|
||||
description: """ Logout (including SSO, if used)) """
|
||||
request {
|
||||
type: object
|
||||
additionalProperties: false
|
||||
}
|
||||
response {
|
||||
type: object
|
||||
additionalProperties: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,14 +41,12 @@ def login(call: APICall, *_, **__):
|
||||
)
|
||||
|
||||
# Add authorization cookie
|
||||
call.result.cookies[
|
||||
config.get("apiserver.auth.session_auth_cookie_name")
|
||||
] = call.result.data_model.token
|
||||
call.result.set_auth_cookie(call.result.data_model.token)
|
||||
|
||||
|
||||
@endpoint("auth.logout", min_version="2.2")
|
||||
def logout(call: APICall, *_, **__):
|
||||
call.result.cookies[config.get("apiserver.auth.session_auth_cookie_name")] = None
|
||||
call.result.set_auth_cookie(None)
|
||||
|
||||
|
||||
@endpoint(
|
||||
|
@ -1,5 +1,3 @@
|
||||
from jsonmodels.fields import BoolField
|
||||
|
||||
from apiserver.apimodels.login import (
|
||||
GetSupportedModesRequest,
|
||||
GetSupportedModesResponse,
|
||||
@ -35,3 +33,8 @@ def supported_modes(call: APICall, _, __: GetSupportedModesRequest):
|
||||
),
|
||||
authenticated=call.auth is not None,
|
||||
)
|
||||
|
||||
|
||||
@endpoint("login.logout", min_version="2.13")
|
||||
def logout(call: APICall, _, __):
|
||||
call.result.set_auth_cookie(None)
|
||||
|
Loading…
Reference in New Issue
Block a user