@@ -125,7 +125,7 @@ def get_google_token_from_aud(audience: Optional[str] = None) -> str:
125
125
126
126
def get_google_id_token (audience : Optional [str ] = None ) -> Callable [[], str ]:
127
127
"""
128
- Synchronously fetches a Google ID token for a specific audience .
128
+ Returns a SYNC function that, when called, fetches a Google ID token .
129
129
This function uses Application Default Credentials for local systems
130
130
and standard google auth libraries for Google Cloud environments.
131
131
It caches the token in memory.
@@ -134,7 +134,7 @@ def get_google_id_token(audience: Optional[str] = None) -> Callable[[], str]:
134
134
audience: The audience for the ID token (e.g., a service URL or client ID).
135
135
136
136
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>".
138
138
139
139
Raises:
140
140
GoogleAuthError: If fetching credentials or the token fails.
@@ -146,9 +146,9 @@ def _token_getter() -> str:
146
146
return _token_getter
147
147
148
148
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 ]]:
150
150
"""
151
- Asynchronously fetches a Google ID token for a specific audience .
151
+ Returns an ASYNC function that, when called, fetches a Google ID token .
152
152
This function uses Application Default Credentials for local systems
153
153
and standard google auth libraries for Google Cloud environments.
154
154
It caches the token in memory.
@@ -157,7 +157,7 @@ async def aget_google_id_token(audience: Optional[str] = None) -> Callable[[], C
157
157
audience: The audience for the ID token (e.g., a service URL or client ID).
158
158
159
159
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>".
161
161
162
162
Raises:
163
163
GoogleAuthError: If fetching credentials or the token fails.
0 commit comments