Datasette authentication using IndieAuth and RelMeAuth
Project description
datasette-indieauth
Alpha. Datasette authentication using IndieAuth and RelMeAuth.
This initial version depends on IndieAuth.com.
Installation
Install this plugin in the same environment as Datasette.
$ datasette install datasette-indieauth
Usage
Ensure you have a website with a domain that supports IndieAuth or RelMeAuth.
Visit /-/indieauth
to begin the sign-in progress.
When a user signs in using IndieAuth they will be recieve a signed ds_actor
cookie identifying them as an actor that looks like this:
{
"me": "https://simonwillison.net/",
"display": "https://simonwillison.net/"
}
Restricting access with the restrict_access plugin configuration
You can use Datasette's permissions system to control permissions of authenticated users - by default, an authenticated user will be able to perform the same actions as an unauthenticated user.
As a shortcut if you want to lock down access to your instance entirely to just specific users, you can use the restrict_access
plugin configuration option like this:
{
"plugins": {
"datasette-indieauth": {
"restrict_access": "https://simonwillison.net/"
}
}
}
This can be a string or a list of user identifiers. It can also be a space separated list, which means you can use it with the datasette publish --plugin-secret
configuration option to set permissions as part of a deployment, like this:
datasette publish vercel mydb.db --project my-secret-db \
--install datasette-indieauth \
--plugin-secret datasette-indieauth restrict_access https://simonwillison.net/
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-indieauth
python3 -mvenv venv
source venv/bin/activate
Or if you are using pipenv
:
pipenv shell
Now install the dependencies and tests:
pip install -e '.[test]'
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-indieauth-0.2a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c582dd1490bc837e111cfc0bb57471a4c5579dfe3a6431faf3b3e82a7c3d3fab |
|
MD5 | 9ba9f9b3fe727cdb2ea4431e1c19e75b |
|
BLAKE2b-256 | c6d0d2c63e8e6e8b4d293e373c951e478683e9e90c39aeb01db688d19013657d |
Hashes for datasette_indieauth-0.2a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 712bc547cd0d855b28639998b3b8a625278db43774298a284d4c9aac4054bd22 |
|
MD5 | d72837044c3bb1908dfd569ce1483b88 |
|
BLAKE2b-256 | 5a75c41970b37e70ae9106017dc02827d6f5a1408b819c1767afc98665f63a6c |