Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dexpace/python-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: dexpace/python-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/http-stack-correctness-hardening
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 86 files changed
  • 2 contributors

Commits on Jun 10, 2026

  1. fix: correctness and security hardening across pipeline, transports, …

    …and serde
    
    Resolve a batch of correctness and security issues found while reviewing the
    HTTP stack end to end.
    
    Pipeline & auth:
    - Credential policies are origin-aware: after a cross-origin redirect the
      bearer/basic/key credential is no longer re-stamped onto the foreign host,
      and the redirect policy strips a caller-set Authorization only on
      cross-origin hops (same-origin hops keep it).
    - Retry decides single-use body buffering from the effective per-call retry
      total and no longer retries non-idempotent methods on read-phase errors;
      async body buffering runs off the event loop.
    - Pipeline construction rejects reuse of a policy instance already wired into
      another pipeline.
    
    Transports:
    - requests: never emit Content-Length and Transfer-Encoding together; frame
      known-length bodies by length (streamed, not buffered into memory) and chunk
      unknown-length bodies with any stale Content-Length removed. Close only a
      session the client owns; preserve repeated response headers; report the
      negotiated HTTP version; drop a misleading Content-Length under
      Content-Encoding.
    - urllib: stop following redirects inside the transport so the 3xx reaches the
      pipeline; map response-read failures into the SDK error hierarchy.
    - asyncio: send Host with the port for non-default ports; apply an SSL context
      only to https URLs; reject chunked and read connection-close framing instead
      of fabricating an empty body; detect chunked across multiple
      Transfer-Encoding lines; buffer the request body off the event loop.
    - httpx/aiohttp: set Content-Length for known-length bodies and pump sync body
      iterators on a worker thread.
    - All transports preserve a valid-but-unregistered status code instead of
      discarding the response.
    
    Serde, pagination, streaming, multipart:
    - Codec decodes Annotated[...] fields (including annotated Tristate) correctly,
      guards recursion depth, and wraps conversion failures in CodecError.
    - Link-header pagination reads every Link line and tolerates commas inside the
      target URI; cursor pagination accepts non-string cursors; JSON page parsing
      surfaces DeserializationError.
    - JSONL and SSE decoding map invalid UTF-8 onto the streaming error contract.
    - Multipart rejects CR/LF/NUL in field names, filenames, media types, custom
      part headers, and the boundary to prevent header injection.
    
    Also fixes the digest nonce-count reset, per-operation tracing event emission,
    URL-redactor fail-closed behaviour, proxy configuration parsing, and a number
    of smaller correctness and documentation issues. Adds regression tests
    throughout; the full suite, mypy --strict, and ruff all pass.
    
    Co-Authored-By: Claude Opus 4.8 <[email protected]>
    OmarAlJarrah and claude committed Jun 10, 2026
    Configuration menu
    Copy the full SHA
    865d217 View commit details
    Browse the repository at this point in the history
  2. fix(serde): resolve generic-dataclass type parameters on Python 3.12

    Decoding a PEP 695 generic dataclass (e.g. `Box[int]`, declared `class Box[T]`)
    raised `CodecError: name 'T' is not defined` on Python 3.12. The field
    annotations reference the class type parameters, and 3.12's `get_type_hints`
    does not place those parameters in scope (3.13+ resolves them automatically).
    
    Pass the class `__type_params__` through `get_type_hints`'s `localns` so the
    annotations resolve on every supported interpreter. Verified against the full
    suite on 3.12, 3.13, and 3.14.
    
    Co-Authored-By: Claude Opus 4.8 <[email protected]>
    OmarAlJarrah and claude committed Jun 10, 2026
    Configuration menu
    Copy the full SHA
    bbad452 View commit details
    Browse the repository at this point in the history
Loading