Spaces:
Building
Building
Update config_provider.py
Browse files- config_provider.py +9 -3
config_provider.py
CHANGED
@@ -45,10 +45,16 @@ class GlobalConfig(BaseModel):
|
|
45 |
|
46 |
def get_tts_api_key(self) -> Optional[str]:
|
47 |
"""Get decrypted TTS API key"""
|
48 |
-
|
|
|
|
|
49 |
from encryption_utils import decrypt
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
52 |
|
53 |
def get_stt_api_key(self) -> Optional[str]:
|
54 |
"""Get decrypted STT API key"""
|
|
|
45 |
|
46 |
def get_tts_api_key(self) -> Optional[str]:
|
47 |
"""Get decrypted TTS API key"""
|
48 |
+
raw_key = self.tts_engine_api_key
|
49 |
+
|
50 |
+
if raw_key and raw_key.startswith("enc:"):
|
51 |
from encryption_utils import decrypt
|
52 |
+
decrypted = decrypt(raw_key)
|
53 |
+
log(f"π TTS key decrypted: {'***' + decrypted[-4:] if decrypted else 'None'}")
|
54 |
+
return decrypted
|
55 |
+
|
56 |
+
log(f"π TTS key not encrypted: {'***' + raw_key[-4:] if raw_key else 'None'}")
|
57 |
+
return raw_key
|
58 |
|
59 |
def get_stt_api_key(self) -> Optional[str]:
|
60 |
"""Get decrypted STT API key"""
|