Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 11 Oct 09:38
· 4 commits to master since this release
143eb4a
  • Deadline propagation (#1): ContextMiddleware accepts an optional
    deadlineHeader; an incoming budget in whole milliseconds (1–999999999)
    shortens the configured timeout, a longer or malformed value is ignored.
    PreflightClient and ContextClient take deadlineHeader and send the
    remaining budget downstream.
  • BC — correlation ids (#2): CorrelationId now validates its value
    (1–128 characters of A-Z a-z 0-9 . _ : -), adds isValid() and
    generate(). ContextMiddleware generates an id when the header is
    missing or invalid (injectable correlationIdGenerator), so every request
    has one, and stores it in the context. Both clients take
    correlationHeader to forward it; an explicit header on the request wins.
  • Exception mapping (#3): with an optional responseFactory,
    ContextMiddleware turns ContextExpiredException into expiredStatus
    (504) and ContextCancelledException into cancelledStatus (499); off by
    default. Adds psr/http-factory to the requirements.
  • BC — ContextClient (#4): rejects an object without a Guzzle-compatible
    request() method at construction; sends the body as its stream and keeps
    the protocol version; sets http_errors => false, so 4xx/5xx responses are
    returned like PSR-18; a transport failure after the budget ran out becomes
    ContextExpiredException with the transport exception as previous.
  • Requires rasuvaeff/context ^0.2. Package brought up to the monorepo
    template (@api, #[Covers], missing repository files, README.ru.md,
    release workflow, runnable example).