@@ -107,10 +107,17 @@ Auth
107107
108108To authenticate with Neo4j the authentication details are supplied at driver creation.
109109
110- The auth token is an object of the class :class: `neo4j.Auth ` containing the details.
110+ The auth token is an object of the class :class: `neo4j.Auth ` containing static details or :class: ` neo4j.auth_management.AuthManager ` object .
111111
112112.. autoclass :: neo4j.Auth
113113
114+ .. autoclass :: neo4j.auth_management.AuthManager
115+ :members:
116+
117+ .. autoclass :: neo4j.auth_management.AuthManagers
118+ :members:
119+
120+ .. autoclass :: neo4j.auth_management.ExpiringAuth
114121
115122
116123Example:
@@ -154,7 +161,8 @@ Closing a driver will immediately shut down all connections in the pool.
154161
155162.. autoclass :: neo4j.Driver()
156163 :members: session, query_bookmark_manager, encrypted, close,
157- verify_connectivity, get_server_info
164+ verify_connectivity, get_server_info, verify_authentication,
165+ supports_session_auth, supports_multi_db
158166
159167 .. method :: execute_query(query, parameters_=None,routing_=neo4j.RoutingControl.WRITERS, database_=None, impersonated_user_=None, bookmark_manager_=self.query_bookmark_manager, result_transformer_=Result.to_eager_result, **kwargs)
160168
@@ -174,7 +182,7 @@ Closing a driver will immediately shut down all connections in the pool.
174182
175183 def execute_query(
176184 query_, parameters_, routing_, database_, impersonated_user_,
177- bookmark_manager_, result_transformer_, **kwargs
185+ bookmark_manager_, auth_, result_transformer_, **kwargs
178186 ):
179187 def work(tx):
180188 result = tx.run(query_, parameters_, **kwargs)
@@ -184,6 +192,7 @@ Closing a driver will immediately shut down all connections in the pool.
184192 database=database_,
185193 impersonated_user=impersonated_user_,
186194 bookmark_manager=bookmark_manager_,
195+ auth=auth_,
187196 ) as session:
188197 if routing_ == RoutingControl.WRITERS:
189198 return session.execute_write(work)
@@ -263,6 +272,20 @@ Closing a driver will immediately shut down all connections in the pool.
263272
264273 See also the Session config :ref: `impersonated-user-ref `.
265274 :type impersonated_user_: typing.Optional[str]
275+ :param auth_:
276+ Authentication information to use for this query.
277+
278+ By default, the driver configuration is used.
279+
280+ **This is a preview ** (see :ref: `filter-warnings-ref `).
281+ It might be changed without following the deprecation policy.
282+ See also
283+ https://github.com/neo4j/neo4j-python-driver/wiki/preview-features
284+
285+ See also the Session config :ref: `session-auth-ref `.
286+ :type auth_: typing.Union[
287+ typing.Tuple[typing.Any, typing.Any], neo4j.Auth, None
288+ ]
266289 :param result_transformer_:
267290 A function that gets passed the :class: `neo4j.Result ` object
268291 resulting from the query and converts it to a different type. The
@@ -273,7 +296,6 @@ Closing a driver will immediately shut down all connections in the pool.
273296 The transformer function must **not ** return the
274297 :class: `neo4j.Result ` itself.
275298
276-
277299 .. warning ::
278300
279301 N.B. the driver might retry the underlying transaction so the
@@ -334,7 +356,7 @@ Closing a driver will immediately shut down all connections in the pool.
334356
335357 Defaults to the driver's :attr: `.query_bookmark_manager `.
336358
337- Pass :const : `None ` to disable causal consistency.
359+ Pass :data : `None ` to disable causal consistency.
338360 :type bookmark_manager_:
339361 typing.Union[neo4j.BookmarkManager, neo4j.BookmarkManager,
340362 None]
@@ -348,7 +370,7 @@ Closing a driver will immediately shut down all connections in the pool.
348370 :returns: the result of the ``result_transformer ``
349371 :rtype: T
350372
351- **This is experimental. ** (See :ref: `filter-warnings-ref `)
373+ **This is experimental ** (see :ref: `filter-warnings-ref `).
352374 It might be changed or removed any time even without prior notice.
353375
354376 We are looking for feedback on this feature. Please let us know what
@@ -357,6 +379,9 @@ Closing a driver will immediately shut down all connections in the pool.
357379
358380 .. versionadded :: 5.5
359381
382+ .. versionchanged :: 5.8
383+ Added the ``auth_ `` parameter.
384+
360385
361386.. _driver-configuration-ref :
362387
@@ -433,7 +458,7 @@ Specify whether TCP keep-alive should be enabled.
433458:Type: ``bool ``
434459:Default: ``True ``
435460
436- **This is experimental. ** (See :ref: `filter-warnings-ref `)
461+ **This is experimental ** (see :ref: `filter-warnings-ref `).
437462It might be changed or removed any time even without prior notice.
438463
439464
@@ -784,6 +809,7 @@ Session
784809 .. automethod :: execute_write
785810
786811
812+
787813Query
788814=====
789815
@@ -804,6 +830,7 @@ To construct a :class:`neo4j.Session` use the :meth:`neo4j.Driver.session` metho
804830+ :ref: `default-access-mode-ref `
805831+ :ref: `fetch-size-ref `
806832+ :ref: `bookmark-manager-ref `
833+ + :ref: `session-auth-ref `
807834+ :ref: `session-notifications-min-severity-ref `
808835+ :ref: `session-notifications-disabled-categories-ref `
809836
@@ -816,7 +843,7 @@ Optional :class:`neo4j.Bookmarks`. Use this to causally chain sessions.
816843See :meth: `Session.last_bookmarks ` or :meth: `AsyncSession.last_bookmarks ` for
817844more information.
818845
819- :Default: `` None ` `
846+ :Default: :data: ` None `
820847
821848.. deprecated :: 5.0
822849 Alternatively, an iterable of strings can be passed. This usage is
@@ -995,10 +1022,33 @@ See :class:`.BookmarkManager` for more information.
9951022
9961023.. versionadded :: 5.0
9971024
998- **This is experimental. ** (See :ref: `filter-warnings-ref `)
1025+ **This is experimental ** (see :ref: `filter-warnings-ref `).
9991026It might be changed or removed any time even without prior notice.
10001027
10011028
1029+ .. _session-auth-ref :
1030+
1031+ ``auth ``
1032+ --------
1033+ Optional :class: `neo4j.Auth ` or ``(user, password) ``-tuple. Use this overwrite the
1034+ authentication information for the session.
1035+ This requires the server to support re-authentication on the protocol level. You can
1036+ check this by calling :meth: `.Driver.supports_session_auth ` / :meth: `.AsyncDriver.supports_session_auth `.
1037+
1038+ It is not possible to overwrite the authentication information for the session with no authentication,
1039+ i.e., downgrade the authentication at session level.
1040+ Instead, you should create a driver with no authentication and upgrade the authentication at session level as needed.
1041+
1042+ **This is a preview ** (see :ref: `filter-warnings-ref `).
1043+ It might be changed without following the deprecation policy.
1044+ See also https://github.com/neo4j/neo4j-python-driver/wiki/preview-features
1045+
1046+ :Type: :data: `None `, :class: `.Auth ` or ``(user, password) ``-tuple
1047+ :Default: :data: `None ` - use the authentication information provided during driver creation.
1048+
1049+ .. versionadded :: 5.x
1050+
1051+
10021052.. _session-notifications-min-severity-ref :
10031053
10041054``notifications_min_severity ``
@@ -1293,7 +1343,7 @@ Graph
12931343
12941344 .. automethod :: relationship_type
12951345
1296- **This is experimental. ** (See :ref: `filter-warnings-ref `)
1346+ **This is experimental ** (see :ref: `filter-warnings-ref `).
12971347It might be changed or removed any time even without prior notice.
12981348
12991349
@@ -1751,6 +1801,8 @@ Server-side errors
17511801
17521802 * :class: `neo4j.exceptions.TokenExpired `
17531803
1804+ * :class: `neo4j.exceptions.TokenExpiredRetryable `
1805+
17541806 * :class: `neo4j.exceptions.Forbidden `
17551807
17561808 * :class: `neo4j.exceptions.DatabaseError `
@@ -1786,6 +1838,9 @@ Server-side errors
17861838.. autoexception :: neo4j.exceptions.TokenExpired()
17871839 :show-inheritance:
17881840
1841+ .. autoexception :: neo4j.exceptions.TokenExpiredRetryable()
1842+ :show-inheritance:
1843+
17891844.. autoexception :: neo4j.exceptions.Forbidden()
17901845 :show-inheritance:
17911846
0 commit comments