Commit graph

164 commits

Author SHA1 Message Date
Court Ewing
dc105a41b5
[core] Do not overwrite saved object references if not specified (#47248) (#47520)
* 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:37:24 -04:00
Josh Dover
fe8e6ce5e7
[7.4] Move ui/notify banners to New Platform (#43610) (#45958) 2019-09-18 10:38:08 -05:00
Lisa Cawley
1775f2e5b4
[DOCS] Creates developer folder (#45280) (#45320) 2019-09-10 17:55:23 -07:00
Lisa Cawley
cda4718709
[DOCS] Create developer guide part (#44954) (#45067) 2019-09-06 15:52:26 -07: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
Larry Gregory
20cf5057da
[7.x] Feature Controls docs - removing magic quotes (#43194) (#43202) 2019-08-13 16:52:58 -04: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
liza-mae
5258914eb9
Update functional test doc (#41276) (#41462) 2019-07-18 10:27:00 -06:00
Mikhail Shustov
ce361bb36b
decouple sessiontStorageFactory creation from registerAuth (#40852) (#41256)
* decouple sessiontStorageFactory creation from registerAuth

* expose to plugins

* re-generate docs

* fix mocks
2019-07-16 18:34:27 +02:00
Mikhail Shustov
31b4ae44b5
expose ES createClient to plugins (#40717) (#40839) 2019-07-11 11:34:23 +02:00
Spencer
1591c25148
[7.x] [ts] upgrade to 3.5.3 (#40228) (#40795)
* [ts] upgrade to 3.5.3 (#40228)

* [ts] upgrade to 3.5.2

* [ts] run from cwd so that relative paths are correct

* move eslint-disable-line comment into jsx attribute

* autofix eslint violations

* avoid generic type, it's not necessary and problematic

* make elasticsearch.cluster optional, many instances don't have them

* remove invalid prop

* expand AllowUnknownProperties to cleanly handle arrays

* esfilter values can sometimes be an array of strings

* allow exception objects to have unknown properties

* define accumulator as a boolean

* fix return type

* return a 404 if beat isn't found after update

* use Object.values for better types

* define return type of get() call

* define value type for Set

* define return value of get()

* define State property type

* use less get(), so ts can infer types

* define Set item type

* map state type

* make default_operator optional, since it's not always defined

* remove seemingly unused prop

* define return type of get() fn

* define inner type for state

* don't define base types are objects with index signatues

* regenerate public api docs

* make indices privileges optional too

* remove unnecessary index-signature from Exception interface

* use variadic _arg instead

* [core/plugin] use Record<string, any> rather than {}

* replace a couple more instances of {}

* revert some unnecessary changes

* remove unused types

* [reporting] output, payload, and meta are required properties

* bump to latest patch version

# Conflicts:
#	x-pack/legacy/plugins/canvas/server/usage/custom_element_collector.ts
#	x-pack/legacy/plugins/canvas/server/usage/workpad_collector.ts

* define inner type for Set

* default `config.get()` to any instead of unknown
2019-07-10 15:22:35 -07:00
Liza Katz
4a0c5f65cf
Removed docs of deleted directive (#40597) (#40643) 2019-07-10 00:34:23 +03:00
Mikhail Shustov
5c96930b3f
createCluster requires a partial elasticsearch config (#40405) (#40679)
* createCluster created with partial config

* add tests

* re-genereate docs
2019-07-09 22:19:27 +02:00
Mikhail Shustov
8473fbdde1
Expose "is TLS enabled" flag for Kibana HTTP Server (#40336) (#40665)
* expose it TLS enabled on Http server

* setup contract is under one section in tests

* regenerate docs

* isTLSEnabled --> isTlsEnabled
2019-07-09 20:48:32 +02:00
Vadim Dalecky
b057a93244
[7.x] 「AppArch」Interpreter 👉 New Platform (#39329) (#40117)
* 「AppArch」Interpreter 👉 New Platform (#39329)

* feat: 🎸 set-up NP data plugin

* refactor: 💡 move interpreter functions registry to NP

* refactor: 💡 move interpreter renderer registry to NP plugin

* refactor: 💡 move interpreter typesRegistry to NP

* refactor: 💡 move interpreter types to NP

* chore: 🤖 import typeRegistry from NP and change TS type folder

* refactor: 💡 move interpreter expression types to NP

* refactor: 💡 move rest of interpreter common folder to NP plugin

* fix: 🐛 fix TypeScript errors

* test: 💍 improve typings and test mocks

* refactor: 💡 make Interpreter internal registry impl private

* test: 💍 inline NP backdoor mock creation in test suites

* chore: 🤖 change @kbn/interpreter import paths to try fix errors

* fix: 🐛 improve core Plugin interfaces

* feat: 🎸 add stop() lifecycle to NP data plugins

* refactor: 💡 move interpreter into expressions service data NP

* refactor: 💡 inline Registry @kbn/interpreter class

* refactor: 💡 remove dependency on @kbn/interpreter in data pub

* refactor: 💡 move interpreter common dir into expressions dir

* fix: 🐛 use TS types in kibana_context

* feat: 🎸 add types suggested in PR review

* feat: 🎸 add semantic interpreter registration functions

* refactor: 💡 use require for all @kbn/interpreter imports

* test: 💍 add Karma test mocks, thx @spalger 🙏

* docs: ✏️ update Core docs

* test: 💍 add Sinon stubs for registries

* chore: 🤖 change import syntax in hopes CI will work

* chore: 🤖 set App Architecture as owners of data plugin

* docs: ✏️ add README

* chore: 🤖 change import in hopes to fix optimizer

* fix: 🐛 make stop() plugin life-cycle optional

* docs: ✏️ update Core API docs

* test: 💍 remove unnecessary Jest mock

* chore: 🤖 don't import from deeply inside a plugin

* refactor: 💡 try different interpreter import

* fix: 🐛 fix Karma mocking

* fix: 🐛 fix TypeScript type imports

* test: 💍 fix broken test

* fix: 🐛 use "kibana" version to make it work everywhere

* style: 💄 fix linter error
2019-07-09 00:26:34 +02:00
Mikhail Shustov
cfad1013db
Fake request interface compatible with Kibana Request (#40363) (#40409)
* make FakeRequest compatible with http request

* FakeRequest compatible with Http Request
2019-07-05 14:51:58 +02:00
Mikhail Shustov
416f21a2ff
Expose elasticsearch error wrapper (#40242) (#40357)
* expose elasticsearch error wrapper

* generate docs

* Update src/core/server/elasticsearch/errors.ts

Co-Authored-By: Rudolf Meijering <skaapgif@gmail.com>

* address Oleg comments
2019-07-04 17:04:59 +02:00
spalger
d5db7f7548 update core api docs that should have been updated with prettier pr
(cherry picked from commit bbec883435)
2019-07-03 15:08:29 -07:00
Rudolf Meijering
0a469d2d96
Mocks for CoreStart, CoreSetup and PluginInitializerContext (#39351) (#39894)
* Mocks for CoreStart, CoreSetup and PluginInitializerContext

* Public CoreStart, CoreSetup mocks

* Update api signature/docs

* Convert embaddable_api tests to new core mocks

* CR Feedback

* Introduce ui_new_platform.test.mocks and refactor embedabble tests

* Hack to get TS warnings for Core mocks

* Core mocks types cleanup & hack to get TS warnings for Server Core mocks

* Use __mocks__ new_platform

* Remove accidently commited auto-mock

* Introduce MockedKeys type for Core mocks

* Better typing/docs for UiSettings

* Revert "Use __mocks__ new_platform"

This reverts commit 2d666facc8.

* Add missing mock to test

* Cleanup UiSettings types
2019-07-01 19:54:34 +02:00
bryankouwen
780e047d21 single quotes missing (#30096)
(cherry picked from commit 738a08fc4a)
2019-06-27 17:00:35 -07:00
Josh Dover
d6fb5ce920
[7.x] Move Chrome UI to Core (#39300) (#39755) 2019-06-27 13:30:09 -05:00
Mikhail Shustov
b211cfe163
KibanaRequest provides headers as a property. (#39506) (#39661)
* use property instead of method. not all header names are known

* fix tag name and re-generate docs
2019-06-26 12:27:58 +02:00
Josh Dover
892d096eb6
[7.x] Move ui/documentation_links to Core (#39411) (#39530) 2019-06-24 16:27:51 -05:00
Josh Dover
247eb8602c
[7.x] Remove final legacy dependencies from Header UI (#38175) (#39406) 2019-06-21 11:11:26 -05:00
Court Ewing
a973cbc7a9 Fix path references into and out of x-pack/legacy 2019-06-20 13:35:00 -04:00
Larry Gregory
36f094b8fa
[7.x] Spaces - New Platform Migration, Step 1 (#35429) (#39270)
* crude test updates

* remove custom server typedef

* allow spaces to aquire security plugin after init

* split CoreSetup into CoreSetup and PluginsSetup

* move interfaces to new plugin

* init interceptors in legacy plugin

* fix import

* add placeholder kibana.json

* use NP Elasticsearch service instead of legacy ES Plugin

* cleanup imports

* don't destructure the es client

* introduce request facade

* document reason for getSecurity

* prefer relative imports from src/core

* fix typo in filename: inteceptors --> interceptors

* fix imports; remove stray ts-ignore

* improve typings for spaces client

* rename InterfaceExcept --> Omit

* don't use legacy config in NP

* additional comment

* shim NP config service

* fix merge from master

* revert relative imports into src/core and src/legacy

* shim capabilities modifier into new platform

* removing placeholder kibana.json

* fix prettier problem

* temporary: patch NP 'setUrl'

* migrate onRequest interceptor to NP, without tests

* fix ts error

* testing and deps cleanup for onRequestInterceptor

* replace spaces's usages of request.getBasePath with http.getBasePathFor

* add explicit timeouts for jest interceptor tests

* attempt to fix imports

* use NP logging instead of faked implementation

* revert stray yarn.lock change

* attempt to stablize and fix tests

* update jest config to include src/core/server/mocks

* fix plugin config typings

* add service tests

* fix merge

* allow spaces service to also work with legacy requests

* update interfaces to confirm to new internal/external API convention

* re-enable some post auth interceptor tests

* add explicit timeouts for tests

* prefer modifyUrl instead of manual url modification

* update logger shim to conform to PluginInitializerContext

* remove spaces ConfigClass

* don't weaken type declaration for scoped cluster client calls

* remove legacy server from SpacesCoreSetup

* remove spaces service cache

* remove legacy server as an interceptor dependency

* use modifyUrl on the raw request too

* remove unused import

* cleanup typings

* replace onRequest interceptor with new onPreAuth interceptor

* fix onPostAuth tests

* temporarily copy modifyUrl into spaces plugin

* fix mock export

* fix merge from master

* spaces scopedClient always uses updated ES client and config

* improve typings for usage collector

* rename isLegacyRequest -> isFakeRequest

* use updated NP base path API

* remove commented code

* only expose scoped spaces client

* use OptionalPlugin instead of getSecurity

* update imports of Saved Objects Service to use new src/core/server location

* update core docs
2019-06-19 14:24:14 -04:00
Mikhail Shustov
2466399929
New Platform and Legacy platform servers integration (#39047) (#39263)
* New and Legacy platforms share http server instance.

Required to use a common security interceptor for incoming http requests

* generate docs

* remove excessive contract method

* add test for New platform compatibility

* address comments part #1

* log server running only for http server

* fix test. mutate hapi request headers for BWC with legacy

* return 503 on start

* address @eli comments

* address @joshdover comments
2019-06-19 17:41:50 +02:00