entry
The address of an application, /app/<app id>/, which opens the user's session of it.
Landing on the address signs the user in where nobody is, then takes the
browser to the oldest running session of the application that matches the
address's options, or launches one; the page under client/src/ui/open.html
does the asking. The options are the launcher's, as a query: home, gpu,
room, lang, wayland, and where. The address is what a bookmark or an
installed web app keeps, so its manifest names the address, options and all,
as both id and start_url, and a browser installs each distinct address as
an application of its own.
attributelogger= logging.getLogger(__name__)attributerouter= APIRouter(include_in_schema=False)attributeAPP_ID= re.compile('[a-zA-Z0-9_-]{1,64}')attributeOPTIONS= ('home', 'gpu', 'room', 'lang', 'wayland', 'where')funcclean_options(params) -> dict[str, str]Keep the options an address may carry, with the flags normalized.
paramparamsAnyReturns
dict[str, str]funcaddress(app_id, options) -> strReturn the address of an application with options, as the manifest and a bookmark keep it.
paramapp_idstrparamoptionsdict[str, str]Returns
strfuncmanifest_for(app, options, icon) -> dict[str, Any]Describe an application with options for installing it as a web app of its own.
paramappInstalledAppThe application.
paramoptionsdict[str, str]The address's options (see clean_options).
paramiconstrThe path the icon is served at.
Returns
dict[str, typing.Any]funcicon_response(app) -> ResponseAnswer with an application's icon: its uploaded one, a redirect to the one its store names, or the brand's logo.
paramappInstalledAppReturns
fastapi.responses.Responsefunc_app(app_id) -> InstalledAppReturn the installed application an address names.
paramapp_idstrReturns
app.models.InstalledAppfunc_open_to(app, user) -> InstalledAppReturn app when user may launch it.
paramappInstalledAppparamuserdict[str, Any]Returns
app.models.InstalledAppfuncapp_address_slash(app_id, request) -> RedirectResponseSend an address written without its trailing slash to the one with it, options kept.
paramapp_idstrparamrequestRequestReturns
fastapi.responses.RedirectResponsefuncapp_address(app_id) -> HTMLResponseServe the page that opens the application; it tells the visitor itself when the application is not theirs.
paramapp_idstrReturns
fastapi.responses.HTMLResponsefuncapp_manifest(app_id, request, user=Depends(verify_token)) -> JSONResponseDescribe the application with the address's options for installing it.
paramapp_idstrparamrequestRequestparamuserdict[str, Any]= Depends(verify_token)Returns
fastapi.responses.JSONResponsefuncapp_icon(app_id) -> ResponseAnswer the application's icon, which an installing browser may ask for without the sign-in.
paramapp_idstrReturns
fastapi.responses.Response