@@ -67,6 +67,7 @@ class Client:
6767
6868 - Provides access to platform resources like applications, versions, and runs.
6969 - Handles authentication and API client configuration.
70+ - Supports external token providers for machine-to-machine or custom auth flows.
7071 - Retries on network and server errors for specific operations.
7172 - Caches operation results for specific operations.
7273 """
@@ -88,8 +89,9 @@ def __init__(self, cache_token: bool = True, token_provider: Callable[[], str] |
8889 Ignored when ``token_provider`` is supplied.
8990 token_provider: Optional external token provider callable. When provided,
9091 bypasses internal OAuth authentication entirely. The callable must
91- return a valid bearer token string. When set, ``cache_token`` has no
92- effect because the external provider manages its own token lifecycle.
92+ return a raw access token string (without the ``Bearer `` prefix).
93+ When set, ``cache_token`` has no effect because the external provider
94+ manages its own token lifecycle.
9395
9496 Sets up resource accessors for applications, versions, and runs.
9597 """
@@ -292,7 +294,10 @@ def get_api_client(cache_token: bool = True, token_provider: Callable[[], str] |
292294 client .user_agent = user_agent ()
293295 api_client = _AuthenticatedApi (client , effective_provider )
294296
295- # Store in the appropriate singleton cache
297+ # Store in the appropriate singleton cache.
298+ # For external providers we use a simple bounded dict rather than LRU:
299+ # switching providers is rare in practice, and a full clear is simpler
300+ # than tracking access order while still bounding memory.
296301 if token_provider is not None :
297302 if len (Client ._api_client_external ) >= _MAX_EXTERNAL_CLIENTS :
298303 logger .warning (
0 commit comments