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

[Transform] Expose authorization failure as transform health issue #94724

Merged

Conversation

przemekwitek
Copy link
Contributor

@przemekwitek przemekwitek commented Mar 24, 2023

This PR enhances the _stats API with the information about the latest authorization failure, i.e. whether the authorization was successful or not, and if not, what was the error.
This information is presented as a TransformHealthIssue under health object.
With this PR, the response of the _stats call will contain:

{
  ...
  "health": {
    "status": "green"
  },
  ...
}

if the last authorization was successful.

or

{
  ...
  "health": {
    "status": "red",
    "issues": [
      {
        "type": "privileges_check_failed",
        "issue": "Privileges check failed",
        "details": "Cannot create transform [my-transform] because user bob lacks the required permissions [my-source-index:[read, view_index_metadata], my-dest-index:[index, read]]"
      }
    ]
  },
  ...
}

if the last authorization was unsuccessful.

Relates #93259

@przemekwitek
Copy link
Contributor Author

run elasticsearch-ci/docs

@przemekwitek przemekwitek force-pushed the permissions_when_dest_exists branch 6 times, most recently from 499aaa2 to 8c0ebee Compare March 29, 2023 11:18
@przemekwitek przemekwitek force-pushed the permissions_when_dest_exists branch from 8c0ebee to f94580f Compare March 29, 2023 11:19
@przemekwitek przemekwitek changed the title Expose authorization state in transform stats [Transform] Expose authorization state as an object in transform stats Mar 29, 2023
@przemekwitek
Copy link
Contributor Author

run elasticsearch-ci/packaging-tests-windows-sample

@przemekwitek przemekwitek removed the WIP label Mar 29, 2023
@przemekwitek przemekwitek marked this pull request as ready for review March 29, 2023 11:51
@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Mar 29, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine
Copy link
Collaborator

Hi @przemekwitek, I've created a changelog YAML for you.

@przemekwitek przemekwitek changed the title [Transform] Expose authorization state as an object in transform stats [Transform] Expose authorization failure as transform health issue Mar 31, 2023
Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :ml/Transform Transform Team:ML Meta label for the ML team v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants