Datasette authentication using IndieAuth and RelMeAuth
Project description
datasette-indieauth
Datasette authentication using IndieAuth and RelMeAuth.
Demo
You can try out the latest version of this plugin at datasette-indieauth-demo.datasette.io
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": "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.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a321a4d8508f26cd324567c8c58aaa527a002b77035b343dce2985c6adcf340e |
|
MD5 | 0a3c07420e2098677dceb9625398b31f |
|
BLAKE2b-256 | 205b944e8d20f4d64c6c6e17a206dcb91053db0dc9757486c53010279f45ce7c |
Hashes for datasette_indieauth-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73c88fbe17a44f593eabf506052ef8bf82f7e8b783c279faf720847572f518d2 |
|
MD5 | 674cf27beabba8ab83318cd9a710baf9 |
|
BLAKE2b-256 | 731d2a81c76c35e8536ccc19726ecefb9861832efb07601f2a995c8c4fca1bc2 |