Skip to main content

Debug SQLite authorizer calls

Project description

datasette-sqlite-debug-authorizer

PyPI Changelog Tests License

Debug SQLite authorizer calls

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-sqlite-debug-authorizer

Usage

Once installed, every SQLite permission check using the conn.set_authorizer() API will be logged to standard error.

This is useful for if you want to use that authorizer API to implement your own custom permissions, and need to see what calls are being made to the authorizer.

Example output (it's generally a lot noisier than this) for select * from sqlite_master:

SQLITE_SELECT: 
SQLITE_READ:  table="sqlite_master" column="type" db_name=main
SQLITE_READ:  table="sqlite_master" column="name" db_name=main
SQLITE_READ:  table="sqlite_master" column="tbl_name" db_name=main
SQLITE_READ:  table="sqlite_master" column="rootpage" db_name=main
SQLITE_READ:  table="sqlite_master" column="sql" db_name=main

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-sqlite-debug-authorizer
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

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

datasette-sqlite-debug-authorizer-0.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file datasette-sqlite-debug-authorizer-0.1.tar.gz.

File metadata

File hashes

Hashes for datasette-sqlite-debug-authorizer-0.1.tar.gz
Algorithm Hash digest
SHA256 33b2a3f4be87f2d21385045b81df3c0fc1e5156950efc2e76dfa28f39a3f8954
MD5 07af6b98993581f6d9a55123c1edec1c
BLAKE2b-256 ec2623bf940816cb6ef689091e0a0938b46655158f52e313732127ace678eb21

See more details on using hashes here.

File details

Details for the file datasette_sqlite_debug_authorizer-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_sqlite_debug_authorizer-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00e2dc9a509462bcfa87a929fdaf9cbee86c1b8ab7ff3f6a2cd190990901fc49
MD5 8d03ffed2c7c84356f0257118bb19ee9
BLAKE2b-256 41020049d1e2947e5f6a00ae751b5ca666fda63a6c2c02407d7f7bbe31f514fd

See more details on using hashes here.

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