This change makes all settings and plugin config access asynchronous in
preparation for a future plugin hook that will allow fetching settings
from a database or via HTTP.
Changes:
- Datasette.setting() is now async
- Datasette.settings_dict() is now async
- Datasette.plugin_config() is now async
- Added _setting_sync() for contexts that cannot await (threads, sync hooks)
- Added _plugin_config_sync() for contexts that cannot await
- Updated all callers throughout the codebase to use await
- Updated tests to work with async methods
The permission_allowed hook has been fully replaced by permission_resources_sql.
This commit removes:
- hookspec definition from hookspecs.py
- 4 implementations from default_permissions.py
- implementations from test plugins (my_plugin.py, my_plugin_2.py)
- hook monitoring infrastructure from conftest.py
- references from fixtures.py
- Also fixes test_get_permission to use ds.get_action() instead of ds.get_permission()
- Removes 5th column (source_plugin) from PermissionSQL queries
This completes the migration to the SQL-based permission system.