OData Write-Back Receipt Tracker (trackers/odata_writeback.py)

bernstein · src/bernstein/core/trackers/odata_writeback.py · python · Apache-2.0
database, integration, security, pos, tag:knn-classified, tag:writeback, tag:hmac, tag:concurrency

Implements GET-before-PATCH OData v4 write-back with optimistic concurrency, conflict handling, and receipt emission anchored in HMAC audit chain.

# Source: https://github.com/sipyourdrink-ltd/bernstein | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Receipt-anchored OData v4 write-back helper.

A write-back to a system of record is not a fire-and-forget HTTP call; it is a
provable act. :func:`update_entity` implements the GET-before-PATCH pattern with
``If-Match`` optimistic concurrency, surfaces ``412`` / ``428`` as typed
conflicts (never a blind retry that could clobber a concurrent human edit), and
emits a receipt bound into the HMAC audit chain: ``{connection, entity set, key
predicate, ETag observed, payload content-hash, HTTP status}``. Because the
receipt is anchored as an ``odata.writeback_receipt`` event, ``berns

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key