Skip to main content

"Flask module allowing to configure and centralize the authorizations on the routes"

Project description

Flask module allowing to configure and centralize the authorizations on the routes.

Exemple

from flask import Flask
from flask_restful import Api, Resource
from RequestChecker import RequestChecker, Path, SecurityPolicyEnum, MethodsEnum

app = Flask("test")
api = Api(app)

requestChecker = RequestChecker(api)

def LoginResource(Resource):
    def post(self):
        pass

def TestResource(Resource):
    def get(self):
        pass

    def post(self):
        pass

pathLogin = Path('/login', policy=SecurityPolicyEnum.ANNONYMOUS, methods=[MethodsEnum.POST])
pathTest = Path('/test', policy=SecurityPolicyEnum.JWT, methods=[MethodsEnum.GET, MethodsEnum.POST])

requestChecker.addPath(pathTest, TestResource)
requestChecker.addPath(pathLogin, LoginResource)

Dependencies

Flask flask_jwt_extended werkzeug Flask-Restful

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requestChecker-0.0.1.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

requestChecker-0.0.1-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page