Metadata-Version: 2.1
Name: webhook-utils
Version: 0.1.0
Summary: Short, well documented utilities for interacting with webhooks.
Home-page: https://github.com/tizz98/webhook-utils
License: MIT
Keywords: webhook,utils,utilities,webhooks
Author: Elijah Wilson
Author-email: dev.tizz98@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Project-URL: Repository, https://github.com/tizz98/webhook-utils
Description-Content-Type: text/markdown

# Webhook Utils

A set of utilities for interacting with webhooks.

## Installation

```shell
pip install webhook-utils
```

## Usage

### Crypto

Available hash algorithms for all methods are:
- `md5` (not recommended)
- `sha1`
- `sha256` (recommended)

Learn more about HMAC signatures [here](https://webhooks.dev/docs/auth/#hmac).

#### Generating HMAC signatures

Bare usage:
```python
from webhook_utils.crypto import generate_sha256_signature

print(generate_sha256_signature(b'secret-key', b'some-message'))
```

#### Comparing HMAC signatures

Bare usage:
```python
from webhook_utils.crypto import compare_sha256_signature

is_valid_signature = compare_sha256_signature(
    b'secret-key',
    b'some-message',
    'expected-signature',
)
if not is_valid_signature:
    raise ValueError('Invalid signature')
```

## Publishing to PYPI

```shell
poetry build
```

