Commit graph

228 commits

Author SHA1 Message Date
Matthew Kime
6ca9018cf6
uiSettings - use validation field for image field maxSize (#54522) (#54641)
* uiSettings - use validation field for image field maxSize
2020-01-13 15:48:38 -06:00
Pierre Gayvallet
8636011d7c
Add ApplicationService app status management (#50223) (#54545)
* add unimplemented registerAppStatusUpdater & remove observers for apps and legacyApps

* adapt NavLinksService to use new application observables

* merge availableApps$ and availableLegacyApps$

* updating core docs

* adapt the navLink updating methods

* filters the inaccessible apps from availableApps$

* restrict access to navigateToApp depending on app status

* fixes due to merge

* add statusUpdater$ to AppBase

* export new types

* disable navlink depending on app status

* update generated doc

* update snapshots for disabled prop

* Address josh review

* Address review comments

* fix merge conflicts

* adapt changes due to merge

* update generated doc

* add comment and fix navlink url for custom url apps

* add AppNavLinkStatus type to split app/navlink states

* fix typo

* review comments and improvements

* add functional tests

* update generated docs and migration guide

* fix wrong type cast on AppsMenuProvider.readLinks

* properly type return of navigateToApp
2020-01-13 07:41:36 +01:00
Pierre Gayvallet
6f9f68c13b
Allow the mounted application to prompt a confirm message before leaving (#54221) (#54437)
* add onAppLeave to AppMountParameters

* adapt legacy shims of app mount

* update generated doc

* returns properly typed AppLeaveAction from leave handler instead of raw strings

* add openConfirm to modal service and use it instead of window.confirm

* fix unit test

* update querystringinput snapshots

* add integration tests

* nits and review comments

* add functional tests
2020-01-10 13:46:28 +01:00
Mikhail Shustov
de4c38c0dc
tighten SO repository type (#54328) (#54425)
* tighten SO repository type

* update docs

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

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-10 12:49:34 +03:00
Joe Portner
74ebdf9b11
Add support for certificates in PKCS#12 (P12) key stores (#53810) (#54383)
Kibana now supports the usage of PKCS#12 (P12) key stores and trust stores for certificates and keys.
2020-01-09 14:47:16 -05:00
Mikhail Shustov
5aad2f6a8f
Don't expose Elasticsearch client as Observable (#53824) (#54228)
* expose ES clients without observables

* expose observable-less api to plugins

* update core api and mocks

* update plugins

* NP SO & legacy use updated API

* update SO tests

* update TSDocs

* update types

* update docs

* document createCluster analog in np

* typo
2020-01-08 13:26:02 +03:00
Mikhail Shustov
d7789f20d9
[7.x] Set consistent EOL symbol in core API docs (#53815) (#53977)
* Set consistent EOL symbol in core API docs

* update yarn lock

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 14:53:47 +03:00
Eli Perelman
5c8762c993
Allow chromeless applications to render via non-/app routes (#51527) (#53833)
* Allow chromeless applications to render via non-/app routes

* Address review nits

* Fix chrome:application integration tests

* Move extraneous application integration tests to unit tests
2019-12-29 17:01:06 -06: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
Matthias Wilhelm
4b2a4196f3
Remove SavedObjectRegistryProvider from codebase (#53455) (#53745) 2019-12-21 13:29:02 +01:00
Alejandro Fernández Haro
f3f1bd2ec6
[NP] Allow custom validations in HTTP Routes apart from @kbn/config-schema (#51919) (#53714)
* [NP] Allow custom validations in HTTP Routes apart from @kbn/config-schema

* API docs

* Allow validate function in the route handler (run-code validation)

* Prefix RouteXXX + Params and Body Validation Aliases

* Fix test broken by lodash

* Update API docs

* Add default types for simpler manual declaration

* Add run-time validation of the RouteValidateSpec

* Expose RouteValidationError instead of SchemaTypeError

* RouteValidator as a class to match config-schema interface

* Test for not-inline handler (need to check IRouter for #47047)

* Add preValidation of the input for a safer custom validation

* Better types for RouteHandlers

* [NP] Move route validation to RouteValidator wrapper

* Use the class only internally but maintain the same API

* Fix types

* Ensure RouteValidator instance in KibanaRequest.from

* Fix validator.tests (Buffer.from instead of new Buffer)

* Default precheck should allow null values

* Also allow undefined in preChecks

* MR feedback fixes

* Provide RouteValidationResolver to the validation function

* Add functional tests

* Fix new functional tests

* Fix validator additional test

* Fix test with new resolver

* Remove unused import

* Rename ValidationResolver to ValidationResultFactory and change the interface to look more like the KibanaResponseFactory

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

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-12-21 00:02:35 +00:00
Joe Reuter
66222f088c
Migrate kql telemetry and scripts api (#52651) (#53717) 2019-12-20 22:27:04 +01:00
Josh Dover
68f77d935f
[7.x] Refactor HttpService tests (#53033) (#53614) 2019-12-19 16:42:30 -06:00
Alexey Antonov
d20a6bc912
Cleanup - Typescript some of src/legacy/server/index_patterns (#53461) (#53593)
Part of #44190.
2019-12-19 21:40:55 +03:00
Pierre Gayvallet
d55c4c7bff
expose asScopedToClient in uiSettingsService start contract (#53290) (#53594)
* expose asScopedToClient in uisettings start contract

* add uiService mock in server tests

* Add tests for start method

* Updates generated doc

* properly export UiSettingsServiceStart from server

* remove useless async

* nit: rename
2019-12-19 17:41:16 +01:00
Mikhail Shustov
55feac99cf
Document how to extend request handler context (#53566) 2019-12-19 11:57:54 +01:00
Pierre Gayvallet
805179726f
Migrate instance uuid logic to new platform (#52060) (#53260)
* move and migrate uuid code to new platform

* create and wire uuid service

* handle legacy compatibility

* update generated docs

* add `set` to LegacyConfig interface

* Fix types

* fix config access

* respect naming conventions for uuid

* remove hardcoded config paths

* rename manageInstanceUuid to resolveInstanceUuid

* moves legacy config uuid set from uuid to legacy service

* log specific message depending on how uuid was resolved

* resolve merge conflicts

* use fs.promises

* add forgotten @public in uuid contract

* add explicit errors and tests

* ensure uuid is valid in configuration

* fix read/write tests
2019-12-17 11:16:38 +01:00
Josh Dover
55f24fbacc
[7.x] Add lint rule to prevent server code being imported into… (#53019) 2019-12-16 16:46:07 -06:00
Eli Perelman
4e3095be0e
[7.x] Move CSP options to new platform (#52698) (#53049)
* Move CSP options to new platform (#52698)

* Move CSP options to new platform

* Expose SharedGlobalConfig from root

* Derive CSP options from config

* Consolidate CSP configuration with HTTP config

* Fix outstanding config renames

* Remove legacy CSP configuration calls, migrate to platform properties

* Revise docs

* Fix test from type change

* Expose ICspConfig, consolidate and simplify CSP defaults access

* Rebase and update docs

* Remove legacy API from route definition params, review nits

* Clean up config path usages for consistency

* Regenerate docs

* Test correct default value of csp.strict in 7.x
2019-12-16 10:53:30 -06:00
Josh Dover
21559879a6
[7.x] Update docs to not use AppMountContext (#52962) (#53028) 2019-12-16 10:20:31 -06:00
Pierre Gayvallet
9e9fea1659
Allow loggers to create child loggers via 'get' method (#52605) (#53106)
* add 'Logger.get' method

* updates generated doc

* resolve merge conflicts
2019-12-16 12:25:45 +01:00
Pierre Gayvallet
09e269508a
Implements config deprecation in New Platform (#52251) (#52976)
* implements 'rename' and 'unset' deprecations

* introduce usage of ConfigDeprecationProvider

* adapt RawConfigService to only returns unmodified raw config

* apply deprecations when accessing config

* register legacy plugin deprecation in new platform

* implements ConfigService#validate

* add exemple config deprecation usage in testbed

* documentation

* export public config deprecation types

* fix new test due to rebase

* name ConfigDeprecationFactory

* update generated doc

* add tests for unset and move it to src/core/utils

* add tests for renameFromRoot and unusedFromRoot

* cast paths as any as get expects a fixed-length string array

* use specific logger for deprecations

* add additional test on renameFromRoot

* update migration guide

* migrate core deprecations to NP

* add integration test

* use same log context as legacy

* remove old deprecation warnings integration tests, now covered in NP

* migrates csp deprecation to NP

* removes deprecationWarningMixin from legacy

* remove legacy core deprecations

* remove unused import

* rename setupConfigSchemas to setupCoreConfig

* update generated doc
2019-12-13 11:44:39 +01:00
Josh Dover
12153e5733
[7.x] Add getStartServices API (#50231) (#52943) 2019-12-12 16:00:14 -06:00
Josh Dover
26dbc9725c
[7.x] Add asResponse option to HttpService methods (#52434) (#52781) 2019-12-11 13:16:46 -06:00
Lukas Olson
3bf86b9807 [Search service] Add timeout parameter from config to requests (#52352)
* Add timeout parameter to requests

* export SharedGlobalConfig from `core/server`
2019-12-11 10:58:54 -07:00
Rudolf Meijering
16045dd7a7
Expose SavedObjectsStart from AppMountContext (#52059) (#52489) 2019-12-09 13:59:08 +01:00
Mikhail Shustov
68bcd43f90
Add pre-response http interceptor (#52366) (#52404)
* add onPreResponse interceptor

* expose registerPreResponse to plugins

* address comments

* regen docs
2019-12-07 08:28:13 +01:00
Ahmad Bamieh
240dd1c520
[7.x] [Cloud] move cloud plugin to np (#51789) (#52289)
* merge conflicts with 7.x

* resolve conflict

* resolve eslint conflict
2019-12-05 13:59:35 -05:00
Alejandro Fernández Haro
ea3af98e65
[7.x] [NP] Expose global config to the plugins (#51478) (#52263)
* [NP] Expose global config to the plugins (#51478)

* [NP] Expose global config to the plugins

* globalConfig in Plugin context: expose read-only methods only

* SharedGlobalConfig rework + Moving pkg, fromRoot & path utils from legacy to NP

* Updated API docs

* Fix test references to the moved utils

* Replace zip with combineLatest

* Change tests to describe/it + remove "(deprecated)" from the test description

* Moving path files to a folder + exposing the config path in the contract

* deepFreeze the globalConfig in the pluginContext

* Fix types in tests with new path.config

* Move fromRoot and package_json utils to core/server/utils

* Rename globalConfig to legacy.globalConfig$

* path.config renamed to path.configDir (not renaming path.data because it might be a breaking change)

* Change configDir in mocker as well

* Fix test after config renamed to configDir

* Fix API docs conflicts

* Rename the path properties when exposing them

* path.configDir removed from the path config-schema

* Remove path.configDir. It is already in env.configs

* Add Migration documentation and examples

* Fix 'kibana/server' imports in the MIGRATION docs

* Disable eslint complain for the legacy config/schema.js import
2019-12-05 14:04:47 +00:00
Rudolf Meijering
e06dcd5720
static createRepository factory function (#52056) (#52187)
* static createRepository factory function

* Fix API docs after master merge
2019-12-05 10:37:15 +01:00
Pierre Gayvallet
bc6189d364
Migrate Capabilities to new platform (#51438) (#52051)
* create service skeleton

* move registerCapabilitiesModifier to capabilities service and rename to registerCapabilitiesSwitcher

* starts to move capabilities logic to CapabilitiesService

* move capabilities route to service

* add initial integration test for capabilities route

* capabilitiesMixin now delegates to capability service

* use server-side Capabilities import in server code

* update generated doc

* remove capabilities from injectedMetadatas

* use applications sent from client instead of server-registered navLinks

* disable authRequired for capabilities route

* (temp) exposes two endpoints for capabilities

* Add fetch-mock on capabilities call for karma tests

* adapt xpack Capabilities test - first attempt

* adapt x-pack ui_capabilities test

* add '/status' to the list of anonymous pages

* Add documentation on Capabilities APIs

* move Capabilities to core/types

* update generated docs

* add service tests

* protecting resolveCapabilities against added/removed capabilities

* update generated docs

* adapt mocks due to rebase

* add forgotten exports

* improve capabilities routes registering

* name capabilities registering methods

* resolve conflicts due to merge

* address review issues

* add comment about reason for exposing two routes

* extract createHttpServer test helper

* fix merge conflicts

* improve documentation

* remove `/status` anon registration as now done in NP status plugin

* fix merge conflicts
2019-12-03 11:08:28 +01:00
Rudolf Meijering
5a13a20076
Split legacy plugin discovery, expose SavedObjects scopedClient, wrappers, repository (#48882) (#51978)
* Split legacy plugin discovery, expose internal SavedObjectsClient

* Expose internal SavedObjectsClient to plugins

* Add more documentation

* Expose client wrappers, repository, scoped client from SavedObjects

* Remove unused onBeforeWrite

* Refactor Service / Repository for testability

* Bind exposed clientProvider methods

* Fix eArchiver's KibanaMigrator

* Cleanup

* Use APICaller type

* Expose SavedObjectsServiceStart to plugins

* API documentation

* Rename API methods to be verbs
2019-12-02 18:45:07 +01:00
Mikhail Shustov
51947b006a
Unify uiSettingsClient contracts (#51167) (#51894)
* introduce IUiSettingsClient on the client

* switch uiSettings service to  IUiSettingsClient

* update uiSettings service tests

* all plugins should use IUiSettingsClient

* stop is not public methods anymore

* remove savedobject attribute type references

* regen docs

* remove all references to UiSettingsClient class

* regen docs

* add migration example for uiSettings

* update consumer types and tests

* address comments
2019-11-29 07:42:15 +01:00
Alejandro Fernández Haro
fe7a08c3e2
Allow routes to define some payload config values (#50783) (#51864)
* Allow routes to define some payload config values

* Documentation typo

* Move hapi `payload` config under `body` + additional validations

* Update API docs

* Amend explanation in API docs

* Add stream and buffer types to @kbn/config-schema

* Fixes based on PR feedback:
- Add 'patch' and 'options' to valid RouteMethod
- Add tests for all the new flags
- Allow `stream` and `buffer` schema in the body validations (findings from tests)

* API documentation update

* Fix type definitions

* Fix the NITs in the PR comments + better typing inheritance

* API docs update

* Fix APM-legacy wrapper's types

* Fix KibanaRequest.from type exposure of hapi in API docs

* Move RouterRoute interface back to private + Expose some public docs

* Update @kbn/config-schema docs
2019-11-28 10:44:15 +00:00
Joe Portner
108d9732f0
Fix infinite redirect loop when multiple cookies are sent (#50452) (#51821)
Cookies are now checked for attributes that match the current
Kibana configuration. Invalid cookies are cleared more reliably.
2019-11-27 16:50:08 -05:00
Luke Elmers
a812ee93fe
[7.x] Move @kbn/es-query into data plugin (#51014) (#51783) 2019-11-26 16:07:16 -07:00
Pierre Gayvallet
7b6349af2c
Add compatibility wrapper for Boom errors thrown from route handler (#51157) (#51695)
* add wrapErrors method to router

* add RouteRegistrar type

* update generated doc

* add migration example

* rename wrapErrors to handleLegacyErrors
2019-11-26 11:43:23 +01:00
Josh Dover
2508337a22
[7.x] Build bundles for all new platform plugins (#51525) (#51664) 2019-11-25 18:14:56 -06:00
Caroline Horn
48c961c0e4
[Chrome] More Help Menu extensions with semantic links (#50736) (#51286)
* Update help menu util to allow common types of links

- Github, Docs, and custom

* Fix test?

* Updating API docs?

* Quick layout fix

* Kibana core apps updated (Visualize, Dashboard, Discover)

* Updated Canvas usage

* Updated Maps usage

* Added a `discuss` link type

* Updated Logs and Metrics usage

* Update APM usage

* Update Uptime usage

* Update SIEM usage

* Removing old Uptime file

* Update Lens usage

* Update API doc

* [Uptime] Remove test for file that no longer exists

* One more snap and i18n tokens

* PR feedback

- Wrap feedbackText in method
- Use `rel: noopener` on external links
- Rename HeaderHelpMenuUIExtraLink -> ChromeHelpExtensionMenuExtraLink and export

* [APM] Use ‘custom’ style link for Upgrade assistant

* API docs

* i18n

* Fix link

* Documented ChromeHelpExtension props

* Use heading levels

* Update names of props, document prop, and update API docs

* Remove `ae-missing-release-tag` warnings
2019-11-21 15:22:29 -05:00
Pierre Gayvallet
f0257a8de3
Expose whitelisted config values to client-side plugin (#50641) (#51272)
* introduce PluginConfigDescriptor type

* inject client plugin configs in injectedMetadata

* expose client config in PluginInitializerContext

* add example implementation in testbed

* update generated doc

* only generates ui config entry for plugins exposing properties to client

* separate plugin configs from plugins

* restructure plugin services tests

* fix test/mocks due to plugin configs api changes

* add unit tests

* update migration guide

* update tsdoc

* fix typecheck

* use sync getter for config on client side instead of observable

* change type of exposeToBrowser prop

* updates generated doc

* fix doc and address nits
2019-11-21 14:40:51 +01:00
Pierre Gayvallet
e5eddc8abc
Remove react references from core OverlayService apis (#48431) (#51006)
* move/rename overlay mount and unmount types from banner to parent module

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

* migrate openModal / modalService

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

fix I18nProvider import path

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

* updates core doc

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

update doc bis

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

* migrate openFlyout / flyout service

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

* remove CoreStart export from kibana-react

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

* adapt some calls to new signature

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

* adapt new calls

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

* adapt js call

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

* add flex layout on mountWrapper component to avoid losing scroll on overlays

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

* create proper flyout/modal services

* update generated doc

* update snapshot on data/query_bar

* use ReactNode instead of ReactElement

* rename mountForComponent to reactMount

* change reactMount usages to toMountPoint

* remove duplicate MountPoint type in overlays

* remove duplicate mount utilities from overlays

* allow to specify custom class name to MountWrapper

* Allow to specialize MountPoint on HTMLElement subtypes

* updates generated doc

* undeprecates openFlyout/openModal & remove direct subservice access from overlayService

* adapt toast api to get i18n context from service

* use MountPoint instead of inline definition
2019-11-19 11:42:18 +01:00
Mikhail Shustov
bf75969ab0
remove outdated comment (#50895) (#50913) 2019-11-18 17:17:48 +01:00
Pierre Gayvallet
1722e28294
[7.x] Remove react references from core Notifications apis (#49573) (#50616)
* Remove react references from core `Notifications` apis (#49573)

* add reactMount util to kibana_react

(kibana-react) properly export reactMount

* add MountPoint types and utility

* adapt toast API to no longer accept react elements

(toast API) properly export new Toast type

* adapt calls by using reactMount

createNotifications: do not wrap if text

* update generated doc

* add custom snapshot serializer for reactMount

* fix unit tests

fix xpack unit tests

* adapt non-ts calls

* do not add __reactMount__ property in production

* remove string check on createNotifications

* fix typo and small fix using obj spread

* improve react mount snapshot serializer

* simplify convertToEui

* rename reactMount to toMountPoint

* adapt newly added calls

* move mount types to proper file

* use new Mount types for OverlayBanner apis

* fixing typo

* adapt new calls

* use destructured imports

* adapt call in 7.x
2019-11-14 10:36:08 +01:00
Eli Perelman
7bf7f1e50a
Allow registered applications to hide Kibana chrome (#49795) (#50524)
* Allow registered applications to hide Kibana chrome

* Fix bug in flipped value of application chromeHidden

* Add additional test for app chrome hidden versus chrome visibility

* Rename chromeHidden to chromeless

* Default chrome service app hidden observable to same value as force hidden

* Consolidate force hiding in chrome, add functional tests

* Move chromeless flag to App interface to prevent legacy applications from specifying

* Address review nits to improve separation
2019-11-13 16:30:59 -06:00
Pierre Gayvallet
45533f3809
Remove internal platform types exports (#50427) (#50459)
* remove exports of internal core types

* updates documentation

* rename internal types file
2019-11-13 13:23:52 +01:00
Mikhail Shustov
c3f6af3ae3
Provide uiSettings service in NP (#48413) (#49531)
* provide ui settins client via context

* update mocks

* update types and expose setDefaults to plugins

* move ui settings routes to NP

* add typings fro test kbn server

* move integration test & improve typings

* hide client private methods, update tests

* add unit tests for get_upgradable_config

* inline writeErrors into createOrUpgradeConfig to simplify testing

* regen docs

* add functional tests for ui_settings service

* unify test suites

* add types for sipertest in core_plugin tests

* tsify core_plugins tests

* add test for empty saved config

* update renovate

* rename get/setDefaults to reguster

* regen docs

* regen docs

* Update src/core/MIGRATION.md

Co-Authored-By: Josh Dover <me@joshdover.com>
2019-10-28 20:32:51 -04:00
Gidi Meir Morris
f3570747e2
[Saved Objects] Adds support for custom Refresh settings on mutating operations (#48932) (#49290)
Adds the ability to override the Refresh setting of mutating operations (Update, Delete, Bulk, Index) of Saved Objects.
2019-10-25 13:53:01 +01:00
Pierre Gayvallet
cddff2babe
Migrate ui/doc_title to New platform (#48121) (#49265)
* create NP docTitle service and bridge LP to it

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

* properly prefix the docTitle public types

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

* update documentation

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

* replace direct NP access with closure to avoid error when importing module in tests with no usages

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

* remove arrow functions for doc generation

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

* remove get$ from the api

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

* remove apply param and excludeBase option

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

* remove removed export

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

* adapt legacy service to new api

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

* add entry about docTitle in the migration guide

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

* add link in migration guide

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

* update generated doc

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

* update chrome mock

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

* update snapshots due to api change

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

* remove ChromeDocTitleChange in favor of inline type

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>
2019-10-24 19:36:10 -07:00
Brandon Kobel
fc28bfec12
NP Security HTTP Interceptors (#39477) (#49210)
* We have a NP plugin! :celebration:

* Redirecting to login on all 401s

* Adding commented out code for when credentials are omitted

* Fixing types

* Respond 403 when user changes password with incorrect current password

* Adding AnonymousPaths where we ignore all 401s

* Adding anonymous path tests

* Extracted a dedicated SessionExpires class and added tests

* Fixing plugin after refactoring to add SessionExpired

* Beginning to work on the session timeout interceptor

* Fixing UnauthorizedResponseInterceptor anonymous path test

* Removing test anonymous path

* Trying to improve readability

* Displaying session logout warning

* Mocking out the base path

* Revert "Mocking out the base path"

This reverts commit 824086c168.

* Changing coreMock to use a concrete instance of BasePath

* Adding session timeout interceptor tests

* Adding session timeout tests

* Adding more tests for short session timeouts

* Moving some files to a session folder

* More thrashing around: renaming and reorganizing

* Renaming Interceptor to HttpInterceptor

* Fixing some type errors

* Fixing legacy chrome API tests

* Fixing other tests to use the concrete instance of BasePath

* Adjusting some types

* Putting DeeplyMocked back, I don't get how DeeplyMockedKeys works

* Moving anonymousPaths to public core http

* Reading sessionTimeout from injected vars and supporting null timeout

* Doesn't extend session when there is no response

* Updating docs and snapshots

* Casting sessionTimeout injectedVar to "number | null"

* Fixing i18n issues

* Update x-pack/plugins/security/public/plugin.ts

Co-Authored-By: Larry Gregory <lgregorydev@gmail.com>

* Adding milliseconds postfix to SessionTimeout private fields

* Even better anonymous paths, with some validation

* Adjusting public method docs for IAnonymousPaths

* Adjusting spelling of base-path to basePath

* Update x-pack/plugins/security/public/session/session_timeout.tsx

Co-Authored-By: Larry Gregory <lgregorydev@gmail.com>

* Update src/core/public/http/anonymous_paths.ts

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

* Update src/core/public/http/anonymous_paths.ts

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

* AnonymousPaths implements IAnonymousPaths and uses IBasePath

* Removing DeeplyMocked

* Removing TODOs

* Fixing types...

* Now, ever more normal
2019-10-24 12:15:03 -07:00
Eli Perelman
b966e4dac2
Pass along request object to all HTTP interceptors (#47258) (#48697)
* Pass along request object to all HTTP interceptors

* Do not trigger response interceptors from request errors; make request readonly

* Update core API

* Fix failing test

* Add tests to ensure that interceptors accumulate request and response across calls

* Make request readonly for request error interception, simplify response interception return types

* Update docs from request and response interception API change

* Add missing InterceptedHttpResponse generated docs
2019-10-18 16:44:43 -05:00