from __future__ import annotations from typing import Any, MutableMapping from src import config from src.api_client.dsp import AppleMusicApiClient from src.enums import ServiceType from ..schemas import AppleMusicCallbackSchema from .base import BaseDSPAuthorizer __all__ = ["AppleMusicAuthorizer"] class AppleMusicAuthorizer(BaseDSPAuthorizer[AppleMusicApiClient]): service_type = ServiceType.apple_music callback_schema = AppleMusicCallbackSchema() api_client_cls = AppleMusicApiClient def _get_api_client_kwargs(self) -> MutableMapping[str, Any]: return { "key_id": config.APPLE_MUSICKIT_KEYID, "secret_key": config.APPLE_MUSICKIT_KEY, "team_id": config.APPLE_MUSICKIT_TEAM_ID, } def get_auth_url(self) -> str: # No auth url for Apple Music return "" def get_dev_token(self) -> str: return self._api_client.get_access_token()