Skip to content

Commit

Permalink
Merge pull request #227 from opentok/fix-e2ee-type
Browse files Browse the repository at this point in the history
Fix e2ee type
  • Loading branch information
maxkahan authored Sep 6, 2023
2 parents 132c8d4 + c1927b3 commit 98f05f7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.7.0
current_version = 3.7.1
commit = True
tag = False

Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
7 changes: 3 additions & 4 deletions opentok/opentok.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion opentok/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# see: http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers
__version__ = "3.7.0"
__version__ = "3.7.1"

9 changes: 7 additions & 2 deletions tests/test_session_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]))
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 98f05f7

Please sign in to comment.