1.6.0 - 2026-04-27
- CWE-22 (Prevented Path Traversal): Prevented vulnerabilities by enforcing strict URL encoding (
urllib.parse.quote) on all dynamically injected path parameters (idandaction_id). - CWE-113 (CRLF Injection): Added strict header validation to block HTTP Request Smuggling.
- CWE-117 (Log Forging): Implemented mandatory sanitization of telemetry data.
- CWE-316 (Secret Leakage): Enhanced
__repr__and__str__to prevent sensitive data from appearing in stack traces. - CWE-319 (Cleartext transmission): Prevented by enforcing strict
api_urlscheme validation (https) and hostname presence duringConfiginitialization. - CWE-601 (Open Redirect): Hard-disabled automatic redirects (
allow_redirects=False) for all API calls. - CWE-918 (SSRF): Added hostname validation to prevent credential exfiltration to non-Mailjet domains.
- Added comprehensive security scanning to the CI/CD pipeline (
bandit,semgrep,gitleaks,detect-secrets). - Updated
SECURITY.mdpolicy to clarify supported active branches.
- Official support for Python 3.14 (added to CI test matrix and PyPI classifiers).
- Runtime dependency
typing-extensions>=4.7.1for Python versions<3.11to support modern type hinting. - Context Managers (Resource Management): The
Clientnow supports thewithstatement (__enter__/__exit__) for automatic TCP connection pooling and socket cleanup, preventing resource leaks. - New
mailjet_rest.utils.guardrailsmodule for centralized security and routing validation. sanitize_log_traceutility to protect against Log Forging attacks.- Proactive
UserWarningfor insecure TLS configurations and unencrypted HTTP proxies. - Smart Telemetry: The SDK now automatically extracts Mailjet Trace IDs (
CustomID,Campaign,TemplateID) from payloads and headers, injecting them into debug logs for easier correlation with the Mailjet Dashboard. - Executable Documentation: Added
samples/smoke_readme_runner.pyas a dynamic test suite to guarantee allREADME.mdexamples are continuously validated and functional against the live API. - Developer Experience (DX) Guardrails: The SDK now logs explicit warnings when encountering ambiguous routing configurations (e.g., using the singular
templateresource on Content APIv1, or attempting to route the Send API outside ofv3/v3.1). - Content API (v1): Native
multipart/form-dataupload support using therequestsfileskwarg for thedata_imagesendpoint. - Safe Exceptions: Network errors are now safely encapsulated in custom
mailjet_restexceptions (TimeoutError,CriticalApiError,ApiError). - Native Logging: Centralized HTTP status and debug logging in
api_callusing standard Pythonlogging. - IDE Autocompletion: Overrode
__dir__in the coreClientto expose high-traffic dynamic endpoints (e.g.,.contact,.send,.campaigndraft) directly to IDE autocompletion engines (VS Code, PyCharm). - Validated and added explicit test coverage for Issue #97, proving
TemplateLanguageandVariablesare correctly serialized by the SDK.
- Performance: Optimized dynamic routing by introducing an instance-level
_endpoint_cache, resulting in a ~47x speedup for endpoint resolution. - Performance: Reduced RAM footprint and garbage collection overhead by implementing
__slots__across coreClient,Config, andEndpointclasses. - Performance: Optimized API call overhead by replacing dynamic header generation with
types.MappingProxyType(_JSON_HEADERS,_TEXT_HEADERS) and moving the retry configuration to aClassVar. - Performance: Improved cold boot initialization time by replacing regex (
re.match) with native string manipulation (.split()) inmailjet_rest/utils/version.py. - Test Suite Modernization: Migrated from legacy
unittestmonolith topytest, segregated intotests/unit/(offline) andtests/integration/(live network), adhering to the AAA (Arrange, Act, Assert) pattern. - CI/CD Optimization: Drastically improved GitHub Actions speed and reliability by implementing native pip dependency caching (
cache: 'pip') and isolated wheel installation tests. - Refactored
ClientandConfigusing@dataclassandrequests.Sessionfor robust connection pooling on multiple sequential requests. - Refactored
Endpoint._build_urlcyclomatic complexity by extracting pure@staticmethodhelpers (_build_csv_url,_check_dx_guardrails) to satisfy strict static analysis. - Expanded
pre-commithooks for robust security and formatting (ruff, mypy, pyright, typos, bandit, semgrep). - Defined explicit public module interfaces using
__all__to prevent namespace pollution. - Cleaned up local development environments (
environment-dev.yaml) and pinned sub-dependencies for stable CI pipelines. - Tooling Consolidation: Completely migrated to Ruff as the single source of truth for linting and formatting, purging legacy tools (Black, Flake8, Pylint, Pydocstyle) from
pyproject.tomland Conda environments. - Documentation: Rewrote
README.mdto highlight modern DX configurations, including Context Managers, robust Error Handling, and Smart Telemetry.
- Passing
timeout=Noneto allow infinite socket blocking is deprecated to mitigate CWE-400. Explicit timeouts will be strictly enforced in v2.0. - Legacy HTTP exception classes (
AuthorizationError,ApiRateLimitError,DoesNotExistError,ValidationError,ActionDeniedError). The SDK natively returns therequests.Responseobject for standard HTTP status codes. - The legacy
ensure_asciianddata_encodingarguments in thecreateandupdatemethod signatures. The underlyingrequestslibrary handles UTF-8 serialization natively. - The
parse_responseandlogging_handlerutility functions. Logging is now integrated cleanly and automatically via Python's standardlogginglibrary. See theREADMEfor the new 2-line setup.
- Root
test.pymonolith (replaced by a modulartest/directory structure). - Redundant class constants (
API_REF,DEFAULT_API_URL).
- Fixed
statcountersrequired filters (explicitly added theCounterTimingparameter).
- PR_125 - Refactor client.
- PR_126 - build(deps): bump conda-incubator/setup-miniconda from 3.3.0 to 4.0.1
- PR_128 - Release 1.6.0.
- PR_129 - Use hyphen in the package name in readme.
1.5.1 - 2025-07-14
- Remove
*/_version.pyfrom.gitignore
- Improve a conda recipe
- PR_124 - Release 1.5.1
1.5.0 - 2025-07-11
- Add class
TestCsvImporwith a test suite for testing CSV import functionality totest.py - Add
types-requeststomypy'sadditional_dependenciesinpre-commithooks - Add
pydocstylepre-commit's hook - Add
*/_version.pyto.gitignore
- Fix a csvimport error 'List index (0) out of bounds': renamed
json_databack todata. Corrected behavior broken since v1.4.0
- Update pre-commit hooks to the latest versions
- Breaking changes: drop support for Python 3.9
- Import Callable from collections.abc
- Improve a conda recipe
- Update
README.md
- Add the Security Policy file
SECURITY.md - Use
permissions: contents: readin all CI workflow files explicitly - Use commit hashes to ensure reproducible builds
- Update pinning for runtime dependency
requests >=2.32.4
1.4.0 - 2025-05-07
- Enabled debug logging
- Support for Python >=3.9,<3.14
- CI Automation (commit checks, issue-triage, PR validation, publish)
- Issue templates for bug report, feature request, documentation
- Type hinting
- Docstrings
- A conda recipe (meta.yaml)
- Package management stuff: pyproject.toml, .editorconfig, .gitattributes, .gitignore, .pre-commit-config.yaml, Makefile, environment-dev.yaml, environment.yaml
- Linting: py.typed
- New samples
- New tests
- Update README.md
- Improved tests
- requirements.txt and setup.py are replaced by pyproject.toml
- .travis.yml was obsolete
- PR_105 - Update README.md, fix the license name in setup.py
- PR_107 - PEP8 enabled
- PR_108 - Support py>=39,<py313
- PR_109 - PEP 484 enabled
- PR_110 - PEP 257 enabled
- PR_111 - Enable debug logging
- PR_114 - Update README
- PR_115 - Add a conda recipe
- PR_116 - Improve CI Automation and package management
- PR_117 - Release 1.4.0
Closed issues:
- Response 400 error #59
- Lib expected to work on py3.7? #48
- FromTS-ToTS filter does not work for GET /message #47
- import name Client #33
- proxy dict #23
- Too many 500 #19
- ImportError: cannot import name Client #16
- Add a "date" property on pypi #15
- Django support #9
Merged pull requests:
- Update README.md #44 (Hyask)
- new readme version with standardized content #42 (adamyanliev)
- fix page #41 (adamyanliev)
- Fix unit tests for new API address #37 (todorDim)
- Fix URL slicing, update version in unit test #36 (todorDim)
- Add support for domain specific api url, update requests module, remove python 2.6 support #34 (todorDim)
- add versioning section #32 (adamyanliev)
- Update README.md #31 (mskochev)
- Fix README.md #30 (MichalMartinek)
v1.3.2 (2018-11-19)
Merged pull requests:
v1.3.1 (2018-11-13)
Closed issues:
- How to add a contact to a list #22
- Impossible to know what is wrong #20
- wrong version number #13
- example missing / not working #11
- Remove 'Programming Language :: Python :: 3.2', from setup.py #10
Merged pull requests:
- Features/add action #27 (todorDim)
- Fix action_id #26 (mskochev)
- Pass action id, change build_url to accept both number and string #25 (todorDim)
- README: Fix grammar #18 (bfontaine)
- Fix issue #13 #14 (latanasov)
- Improve Package version #12 (jorgii)
v1.3.0 (2017-05-31)
Closed issues:
Merged pull requests:
- Api version kwargs #8 (jorgii)
- fix unresolved variable inside build_headers #4 (vparitskiy)
v1.2.2 (2016-06-21)
Merged pull requests:
- Fix mixed indent type #3 (Malimediagroup)
v1.0.6 (2016-06-20)
Merged pull requests:
v1.0.4 (2015-11-19)
v1.0.3 (2015-10-13)
* This Changelog was automatically generated by github_changelog_generator