matlab-proxy 0.18.0__tar.gz → 0.18.1__tar.gz

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.

Potentially problematic release.


This version of matlab-proxy might be problematic. Click here for more details.

Files changed (169) hide show
  1. {matlab-proxy-0.18.0/matlab_proxy.egg-info → matlab-proxy-0.18.1}/PKG-INFO +1 -1
  2. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/app.py +3 -1
  3. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1/matlab_proxy.egg-info}/PKG-INFO +1 -1
  4. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy.egg-info/SOURCES.txt +1 -0
  5. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/setup.py +1 -1
  6. matlab-proxy-0.18.1/tests/integration/integration_tests_with_license/test_http_end_points.py +398 -0
  7. matlab-proxy-0.18.1/tests/unit/util/mwi/test_download.py +152 -0
  8. matlab-proxy-0.18.0/tests/integration/integration_tests_with_license/test_http_end_points.py +0 -223
  9. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/LICENSE.md +0 -0
  10. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/MANIFEST.in +0 -0
  11. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/README.md +0 -0
  12. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/.eslintrc.json +0 -0
  13. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/.gitignore +0 -0
  14. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/README.md +0 -0
  15. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/package-lock.json +0 -0
  16. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/package.json +0 -0
  17. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/public/favicon.ico +0 -0
  18. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/public/index.html +0 -0
  19. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/public/manifest.json +0 -0
  20. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/public/robots.txt +0 -0
  21. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/actionCreators/actionCreators.spec.js +0 -0
  22. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/actionCreators/index.js +0 -0
  23. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/actions/index.js +0 -0
  24. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/css/bootstrap.min.css +0 -0
  25. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/css/site7.min.css +0 -0
  26. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.eot +0 -0
  27. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.svg +0 -0
  28. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.ttf +0 -0
  29. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff +0 -0
  30. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff2 +0 -0
  31. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/mathworks-eps.svg +0 -0
  32. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/mathworks-eps.ttf +0 -0
  33. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/mathworks-eps.woff +0 -0
  34. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.svg +0 -0
  35. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.ttf +0 -0
  36. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.woff +0 -0
  37. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/mathworks.svg +0 -0
  38. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/mathworks.ttf +0 -0
  39. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/fonts/mathworks.woff +0 -0
  40. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/images/bug_reports/workaround.gif +0 -0
  41. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/images/responsive/global/ico-header-account-hover.svg +0 -0
  42. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/images/responsive/global/ico-header-account.svg +0 -0
  43. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/images/responsive/global/ico-header-contact-hover.svg +0 -0
  44. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/images/responsive/global/ico-header-contact.svg +0 -0
  45. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/3p/images/responsive/global/ico-sprite.png +0 -0
  46. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/App.css +0 -0
  47. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/App.spec.js +0 -0
  48. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/MATLAB-env-blur.png +0 -0
  49. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/App/index.js +0 -0
  50. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Confirmation/Confirmation.spec.js +0 -0
  51. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Confirmation/index.js +0 -0
  52. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/Controls.css +0 -0
  53. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/Controls.spec.js +0 -0
  54. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/feedback.svg +0 -0
  55. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/help.svg +0 -0
  56. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/index.js +0 -0
  57. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/restart.svg +0 -0
  58. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/sign-out.svg +0 -0
  59. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/start.svg +0 -0
  60. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/stop.svg +0 -0
  61. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Controls/terminate.svg +0 -0
  62. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/EntitlementSelector/EntitlementSelector.spec.js +0 -0
  63. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/EntitlementSelector/index.js +0 -0
  64. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Error/Error.css +0 -0
  65. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Error/Error.spec.js +0 -0
  66. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Error/index.js +0 -0
  67. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Help/Help.css +0 -0
  68. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Help/Help.spec.js +0 -0
  69. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Help/index.js +0 -0
  70. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Information/Information.css +0 -0
  71. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Information/Information.spec.js +0 -0
  72. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Information/index.js +0 -0
  73. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/LicensingGatherer/ExistingLicense.css +0 -0
  74. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/LicensingGatherer/ExistingLicense.js +0 -0
  75. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/LicensingGatherer/LicenseGatherer.spec.js +0 -0
  76. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/LicensingGatherer/LicensingGatherer.css +0 -0
  77. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/LicensingGatherer/MHLM.js +0 -0
  78. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/LicensingGatherer/NLM.js +0 -0
  79. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/LicensingGatherer/index.js +0 -0
  80. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/MatlabJsd/MatlabJsd.css +0 -0
  81. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/MatlabJsd/MatlabJsd.spec.js +0 -0
  82. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/MatlabJsd/index.js +0 -0
  83. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Overlay/Overlay.css +0 -0
  84. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Overlay/Overlay.spec.js +0 -0
  85. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/Overlay/index.js +0 -0
  86. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/OverlayTrigger/OverlayTrigger.css +0 -0
  87. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/OverlayTrigger/OverlayTrigger.spec.js +0 -0
  88. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/OverlayTrigger/ResizeOverlayTrigger.spec.js +0 -0
  89. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/OverlayTrigger/arrow.svg +0 -0
  90. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/OverlayTrigger/gripper.svg +0 -0
  91. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/OverlayTrigger/index.js +0 -0
  92. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/OverlayTrigger/trigger-error.svg +0 -0
  93. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/components/OverlayTrigger/trigger-ok.svg +0 -0
  94. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/constants.js +0 -0
  95. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/index.css +0 -0
  96. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/index.js +0 -0
  97. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/jest.config.json +0 -0
  98. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/logo.svg +0 -0
  99. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/reducers/index.js +0 -0
  100. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/reducers/reducers.spec.js +0 -0
  101. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/selectors/index.js +0 -0
  102. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/selectors/selectors.spec.js +0 -0
  103. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/serviceWorker.js +0 -0
  104. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/setupTests.js +0 -0
  105. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/test/utils/react-test.js +0 -0
  106. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/gui/src/test/utils/state.js +0 -0
  107. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/__init__.py +0 -0
  108. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/app_state.py +0 -0
  109. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/constants.py +0 -0
  110. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/default_configuration.py +0 -0
  111. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/devel.py +0 -0
  112. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/icons/matlab.svg +0 -0
  113. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/matlab/evaluateUserMatlabCode.m +0 -0
  114. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/matlab/startup.m +0 -0
  115. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/settings.py +0 -0
  116. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/__init__.py +0 -0
  117. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/event_loop.py +0 -0
  118. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/list_servers.py +0 -0
  119. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mw.py +0 -0
  120. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/__init__.py +0 -0
  121. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/custom_http_headers.py +0 -0
  122. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/download.py +0 -0
  123. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/embedded_connector/__init__.py +0 -0
  124. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/embedded_connector/helpers.py +0 -0
  125. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/embedded_connector/request.py +0 -0
  126. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/environment_variables.py +0 -0
  127. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/exceptions.py +0 -0
  128. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/logger.py +0 -0
  129. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/token_auth.py +0 -0
  130. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/mwi/validators.py +0 -0
  131. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/system.py +0 -0
  132. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy/util/windows.py +0 -0
  133. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy.egg-info/dependency_links.txt +0 -0
  134. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy.egg-info/entry_points.txt +0 -0
  135. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy.egg-info/not-zip-safe +0 -0
  136. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy.egg-info/requires.txt +0 -0
  137. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/matlab_proxy.egg-info/top_level.txt +0 -0
  138. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/setup.cfg +0 -0
  139. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/integration/__init__.py +0 -0
  140. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/integration/integration_tests_with_license/__init__.py +0 -0
  141. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/integration/integration_tests_with_license/conftest.py +0 -0
  142. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/integration/integration_tests_without_license/__init__.py +0 -0
  143. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/integration/integration_tests_without_license/conftest.py +0 -0
  144. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/integration/integration_tests_without_license/test_matlab_is_down_if_unlicensed.py +0 -0
  145. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/integration/utils/__init__.py +0 -0
  146. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/integration/utils/integration_tests_utils.py +0 -0
  147. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/integration/utils/licensing.py +0 -0
  148. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/__init__.py +0 -0
  149. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/conftest.py +0 -0
  150. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/test_app.py +0 -0
  151. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/test_app_state.py +0 -0
  152. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/test_constants.py +0 -0
  153. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/test_ddux.py +0 -0
  154. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/test_devel.py +0 -0
  155. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/test_non_dev_mode.py +0 -0
  156. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/test_settings.py +0 -0
  157. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/__init__.py +0 -0
  158. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/mwi/__init__.py +0 -0
  159. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/mwi/embedded_connector/__init__.py +0 -0
  160. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/mwi/embedded_connector/test_helpers.py +0 -0
  161. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/mwi/embedded_connector/test_request.py +0 -0
  162. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/mwi/test_custom_http_headers.py +0 -0
  163. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/mwi/test_logger.py +0 -0
  164. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/mwi/test_token_auth.py +0 -0
  165. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/mwi/test_validators.py +0 -0
  166. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/test_mw.py +0 -0
  167. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/unit/util/test_util.py +0 -0
  168. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/utils/__init__.py +0 -0
  169. {matlab-proxy-0.18.0 → matlab-proxy-0.18.1}/tests/utils/logging_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: matlab-proxy
