diff --git a/docs/source/api.rst b/docs/source/api.rst index 7e59c72d0..35bc6aad9 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -111,6 +111,16 @@ The auth token is an object of the class :class:`neo4j.Auth` containing static d .. autoclass:: neo4j.Auth +Example: + +.. code-block:: python + + import neo4j + + + auth = neo4j.Auth("basic", "neo4j", "password") + + .. autoclass:: neo4j.auth_management.AuthManager :members: @@ -118,16 +128,9 @@ The auth token is an object of the class :class:`neo4j.Auth` containing static d :members: .. autoclass:: neo4j.auth_management.ExpiringAuth + :members: -Example: - -.. code-block:: python - - import neo4j - - - auth = neo4j.Auth("basic", "neo4j", "password") Auth Token Helper Functions diff --git a/src/neo4j/_auth_management.py b/src/neo4j/_auth_management.py index c4f7b259f..4e6f101ef 100644 --- a/src/neo4j/_auth_management.py +++ b/src/neo4j/_auth_management.py @@ -58,12 +58,18 @@ class ExpiringAuth: :meth:`.AsyncAuthManagers.expiration_based` .. versionadded:: 5.8 + + .. versionchanged:: 5.9 + Removed parameter and attribute ``expires_in`` (relative expiration + time). Replaced with ``expires_at`` (absolute expiration time). + :meth:`.expires_in` can be used to create an :class:`.ExpiringAuth` + with a relative expiration time. """ auth: "_TAuth" expires_at: t.Optional[float] = None def expires_in(self, seconds: float) -> "ExpiringAuth": - """Return a copy of this object with a new expiration time. + """Return a (flat) copy of this object with a new expiration time. This is a convenience method for creating an :class:`.ExpiringAuth` for a relative expiration time ("expires in" instead of "expires at"). @@ -79,6 +85,8 @@ def expires_in(self, seconds: float) -> "ExpiringAuth": :param seconds: The number of seconds from now until the authentication information expires. + + .. versionadded:: 5.9 """ with warnings.catch_warnings(): warnings.filterwarnings("ignore",