sfortis / openai_tts

OpenAI TTS custom component for HA
GNU General Public License v3.0
44 stars 15 forks source link

Invalid API key length #12

Closed mhamzahkhan closed 2 months ago

mhamzahkhan commented 2 months ago

I'm getting a 70 character key back when I create a key owned by a Service Account.

Works fine if I increase the limit in this: https://github.com/sfortis/openai_tts/blob/3b77fb891d0406334eae8794f0c5a9e4914206d2/custom_components/openai_tts/config_flow.py#L23

Traceback (most recent call last):
  File "/config/custom_components/openai_tts/config_flow.py", line 63, in async_step_user
    await validate_user_input(user_input)
  File "/config/custom_components/openai_tts/config_flow.py", line 28, in validate_user_input
    await validate_api_key(user_input.get(CONF_API_KEY))
  File "/config/custom_components/openai_tts/config_flow.py", line 24, in validate_api_key
    raise WrongAPIKey("Invalid API key length")
custom_components.openai_tts.config_flow.WrongAPIKey: Invalid API key length
sfortis commented 2 months ago

omg, these api keys are growing fast! thanks for the update, i've post a fix and a new release for hacks.