How to use the gidgethub.sansio.validate function in gidgethub

To help you get started, we’ve selected a few gidgethub examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brettcannon / gidgethub / tests / test_sansio.py View on Github external
def test_malformed_signature(self):
        """Error out if the signature doesn't start with "sha1="."""
        with pytest.raises(sansio.ValidationFailure):
            sansio.validate(self.payload, secret=self.secret,
                            signature=self.hash_signature)
github brettcannon / gidgethub / tests / test_sansio.py View on Github external
def test_validation(self):
        """Success case."""
        sansio.validate(self.payload, secret=self.secret,
                        signature=self.signature)