2525from urllib3 .exceptions import IncompleteRead , PoolError , ProtocolError , ProxyError
2626from urllib3 .exceptions import TimeoutError as Urllib3TimeoutError
2727
28- from aignostics .platform ._api import _AuthenticatedApi
28+ from aignostics .platform ._api import _AuthenticatedApi , _AuthenticatedResource
2929from aignostics .platform ._operation_cache import cached_operation
3030from aignostics .platform ._settings import settings
3131from aignostics .platform .resources .utils import paginate
@@ -60,24 +60,12 @@ def _log_retry_attempt(retry_state: RetryCallState) -> None:
6060 )
6161
6262
63- class Versions :
63+ class Versions ( _AuthenticatedResource ) :
6464 """Resource class for managing application versions.
6565
6666 Provides operations to list and retrieve application versions.
6767 """
6868
69- def __init__ (self , api : _AuthenticatedApi ) -> None :
70- """Initializes the Versions resource with the API platform.
71-
72- Args:
73- api (_AuthenticatedApi): The configured API platform.
74- """
75- self ._api = api
76- # No runtime hasattr check for token_provider: MyPy strict mode (enforced in CI)
77- # already rejects non-_AuthenticatedApi arguments at static-analysis time.
78- # A silent getattr fallback is intentionally avoided — it would disable per-user
79- # cache key isolation in @cached_operation, causing cross-user cache leakage.
80-
8169 def list (self , application : Application | str , nocache : bool = False ) -> builtins .list [VersionTuple ]:
8270 """Find all versions for a specific application.
8371
@@ -228,7 +216,7 @@ def latest(self, application: Application | str, nocache: bool = False) -> Versi
228216 return sorted_versions [0 ] if sorted_versions else None
229217
230218
231- class Applications :
219+ class Applications ( _AuthenticatedResource ) :
232220 """Resource class for managing applications.
233221
234222 Provides operations to list applications and access version resources.
@@ -240,11 +228,7 @@ def __init__(self, api: _AuthenticatedApi) -> None:
240228 Args:
241229 api (_AuthenticatedApi): The configured API platform.
242230 """
243- self ._api = api
244- # No runtime hasattr check for token_provider: MyPy strict mode (enforced in CI)
245- # already rejects non-_AuthenticatedApi arguments at static-analysis time.
246- # A silent getattr fallback is intentionally avoided — it would disable per-user
247- # cache key isolation in @cached_operation, causing cross-user cache leakage.
231+ super ().__init__ (api )
248232 self .versions : Versions = Versions (self ._api )
249233
250234 def details (self , application_id : str , nocache : bool = False ) -> Application :
0 commit comments