Skip to content

Commit

Permalink
Merge pull request #835 from globus/missing-docparam-cleanup-tokensto…
Browse files Browse the repository at this point in the history
…rage

Fix failing docparams in tokenstorage/
  • Loading branch information
sirosen authored Aug 27, 2023
2 parents 0843602 + c149bf2 commit bac486d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/globus_sdk/tokenstorage/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions src/globus_sdk/tokenstorage/file_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit bac486d

Please sign in to comment.