• v2.1.0 69088dc6e9

    v2.1.0 Stable

    michael released this 2026-08-10 13:19:40 +02:00 | 20 commits to main since this release

    Breaking changes

    • All public failures across http_client and ip_utils now return
      nil, <daw_error/v1 object> instead of nil, <string>. The return
      contract itself (result, nil | nil, err) is unchanged -- only what
      err is. See MIGRATION-DAW-LUA-NET-2.1.md for the full code table
      and cause-chain examples.
    • init.lua's facade stub (missing submodule case) likewise now
      returns nil, daw_error/v1 instead of a string.

    Fixes

    • Module registration (_G.daw_register guard) corrected from
      type(_G.daw_register) == "function" to the simple truthy check
      if _G.daw_register then ..., matching the lived pattern already
      used across daw-lua-common (accepted decision, see
      DAW/daw-docs#18).
    • ip_utils.ip_matches_cidr(): the exact-match path (no / in
      cidr) previously skipped IPv4 validation entirely and crashed with
      a raw Lua error on a non-string cidr (e.g. nil). Both ip and
      cidr are now validated the same way regardless of which path is
      taken.
    • ip_utils.is_ip_allowed() / get_client_ip(): a non-table
      allowed_ips/trusted_proxies (e.g. a bare string) previously
      reached #/ipairs() directly and could crash or silently
      misbehave. Both now return nil, daw_error/v1 for a non-table,
      non-nil value.
    • http_client: opts.headers was previously used directly without a
      type check; a non-table value (e.g. a string) could crash inside
      pairs()/header lookup. Now validated up front in both request()
      and get_raw().
    • http_client.post/put: a json.encode() failure was previously
      flattened into plain text ("encode failed: " .. tostring(err)),
      discarding the structured daw_error/v1 from json.encode(). It is
      now preserved as cause on the resulting encode_failed error,
      consistent with how ip_utils already chains errors.

    Internal

    • http_client.lua: internal request() helper now returns a
      machine-readable reason keyword alongside its plain-text error, so
      the public get/post/put functions can build precise
      daw_error/v1 codes (invalid_opts, encode_failed,
      connection_failed) without parsing error text.
    • ip_utils.lua: nine distinct error codes across
      ip_matches_cidr/is_ip_allowed/get_client_ip; public-to-public
      error propagation now uses cause embedding instead of string
      concatenation.
    • init.lua: facade rebuilt around the daw_error/v1-aware
      fail()/module_stub() pattern shared with daw.common/init.lua.
    • test/dev-module-map.lua: added daw.common.error,
      daw.common.error.util, daw.common.uuid -- required by the new
      error contract, previously missing from this repo's dev module map.
    • New test/test_init.lua covering the root facade (submodule
      aggregation, object identity, stub fallback on a missing submodule),
      mirroring daw-lua-common's test_init.lua.
    • Test suite: 42 -> 64 tests.

    Migration

    Only code that inspects error text (string matching/parsing on
    err) needs changes -- code that only checks if err then is
    unaffected. MIGRATION-DAW-LUA-NET-2.1.md walks through the full
    error-code reference and cause-chain examples.

    Requires daw-lua-common >= 2.1.0 (for daw.common.error).

    Downloads