sessions
Session management for users plus the session proxy entry point.
attributelogger= logging.getLogger(__name__)attributerouter= APIRouter(prefix='/api/sessions', dependencies=[Depends(verify_token)], route_class=EncryptedRoute)attributeproxy_router= APIRouter()func_home_of(data) -> strReturn the name of the persistent home directory a session mounts, or nothing for a cleanroom.
paramdatadict[str, Any]Returns
strfuncsession_info(session_id, data, for_owner=True) -> ActiveSessionInfoBuild the session summary returned to clients.
paramsession_idstrSession id.
paramdatadict[str, Any]Session record.
paramfor_ownerbool= TrueUse the collaboration controller URL for room sessions.
Returns
app.models.ActiveSessionInfoThe ActiveSessionInfo.
funcget_my_sessions(request, user=Depends(verify_token)) -> list[ActiveSessionInfo]List the calling user's sessions on every node, newest first.
paramrequestRequestparamuserdict[str, Any]= Depends(verify_token)Returns
list[app.models.ActiveSessionInfo]funcstop_my_session(session_id, user=Depends(verify_token)) -> ResponseStop one of the calling user's sessions.
paramsession_idstrparamuserdict[str, Any]= Depends(verify_token)Returns
fastapi.Responsefuncsession_screenshot(session_id, fresh=False, user=Depends(verify_token)) -> dict[str, Any]A thumbnail of one of the calling user's sessions, as screenshots.thumbnail makes it; fresh takes a new one.
paramsession_idstrparamfreshbool= Falseparamuserdict[str, Any]= Depends(verify_token)Returns
dict[str, typing.Any]funcsend_file_to_session(session_id, decrypted_body=Depends(get_decrypted_request_body), user=Depends(verify_token)) -> dict[str, str]Place an uploaded file into a running session's files directory.
paramsession_idstrparamdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)paramuserdict[str, Any]= Depends(verify_token)Returns
dict[str, str]func_session_of_request(session_id, request) -> tuple[str, dict[str, Any]]Return a running session the request's cookie or token lets its page in to.
paramsession_iduuid.UUIDparamrequestRequestReturns
tuple[str, dict[str, typing.Any]]funcsession_manifest(session_id, request) -> JSONResponseDescribe a running session's application for installing it, as its own address does.
The page of a session served by this node asks for its manifest here, so
installing from inside a desktop installs the application's address with
the options the session runs with (see entry.app_manifest).
paramsession_iduuid.UUIDparamrequestRequestReturns
fastapi.responses.JSONResponsefuncsession_icon(session_id, request) -> ResponseAnswer a session page's icon with its application's.
paramsession_iduuid.UUIDparamrequestRequestReturns
fastapi.Responsefunc_known_collab_token(data, token) -> str | NoneReturn the stored copy of a collaboration token, or None if unknown.
paramdatadict[str, Any]Session record.
paramtokenstr | NoneToken supplied by the client.
Returns
str | NoneThe controller or viewer token as held in the session record.
funcinitial_session_auth(session_id, request) -> ResponseExchange the one-time access token for the session cookie and redirect.
The first exchange settles the origin the session is served from (see
on_session_origin); a collaboration session of a key-file client stays
on the shared origin, where its room frames it. With session_isolation
a session of a web sign-in, room or not, is served on its own origin
alone; without, on the shared origin, by this node's copy of its web
client, and never by its container.
paramsession_iduuid.UUIDparamrequestRequestReturns
fastapi.Response