Skip to content

Commit 1fe2f34

Browse files
krisctlPrabhakar Kumar
authored andcommitted
Responds to backwards incompatible change in matlab-proxy v0.16.0
1 parent 42d164d commit 1fe2f34

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ classifiers = [
4545
dependencies = [
4646
"jupyter-server-proxy",
4747
"simpervisor>=1.0.0",
48-
"matlab-proxy>=0.10.0",
48+
"matlab-proxy>=0.16.0",
4949
"psutil",
5050
"requests",
5151
"ipykernel"

src/jupyter_matlab_proxy/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020-2023 The MathWorks, Inc.
1+
# Copyright 2020-2024 The MathWorks, Inc.
22

33
import os
44
from pathlib import Path
@@ -77,6 +77,7 @@ def setup_matlab():
7777
"""
7878

7979
import matlab_proxy
80+
from matlab_proxy.constants import MWI_AUTH_TOKEN_NAME_FOR_HTTP
8081
from matlab_proxy.util.mwi import logger as mwi_logger
8182

8283
logger = mwi_logger.get(init=True)
@@ -104,7 +105,7 @@ def setup_matlab():
104105
# We are using token_hash instead of raw token for better security.
105106
if _mwi_auth_token:
106107
jsp_config["request_headers_override"] = {
107-
"mwi_auth_token": _mwi_auth_token.get("token_hash")
108+
MWI_AUTH_TOKEN_NAME_FOR_HTTP: _mwi_auth_token.get("token_hash")
108109
}
109110

110111
return jsp_config

tests/unit/test_jupyter_server_proxy.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Copyright 2020-2023 The MathWorks, Inc.
1+
# Copyright 2020-2024 The MathWorks, Inc.
22

33
import inspect
44
import os
55
from pathlib import Path
66

7-
import matlab_proxy
8-
from matlab_proxy.util.mwi import environment_variables as mwi_env
9-
107
import jupyter_matlab_proxy
8+
import matlab_proxy
119
from jupyter_matlab_proxy.jupyter_config import config
10+
from matlab_proxy.constants import MWI_AUTH_TOKEN_NAME_FOR_HTTP
11+
from matlab_proxy.util.mwi import environment_variables as mwi_env
1212

1313

1414
def test_get_auth_token():
@@ -79,7 +79,9 @@ def test_setup_matlab():
7979
"icon_path": icon_path,
8080
},
8181
"request_headers_override": {
82-
"mwi_auth_token": jupyter_matlab_proxy._mwi_auth_token.get("token_hash"),
82+
MWI_AUTH_TOKEN_NAME_FOR_HTTP: jupyter_matlab_proxy._mwi_auth_token.get(
83+
"token_hash"
84+
),
8385
},
8486
}
8587

0 commit comments

Comments
 (0)