3
- Version: 0.18.0
3
+ Version: 0.18.1
4
4
  Summary: Python® package enables you to launch MATLAB® and access it from a web browser.
5
5
  Home-page: https://github.com/mathworks/matlab-proxy/
6
6
  Author: The MathWorks, Inc.
@@ -624,10 +624,12 @@ async def matlab_view(req):
624
624
 
625
625
  # Standard HTTP Request
626
626
  else:
627
- # Proxy, injecting request header
627
+ # Proxy, injecting request header, disabling request timeouts
628
+ timeout = aiohttp.ClientTimeout(total=None)
628
629
  async with aiohttp.ClientSession(
629
630
  trust_env=True,
630
631
  connector=aiohttp.TCPConnector(verify_ssl=False),
632
+ timeout=timeout,
631
633
  ) as client_session:
632
634
  try:
633
635
  req_body = await transform_body(req)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: matlab-proxy
3
- Version: 0.18.0
3
+ Version: 0.18.1
4
4
  Summary: Python® package enables you to launch MATLAB® and access it from a web browser.
5
5
  Home-page: https://github.com/mathworks/matlab-proxy/
6
6
  Author: The MathWorks, Inc.
@@ -156,6 +156,7 @@ tests/unit/util/test_mw.py
156
156
  tests/unit/util/test_util.py
