Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security solution] Elastic Assistant APIs - always use performChecks #198392

Closed
wants to merge 3 commits into from

Conversation

stephmilovic
Copy link
Contributor

Summary

Makes changes around the performChecks function. Everywhere this was called was passing authenticatedUser: true and license: true, so I removed those parameters and updated the code so that those checks always happen. Previously, performChecks either returned an error response or undefined. I updated it to return either:

{
  isSuccess: true;
  currentUser: AuthenticatedUser;
} |
{
  isSuccess: false;
  response: IKibanaResponse;
};

That way when the check passes, it always returns our AuthenticatedUser and eliminates the need to re-run that check.

Finally, I found any spot that was checking license + user on its own to use the performChecks function.

@stephmilovic stephmilovic added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Security Generative AI Security Generative AI backport:version Backport to applied version labels v8.17.0 labels Oct 30, 2024
@stephmilovic stephmilovic requested a review from a team as a code owner October 30, 2024 15:40
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@stephmilovic
Copy link
Contributor Author

Closing as these changes were included here #198239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants