SealSkin

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.

paramparamsAny

Returns

dict[str, str]
funcaddress(app_id, options) -> str

Return the address of an application with options, as the manifest and a bookmark keep it.

paramapp_idstr
paramoptionsdict[str, str]

Returns

str
funcmanifest_for(app, options, icon) -> dict[str, Any]

Describe an application with options for installing it as a web app of its own.

paramappInstalledApp

The application.

paramoptionsdict[str, str]

The address's options (see clean_options).

paramiconstr

The path the icon is served at.

Returns

dict[str, typing.Any]
funcicon_response(app) -> Response

Answer with an application's icon: its uploaded one, a redirect to the one its store names, or the brand's logo.

paramappInstalledApp

Returns

fastapi.responses.Response
func_app(app_id) -> InstalledApp

Return the installed application an address names.

paramapp_idstr

Returns

app.models.InstalledApp
func_open_to(app, user) -> InstalledApp

Return app when user may launch it.

paramappInstalledApp
paramuserdict[str, Any]

Returns

app.models.InstalledApp
funcapp_address_slash(app_id, request) -> RedirectResponse

Send an address written without its trailing slash to the one with it, options kept.

paramapp_idstr
paramrequestRequest

Returns

fastapi.responses.RedirectResponse
funcapp_address(app_id) -> HTMLResponse

Serve the page that opens the application; it tells the visitor itself when the application is not theirs.

paramapp_idstr

Returns

fastapi.responses.HTMLResponse
funcapp_manifest(app_id, request, user=Depends(verify_token)) -> JSONResponse

Describe the application with the address's options for installing it.

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

Returns

fastapi.responses.JSONResponse
funcapp_icon(app_id) -> Response

Answer the application's icon, which an installing browser may ask for without the sign-in.

paramapp_idstr

Returns

fastapi.responses.Response