fastled 1.2.84__py3-none-any.whl → 1.2.86__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fastled/__init__.py CHANGED
@@ -14,7 +14,7 @@ from .types import BuildMode, CompileResult, CompileServerError, FileResponse
14
14
  # IMPORTANT! There's a bug in github which will REJECT any version update
15
15
  # that has any other change in the repo. Please bump the version as the
16
16
  # ONLY change in a commit, or else the pypi update and the release will fail.
17
- __version__ = "1.2.84"
17
+ __version__ = "1.2.86"
18
18
 
19
19
 
20
20
  class Api:
fastled/server_flask.py CHANGED
@@ -23,7 +23,8 @@ else:
23
23
  logger = logging.getLogger("flask_server")
24
24
  logger.disabled = True
25
25
 
26
- _DRAWF_SOURCE_PREFIX = "drawfsource/js/fastled/src/"
26
+ _DRAWF_SOURCE_FASTLED = "drawfsource/js/fastled/src/"
27
+ _DRAWF_SOURCE_EMSDK = "drawfsource/js/drawfsource/emsdk/"
27
28
 
28
29
 
29
30
  def _run_flask_server(
@@ -126,24 +127,34 @@ def _run_flask_server(
126
127
  return Response(f"Error: {str(e)}", status=500)
127
128
 
128
129
  def handle_dwarfsource(path: str) -> Response:
129
- """Handle requests to /drawfsource/js/fastled/src/"""
130
+ """Handle requests to /drawfsource/js/fastled/src/
131
+ or /drawfsource/js/drawfsource/emsdk/*"""
130
132
  from flask import request
131
133
 
132
134
  start_time = time.time()
133
135
  logger.info(f"Processing request: {request.method} {request.url}")
134
136
 
135
- if not path.startswith(_DRAWF_SOURCE_PREFIX):
137
+ if "../" in path:
138
+ # Prevent directory traversal attacks
139
+ error_msg = "Directory traversal attack detected"
140
+ logger.error(error_msg)
141
+ return Response(error_msg, status=400)
142
+
143
+ if not path.startswith(_DRAWF_SOURCE_FASTLED) and not path.startswith(
144
+ _DRAWF_SOURCE_EMSDK
145
+ ):
136
146
  # unexpected
137
147
  error_msg = f"Unexpected path: {path}"
138
148
  logger.error(error_msg)
139
149
  # Logging disabled
140
150
  return Response("Malformed path", status=400)
141
151
 
142
- path = path.replace("drawfsource/js/fastled/src/", "")
143
- logger.info(f"Transformed path: {path}")
152
+ # Weird magic being played with these paths, it's beyond me.
153
+ if path.startswith(_DRAWF_SOURCE_FASTLED):
154
+ path = path[len("/drawfsource") :]
144
155
 
145
156
  # Forward the request to the compile server
146
- target_url = f"http://localhost:{compile_server_port}/sourcefiles/{path}"
157
+ target_url = f"http://localhost:{compile_server_port}/drawfsource/{path}"
147
158
  logger.info(f"Requesting: {target_url}")
148
159
  logger.info(f"Processing dwarfsource request for {path}")
149
160
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.2.84
3
+ Version: 1.2.86
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -1,4 +1,4 @@
1
- fastled/__init__.py,sha256=hVVZOZS8MY35SzgumbD6jMLfUY0Kg34cBiADzA5cV3Q,7044
1
+ fastled/__init__.py,sha256=5byUn4uJ2EvnYRkab1dfNKQOoRV4SA5W2nRLLJcbY3w,7044
2
2
  fastled/app.py,sha256=0W8Mbplo5UCRzj7nMVgkmCBddQGufsUQjkUUT4pMp74,4611
3
3
  fastled/cli.py,sha256=FjVr31ht0UPlAcmX-84NwfAGMQHTkrCe4o744jCAxiw,375
4
4
  fastled/cli_test.py,sha256=qJB9yLRFR3OwOwdIWSQ0fQsWLnA37v5pDccufiP_hTs,512
@@ -17,7 +17,7 @@ fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
17
17
  fastled/print_filter.py,sha256=ZpebuqfWEraSBD3Dm0PVZhQVBnU_NSILniwBHwjC1qM,2342
18
18
  fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
19
19
  fastled/select_sketch_directory.py,sha256=-eudwCns3AKj4HuHtSkZAFwbnf005SNL07pOzs9VxnE,1383
20
- fastled/server_flask.py,sha256=a8IOX7cgXB9agwF9hlMuAk5fNMAoclSprl0iECcH4qo,17617
20
+ fastled/server_flask.py,sha256=fbLuF993pbBqoyMbjHT1GPwjlxBib3cUUW719PNfN1w,18108
21
21
  fastled/server_start.py,sha256=W9yKStkRlRNuXeV6j_6O7HjjFPyVLBHMcF9Uy2QjDWQ,479
22
22
  fastled/settings.py,sha256=oezRvRUJWwauO-kpC4LDbKg6Q-ij4d09UtR2vkjSAPU,575
23
23
  fastled/sketch.py,sha256=tHckjDj8P6BI_LWzUFM071a9qcqPs-r-qFWIe50P5Xw,3391
@@ -33,9 +33,9 @@ fastled/site/build.py,sha256=2YKU_UWKlJdGnjdbAbaL0co6kceFMSTVYwH1KCmgPZA,13987
33
33
  fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
34
34
  fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
35
35
  fastled/test/examples.py,sha256=GfaHeY1E8izBl6ZqDVjz--RHLyVR4NRnQ5pBesCFJFY,1673
36
- fastled-1.2.84.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
37
- fastled-1.2.84.dist-info/METADATA,sha256=C02EyZg2HxA80WF2AV5tcPt7kxys7h9caPt_gYiEQCM,21940
38
- fastled-1.2.84.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
39
- fastled-1.2.84.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
40
- fastled-1.2.84.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
41
- fastled-1.2.84.dist-info/RECORD,,
36
+ fastled-1.2.86.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
37
+ fastled-1.2.86.dist-info/METADATA,sha256=Y3dWMsj_2bo2uKzkBTYAaUhVMQKjJsNu8FVmjrChKDk,21940
38
+ fastled-1.2.86.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
39
+ fastled-1.2.86.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
40
+ fastled-1.2.86.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
41
+ fastled-1.2.86.dist-info/RECORD,,