3737
3838@dataclass
3939class ExpiringAuth :
40- """Represents potentially expiring authentication information.
40+ """
41+ Represents potentially expiring authentication information.
4142
4243 This class is used with :meth:`.AuthManagers.bearer` and
4344 :meth:`.AsyncAuthManagers.bearer`.
@@ -68,7 +69,8 @@ class ExpiringAuth:
6869 expires_at : t .Optional [float ] = None
6970
7071 def expires_in (self , seconds : float ) -> ExpiringAuth :
71- """Return a (flat) copy of this object with a new expiration time.
72+ """
73+ Return a (flat) copy of this object with a new expiration time.
7274
7375 This is a convenience method for creating an :class:`.ExpiringAuth`
7476 for a relative expiration time ("expires in" instead of "expires at").
@@ -96,7 +98,8 @@ def expiring_auth_has_expired(auth: ExpiringAuth) -> bool:
9698
9799
98100class AuthManager (metaclass = abc .ABCMeta ):
99- """Baseclass for authentication information managers.
101+ """
102+ Abstract base class for authentication information managers.
100103
101104 The driver provides some default implementations of this class in
102105 :class:`.AuthManagers` for convenience.
@@ -132,7 +135,8 @@ class AuthManager(metaclass=abc.ABCMeta):
132135
133136 @abc .abstractmethod
134137 def get_auth (self ) -> _TAuth :
135- """Return the current authentication information.
138+ """
139+ Return the current authentication information.
136140
137141 The driver will call this method very frequently. It is recommended
138142 to implement some form of caching to avoid unnecessary overhead.
@@ -151,7 +155,8 @@ def get_auth(self) -> _TAuth:
151155 def handle_security_exception (
152156 self , auth : _TAuth , error : Neo4jError
153157 ) -> bool :
154- """Handle the server indicating authentication failure.
158+ """
159+ Handle the server indicating authentication failure.
155160
156161 The driver will call this method when the server returns any
157162 `Neo.ClientError.Security.*` error. The error will then be processed
@@ -174,7 +179,8 @@ def handle_security_exception(
174179
175180
176181class AsyncAuthManager (_Protocol , metaclass = abc .ABCMeta ):
177- """Async version of :class:`.AuthManager`.
182+ """
183+ Async version of :class:`.AuthManager`.
178184
179185 .. seealso:: :class:`.AuthManager`
180186
@@ -234,10 +240,14 @@ class ClientCertificate:
234240
235241class ClientCertificateProvider (_Protocol , metaclass = abc .ABCMeta ):
236242 """
237- Provides a client certificate to the driver for mutual TLS.
243+ Interface for providing a client certificate to the driver for mutual TLS.
244+
245+ This is an abstract base class (:class:`abc.ABC`) as well as a protocol
246+ (:class:`typing.Protocol`). Meaning you can either inherit from it or just
247+ implement all required method on a class to satisfy the type constraints.
238248
239249 The package provides some default implementations of this class in
240- :class:`.AsyncClientCertificateProviders ` for convenience.
250+ :class:`.ClientCertificateProviders ` for convenience.
241251
242252 The driver will call :meth:`.get_certificate` to check if the client wants
243253 the driver to use as new certificate for mutual TLS.
@@ -286,12 +296,17 @@ class AsyncClientCertificateProvider(_Protocol, metaclass=abc.ABCMeta):
286296 """
287297 Async version of :class:`.ClientCertificateProvider`.
288298
299+ The package provides some default implementations of this class in
300+ :class:`.AsyncClientCertificateProviders` for convenience.
301+
289302 **This is a preview** (see :ref:`filter-warnings-ref`).
290303 It might be changed without following the deprecation policy.
291304 See also
292305 https://github.com/neo4j/neo4j-python-driver/wiki/preview-features
293306
294- .. seealso:: :class:`.ClientCertificateProvider`
307+ .. seealso::
308+ :class:`.ClientCertificateProvider`,
309+ :class:`.AsyncClientCertificateProviders`
295310
296311 .. versionadded:: 5.19
297312 """
0 commit comments