GithubHelp home page GithubHelp logo

00mjk / github_webhook_message_validator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qubyte/github_webhook_message_validator

1.0 0.0 0.0 15 KB

A library to check that payloads from github webhooks are valid.

Home Page: https://docs.rs/github_webhook_message_validator/

License: MIT License

Rust 100.00%

github_webhook_message_validator's Introduction

GitHub webhook message validator

This package currently contains a single utility function, which may be used to validate the package of a GitHub webhook request against a shared secret.

Note that if you get the signature from the X-Hub-Signature header, you'll need to convert it to bytes via hex. Use the rustc_serialize From_Hex trait to do this.

Example

use github_webhook_message_validator::validate;

let signature = &vec![
    115, 109, 127, 147, 66, 242, 167, 210, 57, 175, 165, 81, 58, 75, 178, 40, 62, 14, 21, 136
];
let secret = b"some-secret";
let message = b"blah-blah-blah";

assert_eq!(validate(secret, signature, message), true);

github_webhook_message_validator's People

Contributors

qubyte avatar xfix avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.