mirror of
https://github.com/prusa3d/PrusaSlicer.git
synced 2026-11-26 23:29:07 +00:00
Reworks how the app chooses between Prusa Account with Prusa Connect and a self-hosted Prusa Connect on-premise server (Connect Local), and removes the service mode checks that the original work spread over the code. Account service - Preferences have two switches, enable_prusa_account and enable_connect_local. Both can be on. The hidden account_service setting holds the active one while both are enabled. - App::AccountServiceSwitcher is the one owner of a change: it ends the account, switches the service URLs and the server trust, starts the account of the new service and tells its listeners once per change. The account menu, the switch on the signed-out pages, the server setup and the welcome dialog call it; settings written by the Preferences go the same way. It asks before signing the person out. - The account button is shown while a service is enabled. With both it offers three states: Signed out, Prusa Account, Prusa Connect on-premise. With one it has sign in / sign out, as before. - The Connect tab is created again when the active service or its server changes, and reloads its page when the enabled services change. A removed tab is destroyed, once its web view is no longer being created, and leaves the account listeners. - The welcome dialog enables both services online and Connect Local only offline. The printer list has no Connect filter without a service. - The service is "Prusa Connect on-premise" in every text and ConnectLocal in the code (ServiceMode, AccountService, the connect_local_* getters, ConnectLocalCredential). Browser logic - BrowserLogicConnectPage is split: AbstractConnectPageLogic holds what the tab does for any service, BrowserLogicConnectPage shows Prusa Connect, BrowserLogicConnectLocalPage a Connect Local server with its setup, certificate flow and page session. - AbstractConnectRequestHandler gets its page authentication as an IConnectPageAuth: the access token for Prusa Connect, a page session cookie for Connect Local. - ConnectNavigationLock holds the navigation rules of the tab. Pages of the service are told by parsed URLs, not by a string prefix. The Connect Local tab lets the app's own pages through, so a failed load shows the error page. - The pairing events left AbstractBrowserLogic and WebViewDialog; the sign-in dialog logic listens to the account itself. User account - The pairing side is behind IPairingCommunication and IPairingListener; IUserAccountSessionListener is back to session events and the OAuth methods of IUserAccountCommunication are pure virtual again. - A refused Prusa Account token is refreshed only when it has expired. - An account the communication did not accept is not announced. - Sign in with a held but unconfirmed Connect Local credential checks that credential again and does not revoke it. A newly adopted credential is always verified. A page session refused for a replaced credential is asked for again. - The preset updater sends a token only for a Prusa Account. Printers and upload - ConnectPrinterService takes printer updates from an IConnectPrinterUpdates: MQTT for Prusa Connect, polling for Connect Local. A printer list refused with 401 is fetched again after the token refresh. - PrintHostPrusaConnectLocal uploads through the legacy team API, the only one Connect Local serves; PrintHostPrusaConnect keeps the REST flow. - An upload carries the URLs of the service it was started with and asks for the account's token before each request, so a service switch or a token refresh during a long upload does not break it. Server trust and global state - The trust of the Connect Local certificate lives in Biz::Network::ServerTrustStore, owned by AppServices. It belongs to its server and survives a switch to the other service. A trust is stored only after its server accepted it. - Requests get their trust through the HTTP factory; the static lookup in HttpCurl and the file-global registries of web views are gone. - Biz::Lifetime replaces the alive tokens seven classes had rolled on their own. - A Connect Local server URL is stored without its default port, and a discovered IPv6 address is bracketed. Tests - New: AccountServiceSwitcher, ConnectNavigationLock, ConnectPageAuth, the Connect Local print host, the split and migration of the account settings. - Changed: the pairing test for signing in with an unconfirmed credential, the trust test for a changed server, the cloud upload fixture. Not built on macOS and Linux. The narration comments in the platform web view files, HttpCurl.cpp and Tls.cpp are still to be turned into doxygen comments. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| be | ||
| ca | ||
| cs | ||
| de | ||
| en | ||
| es | ||
| fi | ||
| fr | ||
| hu | ||
| it | ||
| ja | ||
| ko | ||
| ko_KR | ||
| nl | ||
| pl | ||
| pt_BR | ||
| ru | ||
| sl | ||
| tr | ||
| uk | ||
| wx_locale | ||
| zh_CN | ||
| zh_TW | ||
| list.txt | ||
| PrusaSlicer.pot | ||