feat: add API key validation and corresponding error handling; update tests for validation

This commit is contained in:
bohd4nx
2026-03-15 23:01:37 +02:00
parent f4a96bb01a
commit 041081b919
6 changed files with 29 additions and 10 deletions
+3
View File
@@ -58,6 +58,9 @@ class FragmentClient:
if word_count not in (12, 18, 24):
raise ConfigurationError(ConfigurationError.INVALID_MNEMONIC.format(count=word_count))
if len(api_key.strip()) < 68:
raise ConfigurationError(ConfigurationError.INVALID_API_KEY.format(length=len(api_key.strip())))
if isinstance(cookies, str):
try:
cookies = json.loads(cookies)