def validate_api_key()

in devai-api/app/api_utils.py [0:0]


def validate_api_key(api_key: str):
    """Validates an API key against the stored API key from Secret Manager.

    Args:
        api_key: The API key to validate.

    Returns:
        True if the API key is valid, False otherwise.
    """
    devai_api_key = get_secret_value("DEVAI_API_KEY")

    if api_key is None or api_key == "" or devai_api_key is None:
        return False

    return is_valid_api_key(api_key, devai_api_key)