From 7f9c9515068b8a8feca8c6a0a5e24fcb460b0cbe Mon Sep 17 00:00:00 2001 From: maxkahan Date: Wed, 6 Sep 2023 16:36:26 +0100 Subject: [PATCH 1/3] fix e2ee type conversion issue --- opentok/opentok.py | 7 +++---- tests/test_session_creation.py | 9 +++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/opentok/opentok.py b/opentok/opentok.py index e693eaa..554cbd9 100644 --- a/opentok/opentok.py +++ b/opentok/opentok.py @@ -458,24 +458,23 @@ def create_session( ).format(location) ) options[u("location")] = location - options["e2ee"] = e2ee + options["e2ee"] = str(e2ee).lower() try: logger.debug( "POST to %r with params %r, headers %r, proxies %r", self.endpoints.session_url(), options, - self.headers(), + {**self.get_headers(), "Accept": "application/json"}, self.proxies, ) response = requests.post( self.endpoints.get_session_url(), data=options, - headers=self.get_headers(), + headers={**self.get_headers(), "Accept": "application/json"}, proxies=self.proxies, timeout=self.timeout, ) - response.encoding = "utf-8" if response.status_code == 403: diff --git a/tests/test_session_creation.py b/tests/test_session_creation.py index 374ad99..bc82d0b 100644 --- a/tests/test_session_creation.py +++ b/tests/test_session_creation.py @@ -39,7 +39,12 @@ def test_create_default_session(self): validate_jwt_header(self, httpretty.last_request().headers[u("x-opentok-auth")]) expect(httpretty.last_request().headers[u("user-agent")]).to( - equal(u("OpenTok-Python-SDK/") + __version__ + ' python/' + platform.python_version()) + equal( + u("OpenTok-Python-SDK/") + + __version__ + + " python/" + + platform.python_version() + ) ) body = parse_qs(httpretty.last_request().body) expect(body).to(have_key(b("p2p.preference"), [b("enabled")])) @@ -310,7 +315,7 @@ def test_create_session_with_e2ee(self): session = self.opentok.create_session(e2ee=True) body = parse_qs(httpretty.last_request().body) - expect(body).to(have_key(b("e2ee"), [b"True"])) + expect(body).to(have_key(b("e2ee"), [b"true"])) expect(session).to(be_a(Session)) expect(session).to( have_property( From 9a0944d1d5978fa8c1ab6bf1a6a3f28403b49eba Mon Sep 17 00:00:00 2001 From: maxkahan Date: Wed, 6 Sep 2023 16:37:58 +0100 Subject: [PATCH 2/3] updating changelog --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 47157d9..336c90e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,6 @@ +# Release v3.7.1 +- Fixed an issue with end-to-end encryption not being called correctly when creating a new session + # Release v3.7.0 - Added the `maxBitrate` parameter to the `Client.start_broadcast` method - Added the `hlsStatus` parameter to the `Broadcast object` From c1927b3cf17616b7c34025e17677a10b348ad7c2 Mon Sep 17 00:00:00 2001 From: maxkahan Date: Wed, 6 Sep 2023 16:38:12 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Bump=20version:=203.7.0=20=E2=86=92=203.7.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- opentok/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 72e62e2..cf74125 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.7.0 +current_version = 3.7.1 commit = True tag = False diff --git a/opentok/version.py b/opentok/version.py index 58727e6..cb29373 100644 --- a/opentok/version.py +++ b/opentok/version.py @@ -1,3 +1,3 @@ # see: http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers -__version__ = "3.7.0" +__version__ = "3.7.1"