Skip to content

Commit aaa3bfa

Browse files
committed
Add docs for impersonation
1 parent 8be1ed7 commit aaa3bfa

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/source/api.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,41 @@ Name of the database to query.
499499
:Default: ``neo4j.DEFAULT_DATABASE``
500500

501501

502+
.. _impersonated-user-ref:
503+
504+
``impersonated_user``
505+
---------------------
506+
Name of the user to impersonate.
507+
This means that all actions in the session will be executed in the security
508+
context of the impersonated user. For this, the user for which the
509+
:class:``Driver`` has been created needs to have the appropriate permissions.
510+
511+
:Type: ``str``, None
512+
513+
514+
.. py:data:: None
515+
:noindex:
516+
517+
Will not perform impersonation.
518+
519+
520+
.. Note::
521+
522+
The server or all servers of the cluster need to support impersonation when.
523+
Otherwise, the driver will raise :py:exc:`.ConfigurationError`
524+
as soon as it encounters a server that does not.
525+
526+
527+
.. code-block:: python
528+
529+
from neo4j import GraphDatabase
530+
driver = GraphDatabase.driver(uri, auth=(user, password))
531+
session = driver.session(impersonated_user="alice")
532+
533+
534+
:Default: ``None``
535+
536+
502537
.. _default-access-mode-ref:
503538

504539
``default_access_mode``

0 commit comments

Comments
 (0)