A debugging utility for testing actor permissions/actions with DC Superheros (superman, Batman, Daily Planet, etc.)
Project description
datasette-debug-gotham
A debugging utility for testing actor permissions/actions with DC Superheros (superman, Batman, Daily Planet, etc.)
It can be hard to test or debug Datasette plugins that use the new permissions system. This plugin offers a few builtin actors and a small widget for switching between actors:
Once you select an actor like "Clark Kent" or "Bruce Wayne", the page will refresh and Datasette will recognize the actor in request.actor. You can change actors however you like:
The pre-configured actors have some attributes you can use for debugging or "group permissions":
# https://github.com/datasette/datasette-debug-gotham/blob/main/datasette_debug_gotham/__init__.py#L8-L21
ACTORS = {
###### DAILY PLANET ######
"clark": {
"id": "clark",
"name": "Clark Kent",
"newsroom": "daily-planet",
"profile_picture_url": pfp("C", bg="blue"),
},
"lois": {
"id": "lois",
"name": "Lois Lane",
"newsroom": "daily-planet",
"profile_picture_url": pfp("L", bg="red"),
},
... # many more
}
Or access the actors with Python:
from dataseette_debug_gotham import ACTORS
print(ACTORS["clark"])
Personally I use this with uv for dynamic permissions testing:
uvx \
--from 'datasette>=1a' \
--with datasette-debug-gotham \
datasette \
--default-deny \
-s permissions.view-instance.newsroom daily-planet \
--memory
Here --default-deny means that by default everyone will see a Forbidden view-instance error when visiting dataset.
But, if you use the debug widget and select clark/lois/jimmy, since they have newsroom: daily-planet in their actor config, they will be able to see the instance!
And if you change to bruce/alfred/selina, who have newsroom: gotham-gazette, they will be blocked!
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datasette_debug_gotham-0.1.0a2.tar.gz.
File metadata
- Download URL: datasette_debug_gotham-0.1.0a2.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2f818ca0656c7f45c48e273d38c0f8955d873e530e19fd78485b41338a10529
|
|
| MD5 |
7dde699762ba740fdb13de5ffe0b7862
|
|
| BLAKE2b-256 |
f6a2b887a1c9a1ed56c5c1182a63d287b06ec7a2af3e4b8ce1d706a46fdba3ac
|
Provenance
The following attestation bundles were made for datasette_debug_gotham-0.1.0a2.tar.gz:
Publisher:
publish.yml on datasette/datasette-debug-gotham
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_debug_gotham-0.1.0a2.tar.gz -
Subject digest:
a2f818ca0656c7f45c48e273d38c0f8955d873e530e19fd78485b41338a10529 - Sigstore transparency entry: 1138602314
- Sigstore integration time:
-
Permalink:
datasette/datasette-debug-gotham@999150eee3856ba1eb67a5cd6660b29c9dc5752f -
Branch / Tag:
refs/tags/0.1.0a2 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@999150eee3856ba1eb67a5cd6660b29c9dc5752f -
Trigger Event:
release
-
Statement type:
File details
Details for the file datasette_debug_gotham-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: datasette_debug_gotham-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c413b1a0c30c060c9d1622d963a8bf0ea30782a32a3feadc9cd685072543018
|
|
| MD5 |
e43d6f45a505812ed3e78e2cede80d6a
|
|
| BLAKE2b-256 |
bd3d4466beb02efe9d5f8e1df8341ef2c9a2c5e80036b6327369e37090040916
|
Provenance
The following attestation bundles were made for datasette_debug_gotham-0.1.0a2-py3-none-any.whl:
Publisher:
publish.yml on datasette/datasette-debug-gotham
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_debug_gotham-0.1.0a2-py3-none-any.whl -
Subject digest:
5c413b1a0c30c060c9d1622d963a8bf0ea30782a32a3feadc9cd685072543018 - Sigstore transparency entry: 1138602347
- Sigstore integration time:
-
Permalink:
datasette/datasette-debug-gotham@999150eee3856ba1eb67a5cd6660b29c9dc5752f -
Branch / Tag:
refs/tags/0.1.0a2 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@999150eee3856ba1eb67a5cd6660b29c9dc5752f -
Trigger Event:
release
-
Statement type: