A Datasette plugin that outputs debug information about permission checks
Project description
datasette-debug-permissions
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
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
Hashes for datasette-debug-permissions-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 169737e1725ebbba498a04d5d582e9708a57857cf3c385c768be23f3b47f8b80 |
|
MD5 | 4ec6fcdcf7e0f699d30d8ad2731747d2 |
|
BLAKE2b-256 | 86b78ff2acc8e6dd7c8887efe480f282c1c058f6262f1ee5179d7823d65654ff |
Hashes for datasette_debug_permissions-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82a16068ae5ea76648ebe843f78d975e15ff2eb00dbf484dbc751228b96e146d |
|
MD5 | 83c607a41795e721b05fe3d1f1767383 |
|
BLAKE2b-256 | 7b2fa06eb3979dad4deb77b3906cc96e13bc0209bce09b699e1e167781bc67a7 |