branding
The brand as the pages read it and as an administrator sets it.
The pictures are public: the logo is the favicon of the sign-in page, which
nobody is signed in to, and both are addressed by hash so a browser keeps
them. The record itself is read by signed-in users (GET /api/branding),
and written, with the pictures, by administrators under /api/admin/branding.
attributerouter= APIRouter(prefix='/api/branding')attributeuser_router= APIRouter(prefix='/api/branding', route_class=EncryptedRoute)attributeadmin_router= APIRouter(prefix='/api/admin/branding', dependencies=[Depends(verify_admin), Depends(routing.announce_changes)], route_class=EncryptedRoute)funcget_branding(user=Depends(verify_token)) -> BrandingViewReturn the brand with its pictures.
paramuserdict[str, Any]= Depends(verify_token)Returns
app.models.BrandingViewfunclogo() -> ResponseServe the uploaded logo.
Returns
fastapi.Responsefuncwallpaper() -> ResponseServe the uploaded wallpaper.
Returns
fastapi.Responsefuncwrite_branding(body=Depends(get_decrypted_request_body)) -> BrandingViewReplace the brand's record; the pictures stay.
parambodydict[str, Any]= Depends(get_decrypted_request_body)Returns
app.models.BrandingViewfuncreset_branding() -> BrandingViewRemove the record and the pictures, back to the defaults.
Returns
app.models.BrandingViewfuncupload_picture(kind, body=Depends(get_decrypted_request_body)) -> BrandingViewKeep an uploaded logo or wallpaper.
paramkindstrparambodydict[str, Any]= Depends(get_decrypted_request_body)Returns
app.models.BrandingViewfuncdelete_picture(kind) -> BrandingViewRemove the logo or the wallpaper.
paramkindstrReturns
app.models.BrandingView