mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Use JsonDecorator scope in the Toolbox and CloudSync
Improves security by disallowing other content than json for requests CURA-7150
This commit is contained in:
parent
510d9822dd
commit
27902fe38f
5 changed files with 16 additions and 8 deletions
|
@ -11,6 +11,7 @@ from UM import i18nCatalog
|
|||
from UM.Logger import Logger
|
||||
from UM.Message import Message
|
||||
from UM.Signal import Signal
|
||||
from UM.TaskManagement.HttpRequestScope import JsonDecoratorScope
|
||||
from cura.CuraApplication import CuraApplication, ApplicationMetadata
|
||||
from ..CloudApiModel import CloudApiModel
|
||||
from .SubscribedPackagesModel import SubscribedPackagesModel
|
||||
|
@ -18,13 +19,14 @@ from ..UltimakerCloudScope import UltimakerCloudScope
|
|||
|
||||
from typing import List, Dict, Any
|
||||
|
||||
|
||||
class CloudPackageChecker(QObject):
|
||||
def __init__(self, application: CuraApplication) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.discrepancies = Signal() # Emits SubscribedPackagesModel
|
||||
self._application = application # type: CuraApplication
|
||||
self._scope = UltimakerCloudScope(application)
|
||||
self._scope = JsonDecoratorScope(UltimakerCloudScope(application))
|
||||
self._model = SubscribedPackagesModel()
|
||||
|
||||
self._application.initializationFinished.connect(self._onAppInitialized)
|
||||
|
@ -106,4 +108,4 @@ class CloudPackageChecker(QObject):
|
|||
|
||||
def _onSyncButtonClicked(self, sync_message: Message, sync_message_action: str) -> None:
|
||||
sync_message.hide()
|
||||
self.discrepancies.emit(self._model)
|
||||
self.discrepancies.emit(self._model)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue