Skip to main content

Basic framework to handle authentication and authorization in any kind of Python application.

Project description

GuardPost

GuardPost provides a basic framework to handle authentication and authorization in any kind of Python application.

pip install guardpost

This library is freely inspired by authorization in ASP.NET Core; although its implementation is extremely different.

Notable differences are:

  1. GuardPost is abstracted from the code that executes it, so it's not bound to the context of a web framework.
  2. GuardPost implements both classes for use with synchronous code (not necessarily I/O bound), and classes using async/await syntax (optimized for authentication and authorization rules that involve I/O bound operations such as web requests and communications with databases).
  3. GuardPost leverages Python function decorators for the authorization part, so any function can be wrapped to be executed after handling authorization.
  4. The code API is simpler.

More documentation and examples

For more documentation and examples, refer to the project Wiki.

Both for async/await and synchronous code

GuardPost can be used both with async/await code and with synchronous code, according to use cases and users' preference.

If you have doubts about authentication vs authorization...

Authentication answers the question: Who is the user who is executing the action?, or more in general: Who is the user, or what is the service, that is executing the action?.

Authorization answers the question: Is the user, or service, authorized to do something?.

Usually, to implement authorization, is necessary to have the context of the entity that is executing the action. Anyway, the two things are logically separated and GuardPost is designed to keep them separate.

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

guardpost-0.0.3.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

guardpost-0.0.3-py3-none-any.whl (8.4 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