157
157
  tests/unit/util/mwi/__init__.py
158
158
  tests/unit/util/mwi/test_custom_http_headers.py
159
+ tests/unit/util/mwi/test_download.py
159
160
  tests/unit/util/mwi/test_logger.py
160
161
  tests/unit/util/mwi/test_token_auth.py
161
162
  tests/unit/util/mwi/test_validators.py
@@ -76,7 +76,7 @@ long_description = (HERE / "README.md").read_text()
76
76
 
77
77
  setuptools.setup(
78
78
  name="matlab-proxy",
79
- version="0.18.0",
79
+ version="0.18.1",
80
80
  url=config["doc_url"],
81
81
  author="The MathWorks, Inc.",
82
82
  author_email="cloud@mathworks.com",
@@ -0,0 +1,398 @@
1
+ # Copyright 2023-2024 The MathWorks, Inc.
2
+
3
+ """
4
+ Contains integration tests which exercise HTTP endpoints of interest exposed by matlab-proxy-app
5
+ """
6
+
7
+ # Imports
8
+ from enum import Enum
9
+ import json
10
+ import os
11
+ import pytest
12
+ import re
13
+ import requests
14
+ import time
15
+ from requests.adapters import HTTPAdapter, Retry
16
+ from urllib.parse import urlparse, parse_qs
17
+
18
+ # Local module imports
19
+ import matlab_proxy.settings as settings
20
+ from matlab_proxy.constants import MWI_AUTH_TOKEN_NAME_FOR_HTTP
21
+ from matlab_proxy.util import system
22
+ from tests.integration.utils import integration_tests_utils as utils
23
+ from tests.utils.logging_util import create_integ_test_logger
24
+
25
+ # Logger Setup
26
+ _logger = create_integ_test_logger(__name__)
27
+
28
+ # Constants
29
+
30
+ # Timeout for polling the matlab-proxy http endpoints
31
+ # matlab proxy in Mac machines takes more time to be 'up'
32
+ MAX_TIMEOUT = settings.get_process_startup_timeout()
33
+
34
+
35
+ class Format(Enum):
36
+ """
37
+ An enumeration to specify different format types.
38
+
39
+ Attributes:
40
+ JSON (int): Represents the JSON format type.
41
+ TEXT (int): Represents the plain text format type.
42
+ """
43
+
44
+ JSON = 1
45
+ TEXT = 2
46
+
47
+
48
+ # Utility Functions
49
+ def _http_get_request(
50
+ uri, connection_scheme, headers, http_endpoint="", outputFormat=Format.TEXT
51
+ ):
52
+ """
53
+ Sends an HTTP GET request to a specified URI, optionally appending an endpoint to the URI.
54
+
55
+ This function uses a session with retries configured for transient network errors. It can return
56
+ the response in either text or JSON format, based on the outputFormat parameter.
57
+
58
+ Parameters:
59
+ - uri (str): The base URI for the HTTP request.
60
+ - connection_scheme (str): The scheme to use for the connection (e.g., 'http' or 'https').
61
+ - headers (dict): A dictionary of HTTP headers to include in the request.
62
+ - http_endpoint (str, optional): An additional endpoint to append to the base URI. Defaults to an empty string.
63
+ - outputFormat (format, optional): The desired format for the response content. This should be an attribute
64
+ of a format enumeration, supporting at least 'TEXT' and 'JSON' options. Defaults to Format.TEXT.
65
+
66
+ Returns:
67
+ - str or dict: The response content as a string if outputFormat is Format.TEXT, or as a dictionary
68
+ if outputFormat is Format.JSON.
69
+
70
+ Raises:
71
+ - Exception: If an invalid output format is specified.
72
+
73
+ Note:
74
+ - The function disables SSL certificate verification (`verify=False`). This may introduce security risks,
75
+ such as vulnerability to man-in-the-middle attacks. Use with caution in a production environment.
76
+ """
77
+ request_uri = uri + http_endpoint
78
+ with requests.Session() as s:
79
+ retries = Retry(total=10, backoff_factor=0.1)
80
+ s.mount(f"{connection_scheme}://", HTTPAdapter(max_retries=retries))
81
+ response = s.get(request_uri, headers=headers, verify=False)
82
+
83
+ if outputFormat == Format.TEXT:
84
+ return response.text
85
+ elif outputFormat == Format.JSON:
86
+ return json.loads(response.text)
87
+
88
+ raise Exception("Invalid output format specified.")
89
+
90
+
91
+ def _check_matlab_status(matlab_proxy_app_fixture, status):
92
+ """
93
+ Check the status of a MATLAB session until a specified status is reached or a timeout occurs.
94
+
95
+ This function repeatedly sends HTTP GET requests to a MATLAB proxy application to check the current
96
+ status of MATLAB. It continues checking until MATLAB's status matches the specified target status or
97
+ until a maximum timeout is reached.
98
+
99
+ Parameters:
100
+ - matlab_proxy_app_fixture: An object containing configuration for connecting to the MATLAB proxy application.
101
+ This object must have the following attributes:
102
+ - url (str): The base URL of the MATLAB proxy application.
103
+ - connection_scheme (str): The scheme used for the connection (e.g., 'http' or 'https').
104
+ - headers (dict): A dictionary of HTTP headers to be sent with each request.
105
+ - status (str): The target status to wait for MATLAB to reach.
106
+
107
+ Returns:
108
+ - str: The status of MATLAB at the end of the function execution. This could be the target status if
109
+ it was reached within the timeout period, or the last known status of MATLAB if the timeout was reached
110
+ first.
111
+
112
+ Notes:
113
+ - The function waits for a maximum of MAX_TIMEOUT seconds, defined elsewhere, before exiting.
114
+ - It checks the MATLAB status every 1 second.
115
+ - The MATLAB status is obtained by sending a GET request to the '/get_status' endpoint of the proxy application.
116
+ - The response from the proxy application is expected to be in JSON format, with MATLAB's status accessible
117
+ via `res["matlab"]["status"]`.
118
+
119
+ Exceptions:
120
+ - This function may raise exceptions related to network issues or JSON parsing errors, which are not
121
+ explicitly handled within the function.
122
+ """
123
+ uri = matlab_proxy_app_fixture.url
124
+ connection_scheme = matlab_proxy_app_fixture.connection_scheme
125
+ headers = matlab_proxy_app_fixture.headers
126
+
127
+ matlab_status = None
128
+
129
+ start_time = time.time()
130
+ while matlab_status != status and (time.time() - start_time < MAX_TIMEOUT):
131
+ time.sleep(1)
132
+ res = _http_get_request(
133
+ uri,
134
+ connection_scheme,
135
+ headers,
136
+ http_endpoint="/get_status",
137
+ outputFormat=Format.JSON,
138
+ )
139
+ matlab_status = res["matlab"]["status"]
140
+
141
+ return matlab_status
142
+
143
+
144
+ def _download_test_file(matlab_proxy_app_fixture, test_file):
145
+ """Returns result of hitting the /download endpoint for test_file.
146
+
147
+ Returns:
148
+ str: The contents of the test_file being downloaded through matlab-proxy.
149
+ """
150
+ uri = matlab_proxy_app_fixture.url
151
+ connection_scheme = matlab_proxy_app_fixture.connection_scheme
152
+ headers = matlab_proxy_app_fixture.headers
153
+
154
+ res = _http_get_request(
155
+ uri,
156
+ connection_scheme,
157
+ headers,
158
+ http_endpoint="/download/" + test_file,
159
+ outputFormat=Format.TEXT,
160
+ )
161
+ return res
162
+
163
+
164
+ # Main Classes
165
+ class RealMATLABServer:
166
+ """
167
+ Context Manager class which returns matlab proxy web server serving real MATLAB
168
+ for testing.
169
+
170
+ Setting up the server in the context of Pytest.
171
+ """
172
+
173
+ def __init__(self, event_loop):
174
+ self.event_loop = event_loop
175
+
176
+ def __enter__(self):
177
+ # Store the matlab proxy logs in os.pipe for testing
178
+ # os.pipe2 is only supported in Linux systems
179
+ _logger.info("Setting up MATLAB Server for integration test")
180
+
181
+ _logger.debug("Entering RealMATLABServer enter section.")
182
+ self.dpipe = os.pipe2(os.O_NONBLOCK) if system.is_linux() else os.pipe()
183
+ self.mwi_app_port = utils.get_random_free_port()
184
+ self.matlab_config_file_path = str(utils.get_matlab_config_file())
185
+
186
+ self.temp_dir_path = os.path.dirname(
187
+ os.path.dirname(self.matlab_config_file_path)
188
+ )
189
+
190
+ self.temp_dir_name = "temp_dir"
191
+ self.mwi_base_url = "/matlab-test"
192
+
193
+ # Environment variables to launch matlab proxy
194
+ input_env = {
195
+ "MWI_APP_PORT": self.mwi_app_port,
196
+ "MWI_BASE_URL": self.mwi_base_url,
197
+ }
198
+
199
+ self.proc = self.event_loop.run_until_complete(
200
+ utils.start_matlab_proxy_app(out=self.dpipe[1], input_env=input_env)
201
+ )
202
+
203
+ utils.wait_server_info_ready(self.mwi_app_port)
204
+ parsed_url = urlparse(utils.get_connection_string(self.mwi_app_port))
205
+
206
+ self.headers = {
207
+ MWI_AUTH_TOKEN_NAME_FOR_HTTP: (
208
+ parse_qs(parsed_url.query)[MWI_AUTH_TOKEN_NAME_FOR_HTTP][0]
209
+ if MWI_AUTH_TOKEN_NAME_FOR_HTTP in parse_qs(parsed_url.query)
210
+ else ""
211
+ )
212
+ }
213
+ self.connection_scheme = parsed_url.scheme
214
+ self.url = parsed_url.scheme + "://" + parsed_url.netloc + parsed_url.path
215
+ return self
216
+
217
+ async def _terminate_process(self, timeout=0):
218
+ """
219
+ Asynchronous helper method to terminate the process with a timeout.
220
+
221
+ Args:
222
+ timeout: Maximum number of seconds to wait
223
+ for the process to terminate
224
+
225
+ """
226
+ import asyncio
227
+
228
+ process = self.proc
229
+ try:
230
+ process.terminate()
231
+ await asyncio.wait_for(process.wait(), timeout=timeout)
232
+ except asyncio.TimeoutError:
233
+ _logger.warning(
234
+ "Termination of the MATLAB Server process timed out. Attempting to kill."
235
+ )
236
+ process.kill()
237
+ await process.wait()
238
+ _logger.debug("Killed the MATLAB process after timeout.")
239
+
240
+ def __exit__(self, exc_type, exc_value, exc_traceback):
241
+ _logger.info("Tearing down the MATLAB Server.")
242
+ self.event_loop.run_until_complete(self._terminate_process(timeout=10))
243
+ _logger.debug("Terminated the MATLAB process.")
244
+
245
+
246
+ # Fixtures
247
+ @pytest.fixture
248
+ def matlab_proxy_app_fixture(
249
+ loop,
250
+ ):
251
+ """A pytest fixture which yields a real matlab server to be used by tests.
252
+
253
+ Args:
254
+ loop (Event event_loop): The built-in event event_loop provided by pytest.
255
+
256
+ Yields:
257
+ real_matlab_server : A real matlab web server used by tests.
258
+ """
259
+
260
+ try:
261
+ with RealMATLABServer(loop) as matlab_proxy_app:
262
+ yield matlab_proxy_app
263
+ except ProcessLookupError as e:
264
+ _logger.debug("ProcessLookupError found in matlab proxy app fixture")
265
+ _logger.debug(e)
266
+ pass
267
+
268
+
269
+ @pytest.fixture
270
+ def test_file_contents():
271
+ """
272
+ A pytest fixture that provides a string for testing purposes.
273
+
274
+ This fixture returns a predefined string that can be used in tests to simulate
275
+ the contents of a file or any scenario where a constant string value is needed.
276
+
277
+ Returns:
278
+ str: A string containing the text "I LOVE MATLAB."
279
+ """
280
+ return "I LOVE MATLAB."
281
+
282
+
283
+ @pytest.fixture
284
+ def test_file(tmp_path, test_file_contents):
285
+ """
286
+ A pytest fixture that creates a temporary test file with given contents.
287
+
288
+ This fixture utilizes pytest's `tmp_path` fixture to generate a temporary directory,
289
+ then creates a file named "temporary_test_file.txt" within this directory,
290
+ and writes the provided contents to this file. It is useful for tests that require
291
+ reading from or writing to files without affecting the actual file system.
292
+
293
+ Parameters:
294
+ - tmp_path (Path): A pytest fixture that provides a temporary directory unique to the test function.
295
+ - test_file_contents (str): The content to be written into the temporary test file.
296
+
297
+ Returns:
298
+ - str: The path to the created temporary test file as a string.
299
+ """
300
+ test_file = os.path.join(tmp_path, "temporary_test_file.txt")
301
+ with open(test_file, "w+") as f:
302
+ f.write(test_file_contents)
303
+ return test_file
304
+
305
+
306
+ # Test Functions
307
+ def test_matlab_is_up(matlab_proxy_app_fixture):
308
+ """Test that the status switches from 'starting' to 'up' within a timeout.
309
+
310
+ Args:
311
+ matlab_proxy_app_fixture: A pytest fixture which yields a real matlab server to be used by tests.
312
+ """
313
+
314
+ status = _check_matlab_status(matlab_proxy_app_fixture, "up")
315
+ assert status == "up"
316
+
317
+
318
+ def test_stop_matlab(matlab_proxy_app_fixture):
319
+ """Test to check that matlab is in 'down' state when
320
+ we send the delete request to 'stop_matlab' endpoint
321
+
322
+ Args:
323
+ matlab_proxy_app_fixture: A pytest fixture which yields a real matlab server to be used by tests.
324
+ """
325
+ status = _check_matlab_status(matlab_proxy_app_fixture, "up")
326
+ assert status == "up"
327
+
328
+ http_endpoint_to_test = "/stop_matlab"
329
+ stop_url = matlab_proxy_app_fixture.url + http_endpoint_to_test
330
+
331
+ with requests.Session() as s:
332
+ retries = Retry(total=10, backoff_factor=0.1)
333
+ s.mount(
334
+ f"{matlab_proxy_app_fixture.connection_scheme}://",
335
+ HTTPAdapter(max_retries=retries),
336
+ )
337
+ s.delete(stop_url, headers=matlab_proxy_app_fixture.headers, verify=False)
338
+
339
+ status = _check_matlab_status(matlab_proxy_app_fixture, "down")
340
+ assert status == "down"
341
+
342
+
343
+ async def test_print_message(matlab_proxy_app_fixture):
344
+ """Test if the right logs are printed
345
+
346
+ Args:
347
+ matlab_proxy_app_fixture: A pytest fixture which yields a real matlab server to be used by tests.
348
+
349
+ FIXME: If output has logging or extra debug info, 600 bytes might not be enough.
350
+ """
351
+ # Checks if matlab proxy is in "up" state or not
352
+ status = _check_matlab_status(matlab_proxy_app_fixture, "up")
353
+ assert status == "up"
354
+
355
+ uri_regex = f"{matlab_proxy_app_fixture.connection_scheme}://[a-zA-Z0-9\-_.]+:{matlab_proxy_app_fixture.mwi_app_port}{matlab_proxy_app_fixture.mwi_base_url}"
356
+
357
+ read_descriptor, write_descriptor = matlab_proxy_app_fixture.dpipe
358
+ number_of_bytes = 600
359
+
360
+ if read_descriptor:
361
+ line = os.read(read_descriptor, number_of_bytes).decode("utf-8")
362
+ process_logs = line.strip()
363
+
364
+ assert bool(re.search(uri_regex, process_logs)) == True
365
+
366
+ # Close the read and write descriptors.
367
+ os.close(read_descriptor)
368
+ os.close(write_descriptor)
369
+
370
+
371
+ def test_download_file_from_matlab(
372
+ matlab_proxy_app_fixture, test_file, test_file_contents
373
+ ):
374
+ """
375
+ Test the downloading of a file from a MATLAB proxy application.
376
+
377
+ This test function checks if the MATLAB proxy application is up and running, and then attempts to download
378
+ a specific test file from it. It validates both the status of the MATLAB proxy and the contents of the downloaded file.
379
+
380
+ Parameters:
381
+ - matlab_proxy_app_fixture (fixture): A test fixture representing the MATLAB proxy application environment.
382
+ - test_file (str): The name or path of the test file to be downloaded from the MATLAB proxy application.
383
+ - test_file_contents (str): The expected contents of the test file to validate the download operation.
384
+
385
+ Assertions:
386
+ - Asserts that the MATLAB proxy application is "up".
387
+ - Asserts that the content of the downloaded file matches the expected `test_file_contents`.
388
+
389
+ Raises:
390
+ - AssertionError: If any of the assertions fail, indicating either the MATLAB proxy application is not running
391
+ as expected or there is a mismatch in the file content.
392
+ """
393
+ status = _check_matlab_status(matlab_proxy_app_fixture, "up")
394
+ assert status == "up"
395
+
396
+ # Once MATLAB is up, we can then attempt to download
397
+ result = _download_test_file(matlab_proxy_app_fixture, test_file)
398
+ assert result == test_file_contents
@@ -0,0 +1,152 @@
1
+ # Copyright 2024 The MathWorks, Inc.
2
+ import pytest
3
+
4
+ from matlab_proxy.util.mwi.download import (
5
+ _get_download_payload_path,
6
+ get_download_url,
7
+ is_download_request,
8
+ )
9
+
10
+
11
+ # Mock the request object
12
+ @pytest.fixture
13
+ def mock_request_fixture(mocker):
14
+ mock_req = mocker.MagicMock()
15
+ mock_req.app = {
16
+ "settings": {"base_url": ""},
17
+ "state": mocker.MagicMock(),
18
+ }
19
+ mock_req.rel_url = mocker.MagicMock()
20
+ return mock_req
21
+
22
+
23
+ def _get_expected_output_based_on_os_type(paths: list) -> str:
24
+ import matlab_proxy.util.system as system
25
+
26
+ return "\\".join(paths) if system.is_windows() else "/".join(paths)
27
+
28
+
29
+ # Test for is_download_request function
30
+ @pytest.mark.parametrize(
31
+ "test_base_url, path, expected",
32
+ [
33
+ ("/", "/download/something", True),
34
+ ("", "/download/something", True),
35
+ ("/base", "/base/download/something", True),
36
+ ("/base", "/download/something", False),
37
+ ],
38
+ ids=[
39
+ "/ base url and path starting with /download",
40
+ "empty base url and path starting with /download",
41
+ "non-empty base url and path starting with that base url",
42
+ "non-empty base url and path not starting with that base url",
43
+ ],
44
+ )
45
+ def test_is_download_request(mock_request_fixture, test_base_url, path, expected):
46
+ mock_request_fixture.app["settings"]["base_url"] = test_base_url
47
+ mock_request_fixture.rel_url.path = path
48
+ assert is_download_request(mock_request_fixture) == expected
49
+
50
+
51
+ # Test for _get_download_payload_path function
52
+ # This test is a bit tricky since it involves file system operations and OS checks.
53
+ # We will mock system.is_windows() and test for both Windows and Posix systems.
54
+ @pytest.mark.parametrize(
55
+ "is_windows, test_base_url, path, expected",
56
+ [
57
+ (
58
+ True,
59
+ "",
60
+ "/downloadC:\\some\\path\\to\\file.txt",
61
+ "C:\\some\\path\\to\\file.txt",
62
+ ),
63
+ (
64
+ True,
65
+ "/base",
66
+ "/base/downloadC:\\some\\path\\to\\file.txt",
67
+ "C:\\some\\path\\to\\file.txt",
68
+ ),
69
+ (
70
+ False,
71
+ "",
72
+ "/download/some/path/to/file.txt",
73
+ _get_expected_output_based_on_os_type(["/some", "path", "to", "file.txt"]),
74
+ ),
75
+ (
76
+ False,
77
+ "/base",
78
+ "/base/download/some/path/to/file.txt",
79
+ _get_expected_output_based_on_os_type(["/some", "path", "to", "file.txt"]),
80
+ ),
81
+ ],
82
+ ids=[
83
+ "Windows with null base url",
84
+ "Windows with non-null base url",
85
+ "Linux with null base url",
86
+ "Linux with non-null base url",
87
+ ],
88
+ )
89
+ def test_get_download_payload_path(
90
+ mock_request_fixture, mocker, is_windows, test_base_url, path, expected
91
+ ):
92
+ mocker.patch("matlab_proxy.util.system.is_windows", return_value=is_windows)
93
+ mock_request_fixture.app["settings"]["base_url"] = test_base_url
94
+ mock_request_fixture.rel_url.path = path
95
+ assert _get_download_payload_path(mock_request_fixture) == expected
96
+
97
+
98
+ def test_get_download_payload_path_invalid_request(mock_request_fixture):
99
+ test_base_url = "/base"
100
+ path = "/download/something"
101
+
102
+ mock_request_fixture.app["settings"]["base_url"] = test_base_url
103
+ mock_request_fixture.rel_url.path = path
104
+
105
+ assert _get_download_payload_path(mock_request_fixture) is None
106
+
107
+
108
+ @pytest.mark.parametrize(
109
+ "response_json, expected_url",
110
+ [
111
+ (
112
+ {
113
+ "messages": {
114
+ "FEvalResponse": [
115
+ {"isError": False, "results": ["http://download-url.com"]}
116
+ ]
117
+ }
118
+ },
119
+ "http://download-url.com",
120
+ ),
121
+ ({"messages": {"FEvalResponse": [{"isError": True}]}}, None),
122
+ ],
123
+ ids=["connector returning correct download url", "connector returning an error"],
124
+ )
125
+ async def test_get_download_url(
126
+ mock_request_fixture, mocker, response_json, expected_url
127
+ ):
128
+ test_base_url = "/"
129
+ path = "/download/some/path/to/file.txt"
130
+
131
+ mock_request_fixture.app["state"].settings = {
132
+ "mwi_server_url": "http://mwi-server.com"
133
+ }
134
+ mock_request_fixture.app["settings"]["base_url"] = test_base_url
135
+ mock_request_fixture.rel_url.path = path
136
+
137
+ mocker.patch(
138
+ "matlab_proxy.util.mwi.embedded_connector.helpers.get_data_to_feval_mcode",
139
+ return_value={},
140
+ )
141
+ mocker.patch(
142
+ "matlab_proxy.util.mwi.embedded_connector.helpers.get_mvm_endpoint",
143
+ return_value="http://mwi-server.com",
144
+ )
145
+ mocker.patch(
146
+ "matlab_proxy.util.mwi.embedded_connector.send_request",
147
+ return_value=response_json,
148
+ )
149
+
150
+ download_url = await get_download_url(mock_request_fixture)
151
+
152
+ assert download_url == expected_url