Skip to content

Commit eb04044

Browse files
committed
Fix async methods
1 parent cfc03af commit eb04044

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/toolbox-core/src/toolbox_core/auth_methods.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def get_google_token_from_aud(audience: Optional[str] = None) -> str:
125125

126126
def get_google_id_token(audience: Optional[str] = None) -> Callable[[], str]:
127127
"""
128-
Synchronously fetches a Google ID token for a specific audience.
128+
Returns a SYNC function that, when called, fetches a Google ID token.
129129
This function uses Application Default Credentials for local systems
130130
and standard google auth libraries for Google Cloud environments.
131131
It caches the token in memory.
@@ -134,7 +134,7 @@ def get_google_id_token(audience: Optional[str] = None) -> Callable[[], str]:
134134
audience: The audience for the ID token (e.g., a service URL or client ID).
135135
136136
Returns:
137-
A string in the format "Bearer <google_id_token>".
137+
A function that when executed returns string in the format "Bearer <google_id_token>".
138138
139139
Raises:
140140
GoogleAuthError: If fetching credentials or the token fails.
@@ -146,9 +146,9 @@ def _token_getter() -> str:
146146
return _token_getter
147147

148148

149-
async def aget_google_id_token(audience: Optional[str] = None) -> Callable[[], Coroutine[Any, Any, str]]:
149+
def aget_google_id_token(audience: Optional[str] = None) -> Callable[[], Coroutine[Any, Any, str]]:
150150
"""
151-
Asynchronously fetches a Google ID token for a specific audience.
151+
Returns an ASYNC function that, when called, fetches a Google ID token.
152152
This function uses Application Default Credentials for local systems
153153
and standard google auth libraries for Google Cloud environments.
154154
It caches the token in memory.
@@ -157,7 +157,7 @@ async def aget_google_id_token(audience: Optional[str] = None) -> Callable[[], C
157157
audience: The audience for the ID token (e.g., a service URL or client ID).
158158
159159
Returns:
160-
A string in the format "Bearer <google_id_token>".
160+
An async function that when executed returns string in the format "Bearer <google_id_token>".
161161
162162
Raises:
163163
GoogleAuthError: If fetching credentials or the token fails.

0 commit comments

Comments
 (0)