Skip to content

Bug in Analyst class #59

Description

@Seba485

Using the sdk for retrieving and managing the AI Analyst incidents I stumbled on a bug, namely the method acknowledge of the class Analyst (and I believe the others too) fails in bad request due to '{ "aianalyst": "API SIGNATURE ERROR"}'. I tried several things and I ended up fixing it by adding params={"uuid": uuids}, to the self._post_form parameters called inside the method. Below the code for reference.

File dt_analyst.py inside class Analyst

    def acknowledge(
        self,
        uuids: str | list[str],
        timeout: float | tuple[float, float] | None = _UNSET,
    ) -> dict:
        """Acknowledge AI Analyst incident events.

        Args:
            uuids: Single UUID string or list of UUID strings.

        Returns:
            dict: Full Darktrace API response.
        """
        if isinstance(uuids, list):
            uuids = ",".join(uuids)
        return self._post_form(
            "/aianalyst/acknowledge",
            post_form={"uuid": uuids},
            params={"uuid": uuids}, #added to fix the bug
            timeout=timeout,
        )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions