Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/datasette/datasette-insecure-users
https://github.com/datasette/datasette-insecure-users
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/datasette/datasette-insecure-users
- Owner: datasette
- License: apache-2.0
- Created: 2023-09-25T22:40:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-25T22:42:28.000Z (over 1 year ago)
- Last Synced: 2024-05-01T15:21:32.232Z (8 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# datasette-insecure-users
[![PyPI](https://img.shields.io/pypi/v/datasette-insecure-users.svg)](https://pypi.org/project/datasette-insecure-users/)
[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-insecure-users?include_prereleases&label=changelog)](https://github.com/datasette/datasette-insecure-users/releases)
[![Tests](https://github.com/datasette/datasette-insecure-users/workflows/Test/badge.svg)](https://github.com/datasette/datasette-insecure-users/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-insecure-users/blob/main/LICENSE)A username/password Datasette authentication plugin, where passwords are optional. Meant for debugging and private trusted instances!
## Installation
This plugin requires an alpha version of Datasette 1.0.
pip install datasette==1.0a6
Then you can nstall this plugin in the same environment as Datasette.
datasette install datasette-insecure-users
## Usage
Once installed, there will be a new "Log in" option in the upper-right hand menu. Users can then either login with a username/password, or with just a username.
If a password is provided, then future logins will require that same password. If no password is provided when logging in for the first time, then no password is needed in future login attempts.
Passwords are salted + hashed and stored in the new [Datasette internal database](https://docs.datasette.io/en/latest/internals.html#datasette-s-internal-database). By default this is an in-memory database that will disappear when Datasette exists, so to persist login information for all users, pass in a SQLite database with `--internal` like so:
datasette --internal internal.db my_data.db
In this case, usernames/hashed passwords will be stored in `internal.db`, and `my_data.db` will be left untouched.
## Internals
## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-insecure-users
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest