• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mariofix / khipu-tools / 22537856284

01 Mar 2026 06:41AM UTC coverage: 56.401% (+0.9%) from 55.547%
22537856284

push

github

web-flow
fix: security hardening, dead code removal, Python 3.12 modernization (#16)

* fix: security hardening, dead code removal, Python 3.12 modernization

Security:
- Enable SSL verification by default (was hardcoded disabled)
- Fix _http_client: _verify_ssl_certs now uses passed parameter value
- Fix ssl kwargs: remove verify_ssl_certs=False from _get_http_client
- Fix _request_internal: both if/else branches were setting verify=True
- Remove debug print statement leaking POST body to stdout
- Replace bare except BaseException -> except (UnicodeDecodeError, ValueError)
- Replace bare except Exception -> except (json.JSONDecodeError, ValueError)
- Replace hardcoded personal email in error message with GitHub issues URL

Dead code removal:
- _util.py: remove Dict/parse_qsl unused imports, dead secure_compare
  fallback (hmac.compare_digest available since Python 3.3), populate_headers
  (always returned None), sanitize_id, class_method_variant, convert_to_dict
- _error.py: remove CardError (Khipu is bank-transfer only, not card-based)
- _error_object.py: remove Stripe-specific fields: charge, decline_code,
  payment_intent, payment_method, setup_intent, source
- _encode.py/_khipu_response.py: replace OrderedDict with dict (ordered
  since Python 3.7)
- Remove *args/**kwargs from new_default_http_client/new_http_client_async_fallback

Stripe reference cleanup:
- Replace all 'Stripe\'s API' references with 'Khipu\'s API'
- Remove Stripe-specific comment about 'updating a customer with a card'
- Fix TypeError message in RequestsClient: remove 'Stripe\'s' reference

Python 3.10+ modernization:
- Add from __future__ import annotations to _khipu_object.py
- Replace Optional[X] -> X | None throughout all modules
- Replace Union[X, Y] -> X | Y throughout all modules
- Remove typing.Optional and typing.Union imports where unused
- pyproject.toml: requires-python >= 3.10 (drop 3.9)
- pyproject.toml: black target-version [py310, py311, py312]
- pyproject.toml: isort p... (continued)

29 of 113 branches covered (25.66%)

Branch coverage included in aggregate %.

623 of 1043 relevant lines covered (59.73%)

2.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

19.57
/_encode.py


Source Not Available

The file "_encode.py" isn't available on github. Either it's been removed, or the repo root directory needs to be updated.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc