From 82e5fb22ec9a31863646993f5d6ee6dbaea273a2 Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Fri, 26 May 2023 12:34:42 +0200 Subject: [PATCH 1/4] Docs: mention changes made to ExpiringAuth in 5.9.0 --- src/neo4j/_auth_management.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/neo4j/_auth_management.py b/src/neo4j/_auth_management.py index c4f7b259..c58c95a4 100644 --- a/src/neo4j/_auth_management.py +++ b/src/neo4j/_auth_management.py @@ -58,6 +58,12 @@ class ExpiringAuth: :meth:`.AsyncAuthManagers.expiration_based` .. versionadded:: 5.8 + + .. versionchanged:: 5.9 + Removed parameter and member ``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 @@ -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", From 26543ff874ca524e5db095be83933e66b4670c25 Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Fri, 26 May 2023 12:49:14 +0200 Subject: [PATCH 2/4] s/member/attribute/ --- src/neo4j/_auth_management.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neo4j/_auth_management.py b/src/neo4j/_auth_management.py index c58c95a4..ec203672 100644 --- a/src/neo4j/_auth_management.py +++ b/src/neo4j/_auth_management.py @@ -60,8 +60,8 @@ class ExpiringAuth: .. versionadded:: 5.8 .. versionchanged:: 5.9 - Removed parameter and member ``expires_in`` (relative expiration time). - Replaced with ``expires_at`` (absolute expiration time). + 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. """ From e956661d681bd84209675d09ba99e9579586a486 Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Fri, 26 May 2023 12:54:30 +0200 Subject: [PATCH 3/4] Tiny bit of extra precision --- src/neo4j/_auth_management.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neo4j/_auth_management.py b/src/neo4j/_auth_management.py index ec203672..4e6f101e 100644 --- a/src/neo4j/_auth_management.py +++ b/src/neo4j/_auth_management.py @@ -69,7 +69,7 @@ class ExpiringAuth: 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"). From c756c61b42d6332820fb0a4ba1a6082ba095bd8d Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Fri, 26 May 2023 12:54:52 +0200 Subject: [PATCH 4/4] Make docs render ExpiringAuth with all members --- docs/source/api.rst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index 7e59c72d..35bc6aad 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