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

[Alerting] Return 400 Bad Request errors when creating/enabling/updating rules using API key authentication #98088

Merged
merged 10 commits into from
Apr 27, 2021

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Apr 22, 2021

Resolves #96683

Summary

Error message:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Error creating rule: could not create API key - Unsupported scheme \"ApiKey\" for granting API Key"
}

Checklist

Delete any items that are not applicable to this PR.

@ymao1 ymao1 self-assigned this Apr 23, 2021
@ymao1 ymao1 changed the title Catching API key creation errors and throwing bad request errors instead [Alerting] Catching API key creation errors that return 500 and throwing bad request errors instead Apr 23, 2021
@ymao1 ymao1 changed the title [Alerting] Catching API key creation errors that return 500 and throwing bad request errors instead [Alerting] Return 400 Bad Request errors when creating/enabling/updating rules using API key authentication Apr 23, 2021
@ymao1 ymao1 added Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.14.0 v8.0.0 labels Apr 23, 2021
@ymao1 ymao1 marked this pull request as ready for review April 23, 2021 18:40
@ymao1 ymao1 requested a review from a team as a code owner April 23, 2021 18:40
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@ymao1
Copy link
Contributor Author

ymao1 commented Apr 26, 2021

@elasticmachine merge upstream

@chrisronline chrisronline self-requested a review April 26, 2021 15:22
@ymao1 ymao1 requested a review from gchaps April 26, 2021 15:30
Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

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

LGTM! Great work!

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM

@ymao1 ymao1 added the auto-backport Deprecated - use backport:version if exact versions are needed label Apr 26, 2021
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ymao1

@ymao1 ymao1 merged commit b544be6 into elastic:master Apr 27, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 27, 2021
…ating rules using API key authentication (elastic#98088)

* Catching API key creation errors and throwing bad request errors instead

* Catching API key creation errors and throwing bad request errors instead

* Adding warning to docs

* Updating error messages

* Updating tests

* Updating warning wording in docs

Co-authored-by: Kibana Machine <[email protected]>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Apr 27, 2021
…ating rules using API key authentication (#98088) (#98465)

* Catching API key creation errors and throwing bad request errors instead

* Catching API key creation errors and throwing bad request errors instead

* Adding warning to docs

* Updating error messages

* Updating tests

* Updating warning wording in docs

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: ymao1 <[email protected]>
@ymao1 ymao1 deleted the alerting/alerting-client-api-key branch May 19, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[alerts] http 500 response when creating an alert using an API key has the http authorization
6 participants