|
4 | 4 | Changelog |
5 | 5 | ========= |
6 | 6 |
|
7 | | -.. _v0_45a5: |
| 7 | +.. _v0_45: |
8 | 8 |
|
9 | | -0.45a5 (2020-06-30) |
10 | | -------------------- |
| 9 | +0.45 (2020-07-01) |
| 10 | +----------------- |
| 11 | + |
| 12 | +Magic parameters for canned queries, a log out feature, improved plugin documentation and four new plugin hooks. |
| 13 | + |
| 14 | +Magic parameters for canned queries |
| 15 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 16 | + |
| 17 | +Canned queries now support :ref:`canned_queries_magic_parameters`, which can be used to insert or select automatically generated values. For example:: |
| 18 | + |
| 19 | + insert into logs |
| 20 | + (user_id, timestamp) |
| 21 | + values |
| 22 | + (:_actor_id, :_now_datetime_utc) |
| 23 | + |
| 24 | +This inserts the currently authenticated actor ID and the current datetime. (`#842 <https://github.com/simonw/datasette/issues/842>`__) |
11 | 25 |
|
12 | | -.. warning:: This is an **alpha** release. See :ref:`contributing_alpha_beta`. |
| 26 | +Log out |
| 27 | +~~~~~~~ |
13 | 28 |
|
14 | | -- Canned queries now support :ref:`canned_queries_magic_parameters`, which can be used to insert or select automatically generated values. For example:: |
| 29 | +The :ref:`ds_actor cookie <authentication_ds_actor>` can be used by plugins (or by Datasette's :ref:`--root mechanism<authentication_root>`) to authenticate users. The new ``/-/logout`` page provides a way to clear that cookie. |
15 | 30 |
|
16 | | - insert into logs |
17 | | - (user_id, timestamp) |
18 | | - values |
19 | | - (:_actor_id, :_now_datetime_utc) |
| 31 | +A "Log out" button now shows in the global navigation provided the user is authenticated using the ``ds_actor`` cookie. (`#840 <https://github.com/simonw/datasette/issues/840>`__) |
| 32 | + |
| 33 | +Better plugin documentation |
| 34 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 35 | + |
| 36 | +The plugin documentation has been re-arranged into four sections, including a brand new section on testing plugins. (`#687 <https://github.com/simonw/datasette/issues/687>`__) |
| 37 | + |
| 38 | +- :ref:`plugins` introduces Datasette's plugin system and describes how to install and configure plugins. |
| 39 | +- :ref:`writing_plugins` describes how to author plugins, from simple one-off plugins to packaged plugins that can be published to PyPI. It also describes how to start a plugin using the new `datasette-plugin <https://github.com/simonw/datasette-plugin>`__ cookiecutter template. |
| 40 | +- :ref:`plugin_hooks` is a full list of detailed documentation for every Datasette plugin hook. |
| 41 | +- :ref:`testing_plugins` describes how to write tests for Datasette plugins, using `pytest <https://docs.pytest.org/>`__ and `HTTPX <https://www.python-httpx.org/>`__. |
| 42 | + |
| 43 | +New plugin hooks |
| 44 | +~~~~~~~~~~~~~~~~ |
| 45 | + |
| 46 | +- :ref:`plugin_hook_register_magic_parameters` can be used to define new types of magic canned query parameters. |
| 47 | +- :ref:`plugin_hook_startup` can run custom code when Datasette first starts up. `datasette-init <https://github.com/simonw/datasette-init>`__ is a new plugin that uses this hook to create database tables and views on startup if they have not yet been created. (`#834 <https://github.com/simonw/datasette/issues/834>`__) |
| 48 | +- :ref:`plugin_hook_canned_queries` lets plugins provide additional canned queries beyond those defined in Datasette's metadata. See `datasette-saved-queries <https://github.com/simonw/datasette-saved-queries>`__ for an example of this hook in action. (`#852 <https://github.com/simonw/datasette/issues/852>`__) |
| 49 | +- :ref:`plugin_hook_forbidden` is a hook for customizing how Datasette responds to 403 forbidden errors. (`#812 <https://github.com/simonw/datasette/issues/812>`__) |
| 50 | + |
| 51 | +Smaller changes |
| 52 | +~~~~~~~~~~~~~~~ |
20 | 53 |
|
21 | | - This inserts the currently authenticated actor ID and the current datetime. (`#842 <https://github.com/simonw/datasette/issues/842>`__) |
22 | | -- New ``/-/logout`` page, linked to from the navigation if you are logged in with a ``ds_actor`` cookie. (`#840 <https://github.com/simonw/datasette/issues/840>`__) |
23 | 54 | - Cascading view permissons - so if a user has ``view-table`` they can view the table page even if they do not have ``view-database`` or ``view-instance``. (`#832 <https://github.com/simonw/datasette/issues/832>`__) |
24 | 55 | - CSRF protection no longer applies to ``Authentication: Bearer token`` requests or requests without cookies. (`#835 <https://github.com/simonw/datasette/issues/835>`__) |
25 | | -- New :ref:`plugin_hook_forbidden` plugin hook for customizing how Datasette responds to a 403 forbidden error. (`#812 <https://github.com/simonw/datasette/issues/812>`__) |
26 | | -- New :ref:`plugin_hook_register_magic_parameters` plugin hook. |
27 | | -- New :ref:`plugin_hook_startup` plugin hook. (`#834 <https://github.com/simonw/datasette/issues/834>`__) |
28 | | -- New :ref:`plugin_hook_canned_queries` plugin hook. See `datasette-saved-queries <https://github.com/simonw/datasette-saved-queries>`__ for an example of this hook in action. (`#852 <https://github.com/simonw/datasette/issues/852>`__) |
29 | 56 | - ``datasette.add_message()`` now works inside plugins. (`#864 <https://github.com/simonw/datasette/issues/864>`__) |
30 | 57 | - Workaround for "Too many open files" error in test runs. (`#846 <https://github.com/simonw/datasette/issues/846>`__) |
31 | 58 | - Respect existing ``scope["actor"]`` if already set by ASGI middleware. (`#854 <https://github.com/simonw/datasette/issues/854>`__) |
32 | 59 | - New process for shipping :ref:`contributing_alpha_beta`. (`#807 <https://github.com/simonw/datasette/issues/807>`__) |
33 | | -- Re-arranged plugins documentation into :ref:`plugins`, :ref:`writing_plugins`, :ref:`plugin_hooks` and a new section on :ref:`testing_plugins`. (`#687 <https://github.com/simonw/datasette/issues/687>`__) |
34 | 60 | - ``{{ csrftoken() }}`` now works when plugins render a template using ``datasette.render_template(..., request=request)``. (`#863 <https://github.com/simonw/datasette/issues/863>`__) |
| 61 | +- Datasette now creates a single :ref:`internals_request` and uses it throughout the lifetime of the current HTTP request. (`#870 <https://github.com/simonw/datasette/issues/870>`__) |
35 | 62 |
|
36 | 63 | .. _v0_44: |
37 | 64 |
|
|
0 commit comments