API-Docker

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for API-Docker

0.006     2026-11-18 01:20:29Z

  - The test suite runs again in an installed distribution (`perl Makefile.PL
    && make && make test`, as cpanm and CPAN smokers do): t/dist_source.t now
    checks only a git checkout and skips elsewhere.

  - The tests accept the location Carp before 1.25 (perl 5.14 and 5.16)
    appends to an error, without the final full stop.

0.005     2026-11-17 21:33:48Z

  - API::Docker::Type::Network has a typed `status` accessor for the
    runtime IPAM usage the daemon reports on `GET /networks/{id}`
    (NetworkStatus, IPAMStatus, SubnetStatus). Before, the daemon's `Status`
    landed in `unknown_fields`. The fixture was captured from Docker 29.8.0
    (API 1.56); Podman 5.8.4 (API 1.44) reports no `Status`, so `status` is
    undef there.

  - maint/spec-overlay.yaml grafts named fields of a newer spec onto the
    v1.51 base model, together with the definitions they need. The
    generator, the drift checker and t/spec_to_type.t read the grafted
    model, and a grafted field carries the `since` of its spec. The overlay
    holds Network.Status from v1.55.

  - maint/spec-to-type.pl takes the version it writes into the generated
    classes from lib/API/Docker.pm, and t/spec_to_type.t runs in a git
    worktree as well.

  - A daemon that answers and closes before reading the request body leaves
    the calling process running: the request is written with SIGPIPE
    ignored and every write checked, the response the daemon sent is still
    read, so a 4xx arrives as `API::Docker::Error::HTTP`, and without a
    response the call croaks naming the endpoint.

0.004     2026-08-30 03:30:59Z

  - The typed object model: `list` and `inspect` on every resource now
    return generated `API::Docker::Type::*` objects with snake_case
    accessors (`$c->id`, `$c->size_root_fs`) instead of hashrefs. An
    unrecognised field is kept and re-sent unchanged rather than dropped,
    and `since` is documentation only.
  - The hand-written entity classes are gone. Their convenience methods
    (`start`, `stop`, `logs`, ...) keep their signatures and move to
    `API::Docker::Role::Entity::*`, composed onto the generated classes; the
    old names (`API::Docker::Container`, `::Image`, `::Network`, `::Volume`,
    `::Plugin`, `::Secret`, `::Config`) ship as stubs that croak, naming what
    replaces them.
  - New streaming options `on_event`, `on_frame` and `on_chunk` on the HTTP
    verbs, wired into `system->events`, `containers->logs`/`stats`/`attach`,
    `exec->start`, the `images` build/pull/push/load/get family and the
    `plugins` install/upgrade/push. A callback receives each event, frame or
    chunk as it arrives; `$stop->()` ends the stream early. Without one the
    unbounded endpoints still block.
  - New `read_timeout` and `connect_timeout`, as client attributes and
    per-request options, off by default. `read_timeout` is idle time since
    the last byte; both croak `API::Docker::Error::Timeout`, which carries
    whatever already arrived. A new `TIMEOUTS` section in `API::Docker`
    documents what each bounds. `containers->stats` is deliberately not
    bounded by `read_timeout` -- its stream keeps producing rather than
    going idle.
  - New `API::Docker::Role::Using`: `$docker->containers->using(read_timeout
    => 5)->list` clones a resource class to bound a run of calls. Every
    request the run makes, version negotiation included, carries the bound;
    an explicit `0` turns a client-wide default off.
  - A truncated response is now an exception. A body shorter than its
    Content-Length, a short or malformed chunk, a missing zero chunk, a
    malformed status line, a bad `Content-Length` or a stray 1xx all croak
    `API::Docker::Error::Truncated` instead of being handed back as a whole
    response.
  - A status of 400 or above croaks `API::Docker::Error::HTTP` instead of a
    plain string, carrying `status`, `reason`, `body` and decoded `data`. It
    stringifies exactly as the old string croak did, so text-matching
    callers are unaffected.
  - `tls => 1` now speaks real TLS over `tcp://`. `cert_path` names the
    `docker` CLI's `ca.pem`/`cert.pem`/`key.pem` layout, `tls_insecure`
    turns verification off, and `tls` defaults from
    `$ENV{DOCKER_TLS_VERIFY}`. `IO::Socket::SSL` is a recommended
    dependency, loaded on the first TLS connection.
  - New `response => \%h` option fills `status`, `reason` and `headers`,
    including for a request that croaked. New `head` verb beside
    `get`/`post`/`put`/`delete_request`, which never waits for a body.
  - `negotiate_version` croaks, naming `GET /version` and the expected
    shape, when the body is not a JSON object carrying an `ApiVersion` of the
    form `N.N`.
  - New `API::Docker::Role::Filters`, consumed by all eight resource classes
    and applied at every `filters` call site: a bare value, a boolean or a
    mis-shaped filter is normalised to the engine's JSON map-of-arrays
    instead of silently matching nothing.
  - JSON request bodies send booleans as real `true`/`false`; a caller may
    pass `1`/`0` or a JSON boolean interchangeably.
  - `_uri_encode` UTF-8-encodes a decoded character string before
    percent-escaping, so a name or tag typed as characters (`ü`, `中`) goes
    out as valid UTF-8.
  - A request path outside the RFC 3986 origin-form character set is refused
    before it reaches the daemon, closing a request-line injection through a
    container name or image reference.
  - An ArrayRef query parameter expands into one repeated `k=v` pair per
    element (`names=a&names=b`), which some endpoints require.
  - A bare JSON scalar body (`null`, `true`, a number, a quoted string) is
    decoded rather than handed back as raw bytes; `raw` and `ndjson` return
    `''` and `[]` for a zero-byte body instead of `undef`.
  - Registry credentials reach `images->pull` (`auth`, sent as
    `X-Registry-Auth`) and `images->build` (`registry_config`, sent as
    `X-Registry-Config`), sent only when given. An already-base64 auth value
    in the standard alphabet is respelled URL-safe, which the engine
    requires.
  - `images->pull` no longer appends a default `tag` onto a reference that
    already carries a `:tag` or `@digest`.
  - New `images->get`, `->get_all` and `->load`: the image tar roundtrip in
    and out of a daemon without a registry. New `images->commit`
    (POST /commit) and `images->build_prune` (POST /build/prune, the
    BuildKit cache, a different store from the dangling images
    `images->prune` deletes).
  - New container endpoints: `get_archive`, `put_archive`, `stat_archive`
    (the `docker cp` primitives), `changes`, `export`, `resize` and the
    one-way half of `attach`. `attach` defaults to `stream => 0, logs => 1`



( run in 3.431 seconds using v1.01-cache-2.11-cpan-234fa220139 )