Skip to main content

A Pythonic SQLALchemy interface to enforce authorization criteria.

Project description

Authanor

Athanor

A tool providing a a Pythonic interface to SQLAlchemy while enforcing authorization criteria for Flask.

SQLAlchemy provides a solid interface for managing database operations. However, this package is designed to enable the construction of handler objects that perform a series of consistent actions on many similar ORM entities. For example, I find that I frequently want to select all values (for specific columns) in a given table using an ORM or add an entry to the table based on a mapping. At the same time, I want to rigorously test my databases—but not pay the penalty for reconstructing the database for every test.

Authorizations & Database Handlers

The common operations are easy to do using SQLAlchemy, but rather than rolling new functions for each new query in every application, this tool provides a set of handlers that are designed to abstract away a bunch of the tedious details. Also, my experience is that enforcing authorization constraints when manipulating sophisticated table relationships can be tricky, and so this tool and its handlers provide an interface for managing those authorizations consistently.

It's possible I'm missing a key functionality of SQLAlchemy that enables this behavior elegantly, but I haven't found a satisfiably clean way to do it yet. Until I become so enlightened, this package creates an interface where each model may define the chain of joins required to establish whether it belongs to an authorized user, and then a handler to query the database and perform those joins for each query. This is designed to be extensible, since I often want this behavior available for the majority of ORM models in my application.

If you read this and think "This dude's dumb; why on Earth didn't he use this functionality baked into SQLAlchemy?" drop me a line because I'm interested to know what I'm missing.

Installation

The Authanor package is registered on the Python Package Index (PyPI) for easy installation. To install the package, simply run

$ pip install authanor

The package requires a recent version of Python (3.9+).

License

This project is licensed under the GNU General Public License, Version 3. It is fully open-source, and while you are more than welcome to fork, add, modify, etc. it is required that you keep any distributed changes and additions open-source.

Changes

Changes between versions are tracked in the changelog.

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

authanor-1.1.1.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

authanor-1.1.1-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file authanor-1.1.1.tar.gz.

File metadata

  • Download URL: authanor-1.1.1.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for authanor-1.1.1.tar.gz
Algorithm Hash digest
SHA256 1ac690b06ada60597152d9b10321ee43bd85baf21dc28697e297ac50f84b0300
MD5 e9b39ddd362a900985b51ec45c5e7c6a
BLAKE2b-256 629eda57a0fa2148c88d827b218b74dfe9d108768295f55f4511ebc29a4596bb

See more details on using hashes here.

File details

Details for the file authanor-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: authanor-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for authanor-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c837965e3274dede3f14acf1d636ee99dc92caaf935c11bbfb48c04c1a24e66b
MD5 9a46e23fb07740a028ef9d762b6c8855
BLAKE2b-256 f215906fcc1508fd9cdb4bd5f74edc4b6ea121e4bc7bfab8147ed1d22cbda35d

See more details on using hashes here.

Supported by

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