summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.es>2023-03-22 12:32:13 +0100
committerCarlton Gibson <carlton.gibson@noumenal.es>2023-03-22 14:36:42 +0100
commitb00046d2c25771bed2242680b08b524a44aa9798 (patch)
treebb9a5187be2b52b1559b36e7ecb0800153b6b108 /docs
parent203a15cadbf8d03b51df1b28d89b2e7ab4264973 (diff)
Doc'd use of asgiref.sync adapters with sensitive variables.
Diffstat (limited to 'docs')
-rw-r--r--docs/howto/error-reporting.txt11
-rw-r--r--docs/topics/async.txt14
2 files changed, 25 insertions, 0 deletions
diff --git a/docs/howto/error-reporting.txt b/docs/howto/error-reporting.txt
index 4e50c0e309..875e56a51d 100644
--- a/docs/howto/error-reporting.txt
+++ b/docs/howto/error-reporting.txt
@@ -194,6 +194,17 @@ filtered out of error reports in a production environment (that is, where
def process_info(user):
...
+ .. warning::
+
+ Due to the machinery needed to cross the sync/async boundary,
+ :func:`~asgiref.sync.sync_to_async` and
+ :func:`~asgiref.sync.async_to_sync` are **not** compatible with
+ ``sensitive_variables()``.
+
+ If using these adapters with sensitive variables, ensure to audit
+ exception reporting, and consider implementing a :ref:`custom filter
+ <custom-error-reports>` if necessary.
+
.. versionchanged:: 5.0
Support for wrapping ``async`` functions was added.
diff --git a/docs/topics/async.txt b/docs/topics/async.txt
index 96220b97c1..95d3435e07 100644
--- a/docs/topics/async.txt
+++ b/docs/topics/async.txt
@@ -338,3 +338,17 @@ trigger the thread safety checks:
Rather, you should encapsulate all database access within a helper function
that can be called with ``sync_to_async()`` without relying on the connection
object in the calling code.
+
+Use with exception reporting filters
+------------------------------------
+
+.. warning::
+
+ Due to the machinery needed to cross the sync/async boundary,
+ ``sync_to_async()`` and ``async_to_sync()`` are **not** compatible with
+ :func:`~django.views.decorators.debug.sensitive_variables`, used to mask
+ local variables from exception reports.
+
+ If using these adapters with sensitive variables, ensure to audit exception
+ reporting, and consider implementing a :ref:`custom filter
+ <custom-error-reports>` if necessary.