Commit graph

109 commits

Author SHA1 Message Date
Josh Dover 812c950045
Move ui/notify banners to New Platform (#43610) 2019-09-17 16:11:59 -05:00
Lisa Cawley baee2390bf
[DOCS] Creates developer folder (#45280) 2019-09-10 17:13:23 -07:00
Josh Dover b352f67bdb
Add ApplicationService Mounting (#41007)
* Add core-only bundle

* Add ApplicationService mounting

* Add LegacyCore{Setup,Start}

* Fix PR comments

* Add functional tests

* Fix PR comments

* Fix PR comments

* Remove other usages of rootRoute

* Use state field notation

* Add support for open in new tab

* Fix PR comments

* Fix pesky await from the dead

* Update docs

* Bump @types/history
2019-09-03 13:03:05 -05:00
Joe Reuter 6fad639f25
[Graph] Listing page and folder restructuring (#44068) 2019-08-29 17:19:56 +02:00
Mikhail Shustov 9a732014cb Response factory parameters as named arguments (#43248)
* pass body as response parameter. use attributes for error responses

* update core

* update tests

* update x-pack code

* update x-pack tests

* regen docs

* update comment

* Review feedback and fixes after master merge

* Eslint fixes
2019-08-23 19:31:17 +02:00
Mikhail Shustov 00a0203584 Extend request handler with request scoped core capabilities (#43103) 2019-08-19 13:34:48 -05:00
Aleh Zasypkin 6be8b321d5
Add TLS client authentication support. (#43090) 2019-08-14 22:57:54 +02:00
Josh Dover d205f1e456
Export missing Context types (#43051) 2019-08-12 14:07:17 -05:00
Rudolf Meijering f7a71f2035
[Core] Make type option required for SavedObjects.find (#42236)
* Make type option required for SavedObjects.find

* getSortedObjectsForExport test for type or objects
2019-08-12 16:33:35 +02:00
Mikhail Shustov c9220c5863
Expose createRouter from HttpService, prepare handlers for context introduction (#42686)
* 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-09 21:08:34 +02:00
Mikhail Shustov c30df8d136
add socket.getPeerCertificate to KibanaRequest (#42929)
* add socket.getPeerCertificate to KibanaRequest

* update request mocks

* update docs
2019-08-09 10:42:33 +02:00
Mikhail Shustov 06adc737d9
Unify response interface in handler and request interceptors (#42442)
* 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 12:07:43 +02:00
Josh Dover 53abbcdc9c
Add PluginManfiest to generated docs (#42795) 2019-08-07 13:50:10 -05:00
Rudolf Meijering e137477b5a
[Core] Public saved objects client (#39891)
* 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-06 20:53:05 +02:00
Josh Dover 5192dac0b6
Add ContextService to server (#42395) 2019-08-06 12:24:49 -05:00
Mike Côté ef02bf9e0e
Make task manager index configurable again (#42394)
* Initial work

* Fix type check

* Accept core API changes

* Fix broken tests

* Destructure index pattern
2019-08-06 11:22:59 -04:00
Mikhail Shustov d394ded2ac
Document HTTP service (#42331)
* 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-03 09:58:35 +02:00
Larry Gregory f36cc0b155
Expose saved object import/export from core (#42022)
* 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 12:43:53 -04:00
Spencer 95175e9647
[basePathProxy] add __UNSAFE_bypassBasePath route (#41208) 2019-08-01 09:05:50 -07:00
Mikhail Shustov eeae74a8eb
revert PR 36804 (#42333) 2019-08-01 16:17:22 +02:00
Mikhail Shustov 38231c6e4f
Http server route handler implementation (#41894)
* 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 09:34:53 +02:00
Josh Dover 76b0fbebd2
Add ContextService (#41251) 2019-07-30 13:34:17 -05:00
Dmitry Lemeshko ee79dacbd4
[DOCS] Update functional test runner doc (#41806)
* [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 16:38:30 +02:00
Josh Dover eb03fd8c5f
[new-platform] Add legacy property to NavLinks registered by… (#41301) 2019-07-29 17:51:45 -05:00
Mikhail Shustov 8b7164225d
Export public http interfaces (#42001)
* re-export http types

* update docs
2019-07-26 17:54:23 +02:00
Mike Côté 2cd3094ed7
Task manager enhancements for error handling in alerting and actions (#39829)
* 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 12:36:36 -04:00
Mikhail Shustov 3f728334d0
AuthResultData configures response headers (#41775)
* extend AuthResultData with response headers

* add tests

* update docs

* rename headers --> requestHeaders to clarify intention

* update docs

* address comments
2019-07-25 07:40:59 +02:00
Mikhail Shustov 4e73b1865a
Narrow type of PluginDeps to an object (#40846)
* Narrow type of PluginDeps to an object

* re-generate docs
2019-07-23 10:48:32 +02:00
Mikhail Shustov 3467c45e04
core doesn't use Record<string, unknown> for public API (#41448)
* 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 10:12:17 +02:00
liza-mae 48e007aa07
Update functional test doc (#41276) 2019-07-18 08:55:33 -06:00
Mikhail Shustov 51374d6a91
decouple sessiontStorageFactory creation from registerAuth (#40852)
* decouple sessiontStorageFactory creation from registerAuth

* expose to plugins

* re-generate docs

* fix mocks
2019-07-16 16:39:14 +02:00
Mikhail Shustov ed6696251c
expose ES createClient to plugins (#40717) 2019-07-11 09:32:35 +02:00
Spencer 415e3bca27
[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
2019-07-10 12:26:23 -07:00
Mikhail Shustov 9920c87100
createCluster requires a partial elasticsearch config (#40405)
* createCluster created with partial config

* add tests

* re-genereate docs
2019-07-09 20:49:03 +02:00
Mikhail Shustov ff5b7a8df4
Expose "is TLS enabled" flag for Kibana HTTP Server (#40336)
* expose it TLS enabled on Http server

* setup contract is under one section in tests

* regenerate docs

* isTLSEnabled --> isTlsEnabled
2019-07-09 19:18:25 +02:00
Liza Katz db0bed4ac2
Removed docs of deleted directive (#40597) 2019-07-09 17:58:46 +03:00
Mikhail Shustov cc56d05962
Fake request interface compatible with Kibana Request (#40363)
* make FakeRequest compatible with http request

* FakeRequest compatible with Http Request
2019-07-05 12:49:38 +02:00
Mikhail Shustov 8a97392a91
Expose elasticsearch error wrapper (#40242)
* 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 15:41:17 +02:00
spalger bbec883435 update core api docs that should have been updated with prettier pr 2019-07-03 15:04:16 -07:00
Vadim Dalecky f18e7439d9
「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
2019-07-02 09:07:07 +02:00
Rudolf Meijering da09a11858
Mocks for CoreStart, CoreSetup and PluginInitializerContext (#39351)
* 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-06-28 13:34:41 +02:00
Josh Dover 684b4d961d
Move Chrome UI to Core (#39300) 2019-06-26 18:15:18 -05:00
Mikhail Shustov 484351bdac
KibanaRequest provides headers as a property. (#39506)
* use property instead of method. not all header names are known

* fix tag name and re-generate docs
2019-06-26 10:04:34 +02:00
Josh Dover 91a5a54c78
Move ui/documentation_links to Core (#39411) 2019-06-24 13:57:21 -05:00
Josh Dover 5941436e1b
Remove final legacy dependencies from Header UI (#38175)
* Remove final legacy dependencies from Header UI

* Address @eliperelman comments

* Move files for x-pack move
2019-06-20 15:57:02 -05:00
Mikhail Shustov a75d777bea
New Platform and Legacy platform servers integration (#39047)
* 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 16:32:37 +02:00
Larry Gregory 7e4e8fee54
Spaces - New Platform Migration, Step 1 (#35429)
* 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 10:08:54 -04:00
Todd Kennedy 519eef17b1
[feat] restore headers property (#39206)
* [feat] restore headers property

* add tests

* patch: add headers
2019-06-18 16:12:24 -07:00
Vadim Dalecky 67478ccc75
uiSettings in #start() life-cycle (#39054)
* feat: 🎸 add uiSettings service in "start" Core

* test: 💍 add test for uiSettings#start() lifecycle

* fix: 🐛 add uiSettings to plugin context

* docs: ✏️ update Core API docs

* fix: 🐛 fix TypeScript type check errors
2019-06-18 17:27:46 +02:00
Rudolf Meijering 260d907f90
[Core] Move Saved objects files to core (#38771)
* Move src/legacy/server/saved_objects -> src/core/server/saved_objects

* Fix SavedObject import references after moving files to core

* First pass at SavedObjects api docs

* Expose and import all saved object types through core/server

* Don't expose SavedObjectsManagement from core and fix imports

* Improve typings for SavedObject error helpers

* Fix type errors after master merge

* Fix SavedObjectErrorHelpers tests
2019-06-18 13:10:23 +02:00