From 61d363c9eee5263535ce17b51a36f351aa7d6bbd Mon Sep 17 00:00:00 2001 From: NiceAesth Date: Sat, 24 Feb 2024 14:05:22 +0200 Subject: [PATCH] feat: don't store client secrets --- pomice/pool.py | 10 +++------- pomice/spotify/client.py | 5 +---- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/pomice/pool.py b/pomice/pool.py index 6f21da8..0dc6273 100644 --- a/pomice/pool.py +++ b/pomice/pool.py @@ -166,15 +166,11 @@ class Node: self._spotify_client: Optional[spotify.Client] = None self._apple_music_client: Optional[applemusic.Client] = None - self._spotify_client_id: Optional[str] = spotify_client_id - self._spotify_client_secret: Optional[str] = spotify_client_secret - - if self._spotify_client_id and self._spotify_client_secret: + if spotify_client_id and spotify_client_secret: self._spotify_client = spotify.Client( - self._spotify_client_id, - self._spotify_client_secret, + spotify_client_id, + spotify_client_secret, ) - if apple_music: self._apple_music_client = applemusic.Client() diff --git a/pomice/spotify/client.py b/pomice/spotify/client.py index 58b8647..96bf487 100644 --- a/pomice/spotify/client.py +++ b/pomice/spotify/client.py @@ -34,15 +34,12 @@ class Client: """ def __init__(self, client_id: str, client_secret: str) -> None: - self._client_id: str = client_id - self._client_secret: str = client_secret - self.session: aiohttp.ClientSession = None # type: ignore self._bearer_token: Optional[str] = None self._expiry: float = 0.0 self._auth_token = b64encode( - f"{self._client_id}:{self._client_secret}".encode(), + f"{client_id}:{client_secret}".encode(), ) self._grant_headers = { "Authorization": f"Basic {self._auth_token.decode()}",