semvec/pypi-packages huggingface dataset:
simple-oauth2 1.0.4
A simple Outh2 client
Keywords: Oauth OKTA Azure AD Authentication Authorization token implicit flow

# Oauth2 library for python flask and restplus

With this simple library, you can authenticate clients coming from a browser (Implicit Flow) or using Bearer token (Credential flow).
You can manage authorization using rbac function as described here after.

## Requirements

Install these requirements

```text
cryptography
PyJWT==1.7.1
flask-restplus
simple-oauth2
```

## Usage example

```python
import os
from flask import Flask
from flask_restplus import Api, Resource
from simple_oauth2 import OAuth


api = Api()
app = Flask(__name__)
app.secret_key = os.urandom(32)
api.init_app(app)

oauth_config = {
    'well_known_url': '{well_known_url}',
    'client_id': '{client_id}',
    'redirect_uri': '{host:port}/signin-oidc',
    'audience': '{audience}',
    'scopes': '{coma separated scopes}',
    'whitelist': ['/openbar?']
}

def rbac(client, operation):
    print('client ', client, ' is asking for operation ', operation)
    return True

oauth = OAuth(app, oauth_config, rbac=rbac)

# flask
@app.route('/')
def slah():
    return 'Hello'


@app.route('/hello')
@oauth.authorize('hello')
def hello():
    return 'hi'


@app.route('/openbar')
def openbar():
    return 'Chimay'


# restplus
@api.route('/toto')
class Toto(Resource):
    @oauth.authorize('toto')
    def get(self):
        return {'hello': 'world'}


if __name__ == "__main__":
    app.run(host='0.0.0.0', debug=True)

```

## Contributors

Register [here](https://test.pypi.org/account/register/ )

Install required packages

```bash
python -m pip install --user --upgrade setuptools wheel
python -m pip install --user --upgrade twine
```

Package like this:

```bash
python setup.py sdist bdist_wheel
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```

Test install

```bash
pip install -i https://test.pypi.org/simple/ simple-oauth2
```
hellouser 0.0.2
Say hello!

# Hello user

This is a simple example project demonstrating how to publish a python module to PyPI.

##Installation

Run the follwing to install:

```python
pip install hellouser
```

## Usage

```python
from hellouser import say_hello

# Generate "Hello, User!"
say_hello()

# Generate "Hello, Everybody!"
say_hello("Everybody")
```
askpass 0.1
Wrapper for the pinentry program

|pipeline| |coverage| |rtd|

.. |pipeline| image:: https://framagit.org/1ohmatr/sw/py/askpass.git/badges/master/pipeline.svg

.. |coverage| image:: https://framagit.org/1ohmatr/sw/py/askpass.git/badges/master/coverage.svg

.. |rtd| image:: https://readthedocs.org/projects/askpass/badge/?version=latest

Wrapper for the pinentry program. Easy workflow in python:

.. code:: python

  from askpass import AskPass

  with AskPass() as ask:
    for x in ask:
      if x == 'password': break
    else:
      raise ValueError()