Commit graph

105 commits

Author SHA1 Message Date
Pierre Gayvallet 59d7f33115
add isExportable SO export API (#101860)
* add `isExportable` SO export API

* add warning when export contains excluded objects

* add FTR test

* fix API integration assertions

* lint

* fix assertions again

* doc

* update generated doc

* fix esarchiver paths

* use maps instead of objects

* SavedObjectsExportablePredicate is no longer async

* more docs

* generated doc

* use info instead of warning when export contains excluded objects

* try/catch on isExportable call and add exclusion reason

* add FTR test for errored objects

* log error if isExportable throws
2021-06-21 10:06:54 +02:00
Spencer f466ebf1a3
[esArchiver] drop support for --dir, use repo-relative paths instead (#101345)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-06-08 17:37:42 -04:00
Spencer bdafd27e19
[ts] migrate x-pack/test to composite ts project (#101441)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-06-08 12:54:05 -04:00
Mikhail Shustov d920682e4e
Update @elastic/elasticsearch to 8.0.0-canary13 (#98266)
* bump @elastic/elasticsearch to canary.7

* address errors in core

* address errors in data plugin

* address errors in Alerting team plugins

* remove outdated messages in Lens

* remove unnecessary comments in ML

* address errors in Observability plugin

* address errors in reporting plugin

* address errors in Rule registry plugin

* fix errors in Security plugins

* fix errors in ES-UI plugin

* remove unnecessary union.

* update core tests

* fix kbn-es-archiver

* update to canary 8

* bump to v9

* use new typings

* fix new errors in core

* fix errors in core typeings

* fix type errors in data plugin

* fix type errors in telemetray plugin

* fix data plugin tests

* fix search examples type error

* fix errors in discover plugin

* fix errors in index_pattern_management

* fix type errors in vis_type_*

* fix errors in typings/elasticsearch

* fix type errors in actions plugin

* fix type errors in alerting and apm plugins

* fix type errors in canvas and cases

* fix errors in event_log

* fix type errors in ILM and ingest_pipelines

* fix errors in lens plugin

* fix errors in lists plugin

* fix errors in logstash

* fix errors in metrics_entities

* fix errors in o11y

* fix errors in watcher

* fix errors in uptime

* fix errors in upgrade_assistant

* fix errors in task_manager

* fix errors in stack_alerts

* fix errors in security_solution

* fix errors in rule_registry

* fix errors in snapshot_restore

* fix remaining errors

* fix search intergration tests

* adjust assetion

* bump version to canary.10

* adapt code to new naming schema

* use mapping types provided by the client library

* Revert "adjust assetion"

This reverts commit 19b8fe0464.

* fix so intergration tests

* fix http integration tests

* bump version to canary 11

* fix login test

* fix http integration test

* fix apm test

* update docs

* fixing some ml types

* fix new errors in data plugin

* fix new errors in alerting plugin

* fix new errors in lists plugin

* fix new errors in reporting

* fix or mute errors in rule_registry plugin

* more ML type fixes

* bump to canary 12

* fix errors after merge conflict

* additional ML fixes

* bump to canary 13

* fix errors in apm plugin

* fix errors in fleet plugin

* fix errors in infra plugin

* fix errors in monitoring plugin

* fix errors in osquery plugin

* fix errors in security solution plugins

* fix errors in transform plugin

* Update type imports for ES

* fix errors in x-pack plugins

* fix errors in tests

* update docs

* fix errors in x-pack/test

* update error description

* fix errors after master merge

* update comment in infra plugin

* fix new errors on xpack tests/

Co-authored-by: James Gowdy <jgowdy@elastic.co>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
2021-06-08 15:06:06 +02:00
Spencer be9fcad655
[fix] import from the root of @kbn/expect (#101321)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-06-03 18:13:11 -04:00
Tiago Costa f69d63e8be
fix(NA): windows ts_project outside sandbox compilation (#100947)
* fix(NA): windows ts_project outside sandbox compilation adding tsconfig paths for packages

* chore(NA): missing @kbn paths for node_modules so types can work

* chore(NA): missing @kbn paths for node_modules so types can work

* chore(NA): organizing deps on non ts_project packages

* chore(NA): change order to find @kbn packages on node_modules first

* chore(NA): add @kbn/expect typings setting on package.json

* chore(NA): fix typechecking

* chore(NA): add missing change on tsconfig file

* chore(NA): unblock windows build by not depending on the pkg_npm rule symlink in the package.json

* chore(NA): add missing depedencies on BUILD.bazel file for io-ts-list-types

* chore(NA): remove rootDirs configs

* chore(NA): change kbn/monaco targets order

* chore(NA): update kbn-monaco build

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-03 17:53:39 +01:00
Spencer 808b44f2c1
[kbn/test] move types/ftr into src (#99555)
* [kbn/test] move types/ftr into src

* Apply eslint updates

* fix import of Lifecycle type

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-17 09:51:53 -07:00
Joe Portner b2d36b863b
Sharing saved objects phase 3 (#94383) 2021-05-14 14:46:17 -04:00
Aleh Zasypkin 796f679e92
Migrate away from legacyEs service in tests. (#95402) 2021-03-26 18:49:19 +01:00
Tomas Della Vedova 238791b942
ES client : use the new type definitions (#83808)
* Use client from branch

* Get type checking working in core

* Fix types in other plugins

* Update client types + remove type errors from core

* migrate Task Manager Elasticsearch typing from legacy library to client library

* use SortOrder instead o string in alerts

* Update client types + fix core type issues

* fix maps ts errors

* Update Lens types

* Convert Search Profiler body from a string to an object to conform to SearchRequest type.

* Fix SOT types

* Fix/mute Security/Spaces plugins type errors.

* Fix bootstrap types

* Fix painless_lab

* corrected es typing in Event Log

* Use new types from client for inferred search responses

* Latest type defs

* Integrate latest type defs for APM/UX

* fix core errors

* fix telemetry errors

* fix canvas errors

* fix data_enhanced errors

* fix event_log errors

* mute lens errors

* fix or mute maps errors

* fix reporting errors

* fix security errors

* mute errors in task_manager

* fix errors in telemetry_collection_xpack

* fix errors in data plugins

* fix errors in alerts

* mute errors in index_management

* fix task_manager errors

* mute or fix lens errors

* fix upgrade_assistant errors

* fix or mute errors in index_lifecycle_management

* fix discover errors

* fix core tests

* ML changes

* fix core type errors

* mute error in kbn-es-archiver

* fix error in data plugin

* fix error in telemetry plugin

* fix error in discover

* fix discover errors

* fix errors in task_manager

* fix security errors

* fix wrong conflict resolution

* address errors with upstream code

* update deps to the last commit

* remove outdated comments

* fix core errors

* fix errors after update

* adding more expect errors to ML

* pull the lastest changes

* fix core errors

* fix errors in infra plugin

* fix errors in uptime plugin

* fix errors in ml

* fix errors in xpack telemetry

* fix or mute errors in transform

* fix errors in upgrade assistant

* fix or mute fleet errors

* start fixing apm errors

* fix errors in osquery

* fix telemetry tests

* core cleanup

* fix asMutableArray imports

* cleanup

* data_enhanced cleanup

* cleanup events_log

* cleaup

* fix error in kbn-es-archiver

* fix errors in kbn-es-archiver

* fix errors in kbn-es-archiver

* fix ES typings for Hit

* fix SO

* fix actions plugin

* fix fleet

* fix maps

* fix stack_alerts

* fix eslint problems

* fix event_log unit tests

* fix failures in data_enhanced tests

* fix test failure in kbn-es-archiver

* fix test failures in index_pattern_management

* fixing ML test

* remove outdated comment in kbn-es-archiver

* fix error type in ml

* fix eslint errors in osquery plugin

* fix runtime error in infra plugin

* revert changes to event_log cluser exist check

* fix eslint error in osquery

* fixing ML endpoint argument types

* fx types

* Update api-extractor docs

* attempt fix for ese test

* Fix lint error

* Fix types for ts refs

* Fix data_enhanced unit test

* fix lens types

* generate docs

* Fix a number of type issues in monitoring and ml

* fix triggers_actions_ui

* Fix ILM functional test

* Put search.d.ts typings back

* fix data plugin

* Update typings in typings/elasticsearch

* Update snapshots

* mute errors in task_manager

* mute fleet errors

* lens. remove unnecessary ts-expect-errors

* fix errors in stack_alerts

* mute errors in osquery

* fix errors in security_solution

* fix errors in lists

* fix errors in cases

* mute errors in search_examples

* use KibanaClient to enforce promise-based API

* fix errors in test/ folder

* update comment

* fix errors in x-pack/test folder

* fix errors in ml plugin

* fix optional fields in ml api_integartoon tests

* fix another casting problem in ml tests

* fix another ml test failure

* fix fleet problem after conflict resolution

* rollback changes in security_solution. trying to fix test

* Update type for discover rows

* uncomment runtime_mappings as its outdated

* address comments from Wylie

* remove eslint error due to any

* mute error due to incompatibility

* Apply suggestions from code review

Co-authored-by: John Schulz <github.com@jfsiii.org>

* fix type error in lens tests

* Update x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* Update x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* update deps

* fix errors in core types

* fix errors for the new elastic/elasticsearch version

* remove unused type

* remove unnecessary manual type cast and put optional chaining back

* ML: mute Datafeed is missing indices_options

* Apply suggestions from code review

Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>

* use canary pacakge instead of git commit

Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
Co-authored-by: Wylie Conlon <wylieconlon@gmail.com>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: restrry <restrry@gmail.com>
Co-authored-by: James Gowdy <jgowdy@elastic.co>
Co-authored-by: John Schulz <github.com@jfsiii.org>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
2021-03-25 04:47:16 -04:00
Rudolf Meijering e883e500c3
EsArchiver: support for injecting kibana version and use it for spaces tests (#94420)
* EsArchiver: support for injecting kibana version and use it for speeding up spaces tests

* Use kbn/utils to get current kibana version in tests

* Review feedback: improve test by splitting variable over chunks
2021-03-15 09:17:41 -07:00
Rudolf Meijering 42b814e123
Speed up spaces tests by letting v2 migrations do less work (#91829)
* Don't mess with v2 migration's index

* Speed up spaces tests by letting v2 migrations do less work

* Add disabled mapping for spaces so that plugin can be disabled

* Add security as codeowners of xpack saved object api integration suite
2021-02-22 08:44:41 -05:00
Joe Portner 5c3c3efdd8
Sharing saved objects, phase 2.5 (#89344) 2021-02-13 04:28:35 -05:00
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00
Joe Portner 25f16db4d9
Sharing saved objects, phase 2 (#80945) 2021-01-20 17:39:21 -05:00
Aleh Zasypkin 0a42b6534c
Migrate privilege/role/user-related operations to a new Elasticsearch client. (#84641) 2020-12-04 14:24:30 +01:00
Mikhail Shustov 4917df30b9
Update typescript eslint to v4.8 (#83520)
* update deps

* update rules

use type-aware @typescript-eslint/no-shadow instead of no-shadow. do not use no-undef, rely on TypeScript instead

* fix or mute all lint errors

* react-hooks eslint plugin fails on ? syntax

* fix wrong typings in viz

* remove React as a global type

* fix eslint errors

* update version to 4.8.1

* fix a new error
2020-11-18 18:23:08 +01:00
Joe Portner 0a02ac1327
Rename namespaces to initialNamespaces for create operations (#79682) 2020-10-06 17:01:26 -04:00
Thomas Watson e31ec7eb54
Give user the option to log out if they encounter a 403 (#75538) 2020-10-06 20:40:28 +02:00
Joe Portner caa5da26f0
Add support for sharing saved objects to all spaces (#76132) 2020-10-04 23:28:49 -04:00
Joe Portner d666038c8f
Change saved objects client find to allow partial authorization (#77699) 2020-09-22 12:40:38 -04:00
Tyler Smalley 9acf8d2656
Adds @kbn/utils package (#76518)
Moves common utility functions to obtain the repository root,
paths (config/data), and Kibana package.json to a @kbn/utils package.
Moving these existing functions allows them to be used in production, in
other packages because of Kibana.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-09-15 10:34:39 -07:00
Joe Portner 52d044c74a
Change saved object bulkUpdate to work across multiple namespaces (#75478) 2020-09-10 22:09:24 -04:00
Brian Seeders 92ab49c100
[CI] Balance xpack ci groups a bit (#77068) 2020-09-09 14:42:47 -04:00
Spencer 64311d306f
[plugin-helpers] improve 3rd party KP plugin support (#75019)
Co-authored-by: Tyler Smalley <tylersmalley@me.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-08-27 14:56:48 -07:00
Joe Portner 6627d7d9af
Sharing saved-objects phase 1.5 (#75444)
Added UI for sharing saved objects, and updated UI for importing and copying too
2020-08-26 16:52:29 -04:00
Aleh Zasypkin e46e66210f
Implement Server-Side sessions (#68117) 2020-08-18 08:38:23 +02:00
Spencer 4c810be335
Remove legacy optimizer (#73154)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-13 09:08:44 -07:00
Larry Gregory 692db4f172
Search across spaces (#67644)
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-13 20:10:17 -04:00
Aleh Zasypkin c6e2fed1c6
Register privileges in Kibana Platform Security plugin and remove legacy getUser API. (#65472) 2020-06-05 08:11:58 +02:00
restrry bf04235dae apply prettier styles 2020-05-22 09:08:58 +02:00
Spencer 4e0921d41e
[kbn/plugin-helpers] typescript-ify (#66513) 2020-05-15 10:35:44 -07:00
Joe Portner 91861339a0
Migrate security and spaces integration test plugins to Kibana Platform (#66415) 2020-05-13 16:08:49 -04:00
Mikhail Shustov 4912153ce6
don't register any features in LP. (#65611)
* don't register any features in LP. breaks features value reading in KP

* move test plugin to NP

* fix mappings

* update docs

* migrate another test

* use contstants file for BWC with original code

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 18:43:45 +02:00
Joe Portner 97d1685c3d
Sharing saved-objects phase 1 (#54605)
Co-authored-by: kobelb <brandon.kobel@elastic.co>
2020-04-09 23:18:18 -04:00
Pierre Gayvallet f1272b5ffe
Add SavedObject management section registration in core (#59291)
* 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 11:13:45 +01:00
Pierre Gayvallet 055c61110f
migrate savedObjects routes to core (#56734)
* 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>
2020-02-18 15:40:21 +01:00
Larry Gregory 974a51d104
Spaces -> Client to NP (#54298)
* moves

* updates to support spaces client in NP

* fixing MLs import

* update karma mock

* remove unnecessary setup license

* fix merge from master

* moving management app registration to NP

* move space selector app to NP

* remove unused xpackMain legacy dependency

* hide spaces management if not authorized

* additional testing

* additional cleanup

* additional testing

* use NP advancedSettings plugin

* Apply suggestions from code review

Co-Authored-By: Aleh Zasypkin <aleh.zasypkin@gmail.com>

* start addressing PR feedback

* reverting logic to determine serverBasePath

* removing spaces mock

* mantain BWC with old management links

* add types to management mock

* address remaining PR feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
2020-02-10 09:15:57 -05:00
spalger 8e9a8a84dc autofix all violations 2019-12-13 23:17:13 -07:00
Aleh Zasypkin 2ec82d3dd9
Migrate the rest of the API endpoints to the New Platform plugin (#50695) 2019-12-11 18:35:49 +01:00
Spencer b66415e416
[xpack/ftr/common] follow service provider conventions (#52236)
* [xpack/ftr/common] follow conventions, expose a config file

In order to make xpack/test/common ftr config easier to work with, this updates it to follow the conventions established by most other configs of exposing all services from the services module as an object that can be easily merges into local services modules.

* common config file and FtrProviderConfig are unused and unnecessary

* turns out FtrProviderContext was used...
2019-12-05 10:16:17 -07:00
Spencer 1814957edc
[FTR] expose new es client service (#51066)
* always extend all common config and expose new es client service

* replace `es` service with `legacyEs`
2019-11-20 08:56:23 -07:00
Liza Katz 19f7e99d3f
Remove deprecated argument include_type_name from ES calls (#50285)
This PR is merged with an error, because these errors happen on master as well. @flash1293 is working on fixing those.

This one should allow us running with the latest es snapshot 



* deprecate include_type_name

* include_type_name

* remove doc from mappings

* Updated timelion mapping

* Updated spaces and uptime mapping

* monitoring apm mapping

* Updated more mappings

* 2 more mappings

* Updated reporting mappings after syncing with @gammon

* Removed deprecated setting
2019-11-12 20:27:37 +02:00
Jonathan Budzenski 1cc2a34745
Removes references to Elasticsearch mapping types (#47610)
* rm types

* fix infra/reindex test

* rm max_adjacency_matrix_filters

* lint

* more fixes

* comment return

* override documentation links

* typo

* return unfedined

* skip highlight test

* lint
2019-11-11 16:41:08 -06:00
Matt Bargar 1dcec9d210
Add nested field support to KQL (#47070)
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 13:07:43 -04:00
Gidi Meir Morris 3f4024c398
[Saved Objects] Add support for bulkUpdate to SavedObjectsClient (#47540)
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 11:12:27 +01:00
Pierre Gayvallet 7df981fbf8 Ignore missing references on saved object exports (#47685)
* 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 12:48:34 +02:00
Tre 1947608378
[FTR] Support for new and old es clients (#47377)
* Add dep for new es client,
refactor all mentions of the old client
to the new.
2019-10-08 09:53:24 -06:00
Court Ewing 485eaf773d
[core] Do not overwrite saved object references if not specified (#47248)
* saved objects: allow partial update without references

For normal attributes, the update API for saved objects supports partial
updates, where it will only attempt to change those attributes you
specify. References should behave the same way otherwise they will be
replaced entirely if you call update without specifying the original
references.
2019-10-07 16:10:29 -04:00
Xavier Mouligneau d95c47f776
Add KQL functionality in the find function of the saved objects (#41136)
* Add KQL functionality in the find function of the saved objects

wip

rename variable from KQL to filter, fix unit test + add new ones

miss security pluggins

review I

fix api changes

refactor after reviewing with Rudolf

fix type

review III

review IV

for security put back allowed logic back to return empty results

remove StaticIndexPattern

review V

fix core_api_changes

fix type

* validate filter to match requirement type.attributes.key or type.savedObjectKey

* Fix types

* fix a bug + add more api integration test

* fix types in test until we create package @kbn/types

* fix type issue

* fix api integration test

* export nodeTypes from packages @kbn/es-query instead of the function buildNodeKuery

* throw 400- bad request when validation error in find

* fix type issue

* accept api change

* renove _ to represent private

* fix unit test + add doc

* add comment to explain why we removed the private
2019-10-02 18:23:44 -04:00