#github #gitlab #webhook #ci

rifling

A library for creating Github/Gitlab webhook listener

9 unstable releases (3 breaking)

0.4.0 Apr 24, 2019
0.3.3 Apr 23, 2019
0.2.1 Apr 20, 2019
0.1.1 Mar 31, 2019

#342 in Testing

Download history 70/week @ 2022-06-04 8/week @ 2022-06-11 13/week @ 2022-06-18 20/week @ 2022-06-25 14/week @ 2022-07-02 14/week @ 2022-07-09 24/week @ 2022-07-16 23/week @ 2022-07-23 27/week @ 2022-07-30 27/week @ 2022-08-06 15/week @ 2022-08-13 34/week @ 2022-08-20 12/week @ 2022-08-27 24/week @ 2022-09-03 29/week @ 2022-09-10 11/week @ 2022-09-17

88 downloads per month
Used in 2 crates

MIT license

29KB
561 lines

Rifling

license crates.io docs.rs Build Status

Rifling is a library to create Github/GitLab Webhook listener, influenced by afterparty.

If you want a commandline tool rather than a library, please consult trigger.

Features

  • Supports both GitHub and GitLab.
  • Supports both application/json mode and (optionally) application/x-www-form-urlencoded mode.
  • (Potentially) support for different web frameworks.
  • Optional payload parsing support. Using serde_json's untyped parsing functionality.
  • Optional payload authentication support with ring or libraries from RustCrypto team.
  • Optional logging.

Optional features

  • Web frameworks:
  • Payload authentication (does not affect usage):
    • crypto-use-ring (default): Use ring as cryptography library. This MAY be faster but has some C code.
    • crypto-use-rustcrypto: Use libraries from RustCrypto team (hmac and sha-1). These libraries are pure Rust implementations of these algorithms, which can be linked with musl.
  • Payload content type:
    • content-type-urlencoded (enabled by default): Support for application/x-www-form-urlencoded typed content.
  • Payload parsing:
    • parse (default): Parse the payload. Parsed payload will be present in Delivery.payload as Option<Value>.
  • Logging:
    • logging (default): Use the official log crate to log.
    • logging-print: Use println macro to print log. Will be ignored when logging is enabled.

Notes

  • Debug logs are useful to find problems.
  • Events received from GitLab will be patched by lower casing and replacing " "(whitespace) with "_"(underscore).
    • e.g. Push Hook will be push_hook while registering hooks.

License

MIT License. See LICENSE.

Dependencies

~0–2.5MB
~69K SLoC