diff --git a/elydora/__init__.py b/elydora/__init__.py index aff3bb5..0581a1e 100644 --- a/elydora/__init__.py +++ b/elydora/__init__.py @@ -68,6 +68,7 @@ from .types import ( AuthLoginResponse, GetMeResponse, IssueApiTokenResponse, + IssueTokenResponse, RotateApiTokenResponse, HealthResponse, DeepHealthResponse, @@ -142,6 +143,7 @@ __all__ = [ "AuthLoginResponse", "GetMeResponse", "IssueApiTokenResponse", + "IssueTokenResponse", "RotateApiTokenResponse", "HealthResponse", "DeepHealthResponse", diff --git a/elydora/async_client.py b/elydora/async_client.py index 3e80523..222bc38 100644 --- a/elydora/async_client.py +++ b/elydora/async_client.py @@ -195,6 +195,15 @@ class AsyncElydoraClient: "POST", "/v1/auth/token", json_body=api_token_body(ttl_seconds) ) + async def issue_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse: + """Deprecated alias for issue_api_token().""" + warnings.warn( + "AsyncElydoraClient.issue_token() is deprecated. Use issue_api_token().", + DeprecationWarning, + stacklevel=2, + ) + return await self.issue_api_token(ttl_seconds=ttl_seconds) + async def rotate_api_token(self) -> RotateApiTokenResponse: return await self._request("POST", "/v1/auth/rotate", json_body={}) diff --git a/elydora/client.py b/elydora/client.py index 53a69d0..feb54a3 100644 --- a/elydora/client.py +++ b/elydora/client.py @@ -181,6 +181,15 @@ class ElydoraClient: def issue_api_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse: return self._request("POST", "/v1/auth/token", json_body=api_token_body(ttl_seconds)) + def issue_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse: + """Deprecated alias for issue_api_token().""" + warnings.warn( + "ElydoraClient.issue_token() is deprecated. Use issue_api_token().", + DeprecationWarning, + stacklevel=2, + ) + return self.issue_api_token(ttl_seconds=ttl_seconds) + def rotate_api_token(self) -> RotateApiTokenResponse: return self._request("POST", "/v1/auth/rotate", json_body={}) diff --git a/elydora/types.py b/elydora/types.py index a163686..d43e82f 100644 --- a/elydora/types.py +++ b/elydora/types.py @@ -351,6 +351,10 @@ class IssueApiTokenResponse(TypedDict): token_id: str +# Deprecated alias for IssueApiTokenResponse. +IssueTokenResponse = IssueApiTokenResponse + + class RotateApiTokenResponse(TypedDict): token: str expires_at: Optional[int]