cldellow / datasette-ui-extras

Add editing UI and other power-user features to Datasette.
Apache License 2.0
12 stars 1 forks source link

easy auth: `datasette yolo <mydb.db>` command #56

Closed cldellow closed 1 year ago

cldellow commented 1 year ago

A use case I want to support: a user runs Datasette for themselves on their laptop, with editing.

They shouldn't need to understand permissions or metadata.json.

We'll use the register_command hook to provide a yolo command.

It should unlock all the editing features, without requiring the user to log in. This is dangerous, so it should warn the user not to expose their instance to the Internet.

Proposal: it adds a database-level permissions block that explicitly does "allow": true for all the permissions enumerated in the docs.

See https://docs.datasette.io/en/latest/authentication.html#other-permissions-in-metadata

It will also put the DB into WAL mode.

It should also set a flag in metadata that we'll recognize, to enable SYNCHRONOUS=NORMAL mode on the DB.