A very micro http framework.
Project description
yhttp-auth
Authentication extension for yhttp.
Install
pip install yhttp-pony
Usage
from yhttp import Application
from yhttp.ext.auth import install as auth_install
app = Application()
auth = auth_install(app)
app.settings.merge(f'''
jwt:
secret: 12345678
''')
@app.route()
@auth()
@text
def get(req):
return req.identity.name
@app.route('/admin')
@auth(roles='admin, god')
@json
def get(req):
return req.identity.roles
app.ready()
Command line interface
setup.py
setup(
...
entry_points={
'console_scripts': [
'myapp = myapp:app.climain'
]
},
...
)
myapp jwt --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yhttp-auth-2.0.6.tar.gz
(5.2 kB
view hashes)
Built Distribution
yhttp_auth-2.0.6-py3.8.egg
(9.1 kB
view hashes)