Skip to content

[Security Solution] [Case] Fixes "Case connector cannot be updated when created with a wrong field"#87223

Merged
stephmilovic merged 6 commits intoelastic:masterfrom
stephmilovic:bugfix-86768
Jan 5, 2021
Merged

[Security Solution] [Case] Fixes "Case connector cannot be updated when created with a wrong field"#87223
stephmilovic merged 6 commits intoelastic:masterfrom
stephmilovic:bugfix-86768

Conversation

@stephmilovic
Copy link
Copy Markdown
Contributor

@stephmilovic stephmilovic commented Jan 4, 2021

Summary

Fixes #86768

Bug fixes issue where case connector cannot be updated when created with a wrong field. Now when there is a problem fetching mappings (needs connector to work, aka have correct fields), we are allowing the configure post/patch/get to complete and swallowing the error, but returning it with the configure and showing it in a toaster, informing the user of the problem.
Screen Shot 2021-01-04 at 1 02 32 PM

I also persist a little error message in the UI for the mappings:
Screen Shot 2021-01-04 at 1 02 38 PM.

There was also a small issue with our createErrorMessage function for reporting Jira authentication failure errors that I fixed to make the error make sense.

Checklist

Delete any items that are not applicable to this PR.

return '';
}
if (typeof errorResponse === 'string') {
// Jira error.response.data can be string!!
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@cnasikas not sure what the response was looking like for other errors, but for 401 data was a string

Copy link
Copy Markdown
Member

@cnasikas cnasikas Jan 5, 2021

Choose a reason for hiding this comment

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

@stephmilovic Nice catch! In their API it says that they return an ErrorCollection that is an object for 400, 401, 403

@stephmilovic stephmilovic marked this pull request as ready for review January 4, 2021 21:45
@stephmilovic stephmilovic requested review from a team as code owners January 4, 2021 21:45
@cnasikas cnasikas changed the title [Security Solution] [Case] Fixes "Case connector cannot be updated when created with a wrong field" #86768 [Security Solution] [Case] Fixes "Case connector cannot be updated when created with a wrong field" Jan 5, 2021
@cnasikas cnasikas added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes labels Jan 5, 2021
@cnasikas
Copy link
Copy Markdown
Member

cnasikas commented Jan 5, 2021

Very good PR. I really liked your approach and the tests! I found the following:

  1. If you get an error and then you update the credentials to the correct ones, you still get the error. You have to switch back and forth to get the mappings.

bug_1

  1. If you create the connector, get the mappings, save the connector as the current one, and update with the wrong credentials you do not get an error.

bug_2

@stephmilovic
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

Copy link
Copy Markdown
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

LGTM! Tested locally. Issue 1 is fixed. Given that the mapping is fixed it is ok to leave behavior 2 as it is. We should consider opening an issue for 2 for future reference when we implement dynamic mappings.

Copy link
Copy Markdown
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.

Alerting changes LGTM!

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 8.5MB 8.5MB +1.1KB

Distributable file count

id before after diff
default 47253 48013 +760

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 246.7KB 246.7KB +48.0B

History

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

@stephmilovic stephmilovic merged commit b0ba4f4 into elastic:master Jan 5, 2021
@stephmilovic stephmilovic deleted the bugfix-86768 branch January 5, 2021 22:33
stephmilovic added a commit to stephmilovic/kibana that referenced this pull request Jan 5, 2021
stephmilovic added a commit to stephmilovic/kibana that referenced this pull request Jan 5, 2021
stephmilovic added a commit that referenced this pull request Jan 6, 2021
stephmilovic added a commit that referenced this pull request Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes for quality problems that affect the customer experience Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team v7.11.0 v7.12.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security Solution] Case connector cannot be updated when created with a wrong field

4 participants