-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ES client to canary.37 (#119791)
* upgrade es client to canary 37 * fix error in core * mute error in test/ * mute incompatible errors * unskip request_entity_too_large_exception test * commit autofix * unskip batch_size_bytes_exceeds_es_content_length test * fix errors in Core code * fix or mute errors in data plugin * fix data_view_management * fix error index_management * fix x-pack/test errors * fix watcher * fix event_log * fix data_enhanced * fix uptime * fix triggers_actions_ui * fix transform * fix reporting * fix rule_registry * fix timeline * fix task_manager * fix security_solution * fix rule_registry * fix fleet * fix index_management * fix lens * fix maps * fix ml * fix observability * bump to canary 8.1-2 * fix error in packages * fix errors in core * fix errors in data * fix errors in discover * fix some discover tests * fix errors in telemetry * fix alerting * fix errors in apm * fix errors in event_log * fix errors in fleet * fix errors in infra * fix errors in lists * mute errors in maps * fix errors in ml * fix errors in osquery * fix errors in security_solution * fix errors in stack_alerts * fix errors in task_manager * fix errors in timelines * fix errors in transform * fix errors in watcher * fix errors in tests * update docs * adjust fleet code * fix problem in fleet * remove outdated _type from data plugin tests * fix packages tests * update type * fix tests part 2 * Adds product header back to elasticsearch * Updates API docs * Fix Discover tests * update alerting typings * Fix type errors * Import Sort type * Update x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_server.ts Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co> * Remove double negation * Fix snapshot conflict issues after merge from "main" Co-authored-by: Christiane Heiligers <christiane.heiligers@elastic.co> Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com> Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co> Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
- Loading branch information
1 parent
54cc284
commit 38feafa
Showing
194 changed files
with
1,876 additions
and
1,437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ | |
<b>Signature:</b> | ||
|
||
```typescript | ||
sortOrder?: estypes.SearchSortOrder; | ||
sortOrder?: estypes.SortOrder; | ||
``` |
23 changes: 23 additions & 0 deletions
23
...core-server.savedobjectserrorhelpers.creategenericnotfoundesunavailableerror.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) > [createGenericNotFoundEsUnavailableError](./kibana-plugin-core-server.savedobjectserrorhelpers.creategenericnotfoundesunavailableerror.md) | ||
|
||
## SavedObjectsErrorHelpers.createGenericNotFoundEsUnavailableError() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static createGenericNotFoundEsUnavailableError(type?: string | null, id?: string | null): DecoratedError; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| type | string \| null | | | ||
| id | string \| null | | | ||
|
||
<b>Returns:</b> | ||
|
||
DecoratedError | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ | |
<b>Signature:</b> | ||
|
||
```typescript | ||
sortOrder?: estypes.SearchSortOrder; | ||
sortOrder?: estypes.SortOrder; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/core/server/elasticsearch/supported_server_response_check.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { isNotFoundFromUnsupportedServer } from './supported_server_response_check'; | ||
|
||
describe('#isNotFoundFromUnsupportedServer', () => { | ||
it('returns true with not found response from unsupported server', () => { | ||
const rawResponse = { | ||
statusCode: 404, | ||
headers: {}, | ||
}; | ||
|
||
const result = isNotFoundFromUnsupportedServer(rawResponse); | ||
expect(result).toBe(true); | ||
}); | ||
|
||
it('returns false with not found response from supported server', async () => { | ||
const rawResponse = { | ||
statusCode: 404, | ||
headers: { 'x-elastic-product': 'Elasticsearch' }, | ||
}; | ||
|
||
const result = isNotFoundFromUnsupportedServer(rawResponse); | ||
expect(result).toBe(false); | ||
}); | ||
|
||
it('returns false when not a 404', async () => { | ||
const rawResponse = { | ||
statusCode: 200, | ||
headers: { 'x-elastic-product': 'Elasticsearch' }, | ||
}; | ||
|
||
const result = isNotFoundFromUnsupportedServer(rawResponse); | ||
expect(result).toBe(false); | ||
}); | ||
}); |
35 changes: 35 additions & 0 deletions
35
src/core/server/elasticsearch/supported_server_response_check.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
export const PRODUCT_RESPONSE_HEADER = 'x-elastic-product'; | ||
/** | ||
* Response headers check to determine if the response is from Elasticsearch | ||
* @param headers Response headers | ||
* @returns boolean | ||
*/ | ||
// This check belongs to the elasticsearch service as a dedicated helper method. | ||
export const isSupportedEsServer = ( | ||
headers: Record<string, string | string[] | undefined> | null | undefined | ||
) => { | ||
return !!headers && headers[PRODUCT_RESPONSE_HEADER] === 'Elasticsearch'; | ||
}; | ||
|
||
/** | ||
* Check to ensure that a 404 response does not come from Elasticsearch | ||
* | ||
* WARNING: This is a hack to work around for 404 responses returned from a proxy. | ||
* We're aiming to minimise the risk of data loss when consumers act on Not Found errors | ||
* | ||
* @param response response from elasticsearch client call | ||
* @returns boolean 'true' if the status code is 404 and the Elasticsearch product header is missing/unexpected value | ||
*/ | ||
export const isNotFoundFromUnsupportedServer = (args: { | ||
statusCode: number | null; | ||
headers: Record<string, string | string[] | undefined> | null; | ||
}): boolean => { | ||
return args.statusCode === 404 && !isSupportedEsServer(args.headers); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.