Module webhook

Module webhook 

Source
Expand description

webhook handling (forge-agnostic)

Processing happens as follows:

  • HHTP POST data
    1. processed by Rocket route handler
    2. FromData for RoutePayloadParameter<F>
      • Checks the vhost.
      • Extracts the client IP address and checks it against the union of the forge ACLs.
      • Deserialises the JSON into serde_json::Value.
    3. Per-forge webhook implementation route calls RoutePayloadParameter<F>::webhook_impl.
    4. Global implementation webhook_impl, here:
      • Goes via webhook_impl_logged and RawPayload.decode_analyse_validate_record to structure the logging and error handling.
      • Calls the forge-specific prefilter.
      • Further deserialises the payload into the forge-specific data We3bhookForge::Payload.
      • Calls ForgeKind::analyse_payload to get a webhook::AnalysedPayloadData.
      • Checks the host name and IP address against the specific ACL.
      • Parses the tag metadata.
      • Makes a JobRow and Inserts it into the database.

Structsยง

AnalysedPayload
RoutePayloadParameter
Used in #[rocket::post]