Metadata-Version: 2.1
Name: SanicApiKey
Version: 1.0.1
Summary: Basic Sanic API Key plugin.
Home-page: https://github.com/quiec/SanicApiKey
Author: Yusuf Usta
Author-email: yusuf@fusuf.codes
Maintainer: Yusuf Usta
Maintainer-email: yusuf@fusuf.codes
License: GPL3
Description: # Sanic Api Key
        Basic support for API Keys. Support form, args, header.
        
        ## Installion 
        ```sh
        pip install sanicapikey
        ```
        
        ## Example Usage
        ```python
        from sanic import Sanic
        from sanic.response import text, json
        from SanicApiKey import SanicApiKey
        
        app = Sanic('test')
        
        async def test(request):
            return json({ "error": 'invalid api key' })
        
        auth = SanicApiKey(app, 'api_key', keys=['hello', 'world'], error=test)
        
        # Header:
        # auth = SanicApiKey(app, header='api_key', keys=['hello', 'world'], error=test)
        
        # Form
        # auth = SanicApiKey(app, form='api_key', keys=['hello', 'world'], error=test)
        
        @app.route('/')
        @auth.key_required
        async def test(request):
            return json({'success': True, 'key': auth.get_token()})
        
        if __name__ == '__main__':
            app.run(host='localhost', port=8000)
        ```
Keywords: sanic
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown
