From 9da2bf87973010ad00b12f4fd51e026e31517576 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 31 Mar 2020 15:41:59 +0200 Subject: [PATCH 01/20] Add missing direct dependency podium to package.json --- package.json | 1 + yarn.lock | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a2d13fd5ef3b..5f2caf6492d2b 100644 --- a/package.json +++ b/package.json @@ -191,6 +191,7 @@ "oppsy": "^2.0.0", "p-map": "^4.0.0", "pegjs": "0.10.0", + "podium": "3.1.2", "proxy-from-env": "1.0.0", "query-string": "^6.13.2", "re2": "^1.15.4", diff --git a/yarn.lock b/yarn.lock index b2216537bbd7c..b421192edeea8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21753,7 +21753,7 @@ pnp-webpack-plugin@1.6.4: dependencies: ts-pnp "^1.1.6" -podium@3.x.x: +podium@3.1.2, podium@3.x.x: version "3.1.2" resolved "https://registry.yarnpkg.com/podium/-/podium-3.1.2.tgz#b701429739cf6bdde6b3015ae6b48d400817ce9e" integrity sha512-18VrjJAduIdPv7d9zWsfmKxTj3cQTYC5Pv5gtKxcWujYBpGbV+mhNSPYhlHW5xeWoazYyKfB9FEsPT12r5rY1A== From f913f8e3db3f24f211cf24d3f8a53e7a4ed26d26 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 14 Oct 2020 11:37:35 +0200 Subject: [PATCH 02/20] Add missing direct dependency statehood to package.json --- package.json | 1 + yarn.lock | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f2caf6492d2b..a4706f992bb6d 100644 --- a/package.json +++ b/package.json @@ -211,6 +211,7 @@ "seedrandom": "^3.0.5", "semver": "^5.7.0", "source-map-support": "^0.5.19", + "statehood": "6.0.6", "style-it": "^2.1.3", "symbol-observable": "^1.2.0", "tar": "4.4.13", diff --git a/yarn.lock b/yarn.lock index b421192edeea8..eb9c58044c5a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25517,7 +25517,7 @@ state-toggle@^1.0.0: resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.0.tgz#d20f9a616bb4f0c3b98b91922d25b640aa2bc425" integrity sha1-0g+aYWu08MO5i5GSLSW2QKorxCU= -statehood@6.x.x: +statehood@6.0.6, statehood@6.x.x: version "6.0.6" resolved "https://registry.yarnpkg.com/statehood/-/statehood-6.0.6.tgz#0dbd7c50774d3f61a24e42b0673093bbc81fa5f0" integrity sha512-jR45n5ZMAkasw0xoE9j9TuLmJv4Sa3AkXe+6yIFT6a07kXYHgSbuD2OVGECdZGFxTmvNqLwL1iRIgvq6O6rq+A== From 172cd6cdd17d009b6afd69b310e2e0b7e76436d0 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 13:57:56 +0200 Subject: [PATCH 03/20] Upgrade from hapi@17.6.0 to @hapi/hapi@18.4.1 --- package.json | 5 +- .../server/http/base_path_proxy_server.ts | 2 +- .../server/http/cookie_session_storage.ts | 2 +- src/core/server/http/http_server.mocks.ts | 2 +- src/core/server/http/http_server.ts | 2 +- src/core/server/http/http_service.mock.ts | 2 +- src/core/server/http/http_service.ts | 2 +- src/core/server/http/http_tools.test.ts | 2 +- src/core/server/http/http_tools.ts | 2 +- src/core/server/http/https_redirect_server.ts | 2 +- .../integration_tests/core_services.test.ts | 2 +- src/core/server/http/lifecycle/auth.ts | 2 +- .../server/http/lifecycle/on_post_auth.ts | 2 +- src/core/server/http/lifecycle/on_pre_auth.ts | 2 +- .../server/http/lifecycle/on_pre_response.ts | 7 +- .../server/http/lifecycle/on_pre_routing.ts | 2 +- src/core/server/http/router/request.test.ts | 2 +- src/core/server/http/router/request.ts | 2 +- .../server/http/router/response_adapter.ts | 5 +- src/core/server/http/router/router.ts | 2 +- .../legacy/logging/legacy_logging_server.ts | 2 +- src/core/server/metrics/collectors/server.ts | 2 +- .../server_collector.test.ts | 2 +- .../server/metrics/ops_metrics_collector.ts | 2 +- src/core/server/server.api.md | 8 +- src/legacy/server/core/index.ts | 2 +- src/legacy/server/i18n/i18n_mixin.ts | 2 +- src/legacy/server/kbn_server.d.ts | 4 +- src/legacy/server/logging/rotate/index.ts | 2 +- .../server/logging/rotate/log_rotator.ts | 2 +- .../bundles_route/bundles_route.test.ts | 2 +- src/optimize/bundles_route/bundles_route.ts | 2 +- .../bundles_route/dynamic_asset_response.ts | 2 +- src/optimize/optimize_mixin.ts | 2 +- .../data/server/plugins_data_server.api.md | 6 +- .../vis_type_timeseries/server/plugin.ts | 2 +- x-pack/package.json | 2 +- .../server/alerts_client_factory.test.ts | 2 +- x-pack/plugins/infra/server/kibana.index.ts | 2 +- .../lib/adapters/framework/adapter_types.ts | 2 +- x-pack/plugins/infra/server/plugin.ts | 2 +- x-pack/plugins/ml/server/routes/system.ts | 2 +- x-pack/plugins/reporting/server/core.ts | 2 +- x-pack/plugins/uptime/server/kibana.index.ts | 2 +- yarn.lock | 458 ++++++++++++------ 45 files changed, 377 insertions(+), 192 deletions(-) diff --git a/package.json b/package.json index a4706f992bb6d..88f16321bbeab 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "url": "https://github.com/elastic/kibana.git" }, "resolutions": { + "**/@hapi/iron": "^5.1.4", "**/@types/node": ">=10.17.17 <10.20.0", "**/cross-fetch/node-fetch": "^2.6.1", "**/deepmerge": "^4.2.2", @@ -123,6 +124,7 @@ "@elastic/request-crypto": "1.1.4", "@elastic/safer-lodash-set": "0.0.0", "@hapi/good-squeeze": "5.2.1", + "@hapi/hapi": "^18.4.1", "@hapi/wreck": "^15.0.2", "@kbn/ace": "1.0.0", "@kbn/analytics": "1.0.0", @@ -167,7 +169,6 @@ "globby": "^8.0.1", "h2o2": "^8.1.2", "handlebars": "4.7.6", - "hapi": "^17.5.3", "hapi-auth-cookie": "^9.0.0", "hjson": "3.2.1", "hoek": "^5.0.4", @@ -295,8 +296,8 @@ "@types/globby": "^8.0.0", "@types/graphql": "^0.13.2", "@types/h2o2": "^8.1.1", - "@types/hapi": "^17.0.18", "@types/hapi-auth-cookie": "^9.1.0", + "@types/hapi__hapi": "^18.2.6", "@types/has-ansi": "^3.0.0", "@types/history": "^4.7.3", "@types/hjson": "^2.4.2", diff --git a/src/core/server/http/base_path_proxy_server.ts b/src/core/server/http/base_path_proxy_server.ts index acb83962bd457..b766155e19002 100644 --- a/src/core/server/http/base_path_proxy_server.ts +++ b/src/core/server/http/base_path_proxy_server.ts @@ -22,7 +22,7 @@ import { Agent as HttpsAgent, ServerOptions as TlsOptions } from 'https'; import apm from 'elastic-apm-node'; import { ByteSizeValue } from '@kbn/config-schema'; -import { Server, Request } from 'hapi'; +import { Server, Request } from '@hapi/hapi'; import HapiProxy from 'h2o2'; import { sampleSize } from 'lodash'; import * as Rx from 'rxjs'; diff --git a/src/core/server/http/cookie_session_storage.ts b/src/core/server/http/cookie_session_storage.ts index 5ca70045f81db..522195b0dc92d 100644 --- a/src/core/server/http/cookie_session_storage.ts +++ b/src/core/server/http/cookie_session_storage.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Request, Server } from 'hapi'; +import { Request, Server } from '@hapi/hapi'; import hapiAuthCookie from 'hapi-auth-cookie'; // @ts-expect-error no TS definitions import Statehood from 'statehood'; diff --git a/src/core/server/http/http_server.mocks.ts b/src/core/server/http/http_server.mocks.ts index d615e799f383f..afef9f7344f1a 100644 --- a/src/core/server/http/http_server.mocks.ts +++ b/src/core/server/http/http_server.mocks.ts @@ -17,7 +17,7 @@ * under the License. */ import { parse as parseUrl } from 'url'; -import { Request } from 'hapi'; +import { Request } from '@hapi/hapi'; import { merge } from 'lodash'; import { Socket } from 'net'; import { stringify } from 'query-string'; diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index d94bce12fb439..f30901baa2dba 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import HapiStaticFiles from 'inert'; import url from 'url'; import uuid from 'uuid'; diff --git a/src/core/server/http/http_service.mock.ts b/src/core/server/http/http_service.mock.ts index df837dc35505a..03de8fae00c1d 100644 --- a/src/core/server/http/http_service.mock.ts +++ b/src/core/server/http/http_service.mock.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { CspConfig } from '../csp'; diff --git a/src/core/server/http/http_service.ts b/src/core/server/http/http_service.ts index 82b141c8e50dd..0127a6493e7fd 100644 --- a/src/core/server/http/http_service.ts +++ b/src/core/server/http/http_service.ts @@ -19,7 +19,7 @@ import { Observable, Subscription, combineLatest } from 'rxjs'; import { first, map } from 'rxjs/operators'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { pick } from '@kbn/std'; import { CoreService } from '../../types'; diff --git a/src/core/server/http/http_tools.test.ts b/src/core/server/http/http_tools.test.ts index bdeca3a87799a..336c491a131d6 100644 --- a/src/core/server/http/http_tools.test.ts +++ b/src/core/server/http/http_tools.test.ts @@ -31,7 +31,7 @@ jest.mock('uuid', () => ({ })); import supertest from 'supertest'; -import { Request, ResponseToolkit } from 'hapi'; +import { Request, ResponseToolkit } from '@hapi/hapi'; import Joi from 'joi'; import { diff --git a/src/core/server/http/http_tools.ts b/src/core/server/http/http_tools.ts index b70680594151b..61749be85d8fc 100644 --- a/src/core/server/http/http_tools.ts +++ b/src/core/server/http/http_tools.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Lifecycle, Request, ResponseToolkit, Server, ServerOptions, Util } from 'hapi'; +import { Lifecycle, Request, ResponseToolkit, Server, ServerOptions, Util } from '@hapi/hapi'; import Hoek from 'hoek'; import { ServerOptions as TLSOptions } from 'https'; import { ValidationError } from 'joi'; diff --git a/src/core/server/http/https_redirect_server.ts b/src/core/server/http/https_redirect_server.ts index 7e1086752023f..81c50c1325dd3 100644 --- a/src/core/server/http/https_redirect_server.ts +++ b/src/core/server/http/https_redirect_server.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Request, ResponseToolkit, Server } from 'hapi'; +import { Request, ResponseToolkit, Server } from '@hapi/hapi'; import { format as formatUrl } from 'url'; import { Logger } from '../logging'; diff --git a/src/core/server/http/integration_tests/core_services.test.ts b/src/core/server/http/integration_tests/core_services.test.ts index f30ff66ed803a..1df1154aa80a7 100644 --- a/src/core/server/http/integration_tests/core_services.test.ts +++ b/src/core/server/http/integration_tests/core_services.test.ts @@ -24,7 +24,7 @@ import { } from './core_service.test.mocks'; import Boom from 'boom'; -import { Request } from 'hapi'; +import { Request } from '@hapi/hapi'; import { errors as esErrors } from 'elasticsearch'; import { LegacyElasticsearchErrorHelpers } from '../../elasticsearch/legacy'; diff --git a/src/core/server/http/lifecycle/auth.ts b/src/core/server/http/lifecycle/auth.ts index 2eaf7e0f6fbfe..5fa88fd2ed3f6 100644 --- a/src/core/server/http/lifecycle/auth.ts +++ b/src/core/server/http/lifecycle/auth.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { Lifecycle, Request, ResponseToolkit } from 'hapi'; +import { Lifecycle, Request, ResponseToolkit } from '@hapi/hapi'; import { Logger } from '../../logging'; import { HapiResponseAdapter, diff --git a/src/core/server/http/lifecycle/on_post_auth.ts b/src/core/server/http/lifecycle/on_post_auth.ts index 6ce70af2082c1..047dd660ae5d1 100644 --- a/src/core/server/http/lifecycle/on_post_auth.ts +++ b/src/core/server/http/lifecycle/on_post_auth.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from 'hapi'; +import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi'; import { Logger } from '../../logging'; import { HapiResponseAdapter, diff --git a/src/core/server/http/lifecycle/on_pre_auth.ts b/src/core/server/http/lifecycle/on_pre_auth.ts index f76fe87fd14a3..b5f0cf39d2773 100644 --- a/src/core/server/http/lifecycle/on_pre_auth.ts +++ b/src/core/server/http/lifecycle/on_pre_auth.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from 'hapi'; +import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi'; import { Logger } from '../../logging'; import { HapiResponseAdapter, diff --git a/src/core/server/http/lifecycle/on_pre_response.ts b/src/core/server/http/lifecycle/on_pre_response.ts index 37dddf4dd4767..08bd8b8e7c3e8 100644 --- a/src/core/server/http/lifecycle/on_pre_response.ts +++ b/src/core/server/http/lifecycle/on_pre_response.ts @@ -17,7 +17,12 @@ * under the License. */ -import { Lifecycle, Request, ResponseObject, ResponseToolkit as HapiResponseToolkit } from 'hapi'; +import { + Lifecycle, + Request, + ResponseObject, + ResponseToolkit as HapiResponseToolkit, +} from '@hapi/hapi'; import Boom from 'boom'; import { Logger } from '../../logging'; diff --git a/src/core/server/http/lifecycle/on_pre_routing.ts b/src/core/server/http/lifecycle/on_pre_routing.ts index e553f113a7cf8..5afdabd067a07 100644 --- a/src/core/server/http/lifecycle/on_pre_routing.ts +++ b/src/core/server/http/lifecycle/on_pre_routing.ts @@ -18,7 +18,7 @@ */ import { URL } from 'url'; -import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from 'hapi'; +import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi'; import { Logger } from '../../logging'; import { HapiResponseAdapter, diff --git a/src/core/server/http/router/request.test.ts b/src/core/server/http/router/request.test.ts index 0bf81a7aca852..ac49697890022 100644 --- a/src/core/server/http/router/request.test.ts +++ b/src/core/server/http/router/request.test.ts @@ -21,7 +21,7 @@ jest.mock('uuid', () => ({ v4: jest.fn().mockReturnValue('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'), })); -import { RouteOptions } from 'hapi'; +import { RouteOptions } from '@hapi/hapi'; import { KibanaRequest } from './request'; import { httpServerMock } from '../http_server.mocks'; import { schema } from '@kbn/config-schema'; diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index 561bf742050c3..b6d46028087fc 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -19,7 +19,7 @@ import { URL } from 'url'; import uuid from 'uuid'; -import { Request, RouteOptionsApp, ApplicationState } from 'hapi'; +import { Request, RouteOptionsApp, ApplicationState } from '@hapi/hapi'; import { Observable, fromEvent, merge } from 'rxjs'; import { shareReplay, first, takeUntil } from 'rxjs/operators'; import { RecursiveReadonly } from '@kbn/utility-types'; diff --git a/src/core/server/http/router/response_adapter.ts b/src/core/server/http/router/response_adapter.ts index 948b4596e2658..45114541761c6 100644 --- a/src/core/server/http/router/response_adapter.ts +++ b/src/core/server/http/router/response_adapter.ts @@ -16,7 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -import { ResponseObject as HapiResponseObject, ResponseToolkit as HapiResponseToolkit } from 'hapi'; +import { + ResponseObject as HapiResponseObject, + ResponseToolkit as HapiResponseToolkit, +} from '@hapi/hapi'; import typeDetect from 'type-detect'; import Boom from 'boom'; import * as stream from 'stream'; diff --git a/src/core/server/http/router/router.ts b/src/core/server/http/router/router.ts index cc5279a396163..a7ab1cfc120f9 100644 --- a/src/core/server/http/router/router.ts +++ b/src/core/server/http/router/router.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Request, ResponseObject, ResponseToolkit } from 'hapi'; +import { Request, ResponseObject, ResponseToolkit } from '@hapi/hapi'; import Boom from 'boom'; import { isConfigSchema } from '@kbn/config-schema'; diff --git a/src/core/server/legacy/logging/legacy_logging_server.ts b/src/core/server/legacy/logging/legacy_logging_server.ts index 096dbe54565e1..29aa9765b1dce 100644 --- a/src/core/server/legacy/logging/legacy_logging_server.ts +++ b/src/core/server/legacy/logging/legacy_logging_server.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ServerExtType } from 'hapi'; +import { ServerExtType } from '@hapi/hapi'; import Podium from 'podium'; // @ts-expect-error: implicit any for JS file import { Config } from '../../../../legacy/server/config'; diff --git a/src/core/server/metrics/collectors/server.ts b/src/core/server/metrics/collectors/server.ts index 036332c24c34f..e3dac1d1de897 100644 --- a/src/core/server/metrics/collectors/server.ts +++ b/src/core/server/metrics/collectors/server.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { ResponseObject, Server as HapiServer } from 'hapi'; +import { ResponseObject, Server as HapiServer } from '@hapi/hapi'; import { OpsServerMetrics, MetricsCollector } from './types'; interface ServerResponseTime { diff --git a/src/core/server/metrics/integration_tests/server_collector.test.ts b/src/core/server/metrics/integration_tests/server_collector.test.ts index 4476b3c26a2e1..ee3a066505a16 100644 --- a/src/core/server/metrics/integration_tests/server_collector.test.ts +++ b/src/core/server/metrics/integration_tests/server_collector.test.ts @@ -20,7 +20,7 @@ import { BehaviorSubject, Subject } from 'rxjs'; import { take, filter } from 'rxjs/operators'; import supertest from 'supertest'; -import { Server as HapiServer } from 'hapi'; +import { Server as HapiServer } from '@hapi/hapi'; import { createHttpServer } from '../../http/test_utils'; import { HttpService, IRouter } from '../../http'; import { contextServiceMock } from '../../context/context_service.mock'; diff --git a/src/core/server/metrics/ops_metrics_collector.ts b/src/core/server/metrics/ops_metrics_collector.ts index af74caa6cb386..184a4f3451c36 100644 --- a/src/core/server/metrics/ops_metrics_collector.ts +++ b/src/core/server/metrics/ops_metrics_collector.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Server as HapiServer } from 'hapi'; +import { Server as HapiServer } from '@hapi/hapi'; import { ProcessMetricsCollector, OsMetricsCollector, diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 914b5fbdb5196..b11d65a3b4753 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -129,16 +129,16 @@ import { RecursiveReadonly } from '@kbn/utility-types'; import { ReindexParams } from 'elasticsearch'; import { ReindexRethrottleParams } from 'elasticsearch'; import { RenderSearchTemplateParams } from 'elasticsearch'; -import { Request } from 'hapi'; -import { ResponseObject } from 'hapi'; -import { ResponseToolkit } from 'hapi'; +import { Request } from '@hapi/hapi'; +import { ResponseObject } from '@hapi/hapi'; +import { ResponseToolkit } from '@hapi/hapi'; import { SchemaTypeError } from '@kbn/config-schema'; import { ScrollParams } from 'elasticsearch'; import { SearchParams } from 'elasticsearch'; import { SearchResponse as SearchResponse_2 } from 'elasticsearch'; import { SearchShardsParams } from 'elasticsearch'; import { SearchTemplateParams } from 'elasticsearch'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { ShallowPromise } from '@kbn/utility-types'; import { SnapshotCreateParams } from 'elasticsearch'; import { SnapshotCreateRepositoryParams } from 'elasticsearch'; diff --git a/src/legacy/server/core/index.ts b/src/legacy/server/core/index.ts index de5391d33cada..bfa7853de233d 100644 --- a/src/legacy/server/core/index.ts +++ b/src/legacy/server/core/index.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import KbnServer from '../kbn_server'; /** diff --git a/src/legacy/server/i18n/i18n_mixin.ts b/src/legacy/server/i18n/i18n_mixin.ts index 4f77fa8df96cd..0b3879073c164 100644 --- a/src/legacy/server/i18n/i18n_mixin.ts +++ b/src/legacy/server/i18n/i18n_mixin.ts @@ -19,7 +19,7 @@ import { i18n, i18nLoader } from '@kbn/i18n'; import { basename } from 'path'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import type { UsageCollectionSetup } from '../../../plugins/usage_collection/server'; import { getKibanaTranslationPaths } from './get_kibana_translation_paths'; import KbnServer, { KibanaConfig } from '../kbn_server'; diff --git a/src/legacy/server/kbn_server.d.ts b/src/legacy/server/kbn_server.d.ts index 1718a9a8f55da..224398e1603ea 100644 --- a/src/legacy/server/kbn_server.d.ts +++ b/src/legacy/server/kbn_server.d.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { CoreSetup, @@ -104,4 +104,4 @@ export default class KbnServer { } // Re-export commonly used hapi types. -export { Server, Request, ResponseToolkit } from 'hapi'; +export { Server, Request, ResponseToolkit } from '@hapi/hapi'; diff --git a/src/legacy/server/logging/rotate/index.ts b/src/legacy/server/logging/rotate/index.ts index 646c89efe8e20..d6b7cfa76f9ee 100644 --- a/src/legacy/server/logging/rotate/index.ts +++ b/src/legacy/server/logging/rotate/index.ts @@ -18,7 +18,7 @@ */ import { isMaster, isWorker } from 'cluster'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { LogRotator } from './log_rotator'; import { KibanaConfig } from '../../kbn_server'; diff --git a/src/legacy/server/logging/rotate/log_rotator.ts b/src/legacy/server/logging/rotate/log_rotator.ts index 22183b2f0777a..c4054b2daed45 100644 --- a/src/legacy/server/logging/rotate/log_rotator.ts +++ b/src/legacy/server/logging/rotate/log_rotator.ts @@ -20,7 +20,7 @@ import * as chokidar from 'chokidar'; import { isMaster } from 'cluster'; import fs from 'fs'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { throttle } from 'lodash'; import { tmpdir } from 'os'; import { basename, dirname, join, sep } from 'path'; diff --git a/src/optimize/bundles_route/bundles_route.test.ts b/src/optimize/bundles_route/bundles_route.test.ts index 8cf4e9d72685c..920d0fb062252 100644 --- a/src/optimize/bundles_route/bundles_route.test.ts +++ b/src/optimize/bundles_route/bundles_route.test.ts @@ -22,7 +22,7 @@ import { readFileSync } from 'fs'; import crypto from 'crypto'; import Chance from 'chance'; -import Hapi from 'hapi'; +import Hapi from '@hapi/hapi'; import Inert from 'inert'; import { createBundlesRoute } from './bundles_route'; diff --git a/src/optimize/bundles_route/bundles_route.ts b/src/optimize/bundles_route/bundles_route.ts index 6d618fba50ccf..0546ebda22761 100644 --- a/src/optimize/bundles_route/bundles_route.ts +++ b/src/optimize/bundles_route/bundles_route.ts @@ -19,7 +19,7 @@ import { extname, join } from 'path'; -import Hapi from 'hapi'; +import Hapi from '@hapi/hapi'; import * as UiSharedDeps from '@kbn/ui-shared-deps'; import { createDynamicAssetResponse } from './dynamic_asset_response'; diff --git a/src/optimize/bundles_route/dynamic_asset_response.ts b/src/optimize/bundles_route/dynamic_asset_response.ts index ce839b33ccac0..a9a9357dec53a 100644 --- a/src/optimize/bundles_route/dynamic_asset_response.ts +++ b/src/optimize/bundles_route/dynamic_asset_response.ts @@ -23,7 +23,7 @@ import { promisify } from 'util'; import Accept from 'accept'; import Boom from 'boom'; -import Hapi from 'hapi'; +import Hapi from '@hapi/hapi'; import { FileHashCache } from './file_hash_cache'; import { getFileHash } from './file_hash'; diff --git a/src/optimize/optimize_mixin.ts b/src/optimize/optimize_mixin.ts index 37f8b08dde3b8..8bcb2c0a68a4a 100644 --- a/src/optimize/optimize_mixin.ts +++ b/src/optimize/optimize_mixin.ts @@ -17,7 +17,7 @@ * under the License. */ -import Hapi from 'hapi'; +import Hapi from '@hapi/hapi'; import { createBundlesRoute } from './bundles_route'; import { getNpUiPluginPublicDirs } from './np_ui_plugin_public_dirs'; diff --git a/src/plugins/data/server/plugins_data_server.api.md b/src/plugins/data/server/plugins_data_server.api.md index 0f0abe7df8a39..0da089e81781c 100644 --- a/src/plugins/data/server/plugins_data_server.api.md +++ b/src/plugins/data/server/plugins_data_server.api.md @@ -116,9 +116,9 @@ import { RecursiveReadonly } from 'kibana/public'; import { ReindexParams } from 'elasticsearch'; import { ReindexRethrottleParams } from 'elasticsearch'; import { RenderSearchTemplateParams } from 'elasticsearch'; -import { Request } from 'hapi'; -import { ResponseObject } from 'hapi'; -import { ResponseToolkit } from 'hapi'; +import { Request } from '@hapi/hapi'; +import { ResponseObject } from '@hapi/hapi'; +import { ResponseToolkit } from '@hapi/hapi'; import { SchemaTypeError } from '@kbn/config-schema'; import { ScrollParams } from 'elasticsearch'; import { SearchParams } from 'elasticsearch'; diff --git a/src/plugins/vis_type_timeseries/server/plugin.ts b/src/plugins/vis_type_timeseries/server/plugin.ts index 678ba2b371978..aabfa8a40e064 100644 --- a/src/plugins/vis_type_timeseries/server/plugin.ts +++ b/src/plugins/vis_type_timeseries/server/plugin.ts @@ -28,7 +28,7 @@ import { FakeRequest, } from 'src/core/server'; import { Observable } from 'rxjs'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { VisTypeTimeseriesConfig } from './config'; import { getVisData, GetVisData, GetVisDataOptions } from './lib/get_vis_data'; import { ValidationTelemetryService } from './validation_telemetry'; diff --git a/x-pack/package.json b/x-pack/package.json index ec4388c0b8b7d..8368b75cf48fb 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -32,6 +32,7 @@ "@cypress/webpack-preprocessor": "^5.4.1", "@elastic/apm-rum-react": "^1.2.5", "@elastic/maki": "6.3.0", + "@hapi/hapi": "^18.4.1", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", "@kbn/es": "1.0.0", @@ -174,7 +175,6 @@ "graphql-codegen-typescript-resolvers": "^0.18.2", "graphql-codegen-typescript-server": "^0.18.2", "gulp": "4.0.2", - "hapi": "^17.5.3", "he": "^1.2.0", "history-extra": "^5.0.1", "hoist-non-react-statics": "^3.3.2", diff --git a/x-pack/plugins/alerts/server/alerts_client_factory.test.ts b/x-pack/plugins/alerts/server/alerts_client_factory.test.ts index 4e457cdb12bd3..ec95b1e3bda85 100644 --- a/x-pack/plugins/alerts/server/alerts_client_factory.test.ts +++ b/x-pack/plugins/alerts/server/alerts_client_factory.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Request } from 'hapi'; +import { Request } from '@hapi/hapi'; import { AlertsClientFactory, AlertsClientFactoryOpts } from './alerts_client_factory'; import { alertTypeRegistryMock } from './alert_type_registry.mock'; import { taskManagerMock } from '../../task_manager/server/mocks'; diff --git a/x-pack/plugins/infra/server/kibana.index.ts b/x-pack/plugins/infra/server/kibana.index.ts index e47f27117b309..a1e9456ce8084 100644 --- a/x-pack/plugins/infra/server/kibana.index.ts +++ b/x-pack/plugins/infra/server/kibana.index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import JoiNamespace from 'joi'; export interface KbnServer extends Server { diff --git a/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts index 40ff69f78cee2..ad82939ec7f9d 100644 --- a/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts @@ -5,7 +5,7 @@ */ import { GenericParams, SearchResponse } from 'elasticsearch'; -import { Lifecycle } from 'hapi'; +import { Lifecycle } from '@hapi/hapi'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { RouteConfig, RouteMethod } from '../../../../../../../src/core/server'; import { HomeServerPluginSetup } from '../../../../../../../src/plugins/home/server'; diff --git a/x-pack/plugins/infra/server/plugin.ts b/x-pack/plugins/infra/server/plugin.ts index 737f7ed1b6e4f..a83e9ec2a42be 100644 --- a/x-pack/plugins/infra/server/plugin.ts +++ b/x-pack/plugins/infra/server/plugin.ts @@ -5,7 +5,7 @@ */ import { CoreSetup, PluginInitializerContext } from 'src/core/server'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { Observable } from 'rxjs'; import { schema, TypeOf } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/ml/server/routes/system.ts b/x-pack/plugins/ml/server/routes/system.ts index 3a66f60943bb3..a4c61f4eb4576 100644 --- a/x-pack/plugins/ml/server/routes/system.ts +++ b/x-pack/plugins/ml/server/routes/system.ts @@ -6,7 +6,7 @@ import { schema } from '@kbn/config-schema'; -import { Request } from 'hapi'; +import { Request } from '@hapi/hapi'; import { IScopedClusterClient } from 'kibana/server'; import { wrapError } from '../client/error_wrapper'; import { mlLog } from '../client/log'; diff --git a/x-pack/plugins/reporting/server/core.ts b/x-pack/plugins/reporting/server/core.ts index d62adc62bc9aa..a1ed913647711 100644 --- a/x-pack/plugins/reporting/server/core.ts +++ b/x-pack/plugins/reporting/server/core.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Hapi from 'hapi'; +import Hapi from '@hapi/hapi'; import * as Rx from 'rxjs'; import { first, map, take } from 'rxjs/operators'; import { diff --git a/x-pack/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts index 1100fbf5a828d..59d7ee6762c70 100644 --- a/x-pack/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Request, Server } from 'hapi'; +import { Request, Server } from '@hapi/hapi'; import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server'; import { PLUGIN } from '../common/constants/plugin'; import { compose } from './lib/compose/kibana'; diff --git a/yarn.lock b/yarn.lock index eb9c58044c5a0..7b34b8181c541 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1505,6 +1505,33 @@ normalize-path "^2.0.1" through2 "^2.0.3" +"@hapi/accept@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-3.2.4.tgz#687510529493fe1d7d47954c31aff360d9364bd1" + integrity sha512-soThGB+QMgfxlh0Vzhzlf3ZOEOPk5biEwcOXhkF0Eedqx8VnhGiggL9UYHrIsOb1rUg3Be3K8kp0iDL2wbVSOQ== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/address@2.x.x", "@hapi/address@^2.1.2": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5" + integrity sha512-QD1PhQk+s31P1ixsX0H0Suoupp3VMXzIVMSwobR3F3MSUO2YCV0B7xqLcUw/Bh8yuvd3LhpyqLQWTNcRmp6IdQ== + +"@hapi/ammo@^3.1.2": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@hapi/ammo/-/ammo-3.1.2.tgz#a9edf5d48d99b75fdcd7ab3dabf9059942a06961" + integrity sha512-ej9OtFmiZv1qr45g1bxEZNGyaR4jRpyMxU6VhbxjaYThymvOwsyIsUKMZnP5Qw2tfYFuwqCJuIBHGpeIbdX9gQ== + dependencies: + "@hapi/hoek" "8.x.x" + +"@hapi/b64@4.x.x": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@hapi/b64/-/b64-4.2.1.tgz#bf8418d7907c5e73463f2e3b5c6fca7e9f2a1357" + integrity sha512-zqHpQuH5CBMw6hADzKfU/IGNrxq1Q+/wTYV+OiZRQN9F3tMyk+9BUMeBvFRMamduuqL8iSp62QAnJ+7ATiYLWA== + dependencies: + "@hapi/hoek" "8.x.x" + "@hapi/boom@7.x.x": version "7.4.11" resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-7.4.11.tgz#37af8417eb9416aef3367aa60fa04a1a9f1fc262" @@ -1512,11 +1539,69 @@ dependencies: "@hapi/hoek" "8.x.x" +"@hapi/bounce@1.x.x": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@hapi/bounce/-/bounce-1.3.2.tgz#3b096bb02f67de6115e6e4f0debc390be5a86bad" + integrity sha512-3bnb1AlcEByFZnpDIidxQyw1Gds81z/1rSqlx4bIEE+wUN0ATj0D49B5cE1wGocy90Rp/de4tv7GjsKd5RQeew== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "^8.3.1" + "@hapi/bourne@1.x.x": version "1.3.2" resolved "https://registry.yarnpkg.com/@hapi/bourne/-/bourne-1.3.2.tgz#0a7095adea067243ce3283e1b56b8a8f453b242a" integrity sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA== +"@hapi/call@^5.1.3": + version "5.1.3" + resolved "https://registry.yarnpkg.com/@hapi/call/-/call-5.1.3.tgz#217af45e3bc3d38b03aa5c9edfe1be939eee3741" + integrity sha512-5DfWpMk7qZiYhvBhM5oUiT4GQ/O8a2rFR121/PdwA/eZ2C1EsuD547ZggMKAR5bZ+FtxOf0fdM20zzcXzq2mZA== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/catbox-memory@4.x.x": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@hapi/catbox-memory/-/catbox-memory-4.1.1.tgz#263a6f3361f7a200552c5772c98a8e80a1da712f" + integrity sha512-T6Hdy8DExzG0jY7C8yYWZB4XHfc0v+p1EGkwxl2HoaPYAmW7I3E59M/IvmSVpis8RPcIoBp41ZpO2aZPBpM2Ww== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/catbox@10.x.x": + version "10.2.3" + resolved "https://registry.yarnpkg.com/@hapi/catbox/-/catbox-10.2.3.tgz#2df51ab943d7613df3718fa2bfd981dd9558cec5" + integrity sha512-kN9hXO4NYyOHW09CXiuj5qW1syc/0XeVOBsNNk0Tz89wWNQE5h21WF+VsfAw3uFR8swn/Wj3YEVBnWqo82m/JQ== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + "@hapi/podium" "3.x.x" + +"@hapi/content@^4.1.1": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@hapi/content/-/content-4.1.1.tgz#179673d1e2b7eb36c564d8f9605d019bd2252cbf" + integrity sha512-3TWvmwpVPxFSF3KBjKZ8yDqIKKZZIm7VurDSweYpXYENZrJH3C1hd1+qEQW9wQaUaI76pPBLGrXl6I3B7i3ipA== + dependencies: + "@hapi/boom" "7.x.x" + +"@hapi/cryptiles@4.x.x": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@hapi/cryptiles/-/cryptiles-4.2.1.tgz#ff0f18d79074659838caedbb911851313ad1ffbc" + integrity sha512-XoqgKsHK0l/VpqPs+tr6j6vE+VQ3+2bkF2stvttmc7xAOf1oSAwHcJ0tlp/6MxMysktt1IEY0Csy3khKaP9/uQ== + dependencies: + "@hapi/boom" "7.x.x" + +"@hapi/file@1.x.x": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@hapi/file/-/file-1.0.0.tgz#c91c39fd04db8bed5af82d2e032e7a4e65555b38" + integrity sha512-Bsfp/+1Gyf70eGtnIgmScvrH8sSypO3TcK3Zf0QdHnzn/ACnAkI6KLtGACmNRPEzzIy+W7aJX5E+1fc9GwIABQ== + +"@hapi/formula@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@hapi/formula/-/formula-1.2.0.tgz#994649c7fea1a90b91a0a1e6d983523f680e10cd" + integrity sha512-UFbtbGPjstz0eWHb+ga/GM3Z9EzqKXFWIbSOFURU0A/Gku0Bky4bCk9/h//K2Xr3IrCfjFNhMm4jyZ5dbCewGA== + "@hapi/good-squeeze@5.2.1": version "5.2.1" resolved "https://registry.yarnpkg.com/@hapi/good-squeeze/-/good-squeeze-5.2.1.tgz#a7ed3f344c9602348af8f059beda663610ab8a4c" @@ -1525,12 +1610,178 @@ "@hapi/hoek" "8.x.x" fast-safe-stringify "2.x.x" -"@hapi/hoek@8.x.x": +"@hapi/hapi@^18.4.1": + version "18.4.1" + resolved "https://registry.yarnpkg.com/@hapi/hapi/-/hapi-18.4.1.tgz#023fbc131074b1cb2cd7f6766d65f4b0e92df788" + integrity sha512-9HjVGa0Z4Qv9jk9AVoUdJMQLA+KuZ+liKWyEEkVBx3e3H1F0JM6aGbPkY9jRfwsITBWGBU2iXazn65SFKSi/tg== + dependencies: + "@hapi/accept" "^3.2.4" + "@hapi/ammo" "^3.1.2" + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/call" "^5.1.3" + "@hapi/catbox" "10.x.x" + "@hapi/catbox-memory" "4.x.x" + "@hapi/heavy" "6.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "15.x.x" + "@hapi/mimos" "4.x.x" + "@hapi/podium" "3.x.x" + "@hapi/shot" "4.x.x" + "@hapi/somever" "2.x.x" + "@hapi/statehood" "6.x.x" + "@hapi/subtext" "^6.1.3" + "@hapi/teamwork" "3.x.x" + "@hapi/topo" "3.x.x" + +"@hapi/heavy@6.x.x": + version "6.2.2" + resolved "https://registry.yarnpkg.com/@hapi/heavy/-/heavy-6.2.2.tgz#d42a282c62d5bb6332e497d8ce9ba52f1609f3e6" + integrity sha512-PY1dCCO6dsze7RlafIRhTaGeyTgVe49A/lSkxbhKGjQ7x46o/OFf7hLiRqTCDh3atcEKf6362EaB3+kTUbCsVA== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/hoek@8.x.x", "@hapi/hoek@^8.2.4", "@hapi/hoek@^8.3.0", "@hapi/hoek@^8.3.1": version "8.5.1" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06" integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow== -"@hapi/wreck@^15.0.2": +"@hapi/iron@*", "@hapi/iron@5.x.x", "@hapi/iron@^5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@hapi/iron/-/iron-5.1.4.tgz#7406f36847f798f52b92d1d97f855e27973832b7" + integrity sha512-+ElC+OCiwWLjlJBmm8ZEWjlfzTMQTdgPnU/TsoU5QsktspIWmWi9IU4kU83nH+X/SSya8TP8h8P11Wr5L7dkQQ== + dependencies: + "@hapi/b64" "4.x.x" + "@hapi/boom" "7.x.x" + "@hapi/bourne" "1.x.x" + "@hapi/cryptiles" "4.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/joi@15.x.x": + version "15.1.1" + resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.1.1.tgz#c675b8a71296f02833f8d6d243b34c57b8ce19d7" + integrity sha512-entf8ZMOK8sc+8YfeOlM8pCfg3b5+WZIKBfUaaJT8UsjAAPjartzxIYm3TIbjvA4u+u++KbcXD38k682nVHDAQ== + dependencies: + "@hapi/address" "2.x.x" + "@hapi/bourne" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/topo" "3.x.x" + +"@hapi/joi@16.x.x": + version "16.1.8" + resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-16.1.8.tgz#84c1f126269489871ad4e2decc786e0adef06839" + integrity sha512-wAsVvTPe+FwSrsAurNt5vkg3zo+TblvC5Bb1zMVK6SJzZqw9UrJnexxR+76cpePmtUZKHAPxcQ2Bf7oVHyahhg== + dependencies: + "@hapi/address" "^2.1.2" + "@hapi/formula" "^1.2.0" + "@hapi/hoek" "^8.2.4" + "@hapi/pinpoint" "^1.0.2" + "@hapi/topo" "^3.1.3" + +"@hapi/mimos@4.x.x": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@hapi/mimos/-/mimos-4.1.1.tgz#4dab8ed5c64df0603c204c725963a5faa4687e8a" + integrity sha512-CXoi/zfcTWfKYX756eEea8rXJRIb9sR4d7VwyAH9d3BkDyNgAesZxvqIdm55npQc6S9mU3FExinMAQVlIkz0eA== + dependencies: + "@hapi/hoek" "8.x.x" + mime-db "1.x.x" + +"@hapi/nigel@3.x.x": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@hapi/nigel/-/nigel-3.1.1.tgz#84794021c9ee6e48e854fea9fb76e9f7e78c99ad" + integrity sha512-R9YWx4S8yu0gcCBrMUDCiEFm1SQT895dMlYoeNBp8I6YhF1BFF1iYPueKA2Kkp9BvyHdjmvrxCOns7GMmpl+Fw== + dependencies: + "@hapi/hoek" "8.x.x" + "@hapi/vise" "3.x.x" + +"@hapi/pez@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@hapi/pez/-/pez-4.1.2.tgz#14984d0c31fed348f10c962968a21d9761f55503" + integrity sha512-8zSdJ8cZrJLFldTgwjU9Fb1JebID+aBCrCsycgqKYe0OZtM2r3Yv3aAwW5z97VsZWCROC1Vx6Mdn4rujh5Ktcg== + dependencies: + "@hapi/b64" "4.x.x" + "@hapi/boom" "7.x.x" + "@hapi/content" "^4.1.1" + "@hapi/hoek" "8.x.x" + "@hapi/nigel" "3.x.x" + +"@hapi/pinpoint@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@hapi/pinpoint/-/pinpoint-1.0.2.tgz#025b7a36dbbf4d35bf1acd071c26b20ef41e0d13" + integrity sha512-dtXC/WkZBfC5vxscazuiJ6iq4j9oNx1SHknmIr8hofarpKUZKmlUVYVIhNVzIEgK5Wrc4GMHL5lZtt1uS2flmQ== + +"@hapi/podium@3.x.x": + version "3.4.3" + resolved "https://registry.yarnpkg.com/@hapi/podium/-/podium-3.4.3.tgz#d28935870ae1372e2f983a7161e710c968a60de1" + integrity sha512-QJlnYLEYZWlKQ9fSOtuUcpANyoVGwT68GA9P0iQQCAetBK0fI+nbRBt58+aMixoifczWZUthuGkNjqKxgPh/CQ== + dependencies: + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/shot@4.x.x": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@hapi/shot/-/shot-4.1.2.tgz#69f999956041fe468701a89a413175a521dabed5" + integrity sha512-6LeHLjvsq/bQ0R+fhEyr7mqExRGguNTrxFZf5DyKe3CK6pNabiGgYO4JVFaRrLZ3JyuhkS0fo8iiRE2Ql2oA/A== + dependencies: + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/somever@2.x.x": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@hapi/somever/-/somever-2.1.1.tgz#142bddf7cc4d829f678ed4e60618630a9a7ae845" + integrity sha512-cic5Sto4KGd9B0oQSdKTokju+rYhCbdpzbMb0EBnrH5Oc1z048hY8PaZ1lx2vBD7I/XIfTQVQetBH57fU51XRA== + dependencies: + "@hapi/bounce" "1.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/statehood@6.x.x": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@hapi/statehood/-/statehood-6.1.2.tgz#6dda508b5da99a28a3ed295c3cac795cf6c12a02" + integrity sha512-pYXw1x6npz/UfmtcpUhuMvdK5kuOGTKcJNfLqdNptzietK2UZH5RzNJSlv5bDHeSmordFM3kGItcuQWX2lj2nQ== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/bourne" "1.x.x" + "@hapi/cryptiles" "4.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/iron" "5.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/subtext@^6.1.3": + version "6.1.3" + resolved "https://registry.yarnpkg.com/@hapi/subtext/-/subtext-6.1.3.tgz#bbd07771ae2a4e73ac360c93ed74ac641718b9c6" + integrity sha512-qWN6NbiHNzohVcJMeAlpku/vzbyH4zIpnnMPMPioQMwIxbPFKeNViDCNI6fVBbMPBiw/xB4FjqiJkRG5P9eWWg== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/bourne" "1.x.x" + "@hapi/content" "^4.1.1" + "@hapi/file" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/pez" "^4.1.2" + "@hapi/wreck" "15.x.x" + +"@hapi/teamwork@3.x.x": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@hapi/teamwork/-/teamwork-3.3.1.tgz#b52d0ec48682dc793926bd432e22ceb19c915d3f" + integrity sha512-61tiqWCYvMKP7fCTXy0M4VE6uNIwA0qvgFoiDubgfj7uqJ0fdHJFQNnVPGrxhLWlwz0uBPWrQlBH7r8y9vFITQ== + +"@hapi/topo@3.x.x", "@hapi/topo@^3.1.3": + version "3.1.6" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-3.1.6.tgz#68d935fa3eae7fdd5ab0d7f953f3205d8b2bfc29" + integrity sha512-tAag0jEcjwH+P2quUfipd7liWCNX2F8NvYjQp2wtInsZxnMlypdw0FtAOLxtvvkO+GSRRbmNi8m/5y42PQJYCQ== + dependencies: + "@hapi/hoek" "^8.3.0" + +"@hapi/vise@3.x.x": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@hapi/vise/-/vise-3.1.1.tgz#dfc88f2ac90682f48bdc1b3f9b8f1eab4eabe0c8" + integrity sha512-OXarbiCSadvtg+bSdVPqu31Z1JoBL+FwNYz3cYoBKQ5xq1/Cr4A3IkGpAZbAuxU5y4NL5pZFZG3d2a3ZGm/dOQ== + dependencies: + "@hapi/hoek" "8.x.x" + +"@hapi/wreck@15.x.x", "@hapi/wreck@^15.0.2": version "15.1.0" resolved "https://registry.yarnpkg.com/@hapi/wreck/-/wreck-15.1.0.tgz#7917cd25950ce9b023f7fd2bea6e2ef72c71e59d" integrity sha512-tQczYRTTeYBmvhsek/D49En/5khcShaBEmzrAaDjMrFXKJRuF8xA8+tlq1ETLBFwGd6Do6g2OC74rt11kzawzg== @@ -4044,7 +4295,7 @@ dependencies: "@types/hapi" "*" -"@types/hapi@*", "@types/hapi@^17.0.18": +"@types/hapi@*": version "17.0.18" resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-17.0.18.tgz#f855fe18766aa2592a3a689c3e6eabe72989ff1a" integrity sha512-sRoDjz1iVOCxTqq+EepzDQI773k2PjboHpvMpp524278grosStxZ5+oooVjNLJZj1iZIbiLeeR5/ZeIRgVXsCg== @@ -4063,6 +4314,56 @@ resolved "https://registry.yarnpkg.com/@types/hapi__boom/-/hapi__boom-7.4.0.tgz#81d58cffb67c54896614560c007a5015a79c30ba" integrity sha512-i4nerd/aJd5zW8OPHxgeuDYiuiuHxHczkqIaALhINUqBCavRgbiwjfndpgrarB43jcb/2LxzrohMOH7akyt3og== +"@types/hapi__catbox@*": + version "10.2.3" + resolved "https://registry.yarnpkg.com/@types/hapi__catbox/-/hapi__catbox-10.2.3.tgz#c9279c16d709bf2987491c332e11d18124ae018f" + integrity sha512-gs6MKMKXzWpSqeYsPaDIDAxD8jLNg7aFxgAJE6Jnc+ns072Z9fuh39/NF5gSk1KNoGCLnIpeZ0etT9gY9QDCKg== + +"@types/hapi__hapi@^18.2.6": + version "18.2.6" + resolved "https://registry.yarnpkg.com/@types/hapi__hapi/-/hapi__hapi-18.2.6.tgz#61c1b210c55dee4636df594e7a0868ad48c8042a" + integrity sha512-sXFlSg9btu/LdHqK/N/kuQXVqZhSvibXbtZc0KfEcelRXKthdU5ZSu5qItDIov7SYnyK2faMe7dbZaC/VpC33w== + dependencies: + "@types/hapi__boom" "*" + "@types/hapi__catbox" "*" + "@types/hapi__iron" "*" + "@types/hapi__joi" "*" + "@types/hapi__mimos" "*" + "@types/hapi__podium" "*" + "@types/hapi__shot" "*" + "@types/node" "*" + +"@types/hapi__iron@*": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@types/hapi__iron/-/hapi__iron-6.0.1.tgz#ec8b23eff3d69313f1187c234deb80652384ad6b" + integrity sha512-NTr+1FKl+nvEeSwVpfcks36dCm6+tbcQh3tJYbyQ5XWb5sIbCIptW6p38zmCYE5ppOoU/2PK1Y8taGpl6cOl5w== + dependencies: + "@hapi/iron" "*" + +"@types/hapi__joi@*": + version "17.1.6" + resolved "https://registry.yarnpkg.com/@types/hapi__joi/-/hapi__joi-17.1.6.tgz#b84663676aa9753c17183718338dd40ddcbd3754" + integrity sha512-y3A1MzNC0FmzD5+ys59RziE1WqKrL13nxtJgrSzjoO7boue5B7zZD2nZLPwrSuUviFjpKFQtgHYSvhDGfIE4jA== + +"@types/hapi__mimos@*": + version "4.1.3" + resolved "https://registry.yarnpkg.com/@types/hapi__mimos/-/hapi__mimos-4.1.3.tgz#e2ad0510af090a87c16f5a7bdffbb9638ef36444" + integrity sha512-vZiKXZ0QqwSh0v1z9/f/VEPvmAHQaAXeVK9kGQIQH+2cqxrb2IL4TSDF0aPhPnNzuCvcUWaeCuGXj8V79v/kEA== + dependencies: + "@types/mime-db" "*" + +"@types/hapi__podium@*": + version "3.4.1" + resolved "https://registry.yarnpkg.com/@types/hapi__podium/-/hapi__podium-3.4.1.tgz#826ffed038979c844410e576b574f8237afd59bc" + integrity sha512-qgMyeXTZhGWvvUnXFavW2Pksf07IV1haBM/Fdq6cFi1lCIXhUHsaTrr2w651q+rhHZf+1dgP1vltJ0/quLxYYw== + +"@types/hapi__shot@*": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@types/hapi__shot/-/hapi__shot-4.1.1.tgz#c760322b90eb77f36a3003a442e8dc69e6ae3922" + integrity sha512-44Jj7jJAFgNVgfdbyVtBUbEIbYqWRKAbLR4kiQxBbVEdf8ZKfa5Hg1qg4QdzXBgjw0mopewU4wx1/eWRTVelNQ== + dependencies: + "@types/node" "*" + "@types/hapi__wreck@^15.0.1": version "15.0.1" resolved "https://registry.yarnpkg.com/@types/hapi__wreck/-/hapi__wreck-15.0.1.tgz#41df4e122c49316f0057cb5e9c6eb4c00e671e95" @@ -5552,7 +5853,7 @@ abortcontroller-polyfill@^1.4.0: resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.4.0.tgz#0d5eb58e522a461774af8086414f68e1dda7a6c4" integrity sha512-3ZFfCRfDzx3GFjO6RAkYx81lPGpUS20ISxux9gLxuKnqafNcFQo59+IoZqpO2WvQlyc287B62HDnDdNYRmlvWA== -accept@3.0.2, accept@3.x.x: +accept@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/accept/-/accept-3.0.2.tgz#83e41cec7e1149f3fd474880423873db6c6cc9ac" integrity sha512-bghLXFkCOsC1Y2TZ51etWfKDs6q249SAoHTZVfzWWdlZxoij+mgkj9AmUJWQpDY48TfnrTDIe43Xem4zdMe7mQ== @@ -6806,9 +7107,11 @@ axobject-query@^2.0.2: ast-types-flow "0.0.7" b64@4.x.x: - version "4.0.0" - resolved "https://registry.yarnpkg.com/b64/-/b64-4.0.0.tgz#c37f587f0a383c7019e821120e8c3f58f0d22772" - integrity sha512-EhmUQodKB0sdzPPrbIWbGqA5cQeTWxYrAgNeeT1rLZWtD3tbNTnphz8J4vkXI3cPgBNlXBjzEbzDzq0Nwi4f9A== + version "4.1.2" + resolved "https://registry.yarnpkg.com/b64/-/b64-4.1.2.tgz#7015372ba8101f7fb18da070717a93c28c8580d8" + integrity sha512-+GUspBxlH3CJaxMUGUE1EBoWM6RKgWiYwUDal0qdf8m3ArnXNN1KzKVo5HOnE/FSq4HHyWf3TlHLsZI8PKQgrQ== + dependencies: + hoek "6.x.x" babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" @@ -7414,11 +7717,6 @@ big-integer@^1.6.16: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== -big-time@2.x.x: - version "2.0.1" - resolved "https://registry.yarnpkg.com/big-time/-/big-time-2.0.1.tgz#68c7df8dc30f97e953f25a67a76ac9713c16c9de" - integrity sha1-aMffjcMPl+lT8lpnp2rJcTwWyd4= - big.js@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" @@ -8035,14 +8333,6 @@ call-me-maybe@^1.0.1: resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= -call@5.x.x: - version "5.0.1" - resolved "https://registry.yarnpkg.com/call/-/call-5.0.1.tgz#ac1b5c106d9edc2a17af2a4a4f74dd4f0c06e910" - integrity sha512-ollfFPSshiuYLp7AsrmpkQJ/PxCi6AzV81rCjBwWhyF2QGyUY/vPDMzoh4aUcWyucheRglG2LaS5qkIEfLRh6A== - dependencies: - boom "7.x.x" - hoek "5.x.x" - caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" @@ -8187,24 +8477,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -catbox-memory@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/catbox-memory/-/catbox-memory-3.1.2.tgz#4aeec1bc994419c0f7e60087f172aaedd9b4911c" - integrity sha512-lhWtutLVhsq3Mucxk2McxBPPibJ34WcHuWFz3xqub9u9Ve/IQYpZv3ijLhQXfQped9DXozURiaq9O3aZpP91eg== - dependencies: - big-time "2.x.x" - boom "7.x.x" - hoek "5.x.x" - -catbox@10.x.x: - version "10.0.3" - resolved "https://registry.yarnpkg.com/catbox/-/catbox-10.0.3.tgz#1f6f6436dfab30cdd23f753877bcb4afe980414b" - integrity sha512-qwus6RnVctHXYwfxvvDwvlMWHwCjQdIpQQbtyHnRF0JpwmxbQJ/UIZi9y8O6DpphKCdfO9gpxgb2ne9ZDx39BQ== - dependencies: - boom "7.x.x" - hoek "5.x.x" - joi "13.x.x" - ccount@^1.0.0, ccount@^1.0.3: version "1.0.5" resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.5.tgz#ac82a944905a65ce204eb03023157edf29425c17" @@ -9244,13 +9516,6 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== -content@4.x.x: - version "4.0.5" - resolved "https://registry.yarnpkg.com/content/-/content-4.0.5.tgz#bc547deabc889ab69bce17faf3585c29f4c41bf2" - integrity sha512-wDP6CTWDpwCf791fNxlCCkZGRkrNzSEU/8ju9Hnr3Uc5mF/gFR5W+fcoGm6zUSlVPdSXYn5pCbySADKj7YM4Cg== - dependencies: - boom "7.x.x" - continuable-cache@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f" @@ -14675,29 +14940,6 @@ hapi-auth-cookie@^9.0.0: hoek "5.x.x" joi "13.x.x" -hapi@^17.5.3: - version "17.6.0" - resolved "https://registry.yarnpkg.com/hapi/-/hapi-17.6.0.tgz#158a2276253a8de727be678c4daeb1f73929e588" - integrity sha512-GSHjE1hJExluAukrT/QuYSk96irmbYBDd3wOgywiHsPoR2QeKgDnIttD+dB6NbADEmSdb9MS5gTUIVq0uHTdkA== - dependencies: - accept "3.x.x" - ammo "3.x.x" - boom "7.x.x" - bounce "1.x.x" - call "5.x.x" - catbox "10.x.x" - catbox-memory "3.x.x" - heavy "6.x.x" - hoek "5.x.x" - joi "13.x.x" - mimos "4.x.x" - podium "3.x.x" - shot "4.x.x" - statehood "6.x.x" - subtext "6.x.x" - teamwork "3.x.x" - topo "3.x.x" - har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -15022,15 +15264,6 @@ heap@^0.2.6: resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac" integrity sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw= -heavy@6.x.x: - version "6.1.0" - resolved "https://registry.yarnpkg.com/heavy/-/heavy-6.1.0.tgz#1bbfa43dc61dd4b543ede3ff87db8306b7967274" - integrity sha512-TKS9DC9NOTGulHQI31Lx+bmeWmNOstbJbGMiN3pX6bF+Zc2GKSpbbym4oasNnB6yPGkqJ9TQXXYDGohqNSJRxA== - dependencies: - boom "7.x.x" - hoek "5.x.x" - joi "13.x.x" - highlight.js@9.15.10, highlight.js@^9.12.0, highlight.js@~9.15.0, highlight.js@~9.15.1: version "9.15.10" resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.10.tgz#7b18ed75c90348c045eef9ed08ca1319a2219ad2" @@ -15914,13 +16147,14 @@ ipaddr.js@1.9.0, ipaddr.js@^1.9.0: integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== iron@5.x.x: - version "5.0.4" - resolved "https://registry.yarnpkg.com/iron/-/iron-5.0.4.tgz#003ed822f656f07c2b62762815f5de3947326867" - integrity sha512-7iQ5/xFMIYaNt9g2oiNiWdhrOTdRUMFaWENUd0KghxwPUhrIH8DUY8FEyLNTTzf75jaII+jMexLdY/2HfV61RQ== + version "5.0.6" + resolved "https://registry.yarnpkg.com/iron/-/iron-5.0.6.tgz#7121d4a6e3ac2f65e4d02971646fea1995434744" + integrity sha512-zYUMOSkEXGBdwlV/AXF9zJC0aLuTJUKHkGeYS5I2g225M5i6SrxQyGJGhPgOR8BK1omL6N5i6TcwfsXbP8/Exw== dependencies: + b64 "4.x.x" boom "7.x.x" cryptiles "4.x.x" - hoek "5.x.x" + hoek "6.x.x" irregular-plurals@^3.2.0: version "3.2.0" @@ -19335,14 +19569,6 @@ mimic-response@^2.0.0, mimic-response@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.1.0.tgz#d13763d35f613d09ec37ebb30bac0469c0ee8f43" integrity sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA== -mimos@4.x.x: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mimos/-/mimos-4.0.0.tgz#76e3d27128431cb6482fd15b20475719ad626a5a" - integrity sha512-JvlvRLqGIlk+AYypWrbrDmhsM+6JVx/xBM5S3AMwTBz1trPCEoPN/swO2L4Wu653fL7oJdgk8DMQyG/Gq3JkZg== - dependencies: - hoek "5.x.x" - mime-db "1.x.x" - min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" @@ -19960,14 +20186,6 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" integrity sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA== -nigel@3.x.x: - version "3.0.1" - resolved "https://registry.yarnpkg.com/nigel/-/nigel-3.0.1.tgz#48a08859d65177312f1c25af7252c1e07bb07c2a" - integrity sha512-kCVtUG9JyD//tsYrZY+/Y+2gUrANVSba8y23QkM5Znx0FOxlnl9Z4OVPBODmstKWTOvigfTO+Va1VPOu3eWSOQ== - dependencies: - hoek "5.x.x" - vise "3.x.x" - nise@^1.5.2: version "1.5.3" resolved "https://registry.yarnpkg.com/nise/-/nise-1.5.3.tgz#9d2cfe37d44f57317766c6e9408a359c5d3ac1f7" @@ -21590,17 +21808,6 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -pez@4.x.x: - version "4.0.2" - resolved "https://registry.yarnpkg.com/pez/-/pez-4.0.2.tgz#0a7c81b64968e90b0e9562b398f390939e9c4b53" - integrity sha512-HuPxmGxHsEFPWhdkwBs2gIrHhFqktIxMtudISTFN95RQ85ZZAOl8Ki6u3nnN/X8OUaGlIGldk/l8p2IR4/i76w== - dependencies: - b64 "4.x.x" - boom "7.x.x" - content "4.x.x" - hoek "5.x.x" - nigel "3.x.x" - phin@^2.9.1: version "2.9.3" resolved "https://registry.yarnpkg.com/phin/-/phin-2.9.3.tgz#f9b6ac10a035636fb65dfc576aaaa17b8743125c" @@ -21753,7 +21960,7 @@ pnp-webpack-plugin@1.6.4: dependencies: ts-pnp "^1.1.6" -podium@3.1.2, podium@3.x.x: +podium@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/podium/-/podium-3.1.2.tgz#b701429739cf6bdde6b3015ae6b48d400817ce9e" integrity sha512-18VrjJAduIdPv7d9zWsfmKxTj3cQTYC5Pv5gtKxcWujYBpGbV+mhNSPYhlHW5xeWoazYyKfB9FEsPT12r5rY1A== @@ -24992,14 +25199,6 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -shot@4.x.x: - version "4.0.5" - resolved "https://registry.yarnpkg.com/shot/-/shot-4.0.5.tgz#c7e7455d11d60f6b6cd3c43e15a3b431c17e5566" - integrity sha1-x+dFXRHWD2ts08Q+FaO0McF+VWY= - dependencies: - hoek "5.x.x" - joi "13.x.x" - side-channel@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" @@ -25517,7 +25716,7 @@ state-toggle@^1.0.0: resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.0.tgz#d20f9a616bb4f0c3b98b91922d25b640aa2bc425" integrity sha1-0g+aYWu08MO5i5GSLSW2QKorxCU= -statehood@6.0.6, statehood@6.x.x: +statehood@6.0.6: version "6.0.6" resolved "https://registry.yarnpkg.com/statehood/-/statehood-6.0.6.tgz#0dbd7c50774d3f61a24e42b0673093bbc81fa5f0" integrity sha512-jR45n5ZMAkasw0xoE9j9TuLmJv4Sa3AkXe+6yIFT6a07kXYHgSbuD2OVGECdZGFxTmvNqLwL1iRIgvq6O6rq+A== @@ -25995,17 +26194,6 @@ stylus-lookup@^3.0.1: commander "^2.8.1" debug "^4.1.0" -subtext@6.x.x: - version "6.0.7" - resolved "https://registry.yarnpkg.com/subtext/-/subtext-6.0.7.tgz#8e40a67901a734d598142665c90e398369b885f9" - integrity sha512-IcJUvRjeR+NB437Iq+LORFNJW4L6Knqkj3oQrBrkdhIaS2VKJvx/9aYEq7vi+PEx5/OuehOL/40SkSZotLi/MA== - dependencies: - boom "7.x.x" - content "4.x.x" - hoek "5.x.x" - pez "4.x.x" - wreck "14.x.x" - success-symbol@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/success-symbol/-/success-symbol-0.1.0.tgz#24022e486f3bf1cdca094283b769c472d3b72897" @@ -26375,11 +26563,6 @@ tcp-port-used@^1.0.1: debug "4.1.0" is2 "2.0.1" -teamwork@3.x.x: - version "3.0.1" - resolved "https://registry.yarnpkg.com/teamwork/-/teamwork-3.0.1.tgz#ff38c7161f41f8070b7813716eb6154036ece196" - integrity sha512-hEkJIpDOfOYe9NYaLFk00zQbzZeKNCY8T2pRH3I13Y1mJwxaSQ6NEsjY5rCp+11ezCiZpWGoGFTbOuhg4qKevQ== - telejson@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/telejson/-/telejson-5.0.2.tgz#ed1e64be250cc1c757a53c19e1740b49832b3d51" @@ -28513,13 +28696,6 @@ vinyl@^2.0.0, vinyl@^2.0.1, vinyl@^2.1.0, vinyl@^2.2.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" -vise@3.x.x: - version "3.0.0" - resolved "https://registry.yarnpkg.com/vise/-/vise-3.0.0.tgz#76ad14ab31669c50fbb0817bc0e72fedcbb3bf4c" - integrity sha512-kBFZLmiL1Vm3rHXphkhvvAcsjgeQXRrOFCbJb0I50YZZP4HGRNH+xGzK3matIMcpbsfr3I02u9odj4oCD0TWgA== - dependencies: - hoek "5.x.x" - vision@^5.3.3: version "5.4.0" resolved "https://registry.yarnpkg.com/vision/-/vision-5.4.0.tgz#fc620deb95227881ea8b8d8a044dc1d1fd40e584" From 309c2844ea7fd81cf451d8bc479523810c3b3e9a Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 14 Oct 2020 14:42:16 +0200 Subject: [PATCH 04/20] Implement breaking changes from @hapi/hapi upgrade --- src/core/server/http/cookie_session_storage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/server/http/cookie_session_storage.ts b/src/core/server/http/cookie_session_storage.ts index 522195b0dc92d..7c444496175c9 100644 --- a/src/core/server/http/cookie_session_storage.ts +++ b/src/core/server/http/cookie_session_storage.ts @@ -80,7 +80,7 @@ class ScopedCookieSessionStorage> implements Sessi const session = await this.server.auth.test('security-cookie', this.request); // A browser can send several cookies, if it's not an array, just return the session value if (!Array.isArray(session)) { - return session as T; + return session.credentials as T; } // If we have an array with one value, we're good also From d19511c85335f3cf2c1ef4f0b74bda7a34c3bef6 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 15:49:47 +0200 Subject: [PATCH 05/20] TypeScript fix: Use correct ApplicationState interface The `ApplicationState` interface has in the new version of `@types/hapi__hapi` been split up into: - `RequestApplicationState` - `ResponeApplicationState` - `ServerApplicationState` See PR for more info: DefinitelyTyped/DefinitelyTyped#36361 It looks like the one we want to use is `RequestApplicationState`. --- src/core/server/http/router/request.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index b6d46028087fc..eccfee20489a5 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -19,7 +19,7 @@ import { URL } from 'url'; import uuid from 'uuid'; -import { Request, RouteOptionsApp, ApplicationState } from '@hapi/hapi'; +import { Request, RouteOptionsApp, RequestApplicationState } from '@hapi/hapi'; import { Observable, fromEvent, merge } from 'rxjs'; import { shareReplay, first, takeUntil } from 'rxjs/operators'; import { RecursiveReadonly } from '@kbn/utility-types'; @@ -42,7 +42,7 @@ export interface KibanaRouteOptions extends RouteOptionsApp { /** * @internal */ -export interface KibanaRequestState extends ApplicationState { +export interface KibanaRequestState extends RequestApplicationState { requestId: string; requestUuid: string; rewrittenUrl?: URL; From d01b71a336e528dc0ae9fcc4873221a1117249d6 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 27 Oct 2020 09:39:41 +0100 Subject: [PATCH 06/20] Remove pre-hapi 18 hacks --- src/core/server/http/http_server.mocks.ts | 16 ++++++---------- .../server/http/lifecycle/on_pre_routing.ts | 5 +---- src/core/server/http/router/request.ts | 3 +-- .../server/lib/task_runner_factory.test.ts | 18 ------------------ .../actions/server/lib/task_runner_factory.ts | 6 ------ .../server/alerts_client_factory.test.ts | 6 ------ x-pack/plugins/alerts/server/plugin.test.ts | 6 ------ .../server/task_runner/task_runner.test.ts | 18 ------------------ .../alerts/server/task_runner/task_runner.ts | 6 ------ .../event_log/server/event_log_client.test.ts | 6 ------ .../server/event_log_start_service.test.ts | 6 ------ .../saved_object_provider_registry.test.ts | 6 ------ .../server/services/agent_policy_update.ts | 6 ------ .../agents/checkin/state_connected_agents.ts | 6 ------ .../agents/checkin/state_new_actions.ts | 6 ------ x-pack/plugins/reporting/server/core.ts | 7 ------- 16 files changed, 8 insertions(+), 119 deletions(-) diff --git a/src/core/server/http/http_server.mocks.ts b/src/core/server/http/http_server.mocks.ts index afef9f7344f1a..fc9c3ca67d856 100644 --- a/src/core/server/http/http_server.mocks.ts +++ b/src/core/server/http/http_server.mocks.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { parse as parseUrl } from 'url'; +import { URL, format as formatUrl } from 'url'; import { Request } from '@hapi/hapi'; import { merge } from 'lodash'; import { Socket } from 'net'; @@ -73,7 +73,7 @@ function createKibanaRequestMock

({ auth = { isAuthenticated: true }, }: RequestFixtureOptions = {}) { const queryString = stringify(query, { sort: false }); - const url = parseUrl(`${path}${queryString ? `?${queryString}` : ''}`); + const url = new URL(`${path}${queryString ? `?${queryString}` : ''}`, 'http://localhost'); return KibanaRequest.from( createRawRequestMock({ @@ -120,9 +120,11 @@ type DeepPartialObject = { [P in keyof T]+?: DeepPartial }; function createRawRequestMock(customization: DeepPartial = {}) { const pathname = customization.url?.pathname || '/'; const path = `${pathname}${customization.url?.search || ''}`; - const url = Object.assign({ pathname, path, href: path }, customization.url); + const url = new URL( + formatUrl(Object.assign({ pathname, path, href: path }, customization.url)), + 'http://localhost' + ); - // @ts-expect-error _core isn't supposed to be accessed - remove once we upgrade to hapi v18 return merge( {}, { @@ -140,12 +142,6 @@ function createRawRequestMock(customization: DeepPartial = {}) { socket: {}, }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }, customization ) as Request; diff --git a/src/core/server/http/lifecycle/on_pre_routing.ts b/src/core/server/http/lifecycle/on_pre_routing.ts index 5afdabd067a07..620ad9ed276b9 100644 --- a/src/core/server/http/lifecycle/on_pre_routing.ts +++ b/src/core/server/http/lifecycle/on_pre_routing.ts @@ -17,7 +17,6 @@ * under the License. */ -import { URL } from 'url'; import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi'; import { Logger } from '../../logging'; import { @@ -111,9 +110,7 @@ export function adoptToHapiOnRequest(fn: OnPreRoutingHandler, log: Logger) { if (preRoutingResult.isRewriteUrl(result)) { const appState = request.app as KibanaRequestState; - appState.rewrittenUrl = - // @ts-expect-error request._core isn't supposed to be accessed - remove once we upgrade to hapi v18 - appState.rewrittenUrl ?? new URL(request.url.href!, request._core.info.uri); + appState.rewrittenUrl = appState.rewrittenUrl ?? request.url; const { url } = result; diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index eccfee20489a5..5bbdd4bea9a5f 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -212,8 +212,7 @@ export class KibanaRequest< this.uuid = appState?.requestUuid ?? uuid.v4(); this.rewrittenUrl = appState?.rewrittenUrl; - // @ts-expect-error request._core isn't supposed to be accessed - remove once we upgrade to hapi v18 - this.url = new URL(request.url.href!, request._core.info.uri); + this.url = request.url; this.headers = deepFreeze({ ...request.headers }); this.isSystemRequest = request.headers['kbn-system-request'] === 'true' || diff --git a/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts b/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts index c8e2684651598..18cbd9f9c5fad 100644 --- a/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts +++ b/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts @@ -145,12 +145,6 @@ test('executes the task by calling the executor with proper parameters', async ( url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }, }); }); @@ -277,12 +271,6 @@ test('uses API key when provided', async () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }, }); }); @@ -322,12 +310,6 @@ test(`doesn't use API key when not provided`, async () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }, }); }); diff --git a/x-pack/plugins/actions/server/lib/task_runner_factory.ts b/x-pack/plugins/actions/server/lib/task_runner_factory.ts index 93ae5a2c807f9..aeeeb4ed7d520 100644 --- a/x-pack/plugins/actions/server/lib/task_runner_factory.ts +++ b/x-pack/plugins/actions/server/lib/task_runner_factory.ts @@ -102,12 +102,6 @@ export class TaskRunnerFactory { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; let executorResult: ActionTypeExecutorResult; diff --git a/x-pack/plugins/alerts/server/alerts_client_factory.test.ts b/x-pack/plugins/alerts/server/alerts_client_factory.test.ts index ec95b1e3bda85..3cf6666e90eb0 100644 --- a/x-pack/plugins/alerts/server/alerts_client_factory.test.ts +++ b/x-pack/plugins/alerts/server/alerts_client_factory.test.ts @@ -60,12 +60,6 @@ const fakeRequest = ({ url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: () => savedObjectsClient, } as unknown) as Request; diff --git a/x-pack/plugins/alerts/server/plugin.test.ts b/x-pack/plugins/alerts/server/plugin.test.ts index ece7d31d2f7fd..b13a1c62f6602 100644 --- a/x-pack/plugins/alerts/server/plugin.test.ts +++ b/x-pack/plugins/alerts/server/plugin.test.ts @@ -149,12 +149,6 @@ describe('Alerting Plugin', () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: jest.fn(), } as unknown) as KibanaRequest; await startContract.getAlertsClientWithRequest(fakeRequest); diff --git a/x-pack/plugins/alerts/server/task_runner/task_runner.test.ts b/x-pack/plugins/alerts/server/task_runner/task_runner.test.ts index 17d5fcd31b745..8e345d6ff66a8 100644 --- a/x-pack/plugins/alerts/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerts/server/task_runner/task_runner.test.ts @@ -364,12 +364,6 @@ describe('Task Runner', () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }); expect(actionsClient.enqueueExecution).toHaveBeenCalledTimes(1); expect(actionsClient.enqueueExecution.mock.calls[0]).toMatchInlineSnapshot(` @@ -668,12 +662,6 @@ describe('Task Runner', () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }); }); @@ -706,12 +694,6 @@ describe('Task Runner', () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }); }); diff --git a/x-pack/plugins/alerts/server/task_runner/task_runner.ts b/x-pack/plugins/alerts/server/task_runner/task_runner.ts index 76125da20d552..954c5675df89c 100644 --- a/x-pack/plugins/alerts/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerts/server/task_runner/task_runner.ts @@ -101,12 +101,6 @@ export class TaskRunner { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; } diff --git a/x-pack/plugins/event_log/server/event_log_client.test.ts b/x-pack/plugins/event_log/server/event_log_client.test.ts index d9846428b9488..d6793be425585 100644 --- a/x-pack/plugins/event_log/server/event_log_client.test.ts +++ b/x-pack/plugins/event_log/server/event_log_client.test.ts @@ -322,12 +322,6 @@ function FakeRequest(): KibanaRequest { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: () => savedObjectGetter, } as unknown) as KibanaRequest; } diff --git a/x-pack/plugins/event_log/server/event_log_start_service.test.ts b/x-pack/plugins/event_log/server/event_log_start_service.test.ts index db6f4a1ad0f27..0a5b169e87d4d 100644 --- a/x-pack/plugins/event_log/server/event_log_start_service.test.ts +++ b/x-pack/plugins/event_log/server/event_log_start_service.test.ts @@ -56,12 +56,6 @@ function fakeRequest(): KibanaRequest { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: () => savedObjectsClient, } as unknown) as KibanaRequest; } diff --git a/x-pack/plugins/event_log/server/saved_object_provider_registry.test.ts b/x-pack/plugins/event_log/server/saved_object_provider_registry.test.ts index 076260ab2fe53..6a02d54c87514 100644 --- a/x-pack/plugins/event_log/server/saved_object_provider_registry.test.ts +++ b/x-pack/plugins/event_log/server/saved_object_provider_registry.test.ts @@ -93,12 +93,6 @@ function fakeRequest(): KibanaRequest { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: () => savedObjectsClient, } as unknown) as KibanaRequest; } diff --git a/x-pack/plugins/ingest_manager/server/services/agent_policy_update.ts b/x-pack/plugins/ingest_manager/server/services/agent_policy_update.ts index 1ad710ba70e29..fe06de765bbff 100644 --- a/x-pack/plugins/ingest_manager/server/services/agent_policy_update.ts +++ b/x-pack/plugins/ingest_manager/server/services/agent_policy_update.ts @@ -23,12 +23,6 @@ const fakeRequest = ({ url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; export async function agentPolicyUpdateEventHandler( diff --git a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_connected_agents.ts b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_connected_agents.ts index b9ef36ecaae54..994ecc64c82a7 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_connected_agents.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_connected_agents.ts @@ -23,12 +23,6 @@ function getInternalUserSOClient() { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; return appContextService.getInternalUserSOClient(fakeRequest); diff --git a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts index c0e8540004930..aa48d8fe18e9f 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts @@ -58,12 +58,6 @@ function getInternalUserSOClient() { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; return appContextService.getInternalUserSOClient(fakeRequest); diff --git a/x-pack/plugins/reporting/server/core.ts b/x-pack/plugins/reporting/server/core.ts index a1ed913647711..2c1ac95d6e824 100644 --- a/x-pack/plugins/reporting/server/core.ts +++ b/x-pack/plugins/reporting/server/core.ts @@ -210,18 +210,11 @@ export class ReportingCore { } public getFakeRequest(baseRequest: object, spaceId: string | undefined, logger = this.logger) { - // @ts-expect-error _core isn't supposed to be accessed - remove once we upgrade to hapi v18 const fakeRequest = KibanaRequest.from({ path: '/', route: { settings: {} }, url: { href: '/' }, raw: { req: { url: '/' } }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, ...baseRequest, } as Hapi.Request); From e0effa25e58c1484847bab71300db1034675d153 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 14 Oct 2020 18:19:46 +0200 Subject: [PATCH 07/20] Fix tests related to @hapi/hapi upgrade --- .../http/integration_tests/router.test.ts | 42 +++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/src/core/server/http/integration_tests/router.test.ts b/src/core/server/http/integration_tests/router.test.ts index e19c348511f1a..6262dd1bcc865 100644 --- a/src/core/server/http/integration_tests/router.test.ts +++ b/src/core/server/http/integration_tests/router.test.ts @@ -769,7 +769,7 @@ describe('Response factory', () => { await supertest(innerServer.listener).get('/').expect(200); }); - it('supports answering with Stream', async () => { + it('supports answering with Stream (without custom Content-Type)', async () => { const { server: innerServer, createRouter } = await server.setup(setupDeps); const router = createRouter('/'); @@ -790,8 +790,39 @@ describe('Response factory', () => { const result = await supertest(innerServer.listener).get('/').expect(200); + expect(result.text).toBe(undefined); + expect(result.body.toString()).toBe('abc'); + expect(result.header['content-type']).toBe('application/octet-stream'); + }); + + it('supports answering with Stream (with custom Content-Type)', async () => { + const { server: innerServer, createRouter } = await server.setup(setupDeps); + const router = createRouter('/'); + + router.get({ path: '/', validate: false }, (context, req, res) => { + const stream = new Stream.Readable({ + read() { + this.push('a'); + this.push('b'); + this.push('c'); + this.push(null); + }, + }); + + return res.ok({ + body: stream, + headers: { + 'Content-Type': 'text/plain', + }, + }); + }); + + await server.start(); + + const result = await supertest(innerServer.listener).get('/').expect(200); + expect(result.text).toBe('abc'); - expect(result.header['content-type']).toBe(undefined); + expect(result.header['content-type']).toBe('text/plain; charset=utf-8'); }); it('supports answering with chunked Stream', async () => { @@ -807,7 +838,12 @@ describe('Response factory', () => { stream.end(); }, 100); - return res.ok({ body: stream }); + return res.ok({ + body: stream, + headers: { + 'Content-Type': 'text/plain', + }, + }); }); await server.start(); From 2aa40202d184c95c4c3e90fa6d24543f224140c5 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 14:11:08 +0200 Subject: [PATCH 08/20] Upgrade from boom@7.2.2 to @hapi/boom@7.4.11 --- package.json | 5 +++-- src/core/public/public.api.md | 2 +- .../server/elasticsearch/legacy/errors.test.ts | 2 +- src/core/server/elasticsearch/legacy/errors.ts | 2 +- .../http/integration_tests/core_services.test.ts | 2 +- .../server/http/integration_tests/router.test.ts | 2 +- src/core/server/http/lifecycle/on_pre_response.ts | 2 +- src/core/server/http/router/error_wrapper.test.ts | 2 +- src/core/server/http/router/error_wrapper.ts | 2 +- src/core/server/http/router/response_adapter.ts | 2 +- src/core/server/http/router/router.ts | 2 +- .../export/get_sorted_objects_for_export.ts | 2 +- .../saved_objects/import/create_limit_stream.ts | 2 +- .../saved_objects/import/validate_references.ts | 2 +- .../migrations/core/document_migrator.ts | 2 +- .../saved_objects/service/lib/errors.test.ts | 2 +- .../server/saved_objects/service/lib/errors.ts | 2 +- .../service/lib/search_dsl/search_dsl.ts | 2 +- .../service/lib/search_dsl/sorting_params.ts | 2 +- .../saved_objects/version/decode_version.test.ts | 2 +- src/core/server/server.api.md | 2 +- src/legacy/server/http/index.js | 2 +- src/legacy/ui/ui_render/ui_render_mixin.js | 2 +- .../bundles_route/dynamic_asset_response.ts | 2 +- src/plugins/console/server/lib/proxy_request.ts | 2 +- src/plugins/data/public/public.api.md | 2 +- .../server/index_patterns/fetcher/lib/errors.ts | 2 +- src/plugins/data/server/plugins_data_server.api.md | 2 +- src/plugins/embeddable/public/public.api.md | 2 +- .../server/routes/lib/short_url_assert_valid.ts | 2 +- .../vis_type_timeseries/server/routes/fields.ts | 2 +- .../apis/index_patterns/es_errors/errors.js | 2 +- x-pack/package.json | 3 +-- .../plugins/actions/server/action_type_registry.ts | 2 +- x-pack/plugins/actions/server/actions_client.ts | 2 +- .../server/authorization/actions_authorization.ts | 2 +- .../actions/server/lib/validate_with_schema.ts | 2 +- .../actions/server/lib/verify_api_access.ts | 2 +- .../plugins/alerts/server/alert_type_registry.ts | 2 +- .../alerts/server/alerts_client/alerts_client.ts | 2 +- .../server/authorization/alerts_authorization.ts | 2 +- .../alerts/server/lib/license_api_access.ts | 2 +- x-pack/plugins/alerts/server/lib/license_state.ts | 2 +- .../server/lib/validate_alert_type_params.ts | 2 +- .../create_anomaly_detection_jobs.ts | 2 +- .../get_anomaly_detection_jobs.ts | 2 +- .../lib/anomaly_detection/has_legacy_jobs.ts | 2 +- .../lib/service_map/get_service_anomalies.ts | 2 +- .../plugins/apm/server/routes/create_api/index.ts | 2 +- x-pack/plugins/apm/server/routes/service_map.ts | 2 +- x-pack/plugins/apm/server/routes/services.ts | 2 +- .../server/routes/settings/agent_configuration.ts | 2 +- .../server/routes/settings/anomaly_detection.ts | 2 +- .../apm/server/routes/settings/custom_link.ts | 2 +- .../apm/server/routes/transaction_groups.ts | 2 +- .../plugins/canvas/server/lib/format_response.js | 2 +- .../canvas/server/routes/templates/list.test.ts | 2 +- x-pack/plugins/case/server/client/cases/create.ts | 2 +- x-pack/plugins/case/server/client/cases/update.ts | 2 +- x-pack/plugins/case/server/client/comments/add.ts | 2 +- .../routes/api/cases/comments/delete_comment.ts | 2 +- .../routes/api/cases/comments/find_comments.ts | 2 +- .../routes/api/cases/comments/patch_comment.ts | 2 +- .../routes/api/cases/configure/get_connectors.ts | 2 +- .../routes/api/cases/configure/patch_configure.ts | 2 +- .../routes/api/cases/configure/post_configure.ts | 2 +- .../case/server/routes/api/cases/find_cases.ts | 2 +- .../case/server/routes/api/cases/push_case.ts | 2 +- .../plugins/case/server/routes/api/utils.test.ts | 2 +- x-pack/plugins/case/server/routes/api/utils.ts | 2 +- x-pack/plugins/file_upload/server/client/errors.js | 2 +- x-pack/plugins/graph/server/lib/license_state.ts | 2 +- x-pack/plugins/graph/server/routes/explore.ts | 2 +- .../infra_ml/results/metrics_hosts_anomalies.ts | 2 +- .../infra_ml/results/metrics_k8s_anomalies.ts | 2 +- .../server/routes/inventory_metadata/index.ts | 2 +- .../server/routes/log_alerts/chart_preview_data.ts | 2 +- .../log_analysis/results/log_entry_anomalies.ts | 2 +- .../results/log_entry_anomalies_datasets.ts | 2 +- .../log_analysis/results/log_entry_categories.ts | 2 +- .../results/log_entry_category_datasets.ts | 2 +- .../results/log_entry_category_datasets_stats.ts | 2 +- .../results/log_entry_category_examples.ts | 2 +- .../log_analysis/results/log_entry_examples.ts | 2 +- .../routes/log_analysis/results/log_entry_rate.ts | 2 +- .../routes/log_analysis/validation/datasets.ts | 2 +- .../routes/log_analysis/validation/indices.ts | 2 +- .../infra/server/routes/log_entries/highlights.ts | 2 +- .../infra/server/routes/log_entries/summary.ts | 2 +- .../routes/log_entries/summary_highlights.ts | 2 +- .../server/routes/log_sources/configuration.ts | 2 +- .../infra/server/routes/log_sources/status.ts | 2 +- .../plugins/infra/server/routes/metadata/index.ts | 2 +- .../infra/server/routes/metrics_explorer/index.ts | 2 +- .../infra/server/routes/node_details/index.ts | 2 +- .../plugins/infra/server/routes/snapshot/index.ts | 2 +- .../ingest_manager/server/errors/handlers.test.ts | 2 +- .../ingest_manager/server/errors/handlers.ts | 2 +- .../server/routes/package_policy/handlers.ts | 2 +- .../server/services/agents/acks.test.ts | 2 +- .../ingest_manager/server/services/agents/acks.ts | 2 +- .../server/services/agents/authenticate.ts | 2 +- .../ingest_manager/server/services/agents/crud.ts | 2 +- .../server/services/agents/enroll.ts | 2 +- .../server/services/agents/reassign.ts | 2 +- .../server/services/agents/saved_objects.ts | 2 +- .../server/services/api_keys/enrollment_api_key.ts | 2 +- .../services/epm/elasticsearch/template/install.ts | 2 +- .../server/services/epm/packages/install.ts | 2 +- .../server/services/epm/packages/remove.ts | 2 +- .../ingest_manager/server/services/settings.ts | 2 +- .../plugins/lens/server/routes/existing_fields.ts | 2 +- x-pack/plugins/lens/server/routes/field_stats.ts | 2 +- x-pack/plugins/lens/server/routes/telemetry.ts | 2 +- .../logstash/server/models/pipeline/pipeline.ts | 2 +- .../ml/common/types/data_frame_analytics.ts | 2 +- .../plugins/ml/common/util/errors/errors.test.ts | 2 +- x-pack/plugins/ml/common/util/errors/types.ts | 2 +- x-pack/plugins/ml/server/client/error_wrapper.ts | 2 +- x-pack/plugins/ml/server/client/errors.js | 2 +- .../server/models/annotation_service/annotation.ts | 2 +- .../models/data_recognizer/data_recognizer.ts | 2 +- .../server/models/fields_service/fields_service.ts | 2 +- .../ml/server/models/filter/filter_manager.ts | 2 +- .../plugins/ml/server/models/job_service/jobs.ts | 2 +- .../server/models/job_service/model_snapshots.ts | 2 +- .../server/models/job_validation/job_validation.ts | 2 +- .../results_service/get_partition_fields_values.ts | 2 +- .../models/results_service/results_service.ts | 2 +- x-pack/plugins/ml/server/routes/annotations.ts | 2 +- x-pack/plugins/ml/server/routes/job_validation.ts | 2 +- .../no_data/__tests__/checker_errors.test.js | 2 +- .../__tests__/enabler.test.js | 2 +- .../server/lib/cluster/get_cluster_stats.js | 2 +- .../lib/cluster/get_clusters_from_request.js | 2 +- .../lib/elasticsearch/verify_monitoring_auth.js | 2 +- .../server/lib/errors/__tests__/auth_errors.js | 2 +- .../monitoring/server/lib/errors/auth_errors.js | 2 +- .../monitoring/server/lib/errors/handle_error.js | 2 +- .../server/lib/errors/handle_settings_error.js | 2 +- .../monitoring/server/lib/errors/known_errors.js | 2 +- .../monitoring/server/lib/logstash/get_pipeline.js | 2 +- .../server/lib/logstash/get_pipeline_vertex.js | 2 +- x-pack/plugins/monitoring/server/plugin.ts | 2 +- .../lib/annotations/create_annotations_client.ts | 2 +- .../server/routes/api/get_route.test.ts | 2 +- .../csv_from_savedobject/create_job.ts | 2 +- .../csv_from_savedobject/lib/get_filters.ts | 2 +- .../plugins/reporting/server/routes/generation.ts | 2 +- x-pack/plugins/reporting/server/routes/jobs.ts | 2 +- .../authentication/authentication_result.test.ts | 2 +- .../server/authentication/authenticator.test.ts | 2 +- .../security/server/authentication/index.test.ts | 2 +- .../authentication/providers/kerberos.test.ts | 2 +- .../server/authentication/providers/kerberos.ts | 2 +- .../server/authentication/providers/oidc.test.ts | 2 +- .../server/authentication/providers/oidc.ts | 2 +- .../server/authentication/providers/pki.test.ts | 2 +- .../server/authentication/providers/pki.ts | 2 +- .../server/authentication/providers/saml.test.ts | 2 +- .../server/authentication/providers/saml.ts | 2 +- .../server/authentication/providers/token.test.ts | 2 +- .../server/authentication/providers/token.ts | 2 +- x-pack/plugins/security/server/errors.test.ts | 2 +- x-pack/plugins/security/server/errors.ts | 2 +- .../server/routes/api_keys/enabled.test.ts | 2 +- .../security/server/routes/api_keys/get.test.ts | 2 +- .../server/routes/api_keys/invalidate.test.ts | 2 +- .../server/routes/api_keys/privileges.test.ts | 2 +- .../routes/authorization/roles/delete.test.ts | 2 +- .../server/routes/authorization/roles/get.test.ts | 2 +- .../routes/authorization/roles/get_all.test.ts | 2 +- .../server/routes/role_mapping/get.test.ts | 2 +- .../server/endpoint/routes/metadata/handlers.ts | 2 +- .../lib/detection_engine/routes/utils.test.ts | 2 +- .../server/lib/detection_engine/routes/utils.ts | 2 +- .../components/copy_to_space_flyout.test.tsx | 2 +- .../components/share_to_space_flyout.test.tsx | 2 +- .../lib/create_empty_failure_response.ts | 2 +- .../spaces/server/lib/copy_to_spaces/types.ts | 2 +- x-pack/plugins/spaces/server/lib/errors.ts | 2 +- .../on_post_auth_interceptor.test.ts | 2 +- .../server/lib/spaces_client/spaces_client.ts | 2 +- .../spaces/server/routes/api/external/delete.ts | 2 +- .../spaces/server/routes/api/external/post.ts | 2 +- .../spaces_saved_objects_client.test.ts | 2 +- .../saved_objects/spaces_saved_objects_client.ts | 2 +- .../transform/server/routes/api/error_utils.ts | 2 +- .../server/models/action_status/action_status.js | 2 +- .../plugins/watcher/server/models/fields/fields.js | 2 +- .../watcher/server/models/watch/base_watch.js | 2 +- .../server/models/watch/monitoring_watch.js | 2 +- .../plugins/watcher/server/models/watch/watch.js | 2 +- .../watch_history_item/watch_history_item.js | 2 +- .../server/models/watch_status/watch_status.js | 2 +- yarn.lock | 14 +++++++------- 196 files changed, 204 insertions(+), 204 deletions(-) diff --git a/package.json b/package.json index 88f16321bbeab..750bc93fbab2c 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ }, "resolutions": { "**/@hapi/iron": "^5.1.4", + "**/@types/hapi__boom": "^7.4.1", "**/@types/node": ">=10.17.17 <10.20.0", "**/cross-fetch/node-fetch": "^2.6.1", "**/deepmerge": "^4.2.2", @@ -123,6 +124,7 @@ "@elastic/numeral": "^2.5.0", "@elastic/request-crypto": "1.1.4", "@elastic/safer-lodash-set": "0.0.0", + "@hapi/boom": "^7.4.11", "@hapi/good-squeeze": "5.2.1", "@hapi/hapi": "^18.4.1", "@hapi/wreck": "^15.0.2", @@ -147,7 +149,6 @@ "angular-elastic": "^2.5.1", "angular-sanitize": "^1.8.0", "bluebird": "3.5.5", - "boom": "^7.2.0", "chalk": "^4.1.0", "check-disk-space": "^2.1.0", "chokidar": "^3.4.2", @@ -275,7 +276,6 @@ "@types/archiver": "^3.1.0", "@types/babel__core": "^7.1.10", "@types/bluebird": "^3.1.1", - "@types/boom": "^7.2.0", "@types/chance": "^1.0.0", "@types/cheerio": "^0.22.10", "@types/chromedriver": "^81.0.0", @@ -297,6 +297,7 @@ "@types/graphql": "^0.13.2", "@types/h2o2": "^8.1.1", "@types/hapi-auth-cookie": "^9.1.0", + "@types/hapi__boom": "^7.4.1", "@types/hapi__hapi": "^18.2.6", "@types/has-ansi": "^3.0.0", "@types/history": "^4.7.3", diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index f52d5b6fbd6a5..0814792a730cd 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -6,7 +6,7 @@ import { Action } from 'history'; import { ApiResponse } from '@elastic/elasticsearch/lib/Transport'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ConfigPath } from '@kbn/config'; import { EnvironmentMode } from '@kbn/config'; import { EuiBreadcrumb } from '@elastic/eui'; diff --git a/src/core/server/elasticsearch/legacy/errors.test.ts b/src/core/server/elasticsearch/legacy/errors.test.ts index 85e5eba721b34..4b315bf8aff45 100644 --- a/src/core/server/elasticsearch/legacy/errors.test.ts +++ b/src/core/server/elasticsearch/legacy/errors.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { LegacyElasticsearchErrorHelpers } from './errors'; diff --git a/src/core/server/elasticsearch/legacy/errors.ts b/src/core/server/elasticsearch/legacy/errors.ts index de4d2739977bb..e557e7395fe56 100644 --- a/src/core/server/elasticsearch/legacy/errors.ts +++ b/src/core/server/elasticsearch/legacy/errors.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { get } from 'lodash'; const code = Symbol('ElasticsearchError'); diff --git a/src/core/server/http/integration_tests/core_services.test.ts b/src/core/server/http/integration_tests/core_services.test.ts index 1df1154aa80a7..7f785d4d67c29 100644 --- a/src/core/server/http/integration_tests/core_services.test.ts +++ b/src/core/server/http/integration_tests/core_services.test.ts @@ -23,7 +23,7 @@ import { legacyClusterClientInstanceMock, } from './core_service.test.mocks'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { Request } from '@hapi/hapi'; import { errors as esErrors } from 'elasticsearch'; import { LegacyElasticsearchErrorHelpers } from '../../elasticsearch/legacy'; diff --git a/src/core/server/http/integration_tests/router.test.ts b/src/core/server/http/integration_tests/router.test.ts index 6262dd1bcc865..0db26238d46ce 100644 --- a/src/core/server/http/integration_tests/router.test.ts +++ b/src/core/server/http/integration_tests/router.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { Stream } from 'stream'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import supertest from 'supertest'; import { schema } from '@kbn/config-schema'; diff --git a/src/core/server/http/lifecycle/on_pre_response.ts b/src/core/server/http/lifecycle/on_pre_response.ts index 08bd8b8e7c3e8..42179374ec672 100644 --- a/src/core/server/http/lifecycle/on_pre_response.ts +++ b/src/core/server/http/lifecycle/on_pre_response.ts @@ -23,7 +23,7 @@ import { ResponseObject, ResponseToolkit as HapiResponseToolkit, } from '@hapi/hapi'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { Logger } from '../../logging'; import { HapiResponseAdapter, KibanaRequest, ResponseHeaders } from '../router'; diff --git a/src/core/server/http/router/error_wrapper.test.ts b/src/core/server/http/router/error_wrapper.test.ts index aa20b49dc9c91..33c652c6789ad 100644 --- a/src/core/server/http/router/error_wrapper.test.ts +++ b/src/core/server/http/router/error_wrapper.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaResponse, KibanaResponseFactory, kibanaResponseFactory } from './response'; import { wrapErrors } from './error_wrapper'; import { KibanaRequest, RequestHandler, RequestHandlerContext } from 'kibana/server'; diff --git a/src/core/server/http/router/error_wrapper.ts b/src/core/server/http/router/error_wrapper.ts index 75d0e0d630296..5a4b7e9f77582 100644 --- a/src/core/server/http/router/error_wrapper.ts +++ b/src/core/server/http/router/error_wrapper.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { RequestHandlerWrapper } from './router'; export const wrapErrors: RequestHandlerWrapper = (handler) => { diff --git a/src/core/server/http/router/response_adapter.ts b/src/core/server/http/router/response_adapter.ts index 45114541761c6..63acd2207ac3a 100644 --- a/src/core/server/http/router/response_adapter.ts +++ b/src/core/server/http/router/response_adapter.ts @@ -21,7 +21,7 @@ import { ResponseToolkit as HapiResponseToolkit, } from '@hapi/hapi'; import typeDetect from 'type-detect'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import * as stream from 'stream'; import { diff --git a/src/core/server/http/router/router.ts b/src/core/server/http/router/router.ts index a7ab1cfc120f9..b1e092ba5786a 100644 --- a/src/core/server/http/router/router.ts +++ b/src/core/server/http/router/router.ts @@ -18,7 +18,7 @@ */ import { Request, ResponseObject, ResponseToolkit } from '@hapi/hapi'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { isConfigSchema } from '@kbn/config-schema'; import { Logger } from '../../logging'; diff --git a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts index 214b51db7dd6b..9b13c9b24ffdc 100644 --- a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts +++ b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { createListStream } from '../../utils/streams'; import { SavedObjectsClientContract, SavedObject } from '../types'; import { fetchNestedDependencies } from './inject_nested_depdendencies'; diff --git a/src/core/server/saved_objects/import/create_limit_stream.ts b/src/core/server/saved_objects/import/create_limit_stream.ts index 8f6ac91d0d315..709bb3b2d0065 100644 --- a/src/core/server/saved_objects/import/create_limit_stream.ts +++ b/src/core/server/saved_objects/import/create_limit_stream.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { Transform } from 'stream'; export function createLimitStream(limit: number) { diff --git a/src/core/server/saved_objects/import/validate_references.ts b/src/core/server/saved_objects/import/validate_references.ts index 89fe8ec8c0901..b0686215c00dd 100644 --- a/src/core/server/saved_objects/import/validate_references.ts +++ b/src/core/server/saved_objects/import/validate_references.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObject, SavedObjectsClientContract } from '../types'; import { SavedObjectsImportError, SavedObjectsImportRetry } from './types'; diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.ts b/src/core/server/saved_objects/migrations/core/document_migrator.ts index 345704fbfd783..ccda72702b53c 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.ts @@ -60,7 +60,7 @@ * given an empty migrationVersion property {} if no such property exists. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { set } from '@elastic/safer-lodash-set'; import _ from 'lodash'; import Semver from 'semver'; diff --git a/src/core/server/saved_objects/service/lib/errors.test.ts b/src/core/server/saved_objects/service/lib/errors.test.ts index 931d9f725e412..497dc1bbe4c45 100644 --- a/src/core/server/saved_objects/service/lib/errors.test.ts +++ b/src/core/server/saved_objects/service/lib/errors.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsErrorHelpers } from './errors'; diff --git a/src/core/server/saved_objects/service/lib/errors.ts b/src/core/server/saved_objects/service/lib/errors.ts index 6fd5bc9de0ec5..78956ca8d6868 100644 --- a/src/core/server/saved_objects/service/lib/errors.ts +++ b/src/core/server/saved_objects/service/lib/errors.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; // 400 - badRequest const CODE_BAD_REQUEST = 'SavedObjectsClient/badRequest'; diff --git a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts index 858770579fb9e..fca361b8ffda0 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IndexMapping } from '../../../mappings'; import { getQueryParams } from './query_params'; diff --git a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts index ccf5ccd50bb75..a56cf6462dbe7 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getProperty, IndexMapping } from '../../../mappings'; const TOP_LEVEL_FIELDS = ['_id', '_score']; diff --git a/src/core/server/saved_objects/version/decode_version.test.ts b/src/core/server/saved_objects/version/decode_version.test.ts index b157d97ae8a23..987af3e693823 100644 --- a/src/core/server/saved_objects/version/decode_version.test.ts +++ b/src/core/server/saved_objects/version/decode_version.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { decodeVersion } from './decode_version'; diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index b11d65a3b4753..4562b6d696c87 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -5,7 +5,7 @@ ```ts import { ApiResponse } from '@elastic/elasticsearch/lib/Transport'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { BulkIndexDocumentsParams } from 'elasticsearch'; import { CatAliasesParams } from 'elasticsearch'; import { CatAllocationParams } from 'elasticsearch'; diff --git a/src/legacy/server/http/index.js b/src/legacy/server/http/index.js index 0cab1a1609287..16705e9241be8 100644 --- a/src/legacy/server/http/index.js +++ b/src/legacy/server/http/index.js @@ -18,7 +18,7 @@ */ import { format } from 'url'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { registerHapiPlugins } from './register_hapi_plugins'; import { setupBasePathProvider } from './setup_base_path_provider'; diff --git a/src/legacy/ui/ui_render/ui_render_mixin.js b/src/legacy/ui/ui_render/ui_render_mixin.js index 2983dbbc28667..a02c2fca14c18 100644 --- a/src/legacy/ui/ui_render/ui_render_mixin.js +++ b/src/legacy/ui/ui_render/ui_render_mixin.js @@ -18,7 +18,7 @@ */ import { createHash } from 'crypto'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import * as UiSharedDeps from '@kbn/ui-shared-deps'; import { KibanaRequest } from '../../../core/server'; diff --git a/src/optimize/bundles_route/dynamic_asset_response.ts b/src/optimize/bundles_route/dynamic_asset_response.ts index a9a9357dec53a..43560c08f4919 100644 --- a/src/optimize/bundles_route/dynamic_asset_response.ts +++ b/src/optimize/bundles_route/dynamic_asset_response.ts @@ -22,7 +22,7 @@ import { resolve } from 'path'; import { promisify } from 'util'; import Accept from 'accept'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import Hapi from '@hapi/hapi'; import { FileHashCache } from './file_hash_cache'; diff --git a/src/plugins/console/server/lib/proxy_request.ts b/src/plugins/console/server/lib/proxy_request.ts index fb07b7c49a003..27e19d920ad17 100644 --- a/src/plugins/console/server/lib/proxy_request.ts +++ b/src/plugins/console/server/lib/proxy_request.ts @@ -21,7 +21,7 @@ import http from 'http'; import https from 'https'; import net from 'net'; import stream from 'stream'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { URL } from 'url'; interface Args { diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index 81fa6d4ba20db..3b5b0b13352ee 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -11,7 +11,7 @@ import { ApiResponse as ApiResponse_2 } from '@elastic/elasticsearch/lib/Transpo import { ApplicationStart } from 'kibana/public'; import { Assign } from '@kbn/utility-types'; import { BehaviorSubject } from 'rxjs'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { CoreSetup } from 'src/core/public'; import { CoreSetup as CoreSetup_2 } from 'kibana/public'; import { CoreStart } from 'kibana/public'; diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts b/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts index e5a96c67c56b5..cbb3c2fbf3442 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts +++ b/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { get } from 'lodash'; const ERR_ES_INDEX_NOT_FOUND = 'index_not_found_exception'; diff --git a/src/plugins/data/server/plugins_data_server.api.md b/src/plugins/data/server/plugins_data_server.api.md index 0da089e81781c..9faa7439d70a4 100644 --- a/src/plugins/data/server/plugins_data_server.api.md +++ b/src/plugins/data/server/plugins_data_server.api.md @@ -5,7 +5,7 @@ ```ts import { APICaller as APICaller_2 } from 'kibana/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { BulkIndexDocumentsParams } from 'elasticsearch'; import { CallCluster as CallCluster_2 } from 'src/legacy/core_plugins/elasticsearch'; import { CatAliasesParams } from 'elasticsearch'; diff --git a/src/plugins/embeddable/public/public.api.md b/src/plugins/embeddable/public/public.api.md index 84dd97c8288fc..5e55c27106902 100644 --- a/src/plugins/embeddable/public/public.api.md +++ b/src/plugins/embeddable/public/public.api.md @@ -12,7 +12,7 @@ import { ApiResponse as ApiResponse_2 } from '@elastic/elasticsearch'; import { ApplicationStart as ApplicationStart_2 } from 'kibana/public'; import { Assign } from '@kbn/utility-types'; import { BehaviorSubject } from 'rxjs'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { CoreSetup as CoreSetup_2 } from 'src/core/public'; import { CoreSetup as CoreSetup_3 } from 'kibana/public'; import { CoreStart as CoreStart_2 } from 'kibana/public'; diff --git a/src/plugins/share/server/routes/lib/short_url_assert_valid.ts b/src/plugins/share/server/routes/lib/short_url_assert_valid.ts index 2f120bbc03cd7..462fc31944b74 100644 --- a/src/plugins/share/server/routes/lib/short_url_assert_valid.ts +++ b/src/plugins/share/server/routes/lib/short_url_assert_valid.ts @@ -19,7 +19,7 @@ import { parse } from 'url'; import { trim } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; export function shortUrlAssertValid(url: string) { const { protocol, hostname, pathname } = parse(url); diff --git a/src/plugins/vis_type_timeseries/server/routes/fields.ts b/src/plugins/vis_type_timeseries/server/routes/fields.ts index 255c85c9eefa7..f9a600fa4b1f3 100644 --- a/src/plugins/vis_type_timeseries/server/routes/fields.ts +++ b/src/plugins/vis_type_timeseries/server/routes/fields.ts @@ -17,7 +17,7 @@ * under the License. */ -import { isBoom } from 'boom'; +import { isBoom } from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { getFields } from '../lib/get_fields'; import { Framework } from '../plugin'; diff --git a/test/api_integration/apis/index_patterns/es_errors/errors.js b/test/api_integration/apis/index_patterns/es_errors/errors.js index 9da29a0d3a3da..49a64f835fb35 100644 --- a/test/api_integration/apis/index_patterns/es_errors/errors.js +++ b/test/api_integration/apis/index_patterns/es_errors/errors.js @@ -19,7 +19,7 @@ import expect from '@kbn/expect'; import { errors as esErrors } from 'elasticsearch'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { isEsIndexNotFoundError, diff --git a/x-pack/package.json b/x-pack/package.json index 8368b75cf48fb..2f2840413a679 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -58,7 +58,6 @@ "@types/angular": "^1.6.56", "@types/archiver": "^3.1.0", "@types/base64-js": "^1.2.5", - "@types/boom": "^7.2.0", "@types/cheerio": "^0.22.10", "@types/chroma-js": "^1.4.2", "@types/color": "^3.0.0", @@ -272,6 +271,7 @@ "@elastic/node-crypto": "1.2.1", "@elastic/numeral": "^2.5.0", "@elastic/safer-lodash-set": "0.0.0", + "@hapi/boom": "^7.4.11", "@kbn/config-schema": "1.0.0", "@kbn/i18n": "1.0.0", "@kbn/interpreter": "1.0.0", @@ -289,7 +289,6 @@ "archiver": "^3.1.1", "axios": "^0.19.2", "bluebird": "3.5.5", - "boom": "^7.2.0", "chroma-js": "^1.4.1", "classnames": "2.2.6", "concat-stream": "1.6.2", diff --git a/x-pack/plugins/actions/server/action_type_registry.ts b/x-pack/plugins/actions/server/action_type_registry.ts index cacf7166b96ba..15ff7e558025e 100644 --- a/x-pack/plugins/actions/server/action_type_registry.ts +++ b/x-pack/plugins/actions/server/action_type_registry.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { RunContext, TaskManagerSetupContract } from '../../task_manager/server'; import { ActionType as CommonActionType } from '../common'; diff --git a/x-pack/plugins/actions/server/actions_client.ts b/x-pack/plugins/actions/server/actions_client.ts index e565d420d772e..2735a1ab44521 100644 --- a/x-pack/plugins/actions/server/actions_client.ts +++ b/x-pack/plugins/actions/server/actions_client.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ILegacyScopedClusterClient, SavedObjectsClientContract, diff --git a/x-pack/plugins/actions/server/authorization/actions_authorization.ts b/x-pack/plugins/actions/server/authorization/actions_authorization.ts index cad58bed50981..e8d7bc89f2dbf 100644 --- a/x-pack/plugins/actions/server/authorization/actions_authorization.ts +++ b/x-pack/plugins/actions/server/authorization/actions_authorization.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaRequest } from 'src/core/server'; import { SecurityPluginSetup } from '../../../security/server'; import { ActionsAuthorizationAuditLogger } from './audit_logger'; diff --git a/x-pack/plugins/actions/server/lib/validate_with_schema.ts b/x-pack/plugins/actions/server/lib/validate_with_schema.ts index 50231f1c9a3a1..4cf5e924e3f24 100644 --- a/x-pack/plugins/actions/server/lib/validate_with_schema.ts +++ b/x-pack/plugins/actions/server/lib/validate_with_schema.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ActionType, ActionTypeConfig, ActionTypeSecrets, ActionTypeParams } from '../types'; export function validateParams< diff --git a/x-pack/plugins/actions/server/lib/verify_api_access.ts b/x-pack/plugins/actions/server/lib/verify_api_access.ts index 2055c66865c4e..ddbcaa90dcee1 100644 --- a/x-pack/plugins/actions/server/lib/verify_api_access.ts +++ b/x-pack/plugins/actions/server/lib/verify_api_access.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ILicenseState } from './license_state'; export function verifyApiAccess(licenseState: ILicenseState) { diff --git a/x-pack/plugins/alerts/server/alert_type_registry.ts b/x-pack/plugins/alerts/server/alert_type_registry.ts index 0cd218571035a..1d2d9981faeaa 100644 --- a/x-pack/plugins/alerts/server/alert_type_registry.ts +++ b/x-pack/plugins/alerts/server/alert_type_registry.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { schema } from '@kbn/config-schema'; import typeDetect from 'type-detect'; diff --git a/x-pack/plugins/alerts/server/alerts_client/alerts_client.ts b/x-pack/plugins/alerts/server/alerts_client/alerts_client.ts index 88abce7298622..a455872d23702 100644 --- a/x-pack/plugins/alerts/server/alerts_client/alerts_client.ts +++ b/x-pack/plugins/alerts/server/alerts_client/alerts_client.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { omit, isEqual, map, uniq, pick, truncate, trim } from 'lodash'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/alerts/server/authorization/alerts_authorization.ts b/x-pack/plugins/alerts/server/authorization/alerts_authorization.ts index 17691baa25af8..6814e4ac1cc1b 100644 --- a/x-pack/plugins/alerts/server/authorization/alerts_authorization.ts +++ b/x-pack/plugins/alerts/server/authorization/alerts_authorization.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { map, mapValues, fromPairs, has } from 'lodash'; import { KibanaRequest } from 'src/core/server'; import { ALERTS_FEATURE_ID } from '../../common'; diff --git a/x-pack/plugins/alerts/server/lib/license_api_access.ts b/x-pack/plugins/alerts/server/lib/license_api_access.ts index 2e650ebf5eb17..f9ef51f6b3c9a 100644 --- a/x-pack/plugins/alerts/server/lib/license_api_access.ts +++ b/x-pack/plugins/alerts/server/lib/license_api_access.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { LicenseState } from './license_state'; export function verifyApiAccess(licenseState: LicenseState) { diff --git a/x-pack/plugins/alerts/server/lib/license_state.ts b/x-pack/plugins/alerts/server/lib/license_state.ts index b3204d886960f..ead6b743f1719 100644 --- a/x-pack/plugins/alerts/server/lib/license_state.ts +++ b/x-pack/plugins/alerts/server/lib/license_state.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { assertNever } from '@kbn/std'; import { Observable, Subscription } from 'rxjs'; diff --git a/x-pack/plugins/alerts/server/lib/validate_alert_type_params.ts b/x-pack/plugins/alerts/server/lib/validate_alert_type_params.ts index b6dcb522f0925..a443143d8cbde 100644 --- a/x-pack/plugins/alerts/server/lib/validate_alert_type_params.ts +++ b/x-pack/plugins/alerts/server/lib/validate_alert_type_params.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { AlertType, AlertExecutorOptions } from '../types'; export function validateAlertTypeParams( diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts index d0673335387c6..73e590064bac0 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts @@ -7,7 +7,7 @@ import { Logger } from 'kibana/server'; import uuid from 'uuid/v4'; import { snakeCase } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ProcessorEvent } from '../../../common/processor_event'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { PromiseReturnType } from '../../../../observability/typings/common'; diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts index ead0c79a02836..88da6f619d610 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts @@ -5,7 +5,7 @@ */ import { Logger } from 'kibana/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { Setup } from '../helpers/setup_request'; import { getMlJobsWithAPMGroup } from './get_ml_jobs_with_apm_group'; diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/has_legacy_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/has_legacy_jobs.ts index c1f346aa30e1f..eca8ad273a53d 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/has_legacy_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/has_legacy_jobs.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { Setup } from '../helpers/setup_request'; import { getMlJobsWithAPMGroup } from './get_ml_jobs_with_apm_group'; diff --git a/x-pack/plugins/apm/server/lib/service_map/get_service_anomalies.ts b/x-pack/plugins/apm/server/lib/service_map/get_service_anomalies.ts index 895fc70d76af1..19864cb420b82 100644 --- a/x-pack/plugins/apm/server/lib/service_map/get_service_anomalies.ts +++ b/x-pack/plugins/apm/server/lib/service_map/get_service_anomalies.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getServiceHealthStatus } from '../../../common/service_health_status'; import { Setup, SetupTimeRange } from '../helpers/setup_request'; import { PromiseReturnType } from '../../../typings/common'; diff --git a/x-pack/plugins/apm/server/routes/create_api/index.ts b/x-pack/plugins/apm/server/routes/create_api/index.ts index 42eebc51463db..cecb4f6ed3367 100644 --- a/x-pack/plugins/apm/server/routes/create_api/index.ts +++ b/x-pack/plugins/apm/server/routes/create_api/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { pick, difference } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import * as t from 'io-ts'; import { PathReporter } from 'io-ts/lib/PathReporter'; diff --git a/x-pack/plugins/apm/server/routes/service_map.ts b/x-pack/plugins/apm/server/routes/service_map.ts index 6e86ececd1bfe..ffc8cb84b690a 100644 --- a/x-pack/plugins/apm/server/routes/service_map.ts +++ b/x-pack/plugins/apm/server/routes/service_map.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import * as t from 'io-ts'; import { invalidLicenseMessage, diff --git a/x-pack/plugins/apm/server/routes/services.ts b/x-pack/plugins/apm/server/routes/services.ts index 5673aa123b6aa..590b6c49d71bf 100644 --- a/x-pack/plugins/apm/server/routes/services.ts +++ b/x-pack/plugins/apm/server/routes/services.ts @@ -5,7 +5,7 @@ */ import * as t from 'io-ts'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { uniq } from 'lodash'; import { setupRequest } from '../lib/helpers/setup_request'; import { getServiceAgentName } from '../lib/services/get_service_agent_name'; diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration.ts index beab6b6c850e3..7ed5ef442b6fc 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration.ts @@ -5,7 +5,7 @@ */ import * as t from 'io-ts'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { setupRequest } from '../../lib/helpers/setup_request'; import { getServiceNames } from '../../lib/settings/agent_configuration/get_service_names'; import { createOrUpdateConfiguration } from '../../lib/settings/agent_configuration/create_or_update_configuration'; diff --git a/x-pack/plugins/apm/server/routes/settings/anomaly_detection.ts b/x-pack/plugins/apm/server/routes/settings/anomaly_detection.ts index f0a22356d074b..3e5a9ee725991 100644 --- a/x-pack/plugins/apm/server/routes/settings/anomaly_detection.ts +++ b/x-pack/plugins/apm/server/routes/settings/anomaly_detection.ts @@ -5,7 +5,7 @@ */ import * as t from 'io-ts'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { isActivePlatinumLicense } from '../../../common/service_map'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { createRoute } from '../create_route'; diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link.ts b/x-pack/plugins/apm/server/routes/settings/custom_link.ts index 7882383d78ab0..33769ac1d1c6f 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import * as t from 'io-ts'; import { pick } from 'lodash'; import { INVALID_LICENSE } from '../../../common/custom_link'; diff --git a/x-pack/plugins/apm/server/routes/transaction_groups.ts b/x-pack/plugins/apm/server/routes/transaction_groups.ts index 18fc73b468cd4..a3a73222210bb 100644 --- a/x-pack/plugins/apm/server/routes/transaction_groups.ts +++ b/x-pack/plugins/apm/server/routes/transaction_groups.ts @@ -5,7 +5,7 @@ */ import * as t from 'io-ts'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { setupRequest } from '../lib/helpers/setup_request'; import { getTransactionCharts } from '../lib/transactions/charts'; import { getTransactionDistribution } from '../lib/transactions/distribution'; diff --git a/x-pack/plugins/canvas/server/lib/format_response.js b/x-pack/plugins/canvas/server/lib/format_response.js index a317ca8be56f8..f313d4978d58d 100644 --- a/x-pack/plugins/canvas/server/lib/format_response.js +++ b/x-pack/plugins/canvas/server/lib/format_response.js @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import boom from 'boom'; +import boom from '@hapi/boom'; export const formatResponse = (esErrors) => (resp) => { if (resp.isBoom) { diff --git a/x-pack/plugins/canvas/server/routes/templates/list.test.ts b/x-pack/plugins/canvas/server/routes/templates/list.test.ts index 9ceab3b5c9705..72a0427306f7f 100644 --- a/x-pack/plugins/canvas/server/routes/templates/list.test.ts +++ b/x-pack/plugins/canvas/server/routes/templates/list.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { initializeListTemplates } from './list'; import { kibanaResponseFactory, RequestHandlerContext, RequestHandler } from 'src/core/server'; import { savedObjectsClientMock, httpServerMock } from 'src/core/server/mocks'; diff --git a/x-pack/plugins/case/server/client/cases/create.ts b/x-pack/plugins/case/server/client/cases/create.ts index 3379099419a75..59222be062c75 100644 --- a/x-pack/plugins/case/server/client/cases/create.ts +++ b/x-pack/plugins/case/server/client/cases/create.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/client/cases/update.ts b/x-pack/plugins/case/server/client/cases/update.ts index 424f51ee40f08..a754ce27c5e41 100644 --- a/x-pack/plugins/case/server/client/cases/update.ts +++ b/x-pack/plugins/case/server/client/cases/update.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/client/comments/add.ts b/x-pack/plugins/case/server/client/comments/add.ts index 765eb2c873765..a95b7833a5232 100644 --- a/x-pack/plugins/case/server/client/comments/add.ts +++ b/x-pack/plugins/case/server/client/comments/add.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/routes/api/cases/comments/delete_comment.ts b/x-pack/plugins/case/server/routes/api/cases/comments/delete_comment.ts index 70c0d8c2f84f9..c7770810d172f 100644 --- a/x-pack/plugins/case/server/routes/api/cases/comments/delete_comment.ts +++ b/x-pack/plugins/case/server/routes/api/cases/comments/delete_comment.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { CASE_SAVED_OBJECT } from '../../../../saved_object_types'; diff --git a/x-pack/plugins/case/server/routes/api/cases/comments/find_comments.ts b/x-pack/plugins/case/server/routes/api/cases/comments/find_comments.ts index 3df9fdb80ba8a..a4b89353ef3fe 100644 --- a/x-pack/plugins/case/server/routes/api/cases/comments/find_comments.ts +++ b/x-pack/plugins/case/server/routes/api/cases/comments/find_comments.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/case/server/routes/api/cases/comments/patch_comment.ts b/x-pack/plugins/case/server/routes/api/cases/comments/patch_comment.ts index 61d7382fca808..e75e89fa207b9 100644 --- a/x-pack/plugins/case/server/routes/api/cases/comments/patch_comment.ts +++ b/x-pack/plugins/case/server/routes/api/cases/comments/patch_comment.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/routes/api/cases/configure/get_connectors.ts b/x-pack/plugins/case/server/routes/api/cases/configure/get_connectors.ts index c3e565a404e97..547e67379ad6c 100644 --- a/x-pack/plugins/case/server/routes/api/cases/configure/get_connectors.ts +++ b/x-pack/plugins/case/server/routes/api/cases/configure/get_connectors.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { RouteDeps } from '../../types'; import { wrapError } from '../../utils'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths diff --git a/x-pack/plugins/case/server/routes/api/cases/configure/patch_configure.ts b/x-pack/plugins/case/server/routes/api/cases/configure/patch_configure.ts index d3a64559e5a2b..b3305a2c0b8e4 100644 --- a/x-pack/plugins/case/server/routes/api/cases/configure/patch_configure.ts +++ b/x-pack/plugins/case/server/routes/api/cases/configure/patch_configure.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/routes/api/cases/configure/post_configure.ts b/x-pack/plugins/case/server/routes/api/cases/configure/post_configure.ts index 48b4582b2447b..97856c84d60fc 100644 --- a/x-pack/plugins/case/server/routes/api/cases/configure/post_configure.ts +++ b/x-pack/plugins/case/server/routes/api/cases/configure/post_configure.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/routes/api/cases/find_cases.ts b/x-pack/plugins/case/server/routes/api/cases/find_cases.ts index 4cdafca1cc9e7..e70225456d5a8 100644 --- a/x-pack/plugins/case/server/routes/api/cases/find_cases.ts +++ b/x-pack/plugins/case/server/routes/api/cases/find_cases.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/case/server/routes/api/cases/push_case.ts b/x-pack/plugins/case/server/routes/api/cases/push_case.ts index 11e501bf8f71f..80b65b54468fc 100644 --- a/x-pack/plugins/case/server/routes/api/cases/push_case.ts +++ b/x-pack/plugins/case/server/routes/api/cases/push_case.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import isEmpty from 'lodash/isEmpty'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/case/server/routes/api/utils.test.ts b/x-pack/plugins/case/server/routes/api/utils.test.ts index bb38fae35ad50..00584a9d7431f 100644 --- a/x-pack/plugins/case/server/routes/api/utils.test.ts +++ b/x-pack/plugins/case/server/routes/api/utils.test.ts @@ -17,7 +17,7 @@ import { sortToSnake, } from './utils'; import { newCase } from './__mocks__/request_responses'; -import { isBoom, boomify } from 'boom'; +import { isBoom, boomify } from '@hapi/boom'; import { mockCases, mockCaseComments, diff --git a/x-pack/plugins/case/server/routes/api/utils.ts b/x-pack/plugins/case/server/routes/api/utils.ts index 90066bf29ae66..3f82dac96a70e 100644 --- a/x-pack/plugins/case/server/routes/api/utils.ts +++ b/x-pack/plugins/case/server/routes/api/utils.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import { boomify, isBoom } from 'boom'; +import { boomify, isBoom } from '@hapi/boom'; import { CustomHttpResponseOptions, ResponseError, diff --git a/x-pack/plugins/file_upload/server/client/errors.js b/x-pack/plugins/file_upload/server/client/errors.js index 0f8a0f0d8c0a9..a86edb330dec1 100644 --- a/x-pack/plugins/file_upload/server/client/errors.js +++ b/x-pack/plugins/file_upload/server/client/errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; export function wrapError(error) { return boomify(error, { statusCode: error.status }); diff --git a/x-pack/plugins/graph/server/lib/license_state.ts b/x-pack/plugins/graph/server/lib/license_state.ts index 8d64c826d8fa1..eceecdac2d7c9 100644 --- a/x-pack/plugins/graph/server/lib/license_state.ts +++ b/x-pack/plugins/graph/server/lib/license_state.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { map } from 'rxjs/operators'; import { Observable, Subscription } from 'rxjs'; import { LicensingPluginStart } from '../../../licensing/server'; diff --git a/x-pack/plugins/graph/server/routes/explore.ts b/x-pack/plugins/graph/server/routes/explore.ts index c436fbd1c79af..a1e24695413c9 100644 --- a/x-pack/plugins/graph/server/routes/explore.ts +++ b/x-pack/plugins/graph/server/routes/explore.ts @@ -6,7 +6,7 @@ import { IRouter } from 'kibana/server'; import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { get } from 'lodash'; import { LicenseState, verifyApiAccess } from '../lib/license_state'; diff --git a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts index 9dc309c605206..e0b141be3f5ef 100644 --- a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts +++ b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { INFA_ML_GET_METRICS_HOSTS_ANOMALIES_PATH, diff --git a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts index 1618018b85fcf..34a17b45ad1bd 100644 --- a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts +++ b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { INFA_ML_GET_METRICS_K8S_ANOMALIES_PATH, diff --git a/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts b/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts index 687e368736a41..8b5271cb960c1 100644 --- a/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts +++ b/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/infra/server/routes/log_alerts/chart_preview_data.ts b/x-pack/plugins/infra/server/routes/log_alerts/chart_preview_data.ts index 95389e14acdb8..ba144ef6491b2 100644 --- a/x-pack/plugins/infra/server/routes/log_alerts/chart_preview_data.ts +++ b/x-pack/plugins/infra/server/routes/log_alerts/chart_preview_data.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../lib/infra_types'; import { LOG_ALERTS_CHART_PREVIEW_DATA_PATH, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies.ts index 559609ebc7fbd..ec2bc6e5ed739 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { LOG_ANALYSIS_GET_LOG_ENTRY_ANOMALIES_PATH, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies_datasets.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies_datasets.ts index 8b36f32f318a1..9adb8e71f25e4 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies_datasets.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies_datasets.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogEntryAnomaliesDatasetsRequestPayloadRT, getLogEntryAnomaliesDatasetsSuccessReponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_categories.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_categories.ts index 2e2f2642b4a45..7071d38dffe5d 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_categories.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_categories.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogEntryCategoriesRequestPayloadRT, getLogEntryCategoriesSuccessReponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets.ts index 20d1d919b5006..fa50e4cea7365 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogEntryCategoryDatasetsRequestPayloadRT, getLogEntryCategoryDatasetsSuccessReponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets_stats.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets_stats.ts index 8414fc2062ae9..7250f6abe17b5 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets_stats.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets_stats.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLatestLogEntryCategoryDatasetsStatsRequestPayloadRT, getLatestLogEntryCategoryDatasetsStatsSuccessResponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_examples.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_examples.ts index 0c408b7fc93f7..1c0dacda61829 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_examples.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_examples.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogEntryCategoryExamplesRequestPayloadRT, getLogEntryCategoryExamplesSuccessReponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_examples.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_examples.ts index 678c9f5666fc8..f1ad852e923c2 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_examples.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_examples.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { createValidationFunction } from '../../../../common/runtime_types'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { getLogEntryExamples } from '../../../lib/log_analysis'; diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate.ts index 23d8bd30c659b..5def58505f00b 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { LOG_ANALYSIS_GET_LOG_ENTRY_RATE_PATH, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/validation/datasets.ts b/x-pack/plugins/infra/server/routes/log_analysis/validation/datasets.ts index ba83f7e3f02fa..22790f5110f14 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/validation/datasets.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/validation/datasets.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { diff --git a/x-pack/plugins/infra/server/routes/log_analysis/validation/indices.ts b/x-pack/plugins/infra/server/routes/log_analysis/validation/indices.ts index 9b8219e514c13..832d8b3e08d64 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/validation/indices.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/validation/indices.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/log_entries/highlights.ts b/x-pack/plugins/infra/server/routes/log_entries/highlights.ts index be6be88e4b5ec..cc8483fb5c658 100644 --- a/x-pack/plugins/infra/server/routes/log_entries/highlights.ts +++ b/x-pack/plugins/infra/server/routes/log_entries/highlights.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/log_entries/summary.ts b/x-pack/plugins/infra/server/routes/log_entries/summary.ts index c1d532fa5a083..f8b71b161cd6c 100644 --- a/x-pack/plugins/infra/server/routes/log_entries/summary.ts +++ b/x-pack/plugins/infra/server/routes/log_entries/summary.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/log_entries/summary_highlights.ts b/x-pack/plugins/infra/server/routes/log_entries/summary_highlights.ts index 20f572787e5a4..becf9396e8937 100644 --- a/x-pack/plugins/infra/server/routes/log_entries/summary_highlights.ts +++ b/x-pack/plugins/infra/server/routes/log_entries/summary_highlights.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/log_sources/configuration.ts b/x-pack/plugins/infra/server/routes/log_sources/configuration.ts index 46929954431f5..df2a889e5a34d 100644 --- a/x-pack/plugins/infra/server/routes/log_sources/configuration.ts +++ b/x-pack/plugins/infra/server/routes/log_sources/configuration.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogSourceConfigurationRequestParamsRT, getLogSourceConfigurationSuccessResponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_sources/status.ts b/x-pack/plugins/infra/server/routes/log_sources/status.ts index 193c3541d740b..e9466f7fa8878 100644 --- a/x-pack/plugins/infra/server/routes/log_sources/status.ts +++ b/x-pack/plugins/infra/server/routes/log_sources/status.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogSourceStatusRequestParamsRT, getLogSourceStatusSuccessResponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/metadata/index.ts b/x-pack/plugins/infra/server/routes/metadata/index.ts index ee71167b5a1c7..2ad4a1492a534 100644 --- a/x-pack/plugins/infra/server/routes/metadata/index.ts +++ b/x-pack/plugins/infra/server/routes/metadata/index.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { get } from 'lodash'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/metrics_explorer/index.ts b/x-pack/plugins/infra/server/routes/metrics_explorer/index.ts index 4b90b52cb51f6..86575a4bfb618 100644 --- a/x-pack/plugins/infra/server/routes/metrics_explorer/index.ts +++ b/x-pack/plugins/infra/server/routes/metrics_explorer/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/infra/server/routes/node_details/index.ts b/x-pack/plugins/infra/server/routes/node_details/index.ts index a457ccac2416c..008096261b082 100644 --- a/x-pack/plugins/infra/server/routes/node_details/index.ts +++ b/x-pack/plugins/infra/server/routes/node_details/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/snapshot/index.ts b/x-pack/plugins/infra/server/routes/snapshot/index.ts index 3f09ae89bc97e..0cbd2d1767e1e 100644 --- a/x-pack/plugins/infra/server/routes/snapshot/index.ts +++ b/x-pack/plugins/infra/server/routes/snapshot/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/ingest_manager/server/errors/handlers.test.ts b/x-pack/plugins/ingest_manager/server/errors/handlers.test.ts index 272d95c0b3688..4f8eff6c6c75a 100644 --- a/x-pack/plugins/ingest_manager/server/errors/handlers.test.ts +++ b/x-pack/plugins/ingest_manager/server/errors/handlers.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors } from 'elasticsearch'; import { httpServerMock } from 'src/core/server/mocks'; import { createAppContextStartContractMock } from '../mocks'; diff --git a/x-pack/plugins/ingest_manager/server/errors/handlers.ts b/x-pack/plugins/ingest_manager/server/errors/handlers.ts index ec237c4ca833b..08372571240ff 100644 --- a/x-pack/plugins/ingest_manager/server/errors/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/errors/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom, { isBoom } from 'boom'; +import Boom, { isBoom } from '@hapi/boom'; import { RequestHandlerContext, KibanaRequest, diff --git a/x-pack/plugins/ingest_manager/server/routes/package_policy/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/package_policy/handlers.ts index 9e582e6960ade..d9baeca4deb47 100644 --- a/x-pack/plugins/ingest_manager/server/routes/package_policy/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/package_policy/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { TypeOf } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { RequestHandler, SavedObjectsErrorHelpers } from '../../../../../../src/core/server'; import { appContextService, packagePolicyService } from '../../services'; import { getPackageInfo } from '../../services/epm/packages'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/acks.test.ts b/x-pack/plugins/ingest_manager/server/services/agents/acks.test.ts index 8bcf275fce6ac..4b09fb93e01a1 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/acks.test.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/acks.test.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsBulkResponse } from 'kibana/server'; import { savedObjectsClientMock } from 'src/core/server/mocks'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/acks.ts b/x-pack/plugins/ingest_manager/server/services/agents/acks.ts index a552caa12b95e..814251345788e 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/acks.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/acks.ts @@ -10,7 +10,7 @@ import { SavedObjectsBulkResponse, SavedObjectsClientContract, } from 'src/core/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import LRU from 'lru-cache'; import { Agent, diff --git a/x-pack/plugins/ingest_manager/server/services/agents/authenticate.ts b/x-pack/plugins/ingest_manager/server/services/agents/authenticate.ts index 2515a02da4e78..ce82a27a1a151 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/authenticate.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/authenticate.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaRequest, SavedObjectsClientContract } from 'src/core/server'; import { Agent } from '../../types'; import * as APIKeyService from '../api_keys'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/crud.ts b/x-pack/plugins/ingest_manager/server/services/agents/crud.ts index 90db6c4b17713..bcd409e5f7eab 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/crud.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/crud.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsClientContract } from 'src/core/server'; import { isAgentUpgradeable } from '../../../common'; import { AGENT_SAVED_OBJECT_TYPE, AGENT_EVENT_SAVED_OBJECT_TYPE } from '../../constants'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts b/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts index 3c5850c722e97..89ee0c70ba87c 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import semver from 'semver'; import { SavedObjectsClientContract } from 'src/core/server'; import { AgentType, Agent, AgentSOAttributes } from '../../types'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/reassign.ts b/x-pack/plugins/ingest_manager/server/services/agents/reassign.ts index ab671d5eebc92..b656ab12e96c8 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/reassign.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/reassign.ts @@ -5,7 +5,7 @@ */ import { SavedObjectsClientContract } from 'kibana/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { AGENT_SAVED_OBJECT_TYPE } from '../../constants'; import { AgentSOAttributes } from '../../types'; import { agentPolicyService } from '../agent_policy'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts b/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts index 3ae664c086da9..76efbd7e4b759 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObject } from 'src/core/server'; import { Agent, diff --git a/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts b/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts index ea5d25dc9884f..b9d0cf883d35c 100644 --- a/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts +++ b/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts @@ -5,7 +5,7 @@ */ import uuid from 'uuid'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsClientContract, SavedObject } from 'src/core/server'; import { EnrollmentAPIKey, EnrollmentAPIKeySOAttributes } from '../../types'; import { ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE } from '../../constants'; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/install.ts b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/install.ts index d32d5b8093c52..6a4d1ca0e1d0a 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/install.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/install.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsClientContract } from 'src/core/server'; import { RegistryDataStream, diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts index 9651eafbf1e1c..fdd6db9396da8 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts @@ -6,7 +6,7 @@ import { SavedObject, SavedObjectsClientContract } from 'src/core/server'; import semver from 'semver'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { UnwrapPromise } from '@kbn/utility-types'; import { BulkInstallPackageInfo, InstallSource } from '../../../../common'; import { PACKAGES_SAVED_OBJECT_TYPE, MAX_TIME_COMPLETE_INSTALL } from '../../../constants'; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts index 8d5995f92c95f..4b4fe9540dd95 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts @@ -5,7 +5,7 @@ */ import { SavedObjectsClientContract } from 'src/core/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { PACKAGE_POLICY_SAVED_OBJECT_TYPE, PACKAGES_SAVED_OBJECT_TYPE } from '../../../constants'; import { AssetReference, diff --git a/x-pack/plugins/ingest_manager/server/services/settings.ts b/x-pack/plugins/ingest_manager/server/services/settings.ts index 44aece1c83a18..1b82be09ee62d 100644 --- a/x-pack/plugins/ingest_manager/server/services/settings.ts +++ b/x-pack/plugins/ingest_manager/server/services/settings.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsClientContract } from 'kibana/server'; import url from 'url'; import { diff --git a/x-pack/plugins/lens/server/routes/existing_fields.ts b/x-pack/plugins/lens/server/routes/existing_fields.ts index d3b2314a199cb..844c7b16e1eaa 100644 --- a/x-pack/plugins/lens/server/routes/existing_fields.ts +++ b/x-pack/plugins/lens/server/routes/existing_fields.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { ILegacyScopedClusterClient, SavedObject, RequestHandlerContext } from 'src/core/server'; import { CoreSetup, Logger } from 'src/core/server'; diff --git a/x-pack/plugins/lens/server/routes/field_stats.ts b/x-pack/plugins/lens/server/routes/field_stats.ts index a7368a12f0e2c..a884aeffa6134 100644 --- a/x-pack/plugins/lens/server/routes/field_stats.ts +++ b/x-pack/plugins/lens/server/routes/field_stats.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import DateMath from '@elastic/datemath'; import { schema } from '@kbn/config-schema'; import { CoreSetup } from 'src/core/server'; diff --git a/x-pack/plugins/lens/server/routes/telemetry.ts b/x-pack/plugins/lens/server/routes/telemetry.ts index 06a7091104871..306c631cd78a7 100644 --- a/x-pack/plugins/lens/server/routes/telemetry.ts +++ b/x-pack/plugins/lens/server/routes/telemetry.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { CoreSetup } from 'src/core/server'; import { schema } from '@kbn/config-schema'; import { BASE_API_URL } from '../../common'; diff --git a/x-pack/plugins/logstash/server/models/pipeline/pipeline.ts b/x-pack/plugins/logstash/server/models/pipeline/pipeline.ts index 0b7c3888b6f03..66aac63811050 100755 --- a/x-pack/plugins/logstash/server/models/pipeline/pipeline.ts +++ b/x-pack/plugins/logstash/server/models/pipeline/pipeline.ts @@ -5,7 +5,7 @@ */ import moment from 'moment'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { get } from 'lodash'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/ml/common/types/data_frame_analytics.ts b/x-pack/plugins/ml/common/types/data_frame_analytics.ts index cbf2acd152476..8874b0f7e111a 100644 --- a/x-pack/plugins/ml/common/types/data_frame_analytics.ts +++ b/x-pack/plugins/ml/common/types/data_frame_analytics.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { EsErrorBody } from '../util/errors'; import { ANALYSIS_CONFIG_TYPE } from '../constants/data_frame_analytics'; diff --git a/x-pack/plugins/ml/common/util/errors/errors.test.ts b/x-pack/plugins/ml/common/util/errors/errors.test.ts index ddaf0b04dd12b..166264ebddee1 100644 --- a/x-pack/plugins/ml/common/util/errors/errors.test.ts +++ b/x-pack/plugins/ml/common/util/errors/errors.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { extractErrorMessage, MLHttpFetchError, MLResponseError, EsErrorBody } from './index'; diff --git a/x-pack/plugins/ml/common/util/errors/types.ts b/x-pack/plugins/ml/common/util/errors/types.ts index fec35141f1b5a..667e6e34a5640 100644 --- a/x-pack/plugins/ml/common/util/errors/types.ts +++ b/x-pack/plugins/ml/common/util/errors/types.ts @@ -5,7 +5,7 @@ */ import { HttpFetchError } from 'kibana/public'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; export interface EsErrorRootCause { type: string; diff --git a/x-pack/plugins/ml/server/client/error_wrapper.ts b/x-pack/plugins/ml/server/client/error_wrapper.ts index c635eb74e1f19..e2e97e3a87696 100644 --- a/x-pack/plugins/ml/server/client/error_wrapper.ts +++ b/x-pack/plugins/ml/server/client/error_wrapper.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify, isBoom } from 'boom'; +import { boomify, isBoom } from '@hapi/boom'; import { ResponseError, CustomHttpResponseOptions } from 'kibana/server'; export function wrapError(error: any): CustomHttpResponseOptions { diff --git a/x-pack/plugins/ml/server/client/errors.js b/x-pack/plugins/ml/server/client/errors.js index 0f8a0f0d8c0a9..a86edb330dec1 100644 --- a/x-pack/plugins/ml/server/client/errors.js +++ b/x-pack/plugins/ml/server/client/errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; export function wrapError(error) { return boomify(error, { statusCode: error.status }); diff --git a/x-pack/plugins/ml/server/models/annotation_service/annotation.ts b/x-pack/plugins/ml/server/models/annotation_service/annotation.ts index d45532e956f42..adcf93a6f11ec 100644 --- a/x-pack/plugins/ml/server/models/annotation_service/annotation.ts +++ b/x-pack/plugins/ml/server/models/annotation_service/annotation.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { each, get } from 'lodash'; import { IScopedClusterClient } from 'kibana/server'; diff --git a/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts b/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts index 96be6db03c52b..2c08005cecc09 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts +++ b/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts @@ -5,7 +5,7 @@ */ import fs from 'fs'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import numeral from '@elastic/numeral'; import { KibanaRequest, IScopedClusterClient, SavedObjectsClientContract } from 'kibana/server'; import moment from 'moment'; diff --git a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts index 68427e98750eb..ed8d3f48e387c 100644 --- a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts +++ b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { duration } from 'moment'; import { parseInterval } from '../../../common/util/parse_interval'; diff --git a/x-pack/plugins/ml/server/models/filter/filter_manager.ts b/x-pack/plugins/ml/server/models/filter/filter_manager.ts index 19ba1b76f8a60..de174420d2535 100644 --- a/x-pack/plugins/ml/server/models/filter/filter_manager.ts +++ b/x-pack/plugins/ml/server/models/filter/filter_manager.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { DetectorRule, DetectorRuleScope } from '../../../common/types/detector_rules'; diff --git a/x-pack/plugins/ml/server/models/job_service/jobs.ts b/x-pack/plugins/ml/server/models/job_service/jobs.ts index 822aa4671302e..3209d5748cfd7 100644 --- a/x-pack/plugins/ml/server/models/job_service/jobs.ts +++ b/x-pack/plugins/ml/server/models/job_service/jobs.ts @@ -6,7 +6,7 @@ import { i18n } from '@kbn/i18n'; import { uniq } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { parseTimeIntervalForJob } from '../../../common/util/job_utils'; import { JOB_STATE, DATAFEED_STATE } from '../../../common/constants/states'; diff --git a/x-pack/plugins/ml/server/models/job_service/model_snapshots.ts b/x-pack/plugins/ml/server/models/job_service/model_snapshots.ts index 34206a68ffeb9..5b7f4bd8516ed 100644 --- a/x-pack/plugins/ml/server/models/job_service/model_snapshots.ts +++ b/x-pack/plugins/ml/server/models/job_service/model_snapshots.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { IScopedClusterClient } from 'kibana/server'; import { ModelSnapshot } from '../../../common/types/anomaly_detection_jobs'; diff --git a/x-pack/plugins/ml/server/models/job_validation/job_validation.ts b/x-pack/plugins/ml/server/models/job_validation/job_validation.ts index 9e272f1f770fc..243439115e712 100644 --- a/x-pack/plugins/ml/server/models/job_validation/job_validation.ts +++ b/x-pack/plugins/ml/server/models/job_validation/job_validation.ts @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; import { fieldsServiceProvider } from '../fields_service'; diff --git a/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts b/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts index 76dc68d2b59e3..eb2c6b461a9df 100644 --- a/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts +++ b/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { PARTITION_FIELDS } from '../../../common/constants/anomalies'; import { PartitionFieldsType } from '../../../common/types/anomalies'; diff --git a/x-pack/plugins/ml/server/models/results_service/results_service.ts b/x-pack/plugins/ml/server/models/results_service/results_service.ts index abb42a5a18689..4a4ab73b5ef3a 100644 --- a/x-pack/plugins/ml/server/models/results_service/results_service.ts +++ b/x-pack/plugins/ml/server/models/results_service/results_service.ts @@ -8,7 +8,7 @@ import { sortBy, slice, get } from 'lodash'; import moment from 'moment'; import { SearchResponse } from 'elasticsearch'; import { IScopedClusterClient } from 'kibana/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { buildAnomalyTableItems } from './build_anomaly_table_items'; import { ML_RESULTS_INDEX_PATTERN } from '../../../common/constants/index_patterns'; import { ANOMALIES_TABLE_DEFAULT_QUERY_SIZE } from '../../../common/constants/search'; diff --git a/x-pack/plugins/ml/server/routes/annotations.ts b/x-pack/plugins/ml/server/routes/annotations.ts index 5c4b36164fbb0..05d0624deba59 100644 --- a/x-pack/plugins/ml/server/routes/annotations.ts +++ b/x-pack/plugins/ml/server/routes/annotations.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { SecurityPluginSetup } from '../../../security/server'; diff --git a/x-pack/plugins/ml/server/routes/job_validation.ts b/x-pack/plugins/ml/server/routes/job_validation.ts index b52043595327b..2958b0bc41c24 100644 --- a/x-pack/plugins/ml/server/routes/job_validation.ts +++ b/x-pack/plugins/ml/server/routes/job_validation.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; import { AnalysisConfig } from '../../common/types/anomaly_detection_jobs'; diff --git a/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js b/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js index 8902460507eb0..22700bf3fb5a8 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { boomify, forbidden } from 'boom'; +import { boomify, forbidden } from '@hapi/boom'; import { renderWithIntl } from 'test_utils/enzyme_helpers'; import { CheckerErrors } from '../checker_errors'; diff --git a/x-pack/plugins/monitoring/public/lib/elasticsearch_settings/__tests__/enabler.test.js b/x-pack/plugins/monitoring/public/lib/elasticsearch_settings/__tests__/enabler.test.js index 06db546581700..70fc8e405f904 100644 --- a/x-pack/plugins/monitoring/public/lib/elasticsearch_settings/__tests__/enabler.test.js +++ b/x-pack/plugins/monitoring/public/lib/elasticsearch_settings/__tests__/enabler.test.js @@ -6,7 +6,7 @@ import { Enabler } from '../'; import sinon from 'sinon'; -import { forbidden } from 'boom'; +import { forbidden } from '@hapi/boom'; const updateModel = (properties) => properties; const updateModelSpy = sinon.spy(updateModel); diff --git a/x-pack/plugins/monitoring/server/lib/cluster/get_cluster_stats.js b/x-pack/plugins/monitoring/server/lib/cluster/get_cluster_stats.js index fa0dff9c09431..ea4eb36964b5c 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/get_cluster_stats.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/get_cluster_stats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest, notFound } from 'boom'; +import { badRequest, notFound } from '@hapi/boom'; import { getClustersStats } from './get_clusters_stats'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js index e91679eff2817..ddc33a4b93730 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { notFound } from 'boom'; +import { notFound } from '@hapi/boom'; import { set } from '@elastic/safer-lodash-set'; import { findIndex } from 'lodash'; import { getClustersStats } from './get_clusters_stats'; diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_monitoring_auth.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_monitoring_auth.js index 6d2a853ee24d2..8d774b752b5c0 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_monitoring_auth.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_monitoring_auth.js @@ -5,7 +5,7 @@ */ import { get } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { INDEX_PATTERN } from '../../../common/constants'; /* diff --git a/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js b/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js index df10624999afd..677b395caedd4 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js +++ b/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { errors } from 'elasticsearch'; -import { forbidden, unauthorized } from 'boom'; +import { forbidden, unauthorized } from '@hapi/boom'; import { isAuthError, handleAuthError } from '../auth_errors'; describe('Error handling for 401/403 errors', () => { diff --git a/x-pack/plugins/monitoring/server/lib/errors/auth_errors.js b/x-pack/plugins/monitoring/server/lib/errors/auth_errors.js index b0c4d35a5b095..96535ac6d5311 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/auth_errors.js +++ b/x-pack/plugins/monitoring/server/lib/errors/auth_errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { forbidden } from 'boom'; +import { forbidden } from '@hapi/boom'; import { i18n } from '@kbn/i18n'; const getStatusCode = (err) => { diff --git a/x-pack/plugins/monitoring/server/lib/errors/handle_error.js b/x-pack/plugins/monitoring/server/lib/errors/handle_error.js index 4726020210ce7..6e7dca15a392c 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/handle_error.js +++ b/x-pack/plugins/monitoring/server/lib/errors/handle_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; import { isKnownError, handleKnownError } from './known_errors'; import { isAuthError, handleAuthError } from './auth_errors'; diff --git a/x-pack/plugins/monitoring/server/lib/errors/handle_settings_error.js b/x-pack/plugins/monitoring/server/lib/errors/handle_settings_error.js index 54c0c39d0b396..dfe5f1c4a614f 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/handle_settings_error.js +++ b/x-pack/plugins/monitoring/server/lib/errors/handle_settings_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; export function handleSettingsError(err) { return boomify(err, { statusCode: err.statusCode }); diff --git a/x-pack/plugins/monitoring/server/lib/errors/known_errors.js b/x-pack/plugins/monitoring/server/lib/errors/known_errors.js index 17bcdd0414adf..fb62dc7261057 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/known_errors.js +++ b/x-pack/plugins/monitoring/server/lib/errors/known_errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { MonitoringLicenseError } from './custom_errors'; diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js index a2665aeb041f8..2977159f4206d 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import boom from 'boom'; +import boom from '@hapi/boom'; import { get } from 'lodash'; import { checkParam } from '../error_missing_required'; import { getPipelineStateDocument } from './get_pipeline_state_document'; diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js index 295d86c52b801..cdbe26d993f75 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import boom from 'boom'; +import boom from '@hapi/boom'; import { get } from 'lodash'; import { checkParam } from '../error_missing_required'; import { getPipelineStateDocument } from './get_pipeline_state_document'; diff --git a/x-pack/plugins/monitoring/server/plugin.ts b/x-pack/plugins/monitoring/server/plugin.ts index 6093eacffe9b7..56368a5ece10a 100644 --- a/x-pack/plugins/monitoring/server/plugin.ts +++ b/x-pack/plugins/monitoring/server/plugin.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { combineLatest } from 'rxjs'; import { first, map } from 'rxjs/operators'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/observability/server/lib/annotations/create_annotations_client.ts b/x-pack/plugins/observability/server/lib/annotations/create_annotations_client.ts index 1fb5211a71bcd..41f45683d244c 100644 --- a/x-pack/plugins/observability/server/lib/annotations/create_annotations_client.ts +++ b/x-pack/plugins/observability/server/lib/annotations/create_annotations_client.ts @@ -7,7 +7,7 @@ import { LegacyAPICaller, Logger } from 'kibana/server'; import * as t from 'io-ts'; import { Client } from 'elasticsearch'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ILicense } from '../../../../licensing/server'; import { createAnnotationRt, diff --git a/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts b/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts index 910f9e69ea80c..e30cd80bec227 100644 --- a/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts +++ b/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { kibanaResponseFactory } from '../../../../../../src/core/server'; import { register } from './get_route'; diff --git a/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/create_job.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/create_job.ts index c780247dd61b3..96653b1573662 100644 --- a/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/create_job.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/create_job.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { notFound, notImplemented } from 'boom'; +import { notFound, notImplemented } from '@hapi/boom'; import { get } from 'lodash'; import { RequestHandlerContext } from 'src/core/server'; import { CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../common/constants'; diff --git a/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/lib/get_filters.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/lib/get_filters.ts index 8827a30d370d4..3680fdc54ebe9 100644 --- a/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/lib/get_filters.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/lib/get_filters.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import moment from 'moment-timezone'; import { TimeRangeParams } from '../../common'; import { Filter, QueryFilter, SavedSearchObjectAttributes, SearchSourceFilter } from '../types'; diff --git a/x-pack/plugins/reporting/server/routes/generation.ts b/x-pack/plugins/reporting/server/routes/generation.ts index b2115076aada4..ba69b97bee7f1 100644 --- a/x-pack/plugins/reporting/server/routes/generation.ts +++ b/x-pack/plugins/reporting/server/routes/generation.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors as elasticsearchErrors } from 'elasticsearch'; import { kibanaResponseFactory } from 'src/core/server'; import { ReportingCore } from '../'; diff --git a/x-pack/plugins/reporting/server/routes/jobs.ts b/x-pack/plugins/reporting/server/routes/jobs.ts index 43e73c137fb13..3f067fdec9b0b 100644 --- a/x-pack/plugins/reporting/server/routes/jobs.ts +++ b/x-pack/plugins/reporting/server/routes/jobs.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ReportingCore } from '../'; import { API_BASE_URL } from '../../common/constants'; import { authorizedUserPreRoutingFactory } from './lib/authorized_user_pre_routing'; diff --git a/x-pack/plugins/security/server/authentication/authentication_result.test.ts b/x-pack/plugins/security/server/authentication/authentication_result.test.ts index fd875a7e029d2..8460df6f5de95 100644 --- a/x-pack/plugins/security/server/authentication/authentication_result.test.ts +++ b/x-pack/plugins/security/server/authentication/authentication_result.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { mockAuthenticatedUser } from '../../common/model/authenticated_user.mock'; import { AuthenticationResult } from './authentication_result'; diff --git a/x-pack/plugins/security/server/authentication/authenticator.test.ts b/x-pack/plugins/security/server/authentication/authenticator.test.ts index 51c937f1edcb5..16cb51cbfccf5 100644 --- a/x-pack/plugins/security/server/authentication/authenticator.test.ts +++ b/x-pack/plugins/security/server/authentication/authenticator.test.ts @@ -9,7 +9,7 @@ jest.mock('./providers/token'); jest.mock('./providers/saml'); jest.mock('./providers/http'); -import Boom from 'boom'; +import Boom from '@hapi/boom'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { loggingSystemMock, diff --git a/x-pack/plugins/security/server/authentication/index.test.ts b/x-pack/plugins/security/server/authentication/index.test.ts index b5ce5283df8ce..3d2d26550215c 100644 --- a/x-pack/plugins/security/server/authentication/index.test.ts +++ b/x-pack/plugins/security/server/authentication/index.test.ts @@ -7,7 +7,7 @@ jest.mock('./api_keys'); jest.mock('./authenticator'); -import Boom from 'boom'; +import Boom from '@hapi/boom'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { diff --git a/x-pack/plugins/security/server/authentication/providers/kerberos.test.ts b/x-pack/plugins/security/server/authentication/providers/kerberos.test.ts index 839b5c991f09b..ee89af10cbeba 100644 --- a/x-pack/plugins/security/server/authentication/providers/kerberos.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/kerberos.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors } from 'elasticsearch'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; diff --git a/x-pack/plugins/security/server/authentication/providers/kerberos.ts b/x-pack/plugins/security/server/authentication/providers/kerberos.ts index d7de71f4da9ed..34ed9ac920e93 100644 --- a/x-pack/plugins/security/server/authentication/providers/kerberos.ts +++ b/x-pack/plugins/security/server/authentication/providers/kerberos.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { LegacyElasticsearchError, LegacyElasticsearchErrorHelpers, diff --git a/x-pack/plugins/security/server/authentication/providers/oidc.test.ts b/x-pack/plugins/security/server/authentication/providers/oidc.test.ts index 81e9ecb8a377b..fe46b159833bc 100644 --- a/x-pack/plugins/security/server/authentication/providers/oidc.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/oidc.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; import { mockAuthenticatedUser } from '../../../common/model/authenticated_user.mock'; diff --git a/x-pack/plugins/security/server/authentication/providers/oidc.ts b/x-pack/plugins/security/server/authentication/providers/oidc.ts index 9570c59f8ea1d..eede9f334a5a1 100644 --- a/x-pack/plugins/security/server/authentication/providers/oidc.ts +++ b/x-pack/plugins/security/server/authentication/providers/oidc.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import type from 'type-detect'; import { KibanaRequest } from '../../../../../../src/core/server'; import { AuthenticatedUser } from '../../../common/model'; diff --git a/x-pack/plugins/security/server/authentication/providers/pki.test.ts b/x-pack/plugins/security/server/authentication/providers/pki.test.ts index 053d20e37b39e..7e76f4c81998d 100644 --- a/x-pack/plugins/security/server/authentication/providers/pki.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/pki.test.ts @@ -9,7 +9,7 @@ jest.mock('tls'); import { Socket } from 'net'; import { PeerCertificate, TLSSocket } from 'tls'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors } from 'elasticsearch'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; diff --git a/x-pack/plugins/security/server/authentication/providers/pki.ts b/x-pack/plugins/security/server/authentication/providers/pki.ts index 6dcb448e08150..9214a025484fe 100644 --- a/x-pack/plugins/security/server/authentication/providers/pki.ts +++ b/x-pack/plugins/security/server/authentication/providers/pki.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { DetailedPeerCertificate } from 'tls'; import { KibanaRequest } from '../../../../../../src/core/server'; import { AuthenticationResult } from '../authentication_result'; diff --git a/x-pack/plugins/security/server/authentication/providers/saml.test.ts b/x-pack/plugins/security/server/authentication/providers/saml.test.ts index 75eb7ae93f360..d160b79bf659d 100644 --- a/x-pack/plugins/security/server/authentication/providers/saml.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/saml.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; import { mockAuthenticatedUser } from '../../../common/model/authenticated_user.mock'; diff --git a/x-pack/plugins/security/server/authentication/providers/saml.ts b/x-pack/plugins/security/server/authentication/providers/saml.ts index 59a1782c1f1fd..54619c851470a 100644 --- a/x-pack/plugins/security/server/authentication/providers/saml.ts +++ b/x-pack/plugins/security/server/authentication/providers/saml.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaRequest } from '../../../../../../src/core/server'; import { AuthenticatedUser } from '../../../common/model'; import { isInternalURL } from '../../../common/is_internal_url'; diff --git a/x-pack/plugins/security/server/authentication/providers/token.test.ts b/x-pack/plugins/security/server/authentication/providers/token.test.ts index ffb1c89b24e47..8cd11bce98269 100644 --- a/x-pack/plugins/security/server/authentication/providers/token.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/token.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors } from 'elasticsearch'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; diff --git a/x-pack/plugins/security/server/authentication/providers/token.ts b/x-pack/plugins/security/server/authentication/providers/token.ts index 7dace488bc95a..f919c20c15225 100644 --- a/x-pack/plugins/security/server/authentication/providers/token.ts +++ b/x-pack/plugins/security/server/authentication/providers/token.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaRequest } from '../../../../../../src/core/server'; import { AuthenticationResult } from '../authentication_result'; import { DeauthenticationResult } from '../deauthentication_result'; diff --git a/x-pack/plugins/security/server/errors.test.ts b/x-pack/plugins/security/server/errors.test.ts index 7c4668b245b0e..630ab5b9295db 100644 --- a/x-pack/plugins/security/server/errors.test.ts +++ b/x-pack/plugins/security/server/errors.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors as esErrors } from 'elasticsearch'; import * as errors from './errors'; diff --git a/x-pack/plugins/security/server/errors.ts b/x-pack/plugins/security/server/errors.ts index b5f3667558f55..9c177c3916faf 100644 --- a/x-pack/plugins/security/server/errors.ts +++ b/x-pack/plugins/security/server/errors.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { CustomHttpResponseOptions, ResponseError } from '../../../../src/core/server'; export function wrapError(error: any) { diff --git a/x-pack/plugins/security/server/routes/api_keys/enabled.test.ts b/x-pack/plugins/security/server/routes/api_keys/enabled.test.ts index 3c6dc3c0d7bda..7968402cd2176 100644 --- a/x-pack/plugins/security/server/routes/api_keys/enabled.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/enabled.test.ts @@ -9,7 +9,7 @@ import { LicenseCheck } from '../../../../licensing/server'; import { httpServerMock } from '../../../../../../src/core/server/mocks'; import { routeDefinitionParamsMock } from '../index.mock'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { defineEnabledApiKeysRoutes } from './enabled'; import { APIKeys } from '../../authentication/api_keys'; diff --git a/x-pack/plugins/security/server/routes/api_keys/get.test.ts b/x-pack/plugins/security/server/routes/api_keys/get.test.ts index 40065e757e999..cb991fb2f5aac 100644 --- a/x-pack/plugins/security/server/routes/api_keys/get.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/get.test.ts @@ -10,7 +10,7 @@ import { defineGetApiKeysRoutes } from './get'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; import { routeDefinitionParamsMock } from '../index.mock'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; interface TestOptions { isAdmin?: boolean; diff --git a/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts b/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts index 33c52688ce8e3..88e52f735395d 100644 --- a/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { Type } from '@kbn/config-schema'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; import { LicenseCheck } from '../../../../licensing/server'; diff --git a/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts b/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts index a506cc6306c53..ecc3d32e20aec 100644 --- a/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { LicenseCheck } from '../../../../licensing/server'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; diff --git a/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts index 399f79f44744d..9f5ec635f56cd 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; import { LicenseCheck } from '../../../../../licensing/server'; import { defineDeleteRolesRoutes } from './delete'; diff --git a/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts index d9062bcfa2efe..b25b13b9fc04a 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; import { LicenseCheck } from '../../../../../licensing/server'; import { defineGetRolesRoutes } from './get'; diff --git a/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts index 66e8086d49c66..30e0c52c4c443 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; import { LicenseCheck } from '../../../../../licensing/server'; import { defineGetAllRolesRoutes } from './get_all'; diff --git a/x-pack/plugins/security/server/routes/role_mapping/get.test.ts b/x-pack/plugins/security/server/routes/role_mapping/get.test.ts index 9af7268a57f9c..2519034b386bf 100644 --- a/x-pack/plugins/security/server/routes/role_mapping/get.test.ts +++ b/x-pack/plugins/security/server/routes/role_mapping/get.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { routeDefinitionParamsMock } from '../index.mock'; import { elasticsearchServiceMock, httpServerMock } from 'src/core/server/mocks'; import { defineRoleMappingGetRoutes } from './get'; diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts index c8e0292e8d93a..194f0a1c2e7c5 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { RequestHandlerContext, Logger, RequestHandler } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; import { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts index 977dad680f8a4..25e47b38e8a56 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsFindResponse } from 'kibana/server'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts index 72be7a3c0fa08..6a304a207d000 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import Joi from 'joi'; import { has, snakeCase } from 'lodash/fp'; import { SanitizedAlert } from '../../../../../alerts/common'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx index e214db22aa9cc..f484b738bd222 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import React from 'react'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { mountWithIntl, nextTick } from 'test_utils/enzyme_helpers'; import { CopySavedObjectsToSpaceFlyout } from './copy_to_space_flyout'; import { CopyToSpaceForm } from './copy_to_space_form'; diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.test.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.test.tsx index ad49161ddd705..0c9f4847a4952 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.test.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.test.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import React from 'react'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { mountWithIntl, nextTick } from 'test_utils/enzyme_helpers'; import { ShareSavedObjectsToSpaceFlyout } from './share_to_space_flyout'; import { ShareToSpaceForm } from './share_to_space_form'; diff --git a/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts b/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts index 4913a0ae988e9..764ae5a87ec0e 100644 --- a/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts +++ b/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom, { Payload } from 'boom'; +import Boom, { Payload } from '@hapi/boom'; import { SavedObjectsImportError } from 'src/core/server'; export const createEmptyFailureResponse = (errors?: Array) => { diff --git a/x-pack/plugins/spaces/server/lib/copy_to_spaces/types.ts b/x-pack/plugins/spaces/server/lib/copy_to_spaces/types.ts index 8d4169f972795..d774231d3eb48 100644 --- a/x-pack/plugins/spaces/server/lib/copy_to_spaces/types.ts +++ b/x-pack/plugins/spaces/server/lib/copy_to_spaces/types.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Payload } from 'boom'; +import { Payload } from '@hapi/boom'; import { SavedObjectsImportSuccess, SavedObjectsImportError, diff --git a/x-pack/plugins/spaces/server/lib/errors.ts b/x-pack/plugins/spaces/server/lib/errors.ts index d800020038a38..13a5c2440877a 100644 --- a/x-pack/plugins/spaces/server/lib/errors.ts +++ b/x-pack/plugins/spaces/server/lib/errors.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify, isBoom } from 'boom'; +import { boomify, isBoom } from '@hapi/boom'; import { ResponseError, CustomHttpResponseOptions } from 'src/core/server'; export function wrapError(error: any): CustomHttpResponseOptions { diff --git a/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts b/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts index fe1acd93570f6..89371259ae04c 100644 --- a/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts +++ b/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import * as Rx from 'rxjs'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { Legacy } from 'kibana'; // @ts-ignore import { kibanaTestUser } from '@kbn/test'; diff --git a/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts b/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts index 50e7182b76686..a054ff773be4d 100644 --- a/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts +++ b/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { omit } from 'lodash'; import { KibanaRequest } from 'src/core/server'; import { SecurityPluginSetup } from '../../../../security/server'; diff --git a/x-pack/plugins/spaces/server/routes/api/external/delete.ts b/x-pack/plugins/spaces/server/routes/api/external/delete.ts index 150f1d198cdf6..81e643bf5ede8 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/delete.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/delete.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { SavedObjectsErrorHelpers } from '../../../../../../../src/core/server'; import { wrapError } from '../../../lib/errors'; diff --git a/x-pack/plugins/spaces/server/routes/api/external/post.ts b/x-pack/plugins/spaces/server/routes/api/external/post.ts index 61f90adb300ab..0c77bcc74bb50 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/post.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/post.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsErrorHelpers } from '../../../../../../../src/core/server'; import { wrapError } from '../../../lib/errors'; import { spaceSchema } from '../../../lib/space_schema'; diff --git a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts index f7621f11a1c05..254cf3817ca48 100644 --- a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts +++ b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts @@ -11,7 +11,7 @@ import { savedObjectsClientMock } from '../../../../../src/core/server/mocks'; import { SavedObjectTypeRegistry } from 'src/core/server'; import { SpacesClient } from '../lib/spaces_client'; import { spacesClientMock } from '../lib/spaces_client/spaces_client.mock'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; const typeRegistry = new SavedObjectTypeRegistry(); typeRegistry.registerType({ diff --git a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.ts b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.ts index 4c8e93acd68ac..e96ae49b41679 100644 --- a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.ts +++ b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsBaseOptions, SavedObjectsBulkCreateObject, diff --git a/x-pack/plugins/transform/server/routes/api/error_utils.ts b/x-pack/plugins/transform/server/routes/api/error_utils.ts index ef5927651df88..cf388f3c8ca08 100644 --- a/x-pack/plugins/transform/server/routes/api/error_utils.ts +++ b/x-pack/plugins/transform/server/routes/api/error_utils.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/watcher/server/models/action_status/action_status.js b/x-pack/plugins/watcher/server/models/action_status/action_status.js index 2348ab37b3d2b..b747e5b86cfa6 100644 --- a/x-pack/plugins/watcher/server/models/action_status/action_status.js +++ b/x-pack/plugins/watcher/server/models/action_status/action_status.js @@ -5,7 +5,7 @@ */ import { get } from 'lodash'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { getMoment } from '../../../common/lib/get_moment'; import { ACTION_STATES } from '../../../common/constants'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/watcher/server/models/fields/fields.js b/x-pack/plugins/watcher/server/models/fields/fields.js index cd28b49166383..e0ec9bc6e620d 100644 --- a/x-pack/plugins/watcher/server/models/fields/fields.js +++ b/x-pack/plugins/watcher/server/models/fields/fields.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { forEach, keys, sortBy } from 'lodash'; import { normalizedFieldTypes } from '../../lib/normalized_field_types'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/watcher/server/models/watch/base_watch.js b/x-pack/plugins/watcher/server/models/watch/base_watch.js index 7dbc8458eb062..204d470ce2330 100644 --- a/x-pack/plugins/watcher/server/models/watch/base_watch.js +++ b/x-pack/plugins/watcher/server/models/watch/base_watch.js @@ -5,7 +5,7 @@ */ import { get, map, pick } from 'lodash'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { Action } from '../../../common/models/action'; import { WatchStatus } from '../watch_status'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/watcher/server/models/watch/monitoring_watch.js b/x-pack/plugins/watcher/server/models/watch/monitoring_watch.js index 8f32621bfbb86..769f86e925559 100644 --- a/x-pack/plugins/watcher/server/models/watch/monitoring_watch.js +++ b/x-pack/plugins/watcher/server/models/watch/monitoring_watch.js @@ -5,7 +5,7 @@ */ import { merge } from 'lodash'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { BaseWatch } from './base_watch'; import { WATCH_TYPES } from '../../../common/constants'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/watcher/server/models/watch/watch.js b/x-pack/plugins/watcher/server/models/watch/watch.js index 4e7ecf7feae09..ee30efa66faa9 100644 --- a/x-pack/plugins/watcher/server/models/watch/watch.js +++ b/x-pack/plugins/watcher/server/models/watch/watch.js @@ -5,7 +5,7 @@ */ import { set } from '@elastic/safer-lodash-set'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { WATCH_TYPES } from '../../../common/constants'; import { JsonWatch } from './json_watch'; import { MonitoringWatch } from './monitoring_watch'; diff --git a/x-pack/plugins/watcher/server/models/watch_history_item/watch_history_item.js b/x-pack/plugins/watcher/server/models/watch_history_item/watch_history_item.js index 134b201628195..5b19c9afcd1b2 100644 --- a/x-pack/plugins/watcher/server/models/watch_history_item/watch_history_item.js +++ b/x-pack/plugins/watcher/server/models/watch_history_item/watch_history_item.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { getMoment } from '../../../common/lib/get_moment'; import { get, cloneDeep } from 'lodash'; import { WatchStatus } from '../watch_status'; diff --git a/x-pack/plugins/watcher/server/models/watch_status/watch_status.js b/x-pack/plugins/watcher/server/models/watch_status/watch_status.js index 30d6e72a9645d..e5dd7d8ef186c 100644 --- a/x-pack/plugins/watcher/server/models/watch_status/watch_status.js +++ b/x-pack/plugins/watcher/server/models/watch_status/watch_status.js @@ -5,7 +5,7 @@ */ import { get, map, forEach, max } from 'lodash'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { getMoment } from '../../../common/lib/get_moment'; import { ActionStatus } from '../action_status'; import { ACTION_STATES, WATCH_STATES, WATCH_STATE_COMMENTS } from '../../../common/constants'; diff --git a/yarn.lock b/yarn.lock index 7b34b8181c541..49e008d1e6f81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1532,7 +1532,7 @@ dependencies: "@hapi/hoek" "8.x.x" -"@hapi/boom@7.x.x": +"@hapi/boom@7.x.x", "@hapi/boom@^7.4.11": version "7.4.11" resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-7.4.11.tgz#37af8417eb9416aef3367aa60fa04a1a9f1fc262" integrity sha512-VSU/Cnj1DXouukYxxkes4nNJonCnlogHvIff1v1RVoN4xzkKhMXX+GRmb3NyH1iar10I9WFPDv2JPwfH3GaV0A== @@ -3954,7 +3954,7 @@ resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.30.tgz#ee034a0eeea8b84ed868b1aa60d690b08a6cfbc5" integrity sha512-8LhzvcjIoqoi1TghEkRMkbbmM+jhHnBokPGkJWjclMK+Ks0MxEBow3/p2/iFTZ+OIbJHQDSfpgdZEb+af3gfVw== -"@types/boom@*", "@types/boom@^7.2.0": +"@types/boom@*": version "7.2.0" resolved "https://registry.yarnpkg.com/@types/boom/-/boom-7.2.0.tgz#19c36cbb5811a7493f0f2e37f31d42b28df1abc1" integrity sha512-HonbGsHFbskh9zRAzA6tabcw18mCOsSEOL2ibGAuVqk6e7nElcRmWO5L4UfIHpDbWBWw+eZYFdsQ1+MEGgpcVA== @@ -4309,10 +4309,10 @@ "@types/podium" "*" "@types/shot" "*" -"@types/hapi__boom@*": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@types/hapi__boom/-/hapi__boom-7.4.0.tgz#81d58cffb67c54896614560c007a5015a79c30ba" - integrity sha512-i4nerd/aJd5zW8OPHxgeuDYiuiuHxHczkqIaALhINUqBCavRgbiwjfndpgrarB43jcb/2LxzrohMOH7akyt3og== +"@types/hapi__boom@*", "@types/hapi__boom@^7.4.1": + version "7.4.1" + resolved "https://registry.yarnpkg.com/@types/hapi__boom/-/hapi__boom-7.4.1.tgz#06439d7637245dcbe6dd6548d2a91f2c1243d80b" + integrity sha512-x/ZK824GomII7Yoei/nMoB46NQcSfGe0iVpZK3uUivxIAfUUSzRvu8RQO7ZkKapIgzgshHZc+GR+z/BQ8l2VLg== "@types/hapi__catbox@*": version "10.2.3" @@ -7855,7 +7855,7 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= -boom@7.x.x, boom@^7.1.0, boom@^7.2.0: +boom@7.x.x, boom@^7.1.0: version "7.2.2" resolved "https://registry.yarnpkg.com/boom/-/boom-7.2.2.tgz#ac92101451aa5cea901aed07d881dd32b4f08345" integrity sha512-IFUbOa8PS7xqmhIjpeStwT3d09hGkNYQ6aj2iELSTxcVs2u0aKn1NzhkdUQSzsRg1FVkj3uit3I6mXQCBixw+A== From eeb104355639d90d29094fc935bfa383e5289c01 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 14:24:00 +0200 Subject: [PATCH 09/20] Upgrade from hapi-auth-cookie@9.0.0 to @hapi/cookie@10.1.2 --- package.json | 5 +-- .../server/http/cookie_session_storage.ts | 2 +- yarn.lock | 36 +++++++++---------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 750bc93fbab2c..f48a23c2a6b08 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "resolutions": { "**/@hapi/iron": "^5.1.4", "**/@types/hapi__boom": "^7.4.1", + "**/@types/hapi__hapi": "^18.2.6", "**/@types/node": ">=10.17.17 <10.20.0", "**/cross-fetch/node-fetch": "^2.6.1", "**/deepmerge": "^4.2.2", @@ -125,6 +126,7 @@ "@elastic/request-crypto": "1.1.4", "@elastic/safer-lodash-set": "0.0.0", "@hapi/boom": "^7.4.11", + "@hapi/cookie": "^10.1.2", "@hapi/good-squeeze": "5.2.1", "@hapi/hapi": "^18.4.1", "@hapi/wreck": "^15.0.2", @@ -170,7 +172,6 @@ "globby": "^8.0.1", "h2o2": "^8.1.2", "handlebars": "4.7.6", - "hapi-auth-cookie": "^9.0.0", "hjson": "3.2.1", "hoek": "^5.0.4", "http-proxy-agent": "^2.1.0", @@ -296,8 +297,8 @@ "@types/globby": "^8.0.0", "@types/graphql": "^0.13.2", "@types/h2o2": "^8.1.1", - "@types/hapi-auth-cookie": "^9.1.0", "@types/hapi__boom": "^7.4.1", + "@types/hapi__cookie": "^10.1.1", "@types/hapi__hapi": "^18.2.6", "@types/has-ansi": "^3.0.0", "@types/history": "^4.7.3", diff --git a/src/core/server/http/cookie_session_storage.ts b/src/core/server/http/cookie_session_storage.ts index 7c444496175c9..ad51efaa6bb54 100644 --- a/src/core/server/http/cookie_session_storage.ts +++ b/src/core/server/http/cookie_session_storage.ts @@ -18,7 +18,7 @@ */ import { Request, Server } from '@hapi/hapi'; -import hapiAuthCookie from 'hapi-auth-cookie'; +import hapiAuthCookie from '@hapi/cookie'; // @ts-expect-error no TS definitions import Statehood from 'statehood'; diff --git a/yarn.lock b/yarn.lock index 49e008d1e6f81..70b41e1a22a0e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1585,6 +1585,16 @@ dependencies: "@hapi/boom" "7.x.x" +"@hapi/cookie@^10.1.2": + version "10.1.2" + resolved "https://registry.yarnpkg.com/@hapi/cookie/-/cookie-10.1.2.tgz#9ea7d80f05d764faaf892b84e80c1bf13f5e3bf5" + integrity sha512-wch/uT5NgDEujmaLIqUoohbEP6PUr4ML2Z6zqheWHeHrSzXangPH4dveW+fiMsoPMW2S9ecAyUjCfkh4qRfxjg== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + "@hapi/cryptiles@4.x.x": version "4.2.1" resolved "https://registry.yarnpkg.com/@hapi/cryptiles/-/cryptiles-4.2.1.tgz#ff0f18d79074659838caedbb911851313ad1ffbc" @@ -4288,13 +4298,6 @@ "@types/hapi" "*" "@types/node" "*" -"@types/hapi-auth-cookie@^9.1.0": - version "9.1.0" - resolved "https://registry.yarnpkg.com/@types/hapi-auth-cookie/-/hapi-auth-cookie-9.1.0.tgz#cbcd2236b7d429bd0632a8cc45cfd355fdd7e7a2" - integrity sha512-qsP08L+fNaE2K5dsDVKvHp0AmSBs8m9PD5eWsTdHnkJOk81iD7c0J4GYt/1aDJwZsyx6CgcxpbkPOCwBJmrwAg== - dependencies: - "@types/hapi" "*" - "@types/hapi@*": version "17.0.18" resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-17.0.18.tgz#f855fe18766aa2592a3a689c3e6eabe72989ff1a" @@ -4319,7 +4322,14 @@ resolved "https://registry.yarnpkg.com/@types/hapi__catbox/-/hapi__catbox-10.2.3.tgz#c9279c16d709bf2987491c332e11d18124ae018f" integrity sha512-gs6MKMKXzWpSqeYsPaDIDAxD8jLNg7aFxgAJE6Jnc+ns072Z9fuh39/NF5gSk1KNoGCLnIpeZ0etT9gY9QDCKg== -"@types/hapi__hapi@^18.2.6": +"@types/hapi__cookie@^10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@types/hapi__cookie/-/hapi__cookie-10.1.1.tgz#4420c7f89ef466aa8c1f4d9975c62e6b5b066b1c" + integrity sha512-sWVS20wvqbYSjpjpfOwsD/gtDBba3mi+Y4Yg2qZMBs0/VAgvhOOmpBXzFf2rE8rrEuR44n7tzmEgPWRw5q7kaw== + dependencies: + "@types/hapi__hapi" "*" + +"@types/hapi__hapi@*", "@types/hapi__hapi@^18.2.6": version "18.2.6" resolved "https://registry.yarnpkg.com/@types/hapi__hapi/-/hapi__hapi-18.2.6.tgz#61c1b210c55dee4636df594e7a0868ad48c8042a" integrity sha512-sXFlSg9btu/LdHqK/N/kuQXVqZhSvibXbtZc0KfEcelRXKthdU5ZSu5qItDIov7SYnyK2faMe7dbZaC/VpC33w== @@ -14930,16 +14940,6 @@ handlebars@4.7.6: optionalDependencies: uglify-js "^3.1.4" -hapi-auth-cookie@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/hapi-auth-cookie/-/hapi-auth-cookie-9.0.0.tgz#3b0af443334e2bd92490ddb17bed16e3e9edfd01" - integrity sha512-N71Mt7Jk0+7WLnuvfSv0DoGzgpn7TqOd+/AB73RfHpLvzYoskJ9AlFV3Op60DB01RJNaABZtdcH1l4HM3DMbog== - dependencies: - boom "7.x.x" - bounce "1.x.x" - hoek "5.x.x" - joi "13.x.x" - har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" From a8f9701f74431f257e9e0d9df2da5185c548f82b Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 14 Oct 2020 14:42:49 +0200 Subject: [PATCH 10/20] Implement breaking changes from @hapi/cookie upgrade --- src/core/server/http/cookie_session_storage.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core/server/http/cookie_session_storage.ts b/src/core/server/http/cookie_session_storage.ts index ad51efaa6bb54..e43a3c8acfe03 100644 --- a/src/core/server/http/cookie_session_storage.ts +++ b/src/core/server/http/cookie_session_storage.ts @@ -141,8 +141,15 @@ export async function createCookieSessionStorageFactory( await server.register({ plugin: hapiAuthCookie }); server.auth.strategy('security-cookie', 'cookie', { - cookie: cookieOptions.name, - password: cookieOptions.encryptionKey, + cookie: { + name: cookieOptions.name, + password: cookieOptions.encryptionKey, + isSecure: cookieOptions.isSecure, + path: basePath === undefined ? '/' : basePath, + clearInvalid: false, + isHttpOnly: true, + isSameSite: cookieOptions.sameSite === 'None' ? false : cookieOptions.sameSite ?? false, + }, validateFunc: async (req, session: T | T[]) => { const result = cookieOptions.validate(session); if (!result.isValid) { @@ -150,11 +157,6 @@ export async function createCookieSessionStorageFactory( } return { valid: result.isValid }; }, - isSecure: cookieOptions.isSecure, - path: basePath, - clearInvalid: false, - isHttpOnly: true, - isSameSite: cookieOptions.sameSite === 'None' ? false : cookieOptions.sameSite ?? false, }); // A hack to support SameSite: 'None'. From 190ec43e7c114422f9dade2788b6ee0947fe2475 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 14:46:30 +0200 Subject: [PATCH 11/20] Upgrade from h2o2@8.1.2 to @hapi/h2o2@8.3.2 --- package.json | 4 +- .../server/http/base_path_proxy_server.ts | 2 +- .../server/http/register_hapi_plugins.js | 2 +- x-pack/package.json | 2 +- yarn.lock | 46 ++++++++----------- 5 files changed, 24 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index f48a23c2a6b08..7ccdd3cff7603 100644 --- a/package.json +++ b/package.json @@ -128,6 +128,7 @@ "@hapi/boom": "^7.4.11", "@hapi/cookie": "^10.1.2", "@hapi/good-squeeze": "5.2.1", + "@hapi/h2o2": "^8.3.2", "@hapi/hapi": "^18.4.1", "@hapi/wreck": "^15.0.2", "@kbn/ace": "1.0.0", @@ -170,7 +171,6 @@ "glob": "^7.1.2", "glob-all": "^3.2.1", "globby": "^8.0.1", - "h2o2": "^8.1.2", "handlebars": "4.7.6", "hjson": "3.2.1", "hoek": "^5.0.4", @@ -296,9 +296,9 @@ "@types/glob": "^7.1.2", "@types/globby": "^8.0.0", "@types/graphql": "^0.13.2", - "@types/h2o2": "^8.1.1", "@types/hapi__boom": "^7.4.1", "@types/hapi__cookie": "^10.1.1", + "@types/hapi__h2o2": "8.3.0", "@types/hapi__hapi": "^18.2.6", "@types/has-ansi": "^3.0.0", "@types/history": "^4.7.3", diff --git a/src/core/server/http/base_path_proxy_server.ts b/src/core/server/http/base_path_proxy_server.ts index b766155e19002..42841377e7369 100644 --- a/src/core/server/http/base_path_proxy_server.ts +++ b/src/core/server/http/base_path_proxy_server.ts @@ -23,7 +23,7 @@ import { Agent as HttpsAgent, ServerOptions as TlsOptions } from 'https'; import apm from 'elastic-apm-node'; import { ByteSizeValue } from '@kbn/config-schema'; import { Server, Request } from '@hapi/hapi'; -import HapiProxy from 'h2o2'; +import HapiProxy from '@hapi/h2o2'; import { sampleSize } from 'lodash'; import * as Rx from 'rxjs'; import { take } from 'rxjs/operators'; diff --git a/src/legacy/server/http/register_hapi_plugins.js b/src/legacy/server/http/register_hapi_plugins.js index 103e4a77cb4b2..2572cc178233d 100644 --- a/src/legacy/server/http/register_hapi_plugins.js +++ b/src/legacy/server/http/register_hapi_plugins.js @@ -19,7 +19,7 @@ import HapiTemplates from 'vision'; import HapiStaticFiles from 'inert'; -import HapiProxy from 'h2o2'; +import HapiProxy from '@hapi/h2o2'; const plugins = [HapiTemplates, HapiStaticFiles, HapiProxy]; diff --git a/x-pack/package.json b/x-pack/package.json index 2f2840413a679..73a202ea16da5 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -272,6 +272,7 @@ "@elastic/numeral": "^2.5.0", "@elastic/safer-lodash-set": "0.0.0", "@hapi/boom": "^7.4.11", + "@hapi/h2o2": "^8.3.2", "@kbn/config-schema": "1.0.0", "@kbn/i18n": "1.0.0", "@kbn/interpreter": "1.0.0", @@ -313,7 +314,6 @@ "graphql-fields": "^1.0.2", "graphql-tag": "^2.10.3", "graphql-tools": "^3.0.2", - "h2o2": "^8.1.2", "handlebars": "4.7.6", "history": "^4.9.0", "idx": "^2.5.6", diff --git a/yarn.lock b/yarn.lock index 70b41e1a22a0e..0b48557baa41f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1620,6 +1620,16 @@ "@hapi/hoek" "8.x.x" fast-safe-stringify "2.x.x" +"@hapi/h2o2@^8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@hapi/h2o2/-/h2o2-8.3.2.tgz#008a8f9ec3d9bba29077691aa9ec0ace93d4de80" + integrity sha512-2WkZq+QAkvYHWGqnUuG0stcVeGyv9T7bopBYnCJSUEuvBZlUf2BTX2JCVSKxsnTLOxCYwoC/aI4Rr0ZSRd2oVg== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + "@hapi/wreck" "15.x.x" + "@hapi/hapi@^18.4.1": version "18.4.1" resolved "https://registry.yarnpkg.com/@hapi/hapi/-/hapi-18.4.1.tgz#023fbc131074b1cb2cd7f6766d65f4b0e92df788" @@ -4289,15 +4299,6 @@ "@types/vinyl-fs" "*" chokidar "^2.1.2" -"@types/h2o2@^8.1.1": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@types/h2o2/-/h2o2-8.1.1.tgz#f990302cd2fdfd7909cff9d6643052002b69998f" - integrity sha512-lwF9WSvo4sfT0TnDZDXKef9Yza4xUXC3561QG4Q3Axhrkr+ZFBVJ7kCwI1mUNzk60jI1aMTYVIIoHKZjwCGuHw== - dependencies: - "@types/boom" "*" - "@types/hapi" "*" - "@types/node" "*" - "@types/hapi@*": version "17.0.18" resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-17.0.18.tgz#f855fe18766aa2592a3a689c3e6eabe72989ff1a" @@ -4329,6 +4330,15 @@ dependencies: "@types/hapi__hapi" "*" +"@types/hapi__h2o2@8.3.0": + version "8.3.0" + resolved "https://registry.yarnpkg.com/@types/hapi__h2o2/-/hapi__h2o2-8.3.0.tgz#c2e6598ab6ed28edb1a5edd44ddc185e1c252dd8" + integrity sha512-jD6L+8BJ+SVbwBzQK3W7zGnDYgrwuCNDl9r1P0GdwoYsysNADl7STfrhJ/m9qPt2fD1vFVJsfsFjoJ/iCyNlOQ== + dependencies: + "@types/hapi__boom" "*" + "@types/hapi__hapi" "*" + "@types/node" "*" + "@types/hapi__hapi@*", "@types/hapi__hapi@^18.2.6": version "18.2.6" resolved "https://registry.yarnpkg.com/@types/hapi__hapi/-/hapi__hapi-18.2.6.tgz#61c1b210c55dee4636df594e7a0868ad48c8042a" @@ -14913,16 +14923,6 @@ gzip-size@5.1.1: duplexer "^0.1.1" pify "^4.0.1" -h2o2@^8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/h2o2/-/h2o2-8.1.2.tgz#25e6f69f453175c9ca1e3618741c5ebe1b5000c1" - integrity sha1-Jeb2n0UxdcnKHjYYdBxevhtQAME= - dependencies: - boom "7.x.x" - hoek "5.x.x" - joi "13.x.x" - wreck "14.x.x" - handle-thing@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.0.tgz#0e039695ff50c93fc288557d696f3c1dc6776754" @@ -29303,14 +29303,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -wreck@14.x.x: - version "14.1.0" - resolved "https://registry.yarnpkg.com/wreck/-/wreck-14.1.0.tgz#b13e526b6a8318e5ebc6969c0b21075c06337067" - integrity sha512-y/iwFhwdGoM8Hk1t1I4LbuLhM3curVD8STd5NcFI0c/4b4cQAMLcnCRxXX9sLQAggDC8dXYSaQNsT64hga6lvA== - dependencies: - boom "7.x.x" - hoek "5.x.x" - write-file-atomic@^1.1.2: version "1.3.4" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" From f770865ff59beccae30833adedea633aa4e8a61d Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 14:52:50 +0200 Subject: [PATCH 12/20] Upgrade from hoek@5.0.4 to @hapi/hoek@8.5.1 --- package.json | 4 ++-- src/core/server/http/http_tools.ts | 2 +- src/core/server/metrics/collectors/process.ts | 2 +- yarn.lock | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 7ccdd3cff7603..50d6e4ad4d25c 100644 --- a/package.json +++ b/package.json @@ -130,6 +130,7 @@ "@hapi/good-squeeze": "5.2.1", "@hapi/h2o2": "^8.3.2", "@hapi/hapi": "^18.4.1", + "@hapi/hoek": "^8.5.1", "@hapi/wreck": "^15.0.2", "@kbn/ace": "1.0.0", "@kbn/analytics": "1.0.0", @@ -173,7 +174,6 @@ "globby": "^8.0.1", "handlebars": "4.7.6", "hjson": "3.2.1", - "hoek": "^5.0.4", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^5.0.0", "inert": "^5.1.0", @@ -300,10 +300,10 @@ "@types/hapi__cookie": "^10.1.1", "@types/hapi__h2o2": "8.3.0", "@types/hapi__hapi": "^18.2.6", + "@types/hapi__hoek": "^6.2.0", "@types/has-ansi": "^3.0.0", "@types/history": "^4.7.3", "@types/hjson": "^2.4.2", - "@types/hoek": "^4.1.3", "@types/inert": "^5.1.2", "@types/jest": "^26.0.14", "@types/jest-when": "^2.7.1", diff --git a/src/core/server/http/http_tools.ts b/src/core/server/http/http_tools.ts index 61749be85d8fc..14adbced95c7a 100644 --- a/src/core/server/http/http_tools.ts +++ b/src/core/server/http/http_tools.ts @@ -18,7 +18,7 @@ */ import { Lifecycle, Request, ResponseToolkit, Server, ServerOptions, Util } from '@hapi/hapi'; -import Hoek from 'hoek'; +import Hoek from '@hapi/hoek'; import { ServerOptions as TLSOptions } from 'https'; import { ValidationError } from 'joi'; import uuid from 'uuid'; diff --git a/src/core/server/metrics/collectors/process.ts b/src/core/server/metrics/collectors/process.ts index b020eebcbbd0b..8b9cabe6227b6 100644 --- a/src/core/server/metrics/collectors/process.ts +++ b/src/core/server/metrics/collectors/process.ts @@ -18,7 +18,7 @@ */ import v8 from 'v8'; -import { Bench } from 'hoek'; +import { Bench } from '@hapi/hoek'; import { OpsProcessMetrics, MetricsCollector } from './types'; export class ProcessMetricsCollector implements MetricsCollector { diff --git a/yarn.lock b/yarn.lock index 0b48557baa41f..a70a9b19ff67c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1663,7 +1663,7 @@ "@hapi/hoek" "8.x.x" "@hapi/joi" "16.x.x" -"@hapi/hoek@8.x.x", "@hapi/hoek@^8.2.4", "@hapi/hoek@^8.3.0", "@hapi/hoek@^8.3.1": +"@hapi/hoek@8.x.x", "@hapi/hoek@^8.2.4", "@hapi/hoek@^8.3.0", "@hapi/hoek@^8.3.1", "@hapi/hoek@^8.5.1": version "8.5.1" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06" integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow== @@ -4353,6 +4353,11 @@ "@types/hapi__shot" "*" "@types/node" "*" +"@types/hapi__hoek@^6.2.0": + version "6.2.0" + resolved "https://registry.yarnpkg.com/@types/hapi__hoek/-/hapi__hoek-6.2.0.tgz#61ec4dfb93e6aaccf2b407d6074a0633069e5d2d" + integrity sha512-MMS8ZD0SR2lklVkpNJw7iUYBmlvBLw1T04VSBhbWpiOi0ee6RoJUCcocVao1FLnSYR8Tt03dykRBv+FkvPIJSg== + "@types/hapi__iron@*": version "6.0.1" resolved "https://registry.yarnpkg.com/@types/hapi__iron/-/hapi__iron-6.0.1.tgz#ec8b23eff3d69313f1187c234deb80652384ad6b" @@ -4419,11 +4424,6 @@ resolved "https://registry.yarnpkg.com/@types/hjson/-/hjson-2.4.2.tgz#fd0288a5b6778cda993c978e43cc978ddc8f22e9" integrity sha512-MSKTfEyR8DbzJTOAY47BIJBD72ol4cu6BOw5inda0q1eEtEmurVHL4OmYB3Lxa4/DwXbWidkddvtoygbGQEDIw== -"@types/hoek@^4.1.3": - version "4.1.3" - resolved "https://registry.yarnpkg.com/@types/hoek/-/hoek-4.1.3.tgz#d1982d48fb0d2a0e5d7e9d91838264d8e428d337" - integrity sha1-0ZgtSPsNKg5dfp2Rg4Jk2OQo0zc= - "@types/hoist-non-react-statics@*", "@types/hoist-non-react-statics@^3.3.0", "@types/hoist-non-react-statics@^3.3.1": version "3.3.1" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" @@ -15305,7 +15305,7 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hoek@5.x.x, hoek@^5.0.4: +hoek@5.x.x: version "5.0.4" resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.4.tgz#0f7fa270a1cafeb364a4b2ddfaa33f864e4157da" integrity sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w== From 6bb56f71ecb3e829eccca516a8fd91dc47e7605c Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 14:56:00 +0200 Subject: [PATCH 13/20] Upgrade from inert@5.1.0 to @hapi/inert@5.2.2 --- package.json | 4 +- src/core/server/http/http_server.ts | 2 +- .../server/http/register_hapi_plugins.js | 2 +- .../bundles_route/bundles_route.test.ts | 2 +- yarn.lock | 104 ++++-------------- 5 files changed, 27 insertions(+), 87 deletions(-) diff --git a/package.json b/package.json index 50d6e4ad4d25c..b001cee2abf1e 100644 --- a/package.json +++ b/package.json @@ -131,6 +131,7 @@ "@hapi/h2o2": "^8.3.2", "@hapi/hapi": "^18.4.1", "@hapi/hoek": "^8.5.1", + "@hapi/inert": "^5.2.2", "@hapi/wreck": "^15.0.2", "@kbn/ace": "1.0.0", "@kbn/analytics": "1.0.0", @@ -176,7 +177,6 @@ "hjson": "3.2.1", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^5.0.0", - "inert": "^5.1.0", "inline-style": "^2.0.0", "joi": "^13.5.2", "js-yaml": "^3.14.0", @@ -301,10 +301,10 @@ "@types/hapi__h2o2": "8.3.0", "@types/hapi__hapi": "^18.2.6", "@types/hapi__hoek": "^6.2.0", + "@types/hapi__inert": "^5.2.1", "@types/has-ansi": "^3.0.0", "@types/history": "^4.7.3", "@types/hjson": "^2.4.2", - "@types/inert": "^5.1.2", "@types/jest": "^26.0.14", "@types/jest-when": "^2.7.1", "@types/joi": "^13.4.2", diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index f30901baa2dba..ced728e685f3b 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -17,7 +17,7 @@ * under the License. */ import { Server } from '@hapi/hapi'; -import HapiStaticFiles from 'inert'; +import HapiStaticFiles from '@hapi/inert'; import url from 'url'; import uuid from 'uuid'; diff --git a/src/legacy/server/http/register_hapi_plugins.js b/src/legacy/server/http/register_hapi_plugins.js index 2572cc178233d..f32eb97243520 100644 --- a/src/legacy/server/http/register_hapi_plugins.js +++ b/src/legacy/server/http/register_hapi_plugins.js @@ -18,7 +18,7 @@ */ import HapiTemplates from 'vision'; -import HapiStaticFiles from 'inert'; +import HapiStaticFiles from '@hapi/inert'; import HapiProxy from '@hapi/h2o2'; const plugins = [HapiTemplates, HapiStaticFiles, HapiProxy]; diff --git a/src/optimize/bundles_route/bundles_route.test.ts b/src/optimize/bundles_route/bundles_route.test.ts index 920d0fb062252..cbf9db2f3cd4b 100644 --- a/src/optimize/bundles_route/bundles_route.test.ts +++ b/src/optimize/bundles_route/bundles_route.test.ts @@ -23,7 +23,7 @@ import crypto from 'crypto'; import Chance from 'chance'; import Hapi from '@hapi/hapi'; -import Inert from 'inert'; +import Inert from '@hapi/inert'; import { createBundlesRoute } from './bundles_route'; diff --git a/yarn.lock b/yarn.lock index a70a9b19ff67c..d0405f89ae540 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1518,7 +1518,7 @@ resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5" integrity sha512-QD1PhQk+s31P1ixsX0H0Suoupp3VMXzIVMSwobR3F3MSUO2YCV0B7xqLcUw/Bh8yuvd3LhpyqLQWTNcRmp6IdQ== -"@hapi/ammo@^3.1.2": +"@hapi/ammo@3.x.x", "@hapi/ammo@^3.1.2": version "3.1.2" resolved "https://registry.yarnpkg.com/@hapi/ammo/-/ammo-3.1.2.tgz#a9edf5d48d99b75fdcd7ab3dabf9059942a06961" integrity sha512-ej9OtFmiZv1qr45g1bxEZNGyaR4jRpyMxU6VhbxjaYThymvOwsyIsUKMZnP5Qw2tfYFuwqCJuIBHGpeIbdX9gQ== @@ -1668,6 +1668,18 @@ resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06" integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow== +"@hapi/inert@^5.2.2": + version "5.2.2" + resolved "https://registry.yarnpkg.com/@hapi/inert/-/inert-5.2.2.tgz#3ba4d93afc6d5b42e4bab19cd09556ddd49b5dac" + integrity sha512-8IaGfAEF8SwZtpdaTq0G3aDPG35ZTfWKjnMNniG2N3kE+qioMsBuImIGxna8TNQ+sYMXYK78aqmvzbQHno8qSQ== + dependencies: + "@hapi/ammo" "3.x.x" + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + lru-cache "4.1.x" + "@hapi/iron@*", "@hapi/iron@5.x.x", "@hapi/iron@^5.1.4": version "5.1.4" resolved "https://registry.yarnpkg.com/@hapi/iron/-/iron-5.1.4.tgz#7406f36847f798f52b92d1d97f855e27973832b7" @@ -3974,11 +3986,6 @@ resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.30.tgz#ee034a0eeea8b84ed868b1aa60d690b08a6cfbc5" integrity sha512-8LhzvcjIoqoi1TghEkRMkbbmM+jhHnBokPGkJWjclMK+Ks0MxEBow3/p2/iFTZ+OIbJHQDSfpgdZEb+af3gfVw== -"@types/boom@*": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@types/boom/-/boom-7.2.0.tgz#19c36cbb5811a7493f0f2e37f31d42b28df1abc1" - integrity sha512-HonbGsHFbskh9zRAzA6tabcw18mCOsSEOL2ibGAuVqk6e7nElcRmWO5L4UfIHpDbWBWw+eZYFdsQ1+MEGgpcVA== - "@types/braces@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb" @@ -3999,11 +4006,6 @@ resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8" integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w== -"@types/catbox@*": - version "10.0.1" - resolved "https://registry.yarnpkg.com/@types/catbox/-/catbox-10.0.1.tgz#266679017749041fe9873fee1131dd2aaa04a07e" - integrity sha512-ECuJ+f5gGHiLeiE4RlE/xdqv/0JVDToegPV1aTb10tQStYa0Ycq2OJfQukDv3IFaw3B+CMV46jHc5bXe6QXEQg== - "@types/chance@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/chance/-/chance-1.0.1.tgz#c10703020369602c40dd9428cc6e1437027116df" @@ -4299,20 +4301,6 @@ "@types/vinyl-fs" "*" chokidar "^2.1.2" -"@types/hapi@*": - version "17.0.18" - resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-17.0.18.tgz#f855fe18766aa2592a3a689c3e6eabe72989ff1a" - integrity sha512-sRoDjz1iVOCxTqq+EepzDQI773k2PjboHpvMpp524278grosStxZ5+oooVjNLJZj1iZIbiLeeR5/ZeIRgVXsCg== - dependencies: - "@types/boom" "*" - "@types/catbox" "*" - "@types/iron" "*" - "@types/joi" "*" - "@types/mimos" "*" - "@types/node" "*" - "@types/podium" "*" - "@types/shot" "*" - "@types/hapi__boom@*", "@types/hapi__boom@^7.4.1": version "7.4.1" resolved "https://registry.yarnpkg.com/@types/hapi__boom/-/hapi__boom-7.4.1.tgz#06439d7637245dcbe6dd6548d2a91f2c1243d80b" @@ -4358,6 +4346,13 @@ resolved "https://registry.yarnpkg.com/@types/hapi__hoek/-/hapi__hoek-6.2.0.tgz#61ec4dfb93e6aaccf2b407d6074a0633069e5d2d" integrity sha512-MMS8ZD0SR2lklVkpNJw7iUYBmlvBLw1T04VSBhbWpiOi0ee6RoJUCcocVao1FLnSYR8Tt03dykRBv+FkvPIJSg== +"@types/hapi__inert@^5.2.1": + version "5.2.1" + resolved "https://registry.yarnpkg.com/@types/hapi__inert/-/hapi__inert-5.2.1.tgz#cce395e7470a969f63cf57d561da230218b8b2bb" + integrity sha512-pFvXfN9bTGgR6jkgKseXmu5/eHVGVEsGh0LKHCkcezEqZZMJV9YabREVLa6kcYEQMIDQzQSwSakSnemCFiSnOg== + dependencies: + "@types/hapi__hapi" "*" + "@types/hapi__iron@*": version "6.0.1" resolved "https://registry.yarnpkg.com/@types/hapi__iron/-/hapi__iron-6.0.1.tgz#ec8b23eff3d69313f1187c234deb80652384ad6b" @@ -4456,13 +4451,6 @@ dependencies: "@types/node" "*" -"@types/inert@^5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@types/inert/-/inert-5.1.2.tgz#2bb8bef3b2462f904c960654c9edfa39285a85c6" - integrity sha512-3IoSFLQWvhLfZ85kHas/F3iD/TyZPfeJbTsDjrwYljK1MgBGCB2OywAsyeA/YiJ62VbNXfXBwpD1/VbJPIZSGA== - dependencies: - "@types/hapi" "*" - "@types/inquirer@^7.3.1": version "7.3.1" resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-7.3.1.tgz#1f231224e7df11ccfaf4cf9acbcc3b935fea292d" @@ -4476,13 +4464,6 @@ resolved "https://registry.yarnpkg.com/@types/intl-relativeformat/-/intl-relativeformat-2.1.0.tgz#3a2b0043380388f39c666665ec517e11412f1358" integrity sha512-AfsEUBFuVaTKL+t82wmU0yEvNjaZEIuGRCLUmgKQkn4nA5M84EbTrDobd8x/D3WohY34MBO5h9al5cGeLQ4Y1g== -"@types/iron@*": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@types/iron/-/iron-5.0.1.tgz#5420bbda8623c48ee51b9a78ebad05d7305b4b24" - integrity sha512-Ng5BkVGPt7Tw9k1OJ6qYwuD9+dmnWgActmsnnrdvs4075N8V2go1f6Pz8omG3q5rbHjXN6yzzZDYo3JOgAE/Ug== - dependencies: - "@types/node" "*" - "@types/is-function@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83" @@ -4550,7 +4531,7 @@ jest-diff "^25.2.1" pretty-format "^25.2.1" -"@types/joi@*", "@types/joi@^13.4.2": +"@types/joi@^13.4.2": version "13.6.1" resolved "https://registry.yarnpkg.com/@types/joi/-/joi-13.6.1.tgz#325486a397504f8e22c8c551dc8b0e1d41d5d5ae" integrity sha512-JxZ0NP8NuB0BJOXi1KvAA6rySLTPmhOy4n2gzSFq/IFM3LNFm0h+2Vn/bPPgEYlWqzS2NPeLgKqfm75baX+Hog== @@ -4737,13 +4718,6 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d" integrity sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw== -"@types/mimos@*": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/mimos/-/mimos-3.0.1.tgz#59d96abe1c9e487e7463fe41e8d86d76b57a441a" - integrity sha512-MATIRH4VMIJki8lcYUZdNQEHuAG7iQ1FWwoLgxV+4fUOly2xZYdhHtGgvQyWiTeJqq2tZbE0nOOgZD6pR0FpNQ== - dependencies: - "@types/mime-db" "*" - "@types/minimatch@*", "@types/minimatch@^3.0.3": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -4933,7 +4907,7 @@ dependencies: "@types/node" "*" -"@types/podium@*", "@types/podium@^1.0.0": +"@types/podium@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/podium/-/podium-1.0.0.tgz#bfaa2151be2b1d6109cc69f7faa9dac2cba3bb20" integrity sha1-v6ohUb4rHWEJzGn3+qnawsujuyA= @@ -5201,13 +5175,6 @@ resolved "https://registry.yarnpkg.com/@types/set-value/-/set-value-2.0.0.tgz#63d386b103926dcf49b50e16e0f6dd49983046be" integrity sha512-k8dCJEC80F/mbsIOZ5Hj3YSzTVVVBwMdtP/M9Rtc2TM4F5etVd+2UG8QUiAUfbXm4fABedL2tBZnrBheY7UwpA== -"@types/shot@*": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/shot/-/shot-4.0.0.tgz#7545500c489b65c69b5bc5446ba4fef3bd26af92" - integrity sha512-Xv+n8yfccuicMlwBY58K5PVVNtXRm7uDzcwwmCarBxMP+XxGfnh1BI06YiVAsPbTAzcnYsrzpoS5QHeyV7LS8A== - dependencies: - "@types/node" "*" - "@types/sinon@^7.0.13": version "7.0.13" resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.13.tgz#ca039c23a9e27ebea53e0901ef928ea2a1a6d313" @@ -6107,13 +6074,6 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= -ammo@3.x.x: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ammo/-/ammo-3.0.1.tgz#c79ceeac36fb4e55085ea3fe0c2f42bfa5f7c914" - integrity sha512-4UqoM8xQjwkQ78oiU4NbBK0UgYqeKMAKmwE4ec7Rz3rGU8ZEBFxzgF2sUYKOAlqIXExBDYLN6y1ShF5yQ4hwLQ== - dependencies: - hoek "5.x.x" - angular-aria@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/angular-aria/-/angular-aria-1.8.0.tgz#97aec9b1e8bafd07d5fab30f98d8ec832e18e25d" @@ -7887,14 +7847,6 @@ bottleneck@^2.15.3: resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.18.0.tgz#41fa63ae185b65435d789d1700334bc48222dacf" integrity sha512-U1xiBRaokw4yEguzikOl0VrnZp6uekjpmfrh6rKtr1D+/jFjYCL6J83ZXlGtlBDwVdTmJJ+4Lg5FpB3xmLSiyA== -bounce@1.x.x: - version "1.2.0" - resolved "https://registry.yarnpkg.com/bounce/-/bounce-1.2.0.tgz#e3bac68c73fd256e38096551efc09f504873c8c8" - integrity sha512-8syCGe8B2/WC53118/F/tFy5aW00j+eaGPXmAUP7iBhxc+EBZZxS1vKelWyBCH6IqojgS2t1gF0glH30qAJKEw== - dependencies: - boom "7.x.x" - hoek "5.x.x" - bowser@^1.7.3: version "1.9.4" resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.4.tgz#890c58a2813a9d3243704334fa81b96a5c150c9a" @@ -15840,18 +15792,6 @@ indexes-of@^1.0.1: resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= -inert@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/inert/-/inert-5.1.0.tgz#e9f130dc3047ccd9ffaa64b157b4c1114611035d" - integrity sha512-5rJZbezGEkBN4QrP/HEEwsQ0N+7YzqDZrvBZrE7B0CrNY6I4XKI434aL3UNLCmbI4HzPGQs7Ae/4h1tiTMJ6Wg== - dependencies: - ammo "3.x.x" - boom "7.x.x" - bounce "1.x.x" - hoek "5.x.x" - joi "13.x.x" - lru-cache "4.1.x" - infer-owner@^1.0.3, infer-owner@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" From aefad69b1bc20e7241ddf8ceb1090036fe75b1bf Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 14:58:11 +0200 Subject: [PATCH 14/20] Upgrade from vision@5.4.0 to @hapi/vision@5.5.4 --- package.json | 2 +- .../server/http/register_hapi_plugins.js | 2 +- yarn.lock | 25 ++++++++----------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index b001cee2abf1e..539262be56f0c 100644 --- a/package.json +++ b/package.json @@ -132,6 +132,7 @@ "@hapi/hapi": "^18.4.1", "@hapi/hoek": "^8.5.1", "@hapi/inert": "^5.2.2", + "@hapi/vision": "^5.5.4", "@hapi/wreck": "^15.0.2", "@kbn/ace": "1.0.0", "@kbn/analytics": "1.0.0", @@ -223,7 +224,6 @@ "tslib": "^2.0.0", "type-detect": "^4.0.8", "uuid": "3.3.2", - "vision": "^5.3.3", "whatwg-fetch": "^3.0.0", "yauzl": "^2.10.0" }, diff --git a/src/legacy/server/http/register_hapi_plugins.js b/src/legacy/server/http/register_hapi_plugins.js index f32eb97243520..19560351f3624 100644 --- a/src/legacy/server/http/register_hapi_plugins.js +++ b/src/legacy/server/http/register_hapi_plugins.js @@ -17,7 +17,7 @@ * under the License. */ -import HapiTemplates from 'vision'; +import HapiTemplates from '@hapi/vision'; import HapiStaticFiles from '@hapi/inert'; import HapiProxy from '@hapi/h2o2'; diff --git a/yarn.lock b/yarn.lock index d0405f89ae540..462a89fd360a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1813,6 +1813,16 @@ dependencies: "@hapi/hoek" "8.x.x" +"@hapi/vision@^5.5.4": + version "5.5.4" + resolved "https://registry.yarnpkg.com/@hapi/vision/-/vision-5.5.4.tgz#03a01374fb5e0a498d6e502e635a0b54d70501a1" + integrity sha512-/DFgnQtcrlf2eQNkh/DHnjrCRHLSmHraU+PHe1SlxLUJxATQCw8VIEt6rJraM2jGTpFgHNk6B6ELtu3sBJCClg== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + "@hapi/wreck@15.x.x", "@hapi/wreck@^15.0.2": version "15.1.0" resolved "https://registry.yarnpkg.com/@hapi/wreck/-/wreck-15.1.0.tgz#7917cd25950ce9b023f7fd2bea6e2ef72c71e59d" @@ -16982,11 +16992,6 @@ isurl@^1.0.0-alpha5: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" -items@2.x.x: - version "2.1.1" - resolved "https://registry.yarnpkg.com/items/-/items-2.1.1.tgz#8bd16d9c83b19529de5aea321acaada78364a198" - integrity sha1-i9FtnIOxlSneWuoyGsqtp4NkoZg= - iterall@^1.1.3, iterall@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7" @@ -28636,16 +28641,6 @@ vinyl@^2.0.0, vinyl@^2.0.1, vinyl@^2.1.0, vinyl@^2.2.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" -vision@^5.3.3: - version "5.4.0" - resolved "https://registry.yarnpkg.com/vision/-/vision-5.4.0.tgz#fc620deb95227881ea8b8d8a044dc1d1fd40e584" - integrity sha512-f8kbjvo/dUbR4ZDF0pHPuOjQFg/6zOMlP1Tb9gK2ukCa7Ksd24174DCzubtov6AxIDhZhO5RYQeeDlF8ujlKWQ== - dependencies: - boom "7.x.x" - hoek "5.x.x" - items "2.x.x" - joi "13.x.x" - vm-browserify@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" From 2a75e98d532e03fd1e012e0dc474d9eea9a679fd Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 15:01:20 +0200 Subject: [PATCH 15/20] Upgrade from podium@3.1.2 to @hapi/podium@3.4.3 --- package.json | 4 ++-- .../legacy/logging/legacy_logging_server.ts | 2 +- yarn.lock | 17 ++--------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 539262be56f0c..6147ab95b66d4 100644 --- a/package.json +++ b/package.json @@ -132,6 +132,7 @@ "@hapi/hapi": "^18.4.1", "@hapi/hoek": "^8.5.1", "@hapi/inert": "^5.2.2", + "@hapi/podium": "^3.4.3", "@hapi/vision": "^5.5.4", "@hapi/wreck": "^15.0.2", "@kbn/ace": "1.0.0", @@ -195,7 +196,6 @@ "oppsy": "^2.0.0", "p-map": "^4.0.0", "pegjs": "0.10.0", - "podium": "3.1.2", "proxy-from-env": "1.0.0", "query-string": "^6.13.2", "re2": "^1.15.4", @@ -302,6 +302,7 @@ "@types/hapi__hapi": "^18.2.6", "@types/hapi__hoek": "^6.2.0", "@types/hapi__inert": "^5.2.1", + "@types/hapi__podium": "^3.4.1", "@types/has-ansi": "^3.0.0", "@types/history": "^4.7.3", "@types/hjson": "^2.4.2", @@ -329,7 +330,6 @@ "@types/opn": "^5.1.0", "@types/pegjs": "^0.10.1", "@types/pngjs": "^3.4.0", - "@types/podium": "^1.0.0", "@types/prop-types": "^15.7.3", "@types/reach__router": "^1.2.6", "@types/react": "^16.9.36", diff --git a/src/core/server/legacy/logging/legacy_logging_server.ts b/src/core/server/legacy/logging/legacy_logging_server.ts index 29aa9765b1dce..690c9c0bfe21d 100644 --- a/src/core/server/legacy/logging/legacy_logging_server.ts +++ b/src/core/server/legacy/logging/legacy_logging_server.ts @@ -18,7 +18,7 @@ */ import { ServerExtType } from '@hapi/hapi'; -import Podium from 'podium'; +import Podium from '@hapi/podium'; // @ts-expect-error: implicit any for JS file import { Config } from '../../../../legacy/server/config'; // @ts-expect-error: implicit any for JS file diff --git a/yarn.lock b/yarn.lock index 462a89fd360a3..0e5a863bbb066 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1744,7 +1744,7 @@ resolved "https://registry.yarnpkg.com/@hapi/pinpoint/-/pinpoint-1.0.2.tgz#025b7a36dbbf4d35bf1acd071c26b20ef41e0d13" integrity sha512-dtXC/WkZBfC5vxscazuiJ6iq4j9oNx1SHknmIr8hofarpKUZKmlUVYVIhNVzIEgK5Wrc4GMHL5lZtt1uS2flmQ== -"@hapi/podium@3.x.x": +"@hapi/podium@3.x.x", "@hapi/podium@^3.4.3": version "3.4.3" resolved "https://registry.yarnpkg.com/@hapi/podium/-/podium-3.4.3.tgz#d28935870ae1372e2f983a7161e710c968a60de1" integrity sha512-QJlnYLEYZWlKQ9fSOtuUcpANyoVGwT68GA9P0iQQCAetBK0fI+nbRBt58+aMixoifczWZUthuGkNjqKxgPh/CQ== @@ -4382,7 +4382,7 @@ dependencies: "@types/mime-db" "*" -"@types/hapi__podium@*": +"@types/hapi__podium@*", "@types/hapi__podium@^3.4.1": version "3.4.1" resolved "https://registry.yarnpkg.com/@types/hapi__podium/-/hapi__podium-3.4.1.tgz#826ffed038979c844410e576b574f8237afd59bc" integrity sha512-qgMyeXTZhGWvvUnXFavW2Pksf07IV1haBM/Fdq6cFi1lCIXhUHsaTrr2w651q+rhHZf+1dgP1vltJ0/quLxYYw== @@ -4917,11 +4917,6 @@ dependencies: "@types/node" "*" -"@types/podium@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/podium/-/podium-1.0.0.tgz#bfaa2151be2b1d6109cc69f7faa9dac2cba3bb20" - integrity sha1-v6ohUb4rHWEJzGn3+qnawsujuyA= - "@types/prettier@1.16.1": version "1.16.1" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.16.1.tgz#328d1c9b54402e44119398bcb6a31b7bbd606d59" @@ -21905,14 +21900,6 @@ pnp-webpack-plugin@1.6.4: dependencies: ts-pnp "^1.1.6" -podium@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/podium/-/podium-3.1.2.tgz#b701429739cf6bdde6b3015ae6b48d400817ce9e" - integrity sha512-18VrjJAduIdPv7d9zWsfmKxTj3cQTYC5Pv5gtKxcWujYBpGbV+mhNSPYhlHW5xeWoazYyKfB9FEsPT12r5rY1A== - dependencies: - hoek "5.x.x" - joi "13.x.x" - polished@^1.9.2: version "1.9.2" resolved "https://registry.yarnpkg.com/polished/-/polished-1.9.2.tgz#d705cac66f3a3ed1bd38aad863e2c1e269baf6b6" From 9a79f6aec7188da11a5740586cbe0fd9a24cd3a0 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 14 Oct 2020 11:41:57 +0200 Subject: [PATCH 16/20] Upgrade from statehood@6.0.6 to @hapi/statehood@6.1.2 --- package.json | 2 +- .../server/http/cookie_session_storage.ts | 2 +- yarn.lock | 38 +------------------ 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 6147ab95b66d4..708ddaf82328f 100644 --- a/package.json +++ b/package.json @@ -133,6 +133,7 @@ "@hapi/hoek": "^8.5.1", "@hapi/inert": "^5.2.2", "@hapi/podium": "^3.4.3", + "@hapi/statehood": "^6.1.2", "@hapi/vision": "^5.5.4", "@hapi/wreck": "^15.0.2", "@kbn/ace": "1.0.0", @@ -215,7 +216,6 @@ "seedrandom": "^3.0.5", "semver": "^5.7.0", "source-map-support": "^0.5.19", - "statehood": "6.0.6", "style-it": "^2.1.3", "symbol-observable": "^1.2.0", "tar": "4.4.13", diff --git a/src/core/server/http/cookie_session_storage.ts b/src/core/server/http/cookie_session_storage.ts index e43a3c8acfe03..e48e90ebfeb9d 100644 --- a/src/core/server/http/cookie_session_storage.ts +++ b/src/core/server/http/cookie_session_storage.ts @@ -20,7 +20,7 @@ import { Request, Server } from '@hapi/hapi'; import hapiAuthCookie from '@hapi/cookie'; // @ts-expect-error no TS definitions -import Statehood from 'statehood'; +import Statehood from '@hapi/statehood'; import { KibanaRequest, ensureRawRequest } from './router'; import { SessionStorageFactory, SessionStorage } from './session_storage'; diff --git a/yarn.lock b/yarn.lock index 0e5a863bbb066..f1445cc439582 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1768,7 +1768,7 @@ "@hapi/bounce" "1.x.x" "@hapi/hoek" "8.x.x" -"@hapi/statehood@6.x.x": +"@hapi/statehood@6.x.x", "@hapi/statehood@^6.1.2": version "6.1.2" resolved "https://registry.yarnpkg.com/@hapi/statehood/-/statehood-6.1.2.tgz#6dda508b5da99a28a3ed295c3cac795cf6c12a02" integrity sha512-pYXw1x6npz/UfmtcpUhuMvdK5kuOGTKcJNfLqdNptzietK2UZH5RzNJSlv5bDHeSmordFM3kGItcuQWX2lj2nQ== @@ -7091,13 +7091,6 @@ axobject-query@^2.0.2: dependencies: ast-types-flow "0.0.7" -b64@4.x.x: - version "4.1.2" - resolved "https://registry.yarnpkg.com/b64/-/b64-4.1.2.tgz#7015372ba8101f7fb18da070717a93c28c8580d8" - integrity sha512-+GUspBxlH3CJaxMUGUE1EBoWM6RKgWiYwUDal0qdf8m3ArnXNN1KzKVo5HOnE/FSq4HHyWf3TlHLsZI8PKQgrQ== - dependencies: - hoek "6.x.x" - babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -9813,13 +9806,6 @@ crypt@~0.0.1: resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs= -cryptiles@4.x.x: - version "4.1.3" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-4.1.3.tgz#2461d3390ea0b82c643a6ba79f0ed491b0934c25" - integrity sha512-gT9nyTMSUC1JnziQpPbxKGBbUg8VL7Zn2NB4E1cJYvuXdElHrwxrV9bmltZGDzet45zSDGyYceueke1TjynGzw== - dependencies: - boom "7.x.x" - crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -16091,16 +16077,6 @@ ipaddr.js@1.9.0, ipaddr.js@^1.9.0: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== -iron@5.x.x: - version "5.0.6" - resolved "https://registry.yarnpkg.com/iron/-/iron-5.0.6.tgz#7121d4a6e3ac2f65e4d02971646fea1995434744" - integrity sha512-zYUMOSkEXGBdwlV/AXF9zJC0aLuTJUKHkGeYS5I2g225M5i6SrxQyGJGhPgOR8BK1omL6N5i6TcwfsXbP8/Exw== - dependencies: - b64 "4.x.x" - boom "7.x.x" - cryptiles "4.x.x" - hoek "6.x.x" - irregular-plurals@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-3.2.0.tgz#b19c490a0723798db51b235d7e39add44dab0822" @@ -25648,18 +25624,6 @@ state-toggle@^1.0.0: resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.0.tgz#d20f9a616bb4f0c3b98b91922d25b640aa2bc425" integrity sha1-0g+aYWu08MO5i5GSLSW2QKorxCU= -statehood@6.0.6: - version "6.0.6" - resolved "https://registry.yarnpkg.com/statehood/-/statehood-6.0.6.tgz#0dbd7c50774d3f61a24e42b0673093bbc81fa5f0" - integrity sha512-jR45n5ZMAkasw0xoE9j9TuLmJv4Sa3AkXe+6yIFT6a07kXYHgSbuD2OVGECdZGFxTmvNqLwL1iRIgvq6O6rq+A== - dependencies: - boom "7.x.x" - bounce "1.x.x" - cryptiles "4.x.x" - hoek "5.x.x" - iron "5.x.x" - joi "13.x.x" - static-eval@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.5.tgz#f0782e66999c4b3651cda99d9ce59c507d188f71" From 20f05a3830923d245b01b92712cb9fdf70bc7739 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 13 Oct 2020 15:57:43 +0200 Subject: [PATCH 17/20] Fix TypeScript errors --- src/core/server/http/cookie_session_storage.ts | 2 +- src/core/server/http/http_server.mocks.ts | 3 +++ src/core/server/http/http_service.mock.ts | 1 + src/core/server/http/router/request.test.ts | 6 ++++++ src/core/server/http/router/request.ts | 15 ++++++++++++--- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/core/server/http/cookie_session_storage.ts b/src/core/server/http/cookie_session_storage.ts index e48e90ebfeb9d..1ff0670d78f4e 100644 --- a/src/core/server/http/cookie_session_storage.ts +++ b/src/core/server/http/cookie_session_storage.ts @@ -150,7 +150,7 @@ export async function createCookieSessionStorageFactory( isHttpOnly: true, isSameSite: cookieOptions.sameSite === 'None' ? false : cookieOptions.sameSite ?? false, }, - validateFunc: async (req, session: T | T[]) => { + validateFunc: async (req: Request, session: T | T[]) => { const result = cookieOptions.validate(session); if (!result.isValid) { clearInvalidCookie(req, result.path); diff --git a/src/core/server/http/http_server.mocks.ts b/src/core/server/http/http_server.mocks.ts index fc9c3ca67d856..8e8eaf46a7064 100644 --- a/src/core/server/http/http_server.mocks.ts +++ b/src/core/server/http/http_server.mocks.ts @@ -87,6 +87,9 @@ function createKibanaRequestMock

({ method, url, route: { + // @ts-expect-error According to types/hapi__hapi the following settings-fields have problems: + // - `auth` can't be a boolean, but it can according to the @hapi/hapi source (https://github.com/hapijs/hapi/blob/v18.4.2/lib/route.js#L139) + // - `app` isn't a valid property, but it is and this was fixed in the types in v19.0.1 (https://github.com/DefinitelyTyped/DefinitelyTyped/pull/41968) settings: { tags: routeTags, auth: routeAuthRequired, app: kibanaRouteOptions }, }, raw: { diff --git a/src/core/server/http/http_service.mock.ts b/src/core/server/http/http_service.mock.ts index 03de8fae00c1d..4fc972c9679bb 100644 --- a/src/core/server/http/http_service.mock.ts +++ b/src/core/server/http/http_service.mock.ts @@ -88,6 +88,7 @@ const createInternalSetupContractMock = () => { start: jest.fn(), stop: jest.fn(), config: jest.fn().mockReturnValue(configMock.create()), + // @ts-expect-error somehow it thinks that `Server` isn't a `Construtable` } as unknown) as jest.MockedClass, createCookieSessionStorageFactory: jest.fn(), registerOnPreRouting: jest.fn(), diff --git a/src/core/server/http/router/request.test.ts b/src/core/server/http/router/request.test.ts index ac49697890022..3587c63706ea5 100644 --- a/src/core/server/http/router/request.test.ts +++ b/src/core/server/http/router/request.test.ts @@ -198,6 +198,7 @@ describe('KibanaRequest', () => { const request = httpServerMock.createRawRequest({ route: { settings: { + // @ts-expect-error According to types/hapi__hapi, `auth` can't be a boolean, but it can according to the @hapi/hapi source (https://github.com/hapijs/hapi/blob/v18.4.2/lib/route.js#L139) auth, }, }, @@ -211,6 +212,7 @@ describe('KibanaRequest', () => { const request = httpServerMock.createRawRequest({ route: { settings: { + // @ts-expect-error According to types/hapi__hapi, the `auth` object has to have a `strategies` array, but it doesn't look like it needs it auth, }, }, @@ -225,6 +227,7 @@ describe('KibanaRequest', () => { const request = httpServerMock.createRawRequest({ route: { settings: { + // @ts-expect-error According to types/hapi__hapi, the `auth` object has to have a `strategies` array, but it doesn't look like it needs it auth, }, }, @@ -239,6 +242,7 @@ describe('KibanaRequest', () => { const request = httpServerMock.createRawRequest({ route: { settings: { + // @ts-expect-error According to types/hapi__hapi, the `auth` object has to have a `strategies` array, but it doesn't look like it needs it auth, }, }, @@ -253,6 +257,7 @@ describe('KibanaRequest', () => { const request = httpServerMock.createRawRequest({ route: { settings: { + // @ts-expect-error According to types/hapi__hapi, `auth` can't be a string, but I'm not sure that's true auth, }, }, @@ -268,6 +273,7 @@ describe('KibanaRequest', () => { const request = httpServerMock.createRawRequest({ route: { settings: { + // @ts-expect-error According to types/hapi__hapi, the `auth` object has to have a `strategies` array, but it doesn't look like it needs it auth, }, }, diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index 5bbdd4bea9a5f..65393289552de 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -19,7 +19,7 @@ import { URL } from 'url'; import uuid from 'uuid'; -import { Request, RouteOptionsApp, RequestApplicationState } from '@hapi/hapi'; +import { Request, RouteOptionsApp, RequestApplicationState, RouteOptions } from '@hapi/hapi'; import { Observable, fromEvent, merge } from 'rxjs'; import { shareReplay, first, takeUntil } from 'rxjs/operators'; import { RecursiveReadonly } from '@kbn/utility-types'; @@ -260,8 +260,16 @@ export class KibanaRequest< const socketTimeout = (request.raw.req.socket as any)?.timeout; const options = ({ authRequired: this.getAuthRequired(request), - // some places in LP call KibanaRequest.from(request) manually. remove fallback to true before v8 - xsrfRequired: (request.route.settings.app as KibanaRouteOptions)?.xsrfRequired ?? true, + // TypeScript note: Casting to `RouterOptions` to fix the following error: + // + // Property 'app' does not exist on type 'RouteSettings' + // + // In @types/hapi__hapi v18, `request.route.settings` is of type + // `RouteSettings`, which doesn't have an `app` property. I think this is + // a mistake. In v19, the `RouteSettings` interface does have an `app` + // property. + xsrfRequired: + ((request.route.settings as RouteOptions).app as KibanaRouteOptions)?.xsrfRequired ?? true, // some places in LP call KibanaRequest.from(request) manually. remove fallback to true before v8 tags: request.route.settings.tags || [], timeout: { payload: payloadTimeout, @@ -301,6 +309,7 @@ export class KibanaRequest< return true; } + // @ts-expect-error According to @types/hapi__hapi, `route.settings` should be of type `RouteSettings`, but it seems that it's actually `RouteOptions`. if (authOptions === false) return false; throw new Error( `unexpected authentication options: ${JSON.stringify(authOptions)} for route: ${ From cff8d2d7dbece6e06f71367cddacdc161e0d5366 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 14 Oct 2020 10:00:48 +0200 Subject: [PATCH 18/20] Pin @types/hapi__mimos to v4.1.0 to avoid TypeScript validation error --- package.json | 1 + yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 708ddaf82328f..344fc54515524 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "**/@hapi/iron": "^5.1.4", "**/@types/hapi__boom": "^7.4.1", "**/@types/hapi__hapi": "^18.2.6", + "**/@types/hapi__mimos": "4.1.0", "**/@types/node": ">=10.17.17 <10.20.0", "**/cross-fetch/node-fetch": "^2.6.1", "**/deepmerge": "^4.2.2", diff --git a/yarn.lock b/yarn.lock index f1445cc439582..145af32b21818 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4375,10 +4375,10 @@ resolved "https://registry.yarnpkg.com/@types/hapi__joi/-/hapi__joi-17.1.6.tgz#b84663676aa9753c17183718338dd40ddcbd3754" integrity sha512-y3A1MzNC0FmzD5+ys59RziE1WqKrL13nxtJgrSzjoO7boue5B7zZD2nZLPwrSuUviFjpKFQtgHYSvhDGfIE4jA== -"@types/hapi__mimos@*": - version "4.1.3" - resolved "https://registry.yarnpkg.com/@types/hapi__mimos/-/hapi__mimos-4.1.3.tgz#e2ad0510af090a87c16f5a7bdffbb9638ef36444" - integrity sha512-vZiKXZ0QqwSh0v1z9/f/VEPvmAHQaAXeVK9kGQIQH+2cqxrb2IL4TSDF0aPhPnNzuCvcUWaeCuGXj8V79v/kEA== +"@types/hapi__mimos@*", "@types/hapi__mimos@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@types/hapi__mimos/-/hapi__mimos-4.1.0.tgz#47dbf89ebfc05183c1de2797e9426793db9a0d85" + integrity sha512-hcdSoYa32wcP+sEfyf85ieGwElwokcZ/mma8eyqQ4OTHeCAGwfaoiGxjG4z1Dm+RGhIYLHlW54ji5FFwahH12A== dependencies: "@types/mime-db" "*" From 6c6f2239ed939caaedce595c566cc1050a51d8c6 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Sat, 31 Oct 2020 12:18:12 +0100 Subject: [PATCH 19/20] Replace boom with @hapi/boom in changes from master --- .../plugins/apm/server/lib/service_map/get_trace_sample_ids.ts | 2 +- x-pack/plugins/infra/server/routes/metrics_api/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts b/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts index 524b9bfdc7891..22c655bb96f50 100644 --- a/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts +++ b/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { uniq, take, sortBy } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ProcessorEvent } from '../../../common/processor_event'; import { Setup, SetupTimeRange } from '../helpers/setup_request'; import { rangeFilter } from '../../../common/utils/range_filter'; diff --git a/x-pack/plugins/infra/server/routes/metrics_api/index.ts b/x-pack/plugins/infra/server/routes/metrics_api/index.ts index f3dcdeeb70cc1..06d9fe0f6fc94 100644 --- a/x-pack/plugins/infra/server/routes/metrics_api/index.ts +++ b/x-pack/plugins/infra/server/routes/metrics_api/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; From e74558ef451493cca41a56b57f612bc55e716e1f Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Mon, 2 Nov 2020 09:06:57 +0100 Subject: [PATCH 20/20] Address review comments --- .../http/integration_tests/request.test.ts | 48 +++++++++++++++++++ src/core/server/http/router/request.test.ts | 22 +++------ src/core/server/http/router/request.ts | 2 +- 3 files changed, 55 insertions(+), 17 deletions(-) diff --git a/src/core/server/http/integration_tests/request.test.ts b/src/core/server/http/integration_tests/request.test.ts index 3d0eba6de632e..710d7915c60a1 100644 --- a/src/core/server/http/integration_tests/request.test.ts +++ b/src/core/server/http/integration_tests/request.test.ts @@ -124,6 +124,54 @@ describe('KibanaRequest', () => { }); }); }); + + describe('route options', () => { + describe('authRequired', () => { + it('returns false if a route configured with "authRequired": false', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + registerAuth((req, res, t) => t.authenticated()); + const router = createRouter('/'); + router.get( + { path: '/', validate: false, options: { authRequired: false } }, + (context, req, res) => res.ok({ body: { authRequired: req.route.options.authRequired } }) + ); + await server.start(); + + await supertest(innerServer.listener).get('/').expect(200, { + authRequired: false, + }); + }); + it('returns "optional" if a route configured with "authRequired": optional', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + registerAuth((req, res, t) => t.authenticated()); + const router = createRouter('/'); + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => res.ok({ body: { authRequired: req.route.options.authRequired } }) + ); + await server.start(); + + await supertest(innerServer.listener).get('/').expect(200, { + authRequired: 'optional', + }); + }); + it('returns true if a route configured with "authRequired": true', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + registerAuth((req, res, t) => t.authenticated()); + const router = createRouter('/'); + router.get( + { path: '/', validate: false, options: { authRequired: true } }, + (context, req, res) => res.ok({ body: { authRequired: req.route.options.authRequired } }) + ); + await server.start(); + + await supertest(innerServer.listener).get('/').expect(200, { + authRequired: true, + }); + }); + }); + }); + describe('events', () => { describe('aborted$', () => { it('emits once and completes when request aborted', async (done) => { diff --git a/src/core/server/http/router/request.test.ts b/src/core/server/http/router/request.test.ts index 3587c63706ea5..8e8ef2d692e32 100644 --- a/src/core/server/http/router/request.test.ts +++ b/src/core/server/http/router/request.test.ts @@ -208,12 +208,10 @@ describe('KibanaRequest', () => { expect(kibanaRequest.route.options.authRequired).toBe(false); }); it('handles required auth: { mode: "required" }', () => { - const auth: RouteOptions['auth'] = { mode: 'required' }; const request = httpServerMock.createRawRequest({ route: { settings: { - // @ts-expect-error According to types/hapi__hapi, the `auth` object has to have a `strategies` array, but it doesn't look like it needs it - auth, + auth: { mode: 'required' }, }, }, }); @@ -223,12 +221,10 @@ describe('KibanaRequest', () => { }); it('handles required auth: { mode: "optional" }', () => { - const auth: RouteOptions['auth'] = { mode: 'optional' }; const request = httpServerMock.createRawRequest({ route: { settings: { - // @ts-expect-error According to types/hapi__hapi, the `auth` object has to have a `strategies` array, but it doesn't look like it needs it - auth, + auth: { mode: 'optional' }, }, }, }); @@ -238,12 +234,10 @@ describe('KibanaRequest', () => { }); it('handles required auth: { mode: "try" } as "optional"', () => { - const auth: RouteOptions['auth'] = { mode: 'try' }; const request = httpServerMock.createRawRequest({ route: { settings: { - // @ts-expect-error According to types/hapi__hapi, the `auth` object has to have a `strategies` array, but it doesn't look like it needs it - auth, + auth: { mode: 'try' }, }, }, }); @@ -253,28 +247,24 @@ describe('KibanaRequest', () => { }); it('throws on auth: strategy name', () => { - const auth: RouteOptions['auth'] = 'session'; const request = httpServerMock.createRawRequest({ route: { settings: { - // @ts-expect-error According to types/hapi__hapi, `auth` can't be a string, but I'm not sure that's true - auth, + auth: { strategies: ['session'] }, }, }, }); expect(() => KibanaRequest.from(request)).toThrowErrorMatchingInlineSnapshot( - `"unexpected authentication options: \\"session\\" for route: /"` + `"unexpected authentication options: {\\"strategies\\":[\\"session\\"]} for route: /"` ); }); it('throws on auth: { mode: unexpected mode }', () => { - const auth: RouteOptions['auth'] = { mode: undefined }; const request = httpServerMock.createRawRequest({ route: { settings: { - // @ts-expect-error According to types/hapi__hapi, the `auth` object has to have a `strategies` array, but it doesn't look like it needs it - auth, + auth: { mode: undefined }, }, }, }); diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index 65393289552de..57665a4fad594 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -309,7 +309,7 @@ export class KibanaRequest< return true; } - // @ts-expect-error According to @types/hapi__hapi, `route.settings` should be of type `RouteSettings`, but it seems that it's actually `RouteOptions`. + // @ts-expect-error According to @types/hapi__hapi, `route.settings` should be of type `RouteSettings`, but it seems that it's actually `RouteOptions` (https://github.com/hapijs/hapi/blob/v18.4.2/lib/route.js#L139) if (authOptions === false) return false; throw new Error( `unexpected authentication options: ${JSON.stringify(authOptions)} for route: ${