You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,24 +7,40 @@ We [keep a changelog.](http://keepachangelog.com/)
7
7
### Security
8
8
9
9
-**Enterprise Runtime Security:** Added opt-in PEP 578 Audit Hooks (`sys.addaudithook`) managed via the new `Config` class attribute `enable_security_audit` to monitor runtime network events (`mailjet.security.*`) for SIEM/SecOps compliance.
10
+
-**Path Traversal Mitigation (CWE-22)**: Implemented strict path segment sanitization in `Endpoint` and `guardrails.py` using `urllib.parse.quote(safe="")` to prevent directory traversal via dynamic ID inputs.
11
+
-**Runtime Security**: Centralized and hardened `SecurityGuard.sanitize_segment` to neutralize potential CRLF injections and path traversal attempts across the entire request stack.
10
12
-**Supply Chain Security:** Hardened the GitHub Actions validation pipeline by implementing Google's `osv-scanner` and separating `pip-audit` into an independent strict security job.
11
13
-**Static Analysis Hardening:** Expanded Semgrep scanning targets to include the `p/insecure-transport` extended query suite and wired internal Bandit configuration (`-c pyproject.toml`) directly into CI workflow checkpoints.
12
14
-**Automated Fuzzing:** Integrated `Atheris` (libFuzzer engine) code coverage suite into development workflows, exposing a unified orchestration entry point (`manage.sh fuzz_all`).
13
15
-**Secret Hygiene:** Updated repository infrastructure defaults (`.gitignore`) to strictly reject the accidental stage or commit of local private keys (`*.key`).
-**TemplateContentBuilder**: Introduced a dedicated fluent builder for `Content API` payloads, enforcing schema correctness with fail-fast validation.
21
+
-**URI Templating Engine**: Added a robust path interpolation engine in `Endpoint` to handle complex multi-level REST resources dynamically without handler proliferation.
22
+
-**Telemetry Infrastructure**: Enhanced internal telemetry extraction for better structured logging of API request payloads.
17
23
-**Domain Configuration:** Extracted configuration logic out of the monolithic client layout into a dedicated `Config` structure (`mailjet_rest/config.py`) to safely isolate runtime parameters.
18
24
-**Testing Ecosystem:** Segmented the testing footprint into clear execution topologies: `tests/unit/` (100% offline via mock patches), `tests/integration/` (live network testing), `tests/regression/`, and `tests/fuzz/` (Atheris mutations).
19
25
-**Error Boundaries:** Introduced a dedicated `errors.py` module containing explicit, domain-specific leave exceptions (`ValidationError`, `MailjetAuthError`, `ApiRateLimitError`, etc.) to avoid catching bare exceptions.
20
26
-**Type Definitions:** Added a structured `types.py` layer to eliminate MyPy "Type Blindness" across private utilities and dynamic client trackers.
21
27
22
28
### Changed
23
29
30
+
-**Performance Optimization**:
31
+
- Migrated from procedural dynamic routing (`__getattr__`) to O(1) static lookups.
32
+
- Refactored internal string manipulations to use native Python methods, reducing cold-boot latency by ~29ms.
33
+
- Optimized memory footprint by enforcing `__slots__` across core infrastructure classes (`Client`, `Endpoint`, `Config`).
34
+
-**Configuration**: Standardized `Config` structure and moved internal type aliases to `types.py` to prevent cyclic import dependencies.
35
+
-**Dependency Management**: Updated `pyproject.toml` to optimize `ruff` linting and import grouping (isort).
24
36
-**Architectural Decomposition (SRP):** Refactored the bloated `client.py` component, shifting single-responsibility concerns into individual domain files (`builders.py`, `config.py`, `endpoint.py`, `errors.py`, `types.py`).
25
37
-**Endpoint Routing Interface:** Relaxed the internal route handler signature `_route_data` inside `endpoint.py` by converting the explicit name identifier to an optional parameter (`_name: str | None = None`) to increase routing flexibility.
26
38
-**Pre-commit Workflow Stability:** Configured hooks (Bandit, Mypy) with `pass_filenames: false` to force systematic execution over the full repository context rather than fragmented staged files.
27
39
40
+
### Fixed
41
+
42
+
-**Compatibility**: Restored parity with legacy exceptions and dynamic routing behavior to ensure zero breaking changes for existing SDK consumers.
0 commit comments