%global _empty_manifest_terminate_build 0 Name: python-yhttp-auth Version: 3.8.1 Release: 1 Summary: A very micro http framework. License: MIT URL: http://github.com/yhttp/yhttp-auth Source0: https://mirrors.nju.edu.cn/pypi/web/packages/45/d0/d7832dec974d3e7d6fc8cfeefeece0c05c684a9ea9e56c7e415ef44992ac/yhttp-auth-3.8.1.tar.gz BuildArch: noarch %description # yhttp-auth [![PyPI](http://img.shields.io/pypi/v/yhttp-auth.svg)](https://pypi.python.org/pypi/yhttp-auth) [![Build](https://github.com/yhttp/yhttp-auth/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/yhttp/yhttp-auth/actions/workflows/build.yml) [![Coverage Status](https://coveralls.io/repos/github/yhttp/yhttp-auth/badge.svg?branch=master)](https://coveralls.io/github/yhttp/yhttp-auth?branch=master) Authentication extension for [yhttp](https://github.com/yhttp/yhttp). ### Install ```bash pip install yhttp-pony ``` ### Usage ```python from yhttp import Application from yhttp.ext.auth import install as auth_install app = Application() auth = auth_install(app) app.settings.merge(f''' auth: redis: host: localhost port: 6379 db: 0 token: algorithm: HS256 secret: foobar refresh: key: yhttp-refresh-token algorithm: HS256 secret: quxquux secure: true httponly: true maxage: 2592000 # 1 Month domain: example.com ''') @app.route('/reftokens') @yhttp.statuscode(yhttp.statuses.created) def create(req): app.auth.set_refreshtoken(req, 'alice', dict(baz='qux')) @app.route('/tokens') @yhttp.statuscode(yhttp.statuses.created) @yhttp.text def refresh(req): reftoken = app.auth.verify_refreshtoken(req) return app.auth.dump_from_refreshtoken(reftoken, dict(foo='bar')) @app.route('/admin') @auth(roles='admin, god') @yhttp.text def get(req): return req.identity.roles app.ready() ``` ### Command line interface setup.py ```python setup( ... entry_points={ 'console_scripts': [ 'myapp = myapp:app.climain' ] }, ... ) ``` ```bash myapp auth --help ``` %package -n python3-yhttp-auth Summary: A very micro http framework. Provides: python-yhttp-auth BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-yhttp-auth # yhttp-auth [![PyPI](http://img.shields.io/pypi/v/yhttp-auth.svg)](https://pypi.python.org/pypi/yhttp-auth) [![Build](https://github.com/yhttp/yhttp-auth/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/yhttp/yhttp-auth/actions/workflows/build.yml) [![Coverage Status](https://coveralls.io/repos/github/yhttp/yhttp-auth/badge.svg?branch=master)](https://coveralls.io/github/yhttp/yhttp-auth?branch=master) Authentication extension for [yhttp](https://github.com/yhttp/yhttp). ### Install ```bash pip install yhttp-pony ``` ### Usage ```python from yhttp import Application from yhttp.ext.auth import install as auth_install app = Application() auth = auth_install(app) app.settings.merge(f''' auth: redis: host: localhost port: 6379 db: 0 token: algorithm: HS256 secret: foobar refresh: key: yhttp-refresh-token algorithm: HS256 secret: quxquux secure: true httponly: true maxage: 2592000 # 1 Month domain: example.com ''') @app.route('/reftokens') @yhttp.statuscode(yhttp.statuses.created) def create(req): app.auth.set_refreshtoken(req, 'alice', dict(baz='qux')) @app.route('/tokens') @yhttp.statuscode(yhttp.statuses.created) @yhttp.text def refresh(req): reftoken = app.auth.verify_refreshtoken(req) return app.auth.dump_from_refreshtoken(reftoken, dict(foo='bar')) @app.route('/admin') @auth(roles='admin, god') @yhttp.text def get(req): return req.identity.roles app.ready() ``` ### Command line interface setup.py ```python setup( ... entry_points={ 'console_scripts': [ 'myapp = myapp:app.climain' ] }, ... ) ``` ```bash myapp auth --help ``` %package help Summary: Development documents and examples for yhttp-auth Provides: python3-yhttp-auth-doc %description help # yhttp-auth [![PyPI](http://img.shields.io/pypi/v/yhttp-auth.svg)](https://pypi.python.org/pypi/yhttp-auth) [![Build](https://github.com/yhttp/yhttp-auth/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/yhttp/yhttp-auth/actions/workflows/build.yml) [![Coverage Status](https://coveralls.io/repos/github/yhttp/yhttp-auth/badge.svg?branch=master)](https://coveralls.io/github/yhttp/yhttp-auth?branch=master) Authentication extension for [yhttp](https://github.com/yhttp/yhttp). ### Install ```bash pip install yhttp-pony ``` ### Usage ```python from yhttp import Application from yhttp.ext.auth import install as auth_install app = Application() auth = auth_install(app) app.settings.merge(f''' auth: redis: host: localhost port: 6379 db: 0 token: algorithm: HS256 secret: foobar refresh: key: yhttp-refresh-token algorithm: HS256 secret: quxquux secure: true httponly: true maxage: 2592000 # 1 Month domain: example.com ''') @app.route('/reftokens') @yhttp.statuscode(yhttp.statuses.created) def create(req): app.auth.set_refreshtoken(req, 'alice', dict(baz='qux')) @app.route('/tokens') @yhttp.statuscode(yhttp.statuses.created) @yhttp.text def refresh(req): reftoken = app.auth.verify_refreshtoken(req) return app.auth.dump_from_refreshtoken(reftoken, dict(foo='bar')) @app.route('/admin') @auth(roles='admin, god') @yhttp.text def get(req): return req.identity.roles app.ready() ``` ### Command line interface setup.py ```python setup( ... entry_points={ 'console_scripts': [ 'myapp = myapp:app.climain' ] }, ... ) ``` ```bash myapp auth --help ``` %prep %autosetup -n yhttp-auth-3.8.1 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-yhttp-auth -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri May 05 2023 Python_Bot - 3.8.1-1 - Package Spec generated