Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonw/datasette-mask-columns
Datasette plugin that masks specified database columns
https://github.com/simonw/datasette-mask-columns
datasette datasette-io datasette-plugin
Last synced: 27 days ago
JSON representation
Datasette plugin that masks specified database columns
- Host: GitHub
- URL: https://github.com/simonw/datasette-mask-columns
- Owner: simonw
- License: apache-2.0
- Created: 2020-02-22T01:29:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-25T05:08:09.000Z (10 months ago)
- Last Synced: 2024-10-06T20:19:27.315Z (about 1 month ago)
- Topics: datasette, datasette-io, datasette-plugin
- Language: Python
- Homepage: https://datasette.io/plugins/datasette-mask-columns
- Size: 17.6 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# datasette-mask-columns
[![PyPI](https://img.shields.io/pypi/v/datasette-mask-columns.svg)](https://pypi.org/project/datasette-mask-columns/)
[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-mask-columns?include_prereleases&label=changelog)](https://github.com/simonw/datasette-mask-columns/releases)
[![Tests](https://github.com/simonw/datasette-mask-columns/workflows/Test/badge.svg)](https://github.com/simonw/datasette-mask-columns/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-mask-columns/blob/main/LICENSE)Datasette plugin that masks specified database columns
## Installation
pip install datasette-mask-columns
This depends on plugin hook changes in a not-yet released branch of Datasette. See [issue #678](https://github.com/simonw/datasette/issues/678) for details.
## Usage
In your `metadata.json` file add a section like this describing the database and table in which you wish to mask columns:
```json
{
"databases": {
"my-database": {
"plugins": {
"datasette-mask-columns": {
"users": ["password"]
}
}
}
}
}
```
All SQL queries against the `users` table in `my-database.db` will now return `null` for the `password` column, no matter what value that column actually holds.The table page for `users` will display the text `REDACTED` in the masked column. This visual hint will only be available on the table page; it will not display his text for arbitrary queries against the table.