webex-message-handler 0.6.0__tar.gz → 0.6.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.
Files changed (23) hide show
  1. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/PKG-INFO +1 -1
  2. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/pyproject.toml +1 -1
  3. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/src/webex_message_handler/handler.py +2 -2
  4. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/src/webex_message_handler/kms_client.py +2 -1
  5. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/src/webex_message_handler/mercury_socket.py +2 -1
  6. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/.gitignore +0 -0
  7. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/API.md +0 -0
  8. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/LICENSE +0 -0
  9. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/README.md +0 -0
  10. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/examples/basic_bot.py +0 -0
  11. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/src/webex_message_handler/__init__.py +0 -0
  12. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/src/webex_message_handler/device_manager.py +0 -0
  13. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/src/webex_message_handler/errors.py +0 -0
  14. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/src/webex_message_handler/logger.py +0 -0
  15. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/src/webex_message_handler/message_decryptor.py +0 -0
  16. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/src/webex_message_handler/types.py +0 -0
  17. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/test-proxy.py +0 -0
  18. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/tests/__init__.py +0 -0
  19. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/tests/conftest.py +0 -0
  20. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/tests/test_device_manager.py +0 -0
  21. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/tests/test_handler.py +0 -0
  22. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/tests/test_integration.py +0 -0
  23. {webex_message_handler-0.6.0 → webex_message_handler-0.6.1}/tests/test_message_decryptor.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webex-message-handler
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: Lightweight Webex Mercury WebSocket + KMS decryption for receiving bot messages without the full Webex SDK
5
5
  Project-URL: Homepage, https://github.com/3rg0n/webex-message-handler
6
6
  Project-URL: Repository, https://github.com/3rg0n/webex-message-handler
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "webex-message-handler"
7
- version = "0.6.0"
7
+ version = "0.6.1"
8
8
  description = "Lightweight Webex Mercury WebSocket + KMS decryption for receiving bot messages without the full Webex SDK"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -56,8 +56,8 @@ def extract_person_uuid(person_id: str) -> str:
56
56
  uuid = decoded.rsplit("/", 1)[-1]
57
57
  if uuid:
58
58
  return uuid
59
- except Exception:
60
- # Not base64 — treat as raw UUID
59
+ except (ValueError, UnicodeDecodeError):
60
+ # Not base64 or invalid UTF-8 — treat as raw UUID
61
61
  pass
62
62
  return person_id
63
63
 
@@ -415,7 +415,8 @@ def _derive_ecdh_shared_key(local_key: jwk.JWK, remote_key: jwk.JWK, *, kid: str
415
415
  x_int = int.from_bytes(x_bytes, "big")
416
416
  y_int = int.from_bytes(y_bytes, "big")
417
417
  remote_crypto_key = EllipticCurvePublicNumbers(x_int, y_int, SECP256R1()).public_key()
418
- except Exception:
418
+ except (KeyError, ValueError, TypeError):
419
+ # Failed to parse JWK or convert coordinates — will be caught below
419
420
  pass
420
421
 
421
422
  if remote_crypto_key is None:
@@ -112,7 +112,8 @@ class MercurySocket:
112
112
 
113
113
  # Start read loop in background
114
114
  async def _read_loop() -> None:
115
- assert self._ws is not None
115
+ if self._ws is None:
116
+ raise RuntimeError("WebSocket not initialized before starting read loop")
116
117
  try:
117
118
  async for msg in self._ws:
118
119
  if msg.type == aiohttp.WSMsgType.TEXT: