Release 1.7.0#39
Merged
skupriienko merged 9 commits intomainfrom Apr 30, 2026
Merged
Conversation
…mprovements
Implementing a massive BSSN-aligned refactoring of the Mailgun Python SDK's core architecture and security boundaries.
Security & Defense-in-Depth:
- Blocked Path Traversal (CWE-22) in domain webhooks via strict 'sanitize_path_segment' encoding.
- Fixed Case-Sensitive JSON Header Leak (CWE-17) by enforcing RFC 7230 compliance for 'Content-Type'.
- Applied defensive '.rstrip("/")' and safe '.get("keys", [])' dict lookups across all URL handlers to prevent 404 and KeyError crashes.
Core Architecture & Bug Fixes:
- Fixed 'TypeError: multiple values for keyword argument 'headers'' in all HTTP verbs by safely popping headers from kwargs before argument unpacking.
- Abstracted header merging into 'BaseEndpoint._merge_headers' to eliminate DRY violations across sync and async clients.
- Decoupled routing configuration from engine logic by introducing 'ROUTE_ALIASES' in 'routes.py', fixing the 'domains_webhooks' routing bypass.
- Fixed 'AsyncClient' transport closure logic to allow safe context manager reuse.
- Suppressed internal 'KeyError' stack trace leakage in the dynamic '__getattr__' router using 'raise ... from None'.
Testing & Documentation:
- Achieved 100% pass rate across 318 unit and integration tests.
- Added extensive regression tests for CWE-22, kwargs collisions, and async lifecycle bounds.
- Updated CHANGELOG.md and PERFORMANCE.md to reflect the new architecture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Actions:
CHANGELOG.mdREADME.md_version.pyNotes: