Commit graph

246 commits

Author SHA1 Message Date
Steph Milovic 7d220d54c0
[index patterns] Add pattern validation method to index patterns fetcher (#90170) (#90512)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-08 10:09:18 -07:00
Brandon Kobel 57af8462e4
[7.x] Elastic License 2.0 (#90192)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:39:13 -08:00
Pierre Gayvallet d3c8fa05d8
[7.x] [SOM] display invalid references in the relationship flyout (#88814) (#89838)
* [SOM] display invalid references in the relationship flyout (#88814)

* return invalid relations and display them in SOM

* add FTR test

* fix mappings for 7.x
2021-02-01 14:22:16 +01:00
Liza Katz 6340c7843c
[Search Sessions] Improve search session errors (#88613) (#89823)
* Detect ESError correctly
Fix bfetch error (was recognized as unknown error)
Make sure handleSearchError always returns an error object.

* fix tests and improve types

* type

* normalize search error response format for search and bsearch

* type

* Added es search exception examples

* Normalize and validate errors thrown from oss es_search_strategy
Validate abort

* Added tests for search service error handling

* Update msearch tests to test for errors

* Moved bsearch route to routes folder
Adjusted bsearch response format
Added verification of error's root cause

* Align painless error object

* eslint

* Add to seach interceptor tests

* add json to tsconfig

* docs

* updated xpack search strategy tests

* oops

* license header

* Add test for xpack painless error format

* doc

* Fix bsearch test potential flakiness

* code review

* fix

* code review 2

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-01-31 17:13:06 +02:00
Alejandro Fernández Haro ddcd8a2783
[7.x] [Functional tests] Drop legacyEs usage (#88939) (#89089)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-01-25 12:16:31 +00:00
Joe Portner 73d1f644cd
[7.x] Sharing saved objects, phase 2 (#80945) (#88917) 2021-01-22 16:53:47 -05:00
Pierre Gayvallet fd4628dcd3
Add SO import hook / warnings API (#87996) (#88887)
* initial commit

* adapt client-side signatures

* more type fixes

* adapt api IT asserts

* fix some unit tests

* fix more test usages

* fix integration tests

* fix FT test assertions

* fix FT test assertions

* add FTR API integ test suite

* create the plugin_api_integration test suite

* adapt and fix flyout tests

* update documentation

* update generated doc

* add unit tests for `executeImportHooks`

* wire resolve_import_errors and add unit tests

* move hooks registration to SO type API

* update generated doc

* design integration

* update generated doc

* Add FTR tests for import warnings

* deletes plugins api integ tests

* self review

* move onImport to management definition

* update license header

* rename actionUrl to actionPath
2021-01-20 21:37:24 +01:00
Alejandro Fernández Haro ee5b6d22a3
[7.x] [FTR] Use new ES client instead of legacyEs service (#88720) (#88845) 2021-01-20 17:48:30 +00:00
Tyler Smalley baf56d80c4
[7.x] Updating the License (#88343) (#88745)
* Updating the Licenses, except for applying eslint, building

* Applying ESLint rules,building @kbn/pm, regenerating api docs

Co-authored-by: kobelb <brandon.kobel@elastic.co>
2021-01-19 17:54:11 -08:00
Ahmad Bamieh 863ade4670
[7.x] [SavedObjects] Allow migrations to be a function (#88594) (#88700)
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
2021-01-19 22:14:23 +02:00
Diana Derevyankina e2647645d7
[TSVB] Validation telemetry removal (#87848) (#88304)
* [TSVB] Validation telemetry removal

* Update telemetry check oss_plugins.json

* Remove unnecessary async function, usageCollection from optional plugins and fix telemetry_local test
2021-01-14 12:33:58 +03:00
Pierre Gayvallet 6e66ee0f65
Expose SO import/export APIs from the service's contract instead of exporting static functions (#86264) (#87611)
* Add user doc for SO tagging

* add link to new page

* handle review feedbacks

* second pass

* create SO exporter class

* adapt spaces code

* typo fix

* adapt tests

* some doc

* update generated doc

* fix spaces tests

* move ALL the import things

* adapt / move types

* create context, adapt core code

* adapt integration tests

* rename for consistency

* adapt spaces usages

* adapt spaces routes usages

* remove unused getImportExportObjectLimit

* fix tsdoc

* update generated doc

* doc nits

* review comments

* add test for fetchByObjects failure

* add custom errors for exporter

* remove `getImportExportObjectLimit` API

* fix IT

* update generated doc

* adapt UT

* forgot one Boom usage

* rename import error to failure

* remove Boom usages from importer

* update generated doc

* fix spaces types
2021-01-07 13:43:31 +01:00
Alexey Antonov 41aab669bc
[Data plugin] Wrong caching for Index pattern fields (#87116) (#87376)
* [Data plugin] Wrong caching for Index pattern fields

Closes: #84666

* remove can update index_pattern fields test

* fix tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts
2021-01-06 09:19:53 +03:00
Liza Katz 485667511e
[Search] Session server side functional tests (#86152) (#87210)
* OSS search functional tests

* x-pack tests

* Session tests

* Update search.ts

* Update session.ts

* Update test/api_integration/apis/search/search.ts

Co-authored-by: Lukas Olson <olson.lukas@gmail.com>

* reportServerError

* Improve response error codes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Lukas Olson <olson.lukas@gmail.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
2021-01-04 17:45:28 -07:00
Nick Partridge 86563373c5
[7.x] Create vis_type_xy plugin to replace histogram, area and line charts (#78154) (#86534) 2020-12-18 22:00:58 -06:00
Daniil 9816da3498
[Data table] Reactify & EUIficate the visualization (#70801) (#85936)
* Use data grid for table vis

* Create basic table template

* Add table_vis_split component

* Apply cell filtering

* Add aria-label attributes

* Use field formatters for values

* Add no results component

* Remove legacy dependencies

* Add usePagination

* Create usePagination util

* Use percentage column and total row

* Use csv export button

* Update labels

* Fix merge conflicts

* Use split table

* Fix functional tests

* Fix dashboard tests

* Update data table functional tests

* Fix missed test

* Introduce showToolbar option

* Remove useless package

* Fix merge conflicts

* Return back kibanaUtils required bundle

* Revert "Remove useless package"

This reverts commit 144a7cd77c.

* Use feature flag for legacy vis

* Add footer row

* Remove lock files

* Revert "Remove lock files"

This reverts commit 5c5acd79f4.

* Minor fixes

* Use common no result message

* Fix broken tests

* Use ui state sorting

* Fix error

* Fix merge conflicts

* Add legacy functional tests

* Pull pagination footer up to keep with table

and fix column split growing continuously in dashboard

* Comments fixes

* Use cell actions for filtering

* Fix translations

* Fix comments

* Reduce legacy tests amount

* Update sorting

* Update split column layout

* Add telemetry for legacy vis

* Apply latest changes for split table

* Fix eslint errors

* Use aria labels with values

* Use aria label for export btn

* Fix functional test

* Update translations

* Cleanup

* Truncate cells content

* Enhance types in table_vis_response_handler.ts

* Persist columns width on change

* Fix sorting history

* Add a migration script for toolbar

* Export sorted table

* Use reportUiCounter instead of reportUiStats

* Fix integration tests

* Fix typos

* Adjust FieldFormat type

* Hide the density selector

* Update docs

* Fix pagination

* Restrict hiding the toolbar

* Fix column index on filter

* Add closePopover action

Co-authored-by: cchaos <caroline.horn@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	scripts/functional_tests.js

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-16 14:53:45 +03:00
Ahmad Bamieh 6c1d24fc31
[7.x] [Telemetry] Application Usage track sub application views (#85765) (#86072)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-16 06:11:57 +02:00
Joe Portner d2d98e8ccf
Update core usage stats collection (#85706) (#85879) 2020-12-15 14:19:57 -05:00
Jonathan Budzenski 8b4e2fe7ce skip "without kibana index" suite. #85911 2020-12-15 10:38:10 -06:00
Tiago Costa 815d19d410
skip flaky suite (#85911) 2020-12-15 15:06:15 +00:00
Vadim Dalecky f4b79d327c
HTTP CRUD+ API for Index Patterns (#83576) (#85237)
* refactor: 💡 extract out createIndexPatternsService() method

* feat: 🎸 add create index pattern route

* feat: 🎸 add index patterns http context

* feat: 🎸 add schema for index pattern create method

* refactor: 💡 compose schema out of variables

* feat: 🎸 allow to not make the new index pattern a default one

* feat: 🎸 implement index pattern create endpoint

* docs: ✏️ add index pattern create endpoint docs

* fix: 🐛 add error handling wrapper

* feat: 🎸 add index pattern GET route

* docs: ✏️ add index pattern GET mention to docs

* feat: 🎸 add higher order route handler to check for context

* feat: 🎸 add index pattern deletion endpoint

* docs: ✏️ add delete endpoint docs entry

* feat: 🎸 add index pattern update route

* feat: 🎸 add ability to update timeFieldName

* feat: 🎸 add ability to edit intervalName, sourceFilters, fields

* feat: 🎸 allow updating index pattern type and typeMeta

* feat: 🎸 add ability to update index_pattern fields

* docs: ✏️ add index pattern update endpoint docs

* docs: ✏️ fix typo

* feat: 🎸 disable XSRF and add Content-Type

* fix: 🐛 enable xsrf

* feat: 🎸 send 404 status code when index pattern is not found

* fix: 🐛 correctly report empty change set error

* feat: 🎸 fields API add route for adding field to IP

* docs: ✏️ add index pattern field create route

* fix: 🐛 throw on creating an existing index pattern field

* feat: 🎸 add field upsert route

* feat: 🎸 add field get api endpoint

* feat: 🎸 add field delete endpoint

* refactor: 💡 improve 404 error handling

* refactor: 💡 improve index pattern 404 error class

* feat: 🎸 add field update api endpoint

* docs: ✏️ typo

* refactor: 💡 rename ski_field_refresh to refresh_fields in creat

* refactor: 💡 rename to refresh_fields param in update call

* refactor: 💡 rename parameter to refresh_fields in fields api

* feat: 🎸 allow creating and deleting only scripted fields

* style: 💄 fix TypeScript/Prettier error

* test: 💍 add index pattern creation negative tests

* test: 💍 add index pattern create method tests

* feat: 🎸 remove make_default flag

* docs: ✏️ update docs

* test: 💍 add index patter api get tests

* test: 💍 add delete index pattern tests

* fix: 🐛 fix TypeScript error after refactor

* docs: ✏️ update autogenerated docs

* docs: ✏️ update autogenerated docs

* refactor: 💡 change Fields API to Scripted Fields API

* feat: 🎸 allow only scripted fields in Scripted Fields API

* test: 💍 add index patter api update tests

* test: 💍 add scripted field create api tests

* test: 💍 add scripted field delete api tests

* test: 💍 add scripted fields fetch api tests

* test: 💍 add scripted field field put api tests

* test: 💍 add scripted field update api test

* feat: 🎸 add index pattern field update endpoint

* feat: 🎸 improve index patterns fields api

* test: 💍 fix test

* docs: ✏️ update docs README

* test: 💍 add field metadata deletion teests

* docs: ✏️ improve index pattern api readme

* fix: 🐛 fix TypeScript errors

* test: 💍 update jest tests

* docs: ✏️ update auto-generated docs

* feat: 🎸 remove intervalName from index pattern create API

* test: 💍 fix integration tests

* fix: 🐛 make refresh_fields default to false

* chore: 🤖 remove searchable and aggregatable from public API

* chore: 🤖 remove various field properties

* chore: 🤖 remove "index" attribute from public field schema

* docs: ✏️ update docs to match API

* chore: 🤖 fix TypeScript errors

* test: 💍 try fixing functional tests

* docs: ✏️ update auto-generated docs

* chore: 🤖 check if this fixes security tests

* fix: 🐛 create index patterns context only if user is authc

* fix: 🐛 assert on index patterns service

* test: 💍 try fixing integration tests

* fix: 🐛 try fixing integration tests

* chore: 🤖 update auto-generated docs

* refactor: 💡 directly inject index pattern provider into create

* refactor: 💡 create index pattern service directly in each route

* refactor: 💡 remove index pattern route context provider

* chore: 🤖 remove unused code

* chore: 🤖 remove refresh_fields from scripted fields

* style: 💄 change template param names

* refactor: 💡 make field.count always be an integer

* docs: ✏️ update auto-generated docs

* refactor: 💡 inject index patterns using getStartServices

* docs: ✏️ update autogenerated docs

* docs: ✏️ update docs
2020-12-08 12:16:00 +01:00
Tiago Costa e564439348
skip flaky suite (#85086) 2020-12-08 02:34:49 +00:00
Ahmad Bamieh 7824e075a3
[7.x] [Telemetry] Introduce UI Counters (#84224) (#85038)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-04 19:55:54 +02:00
Alejandro Fernández Haro a66a3e37b8
[7.x] TelemetryCollectionManager: Use X-Pack strategy as an OSS overwrite (#84477) (#84733) 2020-12-02 10:23:16 +00:00
Joe Portner 153a97be47
Fix flaky test suite (#84602) (#84668) 2020-12-01 12:42:48 -05:00
Tiago Costa 7dbfd260d9
skip flaky suite (#84438) 2020-11-26 21:35:33 +00:00
Alejandro Fernández Haro e5433f0db1
[7.x] Remove the parameter timestamp in /api/telemetry/v2/clusters/_stats (#83791) (#84065)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/test/functional/apps/infra/home_page.ts
#	x-pack/test/functional/apps/infra/logs_source_configuration.ts
2020-11-23 15:16:01 +00:00
Pierre Gayvallet 2238f5f3a5
Migrate /translations route to core (#83280) (#83410)
* move i18n route to core

* add FTR test for endpoint
2020-11-16 14:16:30 +01:00
Larry Gregory 56c6b79550
[7.x] Allow the repository to search across all namespaces (#82863) (#82975) 2020-11-09 14:13:31 -05:00
Pierre Gayvallet 29d3838c6d
SavedObjects search_dsl: add match_phrase_prefix clauses when using prefix search (#82693) (#82933)
* add match_phrase_prefix clauses when using prefix search

* add FTR tests
2020-11-09 13:54:11 +01:00
Pierre Gayvallet d449d8cbdb
[7.x] SavedObjects tagging MVP (#79096) (#82407)
* SavedObjects tagging MVP (#79096)

* create xpack plugin skeleton, start to implement management section

* add tag creation modal

* first implementation of the tags table

* use InMemoryTable

* add edit modal and delete action

* update plugin list

* add tag list, fix types

* add capabilities check on client-side

* add tag combo box component

* add missing i18n keys

* fix privilege FTR tests

* add base structure for FTR tests

* fix feature ftr test

* use string literals for i18n

* create savedObjectsTaggingOss plugin, move API types to oss plugin, start to wire to SO management page.

* update plugin list

* fix types

* allow to use `_find` with multiple references

* add FTR test for _find API on references fields

* add _find integration tests

* update generated doc

* start to implement tag filtering on SO management section

* update generated docs

* wire tagging API to dashboard listing page

* fix i18n namespace

* fix type & tests

* update dashboard listing snapshots

* adapt FTR listingTable service to search for parsable queries

* wite tagging API to visualize listing

* update tagging plugin limits

* add server-side and client-side validation for tag create/edit

* rename title field to name

* fix types

* fix types bis

* add removeReferencesTo API to SOR/SOC

* update generated doc

* add server-side unit test for `savedObjectsTagging` plugin

* move tagging API types to its own file

* add savedObjectsTaggingOss mock

* add tags_cache tests

* add tests for client-side tag client

* extract uiApi to distinct files

* various API improvements

* add more tests

* add link between tag and so management sections + add connection counts

* add base functional test suite for tagging

* add more FTR tests

* improve feature control func test

* update codeowners

* update generated doc

* fix access to proxy modal

* adapt SO save modal to allow to add tag field

* add SO decorator registry and tag implementation

* add unit tests for SO tag decorator

* add functional tests for visualize integration

* add tag SO read permission for vis/dash feature

* add RBAC api integ tests

* add API integration tests

* add test for getTagConnectionsUrl

* add SOM test suite

* add dashboard integration suite

* remove test line

* add missing unit tests

* improve API types doc

* fix create modal save button label

* remove console.log

* improve doc

* self review

* add refresh interval for tag cache

* improve page object doc

* minor cleanup

* address review comments

* small layout fixes

* add initial focus

* use lazy accessor for tag request handler context

* adapt SOM export and export route to handle references

* remove icon from feature config due to master changes

* fix SO table tests

* update generated docs

* sort tags by name in filter dropdown and listing component

* wire SO tagging to dashboard save modal

* fix types

* - add 'create tag' action in tag selector
- add notifications on update/create/delete from management
- delete modal wording

* add description max length validation

* remove real-time validation

* fix i18n bundle id

* update expected size of savedObjectsTagging plugin

* use own useIfMounted

* update limit again, contract components cannot be lazy loaded atm.

* math is hard

* remove single usage of lodash for bundle size

* add async imports for create/edit modal

* add FTR test for 'create tag' action from tag selector

* allow 'create new' option to prepopulate name field

* extract savedObjectToTag

* add advancedSettings read user for security api_integ suite

* add audit login for security client wrapper

* use import type when possible

* wire SO tagging to lens visualization

* fix lens jest test

* Fix `create tag` option being selected when closing the selector dropdown

* add sorting to tag column from getTableColumnDef

* address some of restrry comments

* rename tag selector's setSelected option to onTagsSelected

* fix audit logging even type for saved_object_remove_references

* update plugin size limit to current size

* adapt maxlength validation wording

* remove selection column until we have batch action menu

* remove connections link when user lack read privilege to savedObjectManagement

* forbid registering multiple SO decorators with the same priority

* add so decorator test

* extract getTagFindReferences and create API mock

* update audit-logging ascidoc

* doc nit

* throw conflict error if update returns any failure

* use refresh=true as default

* wording nits

* export: rename `references` to `hasReference`

* update generated doc

* set description max length to 100

* do not initialize tag cache on anonymous pages

* split fetchObjectsToExport into two distinct functions

* change tag client `delete` call order

* tsdoc nits

* more nits

* add README for oss plugin

* add oss plugin start tests

* SavedObject.find: rename `references` to `hasReference`

* change section description label

* remove url prefix constants

* last nits and comments

* update generated doc
# Conflicts:
#	.github/CODEOWNERS
#	packages/kbn-optimizer/limits.yml
#	x-pack/scripts/functional_tests.js

* fix FTR mapping files for 7.x
2020-11-03 14:35:43 +01:00
Thomas Watson df4f66b4ac
[7.x] Upgrade to hapi version 18 (#80468) (#82265) 2020-11-02 15:49:43 +01:00
Ahmad Bamieh b64ee1561e
[7.x] [Telemetry] Remove from and to timestamps from usage stats APIs (#81579) (#82266)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/test/functional/apps/infra/home_page.ts
#	x-pack/test/functional/apps/infra/logs_source_configuration.ts
2020-11-02 16:01:28 +02:00
Mikhail Shustov e0704ebc02
Support export for SO with circular refs (#81582) (#81885)
* support export for SO with circular refs

* add a test for export to space

* update test case names

* add test with complex deps tree
2020-10-28 16:16:45 +03:00
Tyler Smalley 96dbf531d3 skips test failing promotion (#79813)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-10-06 23:12:41 -07:00
Alejandro Fernández Haro f712cda3ca
[7.x] [KQL] Rename "telemetry" to "stats" (#78040) (#78448)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-24 19:09:20 +01:00
Pierre Gayvallet 97e7137599
[7.x] remove legacy ES plugin (#77703) (#77847)
* remove legacy ES plugin (#77703)

* remove legacy ES plug

* fix types

* delete some `legacy/core_plugins` references

* fix type
# Conflicts:
#	.github/CODEOWNERS
#	src/legacy/core_plugins/elasticsearch/index.js
#	src/legacy/core_plugins/elasticsearch/lib/abortable_request_handler.js
#	src/legacy/core_plugins/elasticsearch/lib/abortable_request_handler.test.js
#	src/legacy/core_plugins/elasticsearch/lib/cluster.ts
#	src/legacy/core_plugins/elasticsearch/lib/create_proxy.js
#	x-pack/dev-tools/jest/create_jest_config.js

* remove unused legacy file from 7.x
2020-09-18 11:45:32 +02:00
Alejandro Fernández Haro b8e1a53ab8
[7.x] [Application Usage] Daily rollups to overcome the find >10k SO limitation (#77610) (#77664)
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-17 08:23:28 +01:00
Alejandro Fernández Haro 368413d994
[7.x] [Telemetry][API Integration tests] Ensure .kibana index exists (#76662) (#77157)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-10 14:49:21 +01:00
Mikhail Shustov 0d0e9b66d3
Remove legacy SavedObjects (#76852) (#76978)
* remove legacy SO integration

* cleanup integration in the legacy platorm

* remove so schema

* update docs

* remove leftovers, update docs

* update docs after merge master
2020-09-09 07:06:18 +02:00
Luke Elmers e934fb8b36
[data.search.SearchSource] Remove legacy ES client APIs. (#75943) (#76676) 2020-09-03 14:47:38 -06:00
Joe Portner 5d94ec8c1d
[7.x] Sharing saved-objects phase 1.5 (#75444) (#76034) 2020-08-27 13:53:02 -04:00
Pierre Gayvallet 168b586ac1
Migrate CSP usage collector to kibana_usage_collection plugin (#75536) (#75643)
* move csp usage collector from legacy kibana plugin to kibana_usage_collection

* make scripts/telemetry_check happy.

* remove assertion on legacy kibana plugin

* remove test on legacy kibana plugin

* update README
2020-08-21 16:14:54 +02:00
Spencer 47897a2780
[7.x] Remove legacy optimizer (#73154) (#74966)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-13 12:36:25 -07:00
Alejandro Fernández Haro 59dd3a5d30
[7.x] [Telemetry][API Integration] size_in_bytes to be a number (#74664) (#74741) 2020-08-11 14:38:15 +01:00
Mikhail Shustov ab103ffa69
[KP] Expose new es client (#73651) (#73840)
* mark legacy ES client types as deprecated

* expose es client to plugins and update mocks

* ElasticSearchClientMock --> ElasticsearchClientMock

* expose es client mocks

* expose es client via RequestHandlerContext

* convert test/plugin_functional/config into ts

* convert top_nav test into ts

* add an integration test for the es client

* update comments to refer to the new es client

* fix import paths. do not use extensions

temp

* update docs

* fix other refs

* add test for a custom client

* fix context

* add test for scoped client

* update docs
# Conflicts:
#	scripts/functional_tests.js
2020-07-30 21:09:14 +02:00
Mikhail Shustov 9d51c8f073
[KP] use new ES client in SO service (#72289) (#73219)
* adapt retryCallCluster for new ES client

* review comments

* retry on 408 ResponseError

* remove legacy retry functions

* use Migrator Es client in SO migration

* update migration tests

* improve ES typings and mocks

* migrate decorate ES errors

* add repository es client

* use new es client in so repository

* update repository tests

* fix migrator integration tests

* declare _seq_no & _primary_term on get response. _source expect to be a string

* make _sourceIncludes and refresh compatible with the client

* add test for repository_es_client

* move ApiResponse to es client mocks

* TEMP: handle wait_for as true for deleteByNamespace

* add tests for migration_es_client

* TEMP: skip test for deleteByNamespace refresh

* pass ignore as transport option in mget

* log both es client and response errors

* fix update method test failures

* update deleteByNamespace refresh settings

es doesn't support 'refresh: wait_for' for `updateByQuery` endpoint

* update repository tests. we do not allow customising wait_for

* do not delegate retry logic to es client

* fix type errors after master merged

* fix repository tests

* fix security solutions code

SO doesn't throw Error with status code anymore. Always use SO error helpers

* switch error conditions to use SO error helpers

* cleanup

* address comments about mocks

* use isResponseError helper

* address comments

* fix type errors

Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>

Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
2020-07-25 13:42:03 +02:00
Aleh Zasypkin 2764abe4e8
[7.x] Add @elastic/safer-lodash-set as an alternative to lodash.set (#71823)
# Conflicts:
#	yarn.lock

Co-authored-by: Thomas Watson <w@tson.dk>
2020-07-15 12:18:47 +02:00
Larry Gregory 3bc02a6700
Search across spaces (#67644) (#71574)
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-13 22:09:26 -04:00
Tiago Costa 7759b924fc
[7.x] chore(NA): upgrade to lodash@4 (#69868) (#70683)
* chore(NA): upgrade to lodash@4 (#69868)

* chore(NA): upgrade oss to lodash4

chore(NA): migrate cli, cli_plugin, cli_keystore,  dev, test_utils and apm src script to lodash4

chore(NA): missing file for cli plugin

chore(NA): add src core

chore(NA): es archiver and fixtures

chore(NA): try to fix functional test failure

chore(NA): migrate src/legacy entirely to lodash4 except src/legacy/core_plugins

chore(NA): move legacy core plugins to lodash4

chore(NA): upgrade optimize to lodash4

chore(NA): upgrade to lodash4 on advanced_settings, charts, console and dashboard

chore(NA): migrate to lodash4 on dev_tools, discover, embeddable, es_ui)shared, expressions, home plugins

chore(NA): upgrade data plugin to lodash4

chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4

chore(NA): missing data upgrades to lodash4

Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4"

This reverts commit 137055c5fed2fc52bb26547e0bc1ad2e3d4fe309.

Revert "Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4""

This reverts commit f7e73688782998513d9fb6d7e8f0765e9beb28d1.

Revert "chore(NA): missing data upgrades to lodash4"

This reverts commit 92b85bf947a89bfc70cc4052738a6b2128ffb076.

Revert "chore(NA): upgrade data plugin to lodash4"

This reverts commit 88fdb075ee1e26c4ac979b6681d8a2b002df74c6.

chore(NA): upgrade idx_pattern_mgt, input_control_vis, inspector, kbn_legacy, kbn_react, kbn_usage_collections, kbn_utils, management and maps_legacy to lodash4

chore(NA): map src plugin data to lodash3

chore(NA): missing lodash.clonedeep dep

chore(NA): change packages kbn-config-schema deps

chore(NA): update renovate config

chore(NA): upgrade vis_type plugins to lodash4

chore(NA): move vis_type_vislib to lodash3

chore(NA): update visualizations and visualize to lodash4

chore(NA): remove lodash 3 types from src and move test to lodash4

chore(NA): move home, usage_collection and management to lodash 3

Revert "chore(NA): move home, usage_collection and management to lodash 3"

This reverts commit f86e8585f02d21550746569af54215b076a79a3d.

chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3

chore(NA): update x-pack test to mock lodash4

Revert "chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3"

This reverts commit 2d10fe450533e1b36db21d99cfae3ce996a244e0.

* chore(NA): move x-pack and packages to lodash 4

* chore(NA): remove mention to lodash from main package.json

* chore(NA): remove helper alias for lodash4 and make it the default lodash

* chore(NA): fix last failing types in the repo

* chore(NA): fix public api

* chore(NA): fix types for agg_row.tsx

* chore(NA): fix increment of optimizer modules in the rollup plugin

* chore(NA): migrate `src/core/public/http/fetch.ts` (#5)

* omit undefined query props

* just remove merge usage

* fix types

* chore(NA): fixes for feedback from apm team

* chore(NA): recover old behaviour on apm LoadingIndeicatorContext.tsx

* chore(NA): fixes for feedback from watson

* Platform lodash4 tweaks (#6)

* chore(NA): fix types and behaviour on src/core/server/elasticsearch/errors.ts

* Canvas fixes for lodash upgrade

* [APM] Adds unit test for APM service maps transform (#7)

* Adds a snapshot unit test for getConnections and rearranges some code to make testing easier

* reverts `ArrayList` back to `String[]` in the painless script within `fetch_service_paths_from_trace_ids.ts`

* chore(NA): update yarn.lock

* chore(NA): remove any and use a real type for alerts task runner

Co-authored-by: Gidi Meir Morris <github@gidi.io>

* chore(NA): used named import for triggers_actions_ui file

* chore(NA): fix eslint

* chore(NA): fix types

* Delete most uptime lodash references.

* Simplify. Clean up types.

* [Uptime] Delete most uptime lodash references (#8)

* Delete most uptime lodash references.

* Simplify. Clean up types.

* chore(NA): add eslint rule to avoid using lodash3

* chore(NA): apply changes on feedback from es-ui team

* fix some types (#9)

* Clean up some expressions types.

* chore(NA): missing ts-expect-error statements

* Upgrade lodash 4 vislib (#11)

* replace lodash 3 with lodash 4 on vislib plugin

* Further changes

* further replacement of lodash3 to 4

* further work on upgrading to lodash 4

* final changes to update lodash

* chore(NA): upgrade data plugin to lodash4

chore(NA): upgrade data plugin public to lodash4

chore(NA): fix typecheck task

chore(NA): fix agg_config with hasIn

chore(NA): assign to assignIn and has to hasIn

chore(NA): upgrade data plugin server to lodash4

chore(NA): new signature for core api

fix(NA): match behaviour between lodash3 and lodash4 for set in search_source

* chore(NA): remove lodash3 completely from the repo

* chore(NA): fix x-pack/test/api_integration/apis/metrics_ui/snapshot.ts missing content

* chore(NA): fix lodash usage on apm

* chore(NA): fix typecheck for maps

* Patch lodash template (#12)

* Applying changes from https://github.com/elastic/kibana/pull/64985

* Using isIterateeCall, because it seems less brittle

* Also patching `lodash/template` and `lodash/fp/template`

* Reorganizing some files...

* Revising comment

* Ends up `_` is a function also... I hate JavaScript

Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Oliver Gupte <ogupte@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: kobelb <brandon.kobel@elastic.co>
# Conflicts:
#	renovate.json5
#	x-pack/plugins/apm/public/services/rest/observability_dashboard.ts
#	x-pack/plugins/canvas/common/lib/pivot_object_array.ts
#	x-pack/plugins/canvas/public/components/workpad_templates/workpad_templates.js
#	x-pack/plugins/canvas/server/collectors/custom_element_collector.ts
#	x-pack/plugins/canvas/server/collectors/workpad_collector.ts

* chore(NA): updated kbn-pm dist file
2020-07-03 04:40:17 +01:00
Alejandro Fernández Haro 45ddd6564d
[7.x] [Telemetry] Report data shippers (#64935) (#70557)
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 10:11:31 +01:00
Christiane (Tina) Heiligers 6795a4c100
[Usage Collection] Report nodes feature usage (#70108) (#70329)
* Adds nodes feature usage stats merged into cluster_stats.nodes when usage collection is local
2020-06-30 09:19:53 -07:00
Larry Gregory aceaa3170b
[7.x] Consolidate capabilities check for Stack Management (#69437) (#70222)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 14:22:17 -04:00
Pierre Gayvallet b408a9fc9c
delete testbed plugins (#69661) (#69990)
* delete testbed plugins

* remove FTR tests based on KP testbed
2020-06-25 22:52:31 +02:00
Joe Reuter 94e1b57f6d
Properly redirect legacy URLs (#68284) (#69781) 2020-06-24 13:39:02 +02:00
Pierre Gayvallet 543319f492
savedObjects: add score to repository.find results (#68894) (#69486)
* add `score` to repository.find results

* update generated doc

* fix FTR result set

* remove score from exports

* fix FTR for find API

* fix label

* fix tsdoc
2020-06-18 14:11:45 +02:00
Steph Milovic 96df8a7de7
[Security] siem to securitySolution SO migration (#68776) (#69214) 2020-06-16 10:44:33 -06:00
Alexey Antonov e7cd99693c
[New Platform Migration]: Management - Implement NP API (#66781) (#68119)
* [New Platform Migration]: Management - Implement NP API
2020-06-03 13:22:28 -05:00
restrry 2fefd60e90 update code style 2020-05-22 10:35:02 +02:00
Matthew Kime 9cf400b25d
Index pattern management to Kibana platform (#65026) (#66954)
* index pattern management to kibana platform

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-19 08:08:40 -05:00
Joe Reuter ef2c5ef761
Switch to core application service (#63443) (#66353) 2020-05-13 11:34:57 +02:00
Rudolf Meijering 8a2b706472
SavedObjects bulkCreate API should return migrationVersion and strip the type & namespace from the id (#65150) (#65819)
* Deserialize bulkCreate response to remove namespace type from id

* Index operations don't return _source in response

* Fix integration tests

* repository: make id generation and seq_no/primary_term spreading more explicit

* API Integration test for bulk create without ids

* Fix copy_to_space snapshot

* Revert "Fix copy_to_space snapshot"

This reverts commit 9c2b7433e3.

* Move test into returns block

* repository.test.js stricter regexp matching
2020-05-08 12:13:11 +02:00
Christiane (Tina) Heiligers 3c940e225b
[7.x] [Telemetry] oss api tests (#64602) (#64815)
* [Telemetry] oss api tests (#64602)

* Adds telemetry API tests for oss

* Modifies test expectations to match that within oss

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Update telemetry_local.js

debugs backport issue

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-29 14:52:13 -07:00
Joe Portner f6cb14ad1a
[7.x] Refactor SO types to use namespaceType (#63217) (#63745)
Remove `namespaceAgnostic` field that was deprecated in #54605,
use `namespaceType` instead.
2020-04-16 19:11:43 -04:00
Joe Portner a0bde86792
[7.x] Sharing saved-objects phase 1 (#54605) (#63215)
Co-authored-by: kobelb <brandon.kobel@elastic.co>
2020-04-10 12:56:08 -04:00
Mikhail Shustov a8558f926e
Serve static assets from NP (#60490) (#61619)
* add hapi.inert plugin to NP

* update tests

* move serving static assets

* update tests

* add functional tests

* fix type errors. Hapi.Request doesn't support typings for payload

* update docs

* remove comment

* move assets to NP

* update all assets references

* address Spencer's comments

* move ui settings migration to migration examples

* document legacy plugin spec

* move platform assets test to integration_tests

* address Spencer's comment p.2

* try to fix type errors

* fix merge commit

* update tests
2020-03-27 18:01:28 +01:00
Pierre Gayvallet 557c72a9da
Migrate SO management routes to new plugin (#59734) (#61439)
* unexpose SavedObjectsManagement from legacy server

* migrate saved object management routes to new plugin

* fix endpoint methods

* adapt code due to rebase

* extract types

* improve findAll params

* adapt existing api integration tests and migrate to TS

* update generated doc

* add API integration tests for /scroll/count

* add unit tests for plugin and routes

* add injectMetaAttributes tests

* extract relation type

* add find_relationships tests

* add find_all tests

* do not complete migrator$ to avoid unhandled promise rejection

* fix data for search endpoint integration tests

* remove falsy comment

* rename plugin folder to match plugin id

* address review comments

* update CODEOWNERS
2020-03-26 14:32:43 +01:00
Mikhail Shustov 80b58a589d
Add UiSettings validation & Kibana default route redirection (#59694) (#60257)
* add schema to ui settings params

* add validation for defaults and overrides

* validate in ui settings client

* ui settings routes validation

* clean up tests

* use schema for defaultRoutes

* move URL redirection to NP

* fix spaces test

* update docs

* update kbn pm

* fix karma test

* fix tests

* address comments

* get rid of getDEfaultRoute

* regen docs

* fix tests

* fix enter-spaces test

* validate on relative url format

* update i18n

* fix enter-spoace test

* move relative url validation to utils

* add CoreApp containing application logic

* extract public uiSettings params in a separate type

* make schema required

* update docs
2020-03-16 18:09:51 +01:00
Pierre Gayvallet 4a08acbb4a
Add SavedObject management section registration in core (#59291) (#59731)
* add management section to SavedObjectsType

* adapt import/export routes to get types accessor

* add documentation

* update generated doc

* update migration guide

* use request context to access exportable types

* update generated doc

* adapt SavedObjectsManagement to use the registry

* stop magical tricks about the config type, register it as any other so type.

* fix FTR assertions

* fix so_mixin tests

* register the `config` type from the uiSettings service

* nits and comments

* update generated doc

* remove true from dynamic property definition, use force-cast back for config type

* remove obsolete test comment
2020-03-10 12:57:34 +01:00
Pierre Gayvallet 0c57aa83ab
[7.x] Hide input value from kbn-config-schema error messages (#58843) (#59565)
* Hide input value from kbn-config-schema error messages (#58843)

* use inline snapshots instead of snapshots

* hide input value from error messages

* update core snapshots

* update xpack snapshots

* fix ftr assertions

* fix new snapshots

* hide values for byte_size and duration

* update new snapshots

* remove another byte_size value reference

* fix yet another value references in error messages

* update xpack snapshots

* update xpack ftr assertions

* update snapshots
2020-03-08 14:02:16 +01:00
Mikhail Shustov ee00782923
migrate savedObjects routes to core (#56734) (#57846)
* migrate `get` route

* migrate `create` route

* migrate `delete` route

* migrate `find` route

* migrate `update` route

* migrate `bulk_get` route

* migrate `bulk_create` route

* remove route-related mixin tests

* migrate `bulk_update` route

* fix expectTypeRequired assertion

* migrate `log_legacy_imports` route

* migrate `export` route

* fix karma tests

* array is better than object in some situations.

* remove prototype pollution tests

* adapt ftr assertions

* adapt ftr assertions

* adapt yet more ftr assertions

* migrate `import` route

* fix test tests

* fix getSortedObjectsForExport usages

* fix snapshots

* fix so ui exports usages due to merge

* create router with prefix

* creates `savedObjects` namespace config in addition to `migrations`

* migrate `resolve_import_errors` route

* remove old types file

* fix FTR assertion

* remove types parameter from copy_to_space

* move route tests to integration_tests

* use byteSize instead of number

* fix unit tests

* add has_reference query parameter

Co-authored-by: Mikhail Shustov <restrry@gmail.com>

Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
2020-02-18 17:31:29 +01:00
Pierre Gayvallet 181862c191
Restructure SavedObject types internal representation (#56378) (#56953)
* adapt types and tests to prepare for new NP api

* rename and export public types

* update generated doc

* first implementation of registerMappings

* adapt es archiver to convert legacy mappings

* update generated doc

* fix more tests

* add unit tests

* add legacy-compat unit test

* add documentation and examples

* Introduce SavedObjectTypeRegistry and SavedObjectType types

* add and fix tests

* expose createSerializer API and fix usages

* remove registerMappings API, add internal registerType

* revert changes to migration guide

* adapt ES-archiver migrator creation

* export serializer-related types

* update generated doc

* add and use convertTypesToLegacySchema

* remove / move to internal some mapping types

* fix forEach closure context

* add missing docs

* fix core path

* some nits

* fix so_mixin tests

* fix integration tests

* fix integration tests for real

* add documentation on serializer + restructure files and types

* nit

* add and use the ISavedObjectTypeRegistry interface

* Add documentation, deprecates migrationLogger#warning

* better typing for SavedObjectsRawDoc._source

* nits

* update generated doc

* remove exposition of SavedObjectsTypeMappingDefinitions, update doc

* creates so internal contracts mocks

* improve documentation
2020-02-06 12:10:31 +01:00
spalger 2ffbbcb1e8 Revert "[7.x] [csp] allow blob styles when running from source (#54991) (#55597)"
This reverts commit d198bb521b.
2020-01-23 23:33:02 -07:00
Spencer d198bb521b
[7.x] [csp] allow blob styles when running from source (#54991) (#55597)
* [csp] allow blob styles when running from source

* update kbn/pm dist

* add kibanaServer service to saml_api_integration suite

* use common naming

* attempt to use env.packageInfo instead of IS_KIBANA_DISTRIBUTABLE const

* remove mock, clone rules before modifying

* pass env where necessary

* update core api docs

* make env optional in HttpConfig

* add tests for CspConfig changes, base header on this.rules

* fix test snapshot

* make env optional in HttpConfig too

* remove CspConfig.DEFAULT and make env a required constructor arg

* update csp_usage_collector tests

* update core api docs

* fix test name

* rename headerChangedFromDefault back to rulesChangedFromDefault

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-22 17:20:52 -07:00
Tim Roes 921c969d0a
Fix KQL value suggestions for nested fields (#54820) (#55271)
* Revert "Flag nested fields as non-aggregatable (#51774)"

This reverts commit c7046a08

* Filter out nested fields at the agg param level

* Forbid nested fields in TSVB

* Revert "Forbid nested fields in TSVB"

This reverts commit afcaa348

Co-authored-by: Tim Roes <mail@timroes.de>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Matt Bargar <mbargar@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-18 19:16:37 +01:00
Tim Roes c4553588ca
Remove nested root from index pattern (#54978) (#55266)
* Revert "Add label and icon to nested fields in the doc table (#54199)"

This reverts commit f77b3620

* Apply label and icon to nested fields in the doc table

* Add nested type to field_icon

* Improve nested test and add comment

* Fix tests

* Always pass the field type

Co-authored-by: Matt Bargar <mbargar@gmail.com>
2020-01-18 13:28:17 +01:00
Eli Perelman dc1b1f504e
Generate legacy vars when rendering all applications (#54768) (#55079)
* Generate legacy vars when rendering all applications

* Move rendering functional tests and add user settings tests

* Make rendering integration tests more robust, get data from page

* Address review nits, fix CI failures

* Remove extraneous file

* Fix type error
2020-01-16 13:00:20 -06:00
Tim Roes 0198ece079
Add label and icon to nested fields in the doc table (#54199) (#54892)
* Apply label and icon to nested fields in the doc table

* Include nested fields in the index pattern so we can identify them in the Discover UI

* use color recommended by design

* Fix unit tests

* Update api integration test

* Fix test comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Tim Roes <mail@timroes.de>

Co-authored-by: Matt Bargar <mbargar@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-15 12:13:36 +01:00
Ahmad Bamieh 25263ce091
[7.x] [Telemetry] fix bug where uiStatsMetrics is not getting… (#54072)
* fix bug where uiStatsMetrics is not getting reported

* fix tests
2020-01-07 05:22:28 +02:00
Eli Perelman d7e6c84df3
Add server rendering service to enable standalone route rendering (#52161) (#53832)
* Add server rendering service to enable standalone route rendering

* Update renovate config

* Move legacy rendering functionality to legacy service

* Use config for exposed variable in new platform

* Lint changes from rebase

* Rebase artifact

* Remove RenderingProvider, add tests for legacy vars implementation, review notes

* Add UI app functionality to legacy service

* Update rendering snapshots

* Update docs

* Fix up functional tests

* Clean up legacy types

* Revise types from reverting injected metadata changes

* Update translations and broken tests

* Mock legacy internals in legacy tests

* Add missing doc types

* Rename InternalRenderOptions to LegacyRenderOptions

* Remove extraneous legacy exports, review nits

* Functional tests fixes

* Rebase, attempt CI test fixes

* Only allow specified appIds in testbed rendering integration test

* Update snapshot names

* Review nits
2019-12-29 15:09:08 -06:00
Joe Reuter 06abcf8e10
NP Migration: Sample data (#52753) (#53718) 2019-12-20 21:06:42 +01:00
spalger 29921e1935 ensure prettier overrides take precedence, remove style rules
(cherry picked from commit c52571be68)
2019-12-14 17:40:45 -07:00
spalger c2c12539b8 autofix all violations 2019-12-13 23:55:01 -07:00
Ahmad Bamieh 0d301f4cfd
[7.x] [Telemetry] Migrate ui_metric plugin to NP under usageCo… (#53037) 2019-12-13 18:37:09 -05:00
Matt Bargar 2769f80efa
Flag nested fields as non-aggregatable (#51774) (#52549)
backport
2019-12-10 15:33:39 -05:00
Thomas Neirynck 14a9f6c048
[Maps] Load mapbox-gl with static worker (#51675) (#52337)
This instructs mapbox-gl to load its workers using a static script. It removes the corresponding child-src CSP-rule from the policy. It retains the worker-src rule as it is required by the ace-editor in Dev-tools.
2019-12-05 17:08:32 -05:00
Joe Reuter aa5548ce81
Kibana app migration: Remove old apis (#50881) (#52064) 2019-12-03 18:12:54 +01:00
Joe Portner 1f427b9080
Http compression config (#50738) (#51984)
HTTP compression for responses may be disabled entirely, or it may
be conditionally enabled based on a whitelist of trusted referrers.
2019-12-02 13:09:10 -05:00
Spencer 47631985fa
[7.x] [FTR] expose new es client service (#51066) (#51173)
* [FTR] expose new es client service (#51066)

* always extend all common config and expose new es client service

* replace `es` service with `legacyEs`

* fix one refernce that's unique to 7.x
2019-11-20 19:12:19 -07:00
Larry Gregory 62e57599b1
[7.x] Default payload validation (#48753) (#50784)
* trial for default payload validation

* relaxing default validation

* some cleanup and testing

* update xsrf integration test

* adding API smoke tests

* fixing types

* removing Joi extensions

* updating tests

* documenting changes

* fixing NP validation bypass

* fix lint problems

* Update src/legacy/server/http/integration_tests/xsrf.test.js

* Update src/legacy/server/http/integration_tests/xsrf.test.js

* revert test changes

* simplifying tests


Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-11-15 12:18:36 -05:00
Ahmad Bamieh d7992f9bf0 [Telemetry] Server side fetcher (#50015) (#50454)
* initial push

* self code review

* ignore node-fetch type

* usageFetcher api

* user agent metric

* telemetry plugin collector

* remove extra unused method

* remove unused import

* type check

* fix collections tests

* pass kfetch as dep

* add ui metrics integration test for user agent

* dont start ui metrics when not authenticated

* user agent count always 1

* fix broken ui-metric integration tests

* try using config.get

* avoid fetching configs if sending

* type unknown -> string

* check if fetcher is causing the issue

* disable ui_metric from functional tests

* enable ui_metric back again

* ignore keyword above 256

* check requesting app first

* clean up after all the debugging :)

* fix tests

* always return 200 for ui metric reporting

* remove boom import

* logout after removing role/user

* undo some changes in tests

* inside try catch

* prevent potential race conditions in priorities with =

* use snake_case for telemetry plugin collection

* usageFetcher -> sendUsageFrom

* more replacements

* remove extra unused route

* config() -> config

* Update src/legacy/core_plugins/telemetry/index.ts

Co-Authored-By: Mike Côté <mikecote@users.noreply.github.com>

* Update src/legacy/core_plugins/ui_metric/server/routes/api/ui_metric.ts

Co-Authored-By: Mike Côté <mikecote@users.noreply.github.com>

* config() -> config

* fix SO update logic given the current changes

* fix opt in check

* triple check

* check for non boolean

* take into account older settings

* import TelemetryOptInProvider

* update test case
2019-11-13 12:29:00 -05:00
Liza Katz 19dfe26381
Move legacy/server/index_patterns -> src/plugins/data/server (#46537) (#50081)
Dismissed @elastic/kibana-app review of import changes.

ts-ignored @ts-ignore

* Moved files to plugins/data/server.

* Renamed IndexPatternsService to IndexPatternsFetcher and created new IndexPatternsService

* Set routerPath.

* Fixed type error.

* Changed beats_management _fields_for_wildcard request with data/public/legacy api.

* Fixed changed paths.

* Fixes crashes after merge.

* Updated path for clarity.

* Applied Plugin interface to service.

* Fixed test failure caused by non camel case local variable name.

* Fixed import to IndexPatternsService to IndexPatternsFetcher.
2019-11-07 10:32:59 -05:00
Brandon Kobel e21a104dc0
Revert "No response compression when there is a referer (#47751)" (#49987) (#50064)
This reverts commit 85e5885ccf.
2019-11-07 06:01:19 -08:00
Spencer c88cad27ca
[7.x] use a custom wrapper around chance with longer defaults… (#49866)
* use a custom wrapper around chance with longer defaults to avoid conflicts

* fix a reference to chance

* fix another reference to chance service

# Conflicts:
#	x-pack/test/saml_api_integration/apis/security/saml_login.ts
2019-10-31 08:52:10 -07:00
Matt Bargar 7a1f9fbaec
Add nested field support to KQL (#47070) (#49762)
This PR adds a new syntax to KQL for querying nested fields.

Nested fields can be queried in two different ways:

Parts of the query may only match a single nested doc (bool inside nested). This is what most people want when querying on a nested field.
Parts of the query may match different nested docs (nested inside bool). This is how a regular object field works but nested fields can be queried in the same way. Although generally less useful, there are occasions where one might want to query a nested field in this way.
The new KQL syntax supports both.
2019-10-30 14:44:26 -04:00
Tim Roes 2e054e6dfc Bug fix:Adds a migration for transforming TSVB vis split_filters (#49000) (#49492)
* Bug fix:Adds a migration for transforming TSVB visualization split_filters from strings to query:language objects to 7.5

* Changes hard coded migration version to get the version number from the saved object's migrationVersion in failing functional test

* Changes migration number from '7.5.0' to '7.4.2', fixes typo, changes test expectations to more explicit ones
2019-10-28 11:18:30 -07:00
Brandon Kobel 5dcdb03aac
No response compression when there is a referer (#47751) (#48768)
* Hacking it in there, this is obviously not where this belongs

* Moving implementation to a private method

* Adding unit tests, I don't like the way I had to write these

* Adding integration tests

* Test not relying on implementation details...

* No longer using .inject, thanks Mikhail!!!

* Adding comment explaining the long body

* Fixing nesting of describes for api integration tests
2019-10-21 09:41:13 -07:00
Gidi Meir Morris f5eec37026
[Saved Objects] Add support for bulkUpdate to SavedObjectsClient (#47540) (#48502)
This PR adds support for `bulkUpdate` to the Saved Objects API and exposes it on all Saved Objects clients (base client, encrypted, spaces etc.).
2019-10-17 14:29:41 +01:00
Rudolf Meijering 05c76f293c
Ignore missing references on saved object exports (#47685) (#48388)
* add saved object export details in ndjson response

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* update core doc

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* exclude export details for space copy

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* fixing tests

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* display warning instead of success if export contains missing refs

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* nits/typo

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* properly updates api integration tests

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* fix typings

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* add test on objects_table component

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* remove added translations from jp/cn bundles

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* restoring line feeds

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* improve doc and user alert message

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* restoring line feeds on server.api.md

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* warning test label

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>
2019-10-16 15:39:17 +02:00
Rudolf Meijering 83bf4ef0ce
Server saved objects client through request context (#44143) (#48378)
* Expose Saved Objects client in request context

* API Integration test for savedobjects in req context

* SavedObjectsClient docs

* SavedObjectsClient#find remove dependency on indexPatterns

And use the saved objects mappings instead

* Review comments

* Review comments, fixes and tests

* Use correct type for KQL syntax check
2019-10-16 12:08:32 +02:00