Skip to content

Commit 52e8b00

Browse files
author
anna-singleton-resolver
committed
chore: remove some extraneous comments
1 parent a7a7286 commit 52e8b00

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

src/resolver_athena_client/client/channel.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@
1717

1818

1919
class TokenData(NamedTuple):
20-
"""Immutable snapshot of token state.
21-
22-
Storing token, expiry, and scheme together as a single object
23-
ensures that validity checks and token reads are always consistent,
24-
eliminating TOCTOU races between ``get_token`` and
25-
``invalidate_token``.
26-
"""
20+
"""Immutable snapshot of token state."""
2721

2822
access_token: str
2923
expires_at: float
@@ -136,7 +130,6 @@ def _refresh_token(self) -> None:
136130
access_token: str = raw["access_token"]
137131
expires_in: int = raw.get("expires_in", 3600) # Default 1 hour
138132
token_type = raw.get("token_type", "Bearer")
139-
# Preserve server-provided casing, only strip whitespace
140133
scheme: str = token_type.strip() if token_type else "Bearer"
141134
self._token_data = TokenData(
142135
access_token=access_token,
@@ -180,14 +173,7 @@ def invalidate_token(self) -> None:
180173

181174

182175
class _AutoRefreshTokenAuthMetadataPlugin(grpc.AuthMetadataPlugin):
183-
"""gRPC auth plugin that fetches a fresh token for every RPC.
184-
185-
The plugin delegates to ``CredentialHelper.get_token()`` which
186-
handles caching, expiry checks, and thread-safe refresh internally.
187-
This callback is invoked by gRPC on a *separate* thread, so the
188-
underlying ``CredentialHelper`` must use ``threading.Lock`` (not
189-
``asyncio.Lock``).
190-
"""
176+
"""gRPC auth plugin that fetches a fresh token for every RPC."""
191177

192178
def __init__(self, credential_helper: CredentialHelper) -> None:
193179
"""Initialize with a credential helper.
@@ -247,12 +233,6 @@ async def create_channel_with_credentials(
247233
------
248234
InvalidHostError: If host is empty
249235
250-
Note:
251-
----
252-
OAuth errors are no longer raised at channel-creation time.
253-
Instead, they surface as RPC errors when the per-request auth
254-
metadata plugin attempts to acquire a token.
255-
256236
"""
257237
if not host:
258238
raise InvalidHostError(InvalidHostError.default_message)

0 commit comments

Comments
 (0)