SealSkin

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) -> str

Return the name of the persistent home directory a session mounts, or nothing for a cleanroom.

paramdatadict[str, Any]

Returns

str
funcsession_info(session_id, data, for_owner=True) -> ActiveSessionInfo

Build the session summary returned to clients.

paramsession_idstr

Session id.

paramdatadict[str, Any]

Session record.

paramfor_ownerbool
= True

Use the collaboration controller URL for room sessions.

Returns

app.models.ActiveSessionInfo

The ActiveSessionInfo.

funcget_my_sessions(request, user=Depends(verify_token)) -> list[ActiveSessionInfo]

List the calling user's sessions on every node, newest first.

paramrequestRequest
paramuserdict[str, Any]
= Depends(verify_token)

Returns

list[app.models.ActiveSessionInfo]
funcstop_my_session(session_id, user=Depends(verify_token)) -> Response

Stop one of the calling user's sessions.

paramsession_idstr
paramuserdict[str, Any]
= Depends(verify_token)

Returns

fastapi.Response
funcsession_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_idstr
paramfreshbool
= False
paramuserdict[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_idstr
paramdecrypted_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.UUID
paramrequestRequest

Returns

tuple[str, dict[str, typing.Any]]
funcsession_manifest(session_id, request) -> JSONResponse

Describe 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.UUID
paramrequestRequest

Returns

fastapi.responses.JSONResponse
funcsession_icon(session_id, request) -> Response

Answer a session page's icon with its application's.

paramsession_iduuid.UUID
paramrequestRequest

Returns

fastapi.Response
func_known_collab_token(data, token) -> str | None

Return the stored copy of a collaboration token, or None if unknown.

paramdatadict[str, Any]

Session record.

paramtokenstr | None

Token supplied by the client.

Returns

str | None

The controller or viewer token as held in the session record.

funcinitial_session_auth(session_id, request) -> Response

Exchange 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.UUID
paramrequestRequest

Returns

fastapi.Response