Skip to main content

A Datasette plugin that outputs debug information about permission checks

Project description

datasette-debug-permissions

PyPI Changelog Tests License

A Datasette plugin that outputs debug information about permission checks.

Installation

datasette install datasette-debug-permissions

Usage

This plugin adds debugging output to standard error as Datasette is running showing any times the permission_allowed() plugin hook is called.

See Authentication and permissions in the Datasette documentation for more on why this is useful.

Example output

INFO:     Uvicorn running on http://127.0.0.1:8833 (Press CTRL+C to quit)
permission_allowed: action=view-instance, resource=<None>, actor=<None>
permission_allowed: action=view-database, resource=_internal, actor=<None>
permission_allowed: action=view-database, resource=mydatabase, actor=<None>
permission_allowed: action=view-database, resource=mydatabase, actor=<None>
permission_allowed: action=view-table, resource=('mydatabase', 'mytable'), actor=<None>
permission_allowed: action=view-table, resource=('mydatabase', 'mytable'), actor=<None>
permission_allowed: action=view-instance, resource=<None>, actor=<None>
permission_allowed: action=view-instance, resource=<None>, actor=<None>
permission_allowed: action=debug-menu, resource=<None>, actor=<None>

Development

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

cd datasette-debug-permissions
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To install the JavaScript build dependencies, run this:

npm install

You can use the Just command runner to build the TypeScript to minified JavaScript like this:

just js

To run the tests:

pytest

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

datasette-debug-permissions-0.1.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

datasette_debug_permissions-0.1-py3-none-any.whl (7.1 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