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

See sqlite-authorizer-examples for more detailed documentation on what to expect from these calls.

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

Built Distribution

File details

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

File metadata

File hashes

Hashes for datasette-sqlite-debug-authorizer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ec5b16f87c93ee758ed9b76655e8a69aea115c054df75cf6c33629b3ccc70fee
MD5 c0c50e342e41f0b1533e00a96b6f05d7
BLAKE2b-256 1395b9d4f0013aad8b3663157e8539219673bafb826db1c335c39dce4a5f1293

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for datasette_sqlite_debug_authorizer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f62271364d220e9253a2969cfd2d3eee10db4fa1294a49961d0d52bdb87b27e3
MD5 43b85434086ee415f49a9abfc5e715fe
BLAKE2b-256 70b89289020e6235d88f05e1a4f43cfabb702743f74dd199cd0830ee3c29d96b

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