From d6479c863b93f73051d826ba9f5c214877185c46 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Sat, 26 Aug 2023 00:10:50 -0500 Subject: [PATCH 1/2] Fix failing docparams in tokenstorage/ --- src/globus_sdk/tokenstorage/base.py | 10 ++++++++++ src/globus_sdk/tokenstorage/file_adapters.py | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/globus_sdk/tokenstorage/base.py b/src/globus_sdk/tokenstorage/base.py index f2c360b02..2ea6fa73c 100644 --- a/src/globus_sdk/tokenstorage/base.py +++ b/src/globus_sdk/tokenstorage/base.py @@ -13,6 +13,9 @@ class StorageAdapter(metaclass=abc.ABCMeta): def store(self, token_response: OAuthTokenResponse) -> None: """ Store an `OAuthTokenResponse` in the underlying storage for this adapter. + + :param token_response: The token response to store + :type token_response: :class:`~.OAuthTokenResponse` """ @abc.abstractmethod @@ -23,12 +26,19 @@ def get_token_data(self, resource_server: str) -> dict[str, t.Any] | None: Either returns a dict with the access token, refresh token (optional), and expiration time, or returns ``None``, indicating that there was no data for that resource server. + + :param resource_server: The resource_server string which uniquely identifies the + token data to retriever from storage + :type resource_server: str """ def on_refresh(self, token_response: OAuthTokenResponse) -> None: """ By default, the on_refresh handler for a token storage adapter simply stores the token response. + + :param token_response: The token response received from the refresh + :type token_response: :class:`OAuthTokenResponse` """ self.store(token_response) diff --git a/src/globus_sdk/tokenstorage/file_adapters.py b/src/globus_sdk/tokenstorage/file_adapters.py index 026219eb2..074aa9665 100644 --- a/src/globus_sdk/tokenstorage/file_adapters.py +++ b/src/globus_sdk/tokenstorage/file_adapters.py @@ -87,6 +87,9 @@ def store(self, token_response: OAuthTokenResponse) -> None: Under the assumption that this may be running on a system with multiple local users, this sets the umask such that only the owner of the resulting file can read or write it. + + :param token_response: The token data received from the refresh + :type token_response: :class:`~.OAuthTokenResponse` """ to_write = self._load() From c149bf26886c47d24efd480061861930938e42e1 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Sun, 27 Aug 2023 09:04:39 -0500 Subject: [PATCH 2/2] Update src/globus_sdk/tokenstorage/base.py Co-authored-by: Kurt McKee --- src/globus_sdk/tokenstorage/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/globus_sdk/tokenstorage/base.py b/src/globus_sdk/tokenstorage/base.py index 2ea6fa73c..4926ee5e3 100644 --- a/src/globus_sdk/tokenstorage/base.py +++ b/src/globus_sdk/tokenstorage/base.py @@ -38,7 +38,7 @@ def on_refresh(self, token_response: OAuthTokenResponse) -> None: stores the token response. :param token_response: The token response received from the refresh - :type token_response: :class:`OAuthTokenResponse` + :type token_response: :class:`~.OAuthTokenResponse` """ self.store(token_response)