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:
Nino van Hooff 2020-02-25 14:41:02 +01:00
parent 510d9822dd
commit 27902fe38f
5 changed files with 16 additions and 8 deletions

View file

@ -6,10 +6,13 @@ from cura.API import Account
from cura.CuraApplication import CuraApplication
## Add a Authorization header to the request for Ultimaker Cloud Api requests.
# When the user is not logged in or a token is not available, a warning will be logged
# Also add the user agent headers (see DefaultUserAgentScope)
class UltimakerCloudScope(DefaultUserAgentScope):
"""Add an Authorization header to the request for Ultimaker Cloud Api requests.
When the user is not logged in or a token is not available, a warning will be logged
Also add the user agent headers (see DefaultUserAgentScope)
"""
def __init__(self, application: CuraApplication):
super().__init__(application)
api = application.getCuraAPI()