Metadata-Version: 2.1
Name: herre
Version: 0.2.4
Summary: openid connect client tailore to pyqt and async environments
License: CC BY-NC 3.0
Author: jhnnsrs
Author-email: jhnnsrs@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: Other/Proprietary License
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
Provides-Extra: fakts
Provides-Extra: qt
Provides-Extra: windowed
Requires-Dist: QtPy (>=2.0.1,<3.0.0); extra == "qt"
Requires-Dist: aiohttp (>=3.7.4,<4.0.0)
Requires-Dist: fakts (>=0.2.4,<0.3.0); extra == "fakts"
Requires-Dist: koil (>=0.2.4,<0.3.0)
Requires-Dist: oauthlib (>=3.1.1,<4.0.0)
Requires-Dist: pydantic (>=1.9.0,<2.0.0)
Description-Content-Type: text/markdown

# herre

[![codecov](https://codecov.io/gh/jhnnsrs/herre/branch/master/graph/badge.svg?token=UGXEA2THBV)](https://codecov.io/gh/jhnnsrs/herre)
[![PyPI version](https://badge.fury.io/py/herre.svg)](https://pypi.org/project/herre/)
![Maintainer](https://img.shields.io/badge/maintainer-jhnnsrs-blue)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/herre.svg)](https://pypi.python.org/pypi/herre/)
[![PyPI status](https://img.shields.io/pypi/status/herre.svg)](https://pypi.python.org/pypi/herre/)
[![PyPI download month](https://img.shields.io/pypi/dm/herre.svg)](https://pypi.python.org/pypi/herre/)

#### DEVELOPMENT

## Idea

herre is an (asynchronous) oauth2/openid client, that provides sensible defaults for the python
ecosystem

## Prerequisites

herre needs a oauth2/opendid server to connect to

## Supports

- Authorization Code Flow (PKCE)
  - Within a Qt app through a QtWebengine View
  - With a Redirect Server
- Client-Credentials Flow

## Usage

In order to initialize the Client you need to connect it as a Valid Application with your Arnheim Instance

```python

client = Herre(
    grant=AuthorizationCode()
    host="p-tnagerl-lab1",
    port=8000,
    client_id="$YOUR_CLIENT_ID",
    client_secret="$YOUR_CLIENT_SECRET",
    name="karl",
)

with client:
  client.login()

```

Async usage

```python

client = Herre(
    grant=AuthorizationCode()
    host="p-tnagerl-lab1",
    port=8000,
    client_id="$YOUR_CLIENT_ID",
    client_secret="$YOUR_CLIENT_SECRET",
    name="karl",
)

async with client:
  await client.login()

```

## Intergration with Qt

herre fully supports qt-based applications (both PySide2 and PyQt5) and provides a convenient helper class 'QtHerre'
as well as a included windowed Authoriation Code Flow (needs pyqtwebengine as additional dependency) as well as browser based logins

```python
class MainWindow(QtWidget)

    def __init__(self, *args, **kwargs):
        self.herre = QtHerre(
          grant=QtWindowAuthorizationCode()
        )

```

## Build with

- [koil](https://github.com/jhnnsrs/koil) - for pyqt event loop handling
- [oauthlib](https://github.com/oauthlib/oauthlib) - for oauth2 compliance
- [aiohttp](https://github.com/aio-libs/aiohttp) - transport layer (especially redirect server)

