verified-event.ais

execute(input)
  secrets = service "secrets_default"
  keyId = property("security.secrets.callbackSigningKey")
  if keyId == null
    fail Unavailable "Callback signing key is not configured"
  end
  bytes = request.bytes()
  signature = request.header("X-Partner-Signature")
  if bytes == null or signature == null
    fail InvalidInput "Body and signature are required"
  end
  /*
   * @Standard: Partner callback contract
   * @Conformance: Verify the received bytes without reserialization.
   * @Evidence: Secrets Service verification below.
   */
  valid = secrets.verify(keyId, bytes, signature, { algorithm: "HmacSHA256" })
  if not valid
    fail Forbidden "Signature verification failed"
  end
  payload = Object.parse(Bytes.decode(bytes))
  bus = service "messaging_business"
  channel = bus.newChannel()
  channel.publish("callback.received", payload)
  // Broker acknowledgment is not consumer completion; redelivery may occur.
  return { accepted: true }
end
All examples

Search AISDL

Search the paper, references and examples.