Metadata-Version: 2.1
Name: hydratokengen
Version: 0.1.0
Summary: 
Home-page: https://github.com/reciprocity/hydratokengen
Keywords: hydra,jwt
Author: Luka Zakrajšek
Author-email: luka@bancek.net
Requires-Python: >=3.7,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: ory-hydra-client (>=1.10.6,<2.0.0)
Requires-Dist: requests (>=2.26.0,<3.0.0)
Project-URL: Repository, https://github.com/reciprocity/hydratokengen
Description-Content-Type: text/markdown

# HydraTokenGen

ORY Hydra JWT generator.

## Install

```sh
pip install hydratokengen
```

## Usage

```py
from hydratokengen import CachedTokenGen, HydraTokenGen

hydra_token_gen = CachedTokenGen(HydraTokenGen(
    hydra_public_url="http://localhost:4444",
    hydra_admin_url="http://localhost:4445",
    client_id="636986d6-f505-486a-839c-57bb6a881aca",
    client_secret="CLIENTSECRET",
    redirect_uri="http://localhost/callback",
))

token = hydra_token_gen.generate(
    subject="1234",
    access_token={"claim1": "value1"},
    id_token={"claim2": "value2"},
)
```

## Development

### Format code

```sh
poetry run black hydratokengen tests
```

### Testing

Start Hydra:

```sh
docker-compose up -d
```

Install dependencies:

```sh
poetry install
```

Run tests

```sh
poetry run pytest
```

HTML coverage report:

```sh
poetry run pytest --cov=hydratokengen --cov-report=html

open htmlcov/index.html
```

### Publish a new version

Bump the version number in `hydratokengen/__init__.py` and run:

```sh
poetry publish
```

