Commit graph

228 commits

Author SHA1 Message Date
Eli Perelman
8cc58a9866
Supply deprecated req and res properties on IHttpFetchError for legacy compatibility (#48430) (#48555) 2019-10-17 14:13:12 -05: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
Mikhail Shustov
f6c03aeb6a
UI settings move to NP (#47590) (#48395)
* add tests for logWithMetadata in LP

* allow passing metadata to log in NP & LP

* move ui_settings_client to NP

* add ui_settings config

* add ui_settings_service

* switch to NP logging

* export types

* bootstrap uiSettings service in NP

* pass NP uiSettings to LP

* move ui_settings mock to NP

* add  test for mixin and switch to NP logger

* make UiSettingsClient.getDefaults sync as it is

* ui_settings_client uses private fields

* ui_settings_client uses private methods

* keep uiSettings config validation in NP only

* update mocks

* core context should know it is mocked

* add tests for ui_settings_service

* remove unused code from ui_settings_mixin test

* improve types in ui_settings_mixin test

* gen docs

* test moved to NP

* set pkg version in tests explicitly

* update mocks in tests

* UiSettingsServiceSetup --> InternalUiSettingsServiceSetup

* add links to types

* address eli comment

* regen docs

* remove unused types
2019-10-16 15:48:34 +02: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
Josh Dover
82fc2608aa
[7.x] Make generated type docs more explorable (#47069) (#48252) 2019-10-15 17:05:59 -05:00
Greg Thompson
5a5b042136
Upgrade EUI to 14.5.0 (#48119) (#48241)
* eui 14.5.0

* snapshot updates

* update ChromeBreadcrumb interface

* change bad id selector to data-test-subj selector
2019-10-15 11:56:01 -05:00
Mikhail Shustov
1a3c2e3ba2
Expose package info to NP plugins (#48101) (#48215)
* provide packageInfo to server plugins

* provide env to kbn server

* provide env to client plugins

* update server mocks and tests

* update client mocks and tests

* add integration test

* regen docs

* remove weird file

* export types for the client from special folder

* env should not affect test ourcome
2019-10-15 15:42:22 +02:00
Dario Gieselaar
cf7f2aa8c5
[7.x] [APM] Replace ui/kfetch with core.http (#47635) (#48211)
* [APM] Replace ui/kfetch with core.http

Closes #46548.

* Remove kfetch mocks in tests

* Expose HttpFetchError from src/core/public/index

* Make HttpFetchError public

* Simplify tests for ServiceOverview
2019-10-15 15:25:06 +02:00
Mikhail Shustov
53aab78577
Document custom validation for http request (#47699) (#48203)
* document custom validation for http request

* generate docs
2019-10-15 12:19:55 +02:00
Rudolf Meijering
da61b42a0a
SavedObjectAttribute allow array of primitives (#47317) (#47591) 2019-10-08 20:53:48 +02:00
Court Ewing
3f56b9b265
[core] Do not overwrite saved object references if not specified (#47248) (#47519)
* 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-08 10:36:54 -04:00
Josh Dover
8e8a6ef754
[7.x] Add types to Elasticsearch API calls (#46668) (#47496) 2019-10-07 15:55:06 -05:00
Larry Gregory
9bf7fb128c
[7.x] Honor current search criteria when exporting saved objec… (#47466)
* honor current search criteria when exporting saved objects

* adding core docs
2019-10-07 12:30:36 -04:00
Mikhail Shustov
3ab833759e
Expose injectMetadata service temporarily (#47319) (#47404)
* expose injectMetadata until config service provided

* add functional test

* update types

* fix tests. injectMetadata is a part of plugin contract

* add comment about injectedVars API
2019-10-05 19:56:31 +02:00
Josh Dover
003c3b855e
[7.x] Simplify generics for IContextContainer (#46538) (#47266) 2019-10-03 16:53:30 -05:00
Xavier Mouligneau
aa36b9e994
Add KQL functionality in the find function of the saved objects (#41136) (#47182)
* 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-03 08:42:35 -04:00
Rudolf Meijering
a6ea76b209
Move KibanaMigrator into Server SavedObjectsService (#43433) (#47011)
* Rename SavedObjectsService -> SavedObjectsLegacyService

* Expose legacy pluginSpecs from Core LegacyService

* Expose legacy uiExports from Core LegacyService

* Move kibana config to NP

* Expose pluginExtendedConfig from LegacyService

* Make KibanaMigrator NP compatible

* KibanaMigrator -> NP SavedObjectsService

* SavedObjectsService never stop retrying ES connection error

* Move waiting for migrations to complete till after legacy service start

* Fix ESArchiver's KibanaMigrator

* Fix reload logging config tests

* Run migrations on savedobjects start

* Fix env tests

* Fix and make legacy tests more robust/isolated

* Cleanup code

* Fix invalid config test

* Fix SavedObject Migrations logging test

* SavedObjectsService tests

* Lifecycle logging and improve getting kibanaConfig instance

* Fix awaitMigration bug and test

* Fix typing error

* Review comments

* Remove unecessary KibanaConfig class

* Move legacy plugin config extension, specs, uiExports entirely into Core

uiExports, specs, disabledSpecs, config now get injected into KbnServer

* Fix config deprecation test

* Use existing logger mock

* Create SavedObjectsConfig for migration config

* Define KibanaMigratorContract type

* KibanaMigratorContract -> IKibanaMigrator + docs improvements

* Fix esArchiver's KibanaMigrator

* Fix plugin generator integration test

* ConfigServiceContract -> IConfigService

* Address review comments

* Review nits

* Document migrations.skip config

* Review comments continued...

* awaitMigrations -> runMigrations

* Type improvements
2019-10-01 11:09:17 +02:00
Rudolf Meijering
1e2f6d8b1f
Expose serverBasePath fixes #45991 (#45995) (#46966)
* Expose serverBasePath fixes #45991

* Review comments

* Fix basepath mock types

* AppBasePathContract -> IBasePath

* Match basepath test description with assertion

* Fix eslint errors
2019-10-01 09:11:51 +02:00
Josh Dover
300ccb763f
[7.x] Make request and response properties conditionally avail… (#46725)
* Make request and response properties conditionally available during HTTP interception

* Address review comments, fix request reference in http service tests
2019-09-26 16:47:18 -05:00
Josh Dover
721802d456
[7.x] Update @microsoft/api-extractor + @microsoft/api-documen… (#46343) 2019-09-24 17:32:05 -05:00
Josh Dover
7c29e26926
[7.x] Move ui/notify banners to New Platform (#43610) (#45956)
* Move ui/notify banners to New Platform (#43610)

* Fix Lens component
2019-09-18 10:38:25 -05:00
Lisa Cawley
6b2c86368f
[DOCS] Creates developer folder (#45280) (#45319) 2019-09-10 17:39:34 -07:00
Joe Reuter
edd671e631
[Graph] Listing page and folder restructuring (#44068) (#44865) 2019-09-05 17:54:29 +02:00
Josh Dover
069843e406
Add ApplicationService Mounting (#41007) (#44692) 2019-09-03 15:35:22 -05:00
Rudolf Meijering
1d7c0d4cad Response factory parameters as named arguments (#43248) (#43883) 2019-08-23 14:49:36 -05:00
Josh Dover
8af89eddb6
Extend request handler with request scoped core capabilities (#43103) (#43541) 2019-08-19 15:17:37 -05:00
Aleh Zasypkin
d106a4b3a9
[7.x] Add TLS client authentication support. (#43317) 2019-08-15 08:48:04 +02:00
Josh Dover
8a244223ca
[7.x] Export missing Context types (#43051) (#43143) 2019-08-13 10:06:34 -05:00
Rudolf Meijering
46abb3a1db
[Core] Make type option required for SavedObjects.find (#42236) (#43112)
* Make type option required for SavedObjects.find

* getSortedObjectsForExport test for type or objects
2019-08-12 19:55:14 +02:00
Mikhail Shustov
679de5dca7
Expose createRouter from HttpService, prepare handlers for context introduction (#42686) (#43072)
* expose createRouter, prepare route handler for context introduction.

* fix tests

* update examples in docs

* update tests

* re-genereated docs

* remove registerRouter from http service contract

createRouter registers a router under the hood. that reduces API surface
for consumers

* address comments

* update docs
2019-08-10 11:25:28 +02:00
Mikhail Shustov
ec1093820b
add socket.getPeerCertificate to KibanaRequest (#42929) (#43010)
* add socket.getPeerCertificate to KibanaRequest

* update request mocks

* update docs
2019-08-09 11:47:50 +02:00
Mikhail Shustov
26bd65014b
Unify response interface in handler and request interceptors (#42442) (#42918)
* add response factory to the interceptors

* adopt x-pack code to the changes

* Add a separate response factory for lifecycles.

Only route handler can respond with 2xx response.
Interceptors may redirect or reject an incoming request.

* re-generate docs

* response.internal --> response.internalError

* use internalError for exceptions in authenticator

* before Security plugin proxied ES error status code. now sets explicitly.

* provide error via message field of error response for BWC

* update docs

* add customError response

* restore integration test and update unit tests

* update docs

* support Hapi error format for BWC

* add a couple of tests
2019-08-08 13:51:01 +02:00
Josh Dover
ead46453f1
[7.x] Add PluginManfiest to generated docs (#42795) (#42861) 2019-08-07 16:37:17 -05:00
Rudolf Meijering
1995eafdb0
[Core] Public saved objects client (#39891) (#42760)
* Move SavedObjectClient files to core/public

* Initial SavedObjectsService in public Core

* Public SavedObjectsClient tests

* Import SimpleSavedObject from src/core/public

* Use types from source files for kibana.d.ts

* Add html raw loader to x-pack/jest

* Cleanup

* Drop case utilities and improve test coverage

* Update types and documentation

* Fix build breaking when importing directly from /server in /public

* Ensure that all option paramaters are picked and renamed

* Fix option mapping and introduce stronger types

* Eslint: allow imports from src/core/*/types

* Add compatibility layer for kfetch vs http.fetch error responses

* Improve documentation

* Expose SavedObjectsMigrationLogger

* Documentation and type tweaks

* Revert type changes from 73e601f and update api docs

* Refactor request into savedObjectFetch + test

* Make legacy SavedObject compatible with http.fetch exceptions

* Fix types and tests

* simple_saved_object import from src/core/server

* server imports from root instead of server/types

* Make SavedObjectsService a class

* Don't pick unkown keys from server response

* Rename SavedObjectsFindResponse to SavedObjectsFindResponsePublic

* Remove err.response from SavedObjects fetch errors

* Revert "Remove err.response from SavedObjects fetch errors"

This reverts commit 61705ca361.

* Don't introduce err.response until we deprecate err.res
2019-08-07 11:29:30 +02:00
Josh Dover
6e6c01815d Add ContextService to server (#42395) (#42750) 2019-08-06 21:07:52 +02:00
Mike Côté
07ae78f0db
Make task manager index configurable again (#42394) (#42706)
* Initial work

* Fix type check

* Accept core API changes

* Fix broken tests

* Destructure index pattern
2019-08-06 13:01:58 -04:00
Mikhail Shustov
c2aafcff93
Document HTTP service (#42331) (#42558)
* improving naming, add TSDoc

* re-genereate docs

* use response name in migration guide

* Apply suggestions from code review

Co-Authored-By: Josh Dover <me@joshdover.com>

* place docs near the related code

* re-generate docs

* mark code as example to reduce noise in http-service.md
2019-08-04 12:57:34 +02:00
Spencer
32219d2c11
[7.x] [basePathProxy] add __UNSAFE_bypassBasePath route (#4120… (#42450) 2019-08-02 13:41:36 -07:00
Mikhail Shustov
c90f663309
revert PR 36804 (#42333) (#42443) 2019-08-02 07:56:05 +02:00
Larry Gregory
d107d0845e
[7.x] Expose saved object import/export from core (#42022) (#42458)
* expose saved object import/export from core

* additional tests

* removing unused mock

* updater snapshots

* add objectLimit to saved objects service

* don't export the import/export functionality from core; only types

* documenting exported types

* export missing type
2019-08-01 13:55:26 -04:00
Mikhail Shustov
a3a70979ee
Http server route handler implementation (#41894) (#42326)
* add response error

* add hapi response adapter

* add router handler

* add tests

* add comments, update docs

* update tests

* cleanup tests

* address @joshdover comments

* move tests under integration test cathegory

* update docs

* get rid of KibanResponseError class

* update docs
2019-07-31 11:38:28 +02:00
Josh Dover
1898510de8
[7.x] Add ContextService (#41251) (#42278) 2019-07-30 17:55:48 -05:00
Dmitry Lemeshko
b4a60f2243
[DOCS] Update functional test runner doc (#41806) (#42256)
* [ftr/docs] replace leadfoot with webdriver

* [ftr/docs] more details about running tests in Firefox

* [ftr/docs] update references to ftr services

* [ftr/docs] fix links and update description

* [ftr/docs] update services information

* [ftr/docs] fix more links

* small fix

* [ftr/docs] Firefox run example

* revert link changes

* review fix

* review fixes

* add details on how to start x-pack tests

* lost fix for tags description

* Update docs/development/core/development-functional-tests.asciidoc

Co-Authored-By: Spencer <email@spalger.com>

* Update docs/development/core/development-functional-tests.asciidoc

Co-Authored-By: Spencer <email@spalger.com>
2019-07-30 20:48:57 +02:00
Josh Dover
0b52c2672a
[7.x] [new-platform] Add legacy property to NavLinks registe… (#42220) 2019-07-30 11:13:15 -05:00
Mikhail Shustov
7683a741d5
Export public http interfaces (#42001) (#42075)
* re-export http types

* update docs
2019-07-27 10:47:18 +02:00
Mike Côté
44f8c129f7
Task manager enhancements for error handling in alerting and actions (#39829) (#42004)
* Allow mtask definitions to overwrite default setting maxAttemps

* Leverage scheduledAt from task manager

* Treat maxAttempts like attempts and not retries

* Add support for second intervals

* Min 1 attempt

* Reverse relying on scheduledAt

* Add new startedAt attribute in task manager that keeps track when task started running

* Don't extend runAt when claiming a task

* Remove startedAt from state

* Attempt trying to define custom getBackpressureDelay function

* Pass error object to getBackpressureDelay

* Cleanup processResultForRecurringTask code

* Add backpressure to timed out tasks

* Change default timeout backpressure calculation

* getBackpressureDelay to return seconds instead of milliseconds

* Add comment for task store query

* Compress query

* Revert alert / actions specific code

* Add more interval tests

* Fix failing jest tests

* Fix test

* Add more unit tests

* Fix integration tests

* Fix sorting of tasks to process

* WIP

* Always provide error when getBackpressureDelay is called

* Rename getBackpressureDelay to getRetryDelay

* retryAt to be calculated from timeout time by default

* Remove invalid test

* Add unit tests

* Consider timeout before scheduling a retryAt

* Remove backpressure terminology

* Remove support for 0 based intervals and timeouts

* Apply PR feedback

* Fix last place using Math.abs

* Modify migrations to allow running a script when converting an index to an alias

* Convert task manager to use saved objects

* Fix broken test

* Fix broken tests pt1

* Remove index from task manager config schema

* Accept platform changes

* PR feedback

* Apply PR feedback

* Apply PR feedback pt2

* Apply PR feedback pt3

* Apply PR feedback pt4

* Fix feedback pt3

* Rename RawSavedObjectDoc to SavedObjectsRawDoc
2019-07-25 21:35:42 -04:00
Mikhail Shustov
2dcc69c4fe
AuthResultData configures response headers (#41775) (#41948)
* extend AuthResultData with response headers

* add tests

* update docs

* rename headers --> requestHeaders to clarify intention

* update docs

* address comments
2019-07-25 08:50:49 +02:00
Mikhail Shustov
93e4815b61
Narrow type of PluginDeps to an object (#40846) (#41745)
* Narrow type of PluginDeps to an object

* re-generate docs
2019-07-23 12:01:08 +02:00
Mikhail Shustov
8058093241
core doesn't use Record<string, unknown> for public API (#41448) (#41742)
* core contracts don't use unknown to support type assignment

limitations of https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#-k-string-unknown--is-no-longer-a-wildcard-assignment-target

* regenereate docs

* remove type over-write
2019-07-23 11:25:26 +02:00