Skip to main content

parse_lifecycle_request

Function parse_lifecycle_request 

Source
pub fn parse_lifecycle_request(
    raw: &Value,
) -> Result<(LifecycleEvent, Value), AcdpError>
Expand description

Validate a raw lifecycle request body against the closed {"event": {…}} envelope (RFC-ACDP-0013 §6 step 2) and parse the event through the closed §4 schema.

Returns the parsed event together with the RAW event JSON — signature verification must hash the event exactly as received (LifecycleEvent::preimage_hash_of_value), never a re-serialization.

Errors:

  • AcdpError::ImmutableField — the envelope carries a body member or a member named after a body field (fixture lc-002 scenarios A/B). Checked before the generic closed-shape rejection so the category error wins.
  • AcdpError::SchemaViolation — any other unknown envelope member, a missing/non-object event, or an event violating the closed §4 schema (including an unsigned producer event’s later checks — see the server’s endpoint pipeline).