From 3aa87eeaf21083e32d9e02bd857fd44707dc4113 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 9 Jun 2020 07:58:12 -0700 Subject: [PATCH] Documentation no loger suggests that actor["id"] is required, closes #823 --- docs/authentication.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/authentication.rst b/docs/authentication.rst index 04564886..153466ad 100644 --- a/docs/authentication.rst +++ b/docs/authentication.rst @@ -17,7 +17,7 @@ Through plugins, Datasette can support both authenticated users (with cookies) a Every request to Datasette has an associated actor value, available in the code as ``request.actor``. This can be ``None`` for unauthenticated requests, or a JSON compatible Python dictionary for authenticated users or API agents. -The only required field in an actor is ``"id"``, which must be a string. Plugins may decide to add any other fields to the actor dictionary. +The actor dictionary can be any shape - the design of that data structure is left up to the plugins. A useful convention is to include an ``"id"`` string, as demonstrated by the "root" actor below. Plugins can use the :ref:`plugin_actor_from_request` hook to implement custom logic for authenticating an actor based on the incoming HTTP request.