Skip to content

Commit

Permalink
Merge branch '6.8' into bump-node
Browse files Browse the repository at this point in the history
  • Loading branch information
watson committed Jul 1, 2021
2 parents 9fb3ca7 + 0997f4e commit 0e476e5
Show file tree
Hide file tree
Showing 241 changed files with 1,047 additions and 654 deletions.
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"**/grunt-legacy-log-utils/lodash": "^4.17.21",
"**/grunt-legacy-util/lodash": "^4.17.21",
"**/grunt/js-yaml": "^3.13.1",
"**/@elastic/eui/highlight.js": "^9.18.5",
"**/isomorphic-fetch/node-fetch": "^2.6.1",
"**/istanbul-instrumenter-loader/schema-utils": "1.0.0",
"**/load-grunt-config/js-yaml": "^3.13.1",
Expand Down Expand Up @@ -126,20 +127,20 @@
]
},
"dependencies": {
"@commercial/boom": "^7.4.12",
"@commercial/hapi": "^17.9.4",
"@commercial/hoek": "^6.2.5",
"@commercial/podium": "^3.4.3",
"@elastic/datemath": "5.0.2",
"@elastic/eui": "6.10.9",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.2",
"@elastic/ui-ace": "0.2.3",
"@hapi/boom": "^7.4.11",
"@hapi/good-squeeze": "^6.0.0",
"@hapi/h2o2": "^8.3.2",
"@hapi/hapi": "^17.9.0",
"@hapi/hoek": "^6.2.4",
"@hapi/inert": "^5.2.2",
"@hapi/oppsy": "^2.1.2",
"@hapi/podium": "^3.4.3",
"@hapi/vision": "^5.5.4",
"@hapi/wreck": "^16.0.1",
"@kbn/babel-code-parser": "1.0.0",
Expand Down Expand Up @@ -300,6 +301,10 @@
"@types/bluebird": "^3.1.1",
"@types/chance": "^1.0.0",
"@types/classnames": "^2.2.3",
"@types/commercial__boom": "npm:@types/hapi__boom@^7.4.1",
"@types/commercial__hapi": "npm:@types/[email protected]",
"@types/commercial__hoek": "npm:@types/hapi__hoek@^6.2.0",
"@types/commercial__podium": "npm:@types/hapi__podium@^3.4.1",
"@types/d3": "^3.5.41",
"@types/dedent": "^0.7.0",
"@types/del": "^3.0.1",
Expand All @@ -313,10 +318,6 @@
"@types/glob": "^5.0.35",
"@types/globby": "^8.0.0",
"@types/graphql": "^0.13.1",
"@types/hapi__boom": "^7.4.1",
"@types/hapi__hapi": "npm:@types/[email protected]",
"@types/hapi__hoek": "^6.2.0",
"@types/hapi__podium": "^3.4.1",
"@types/has-ansi": "^3.0.0",
"@types/humps": "^1.1.2",
"@types/jest": "^23.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"grunt-babel": "^7.0.0",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-copy": "^1.0.0",
"highlight.js": "9.0.0",
"highlight.js": "^9.18.5",
"html": "1.0.0",
"html-loader": "^0.5.5",
"imports-loader": "^0.8.0",
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/base_path_proxy_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Server } from '@hapi/hapi';
import { Server } from '@commercial/hapi';
import { ByteSizeValue } from '@kbn/config-schema';
import { Agent as HttpsAgent, ServerOptions as TlsOptions } from 'https';
import { sample } from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/http_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Server, ServerOptions } from '@hapi/hapi';
import { Server, ServerOptions } from '@commercial/hapi';

import { modifyUrl } from '../../utils';
import { Logger } from '../logging';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/http_tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Request, ResponseToolkit } from '@hapi/hapi';
import { Request, ResponseToolkit } from '@commercial/hapi';
import Joi from 'joi';
import { defaultValidationErrorHandler, HapiValidationError } from './http_tools';

Expand Down
4 changes: 2 additions & 2 deletions src/core/server/http/http_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

import { Lifecycle, Request, ResponseToolkit, Server, ServerOptions, Util } from '@hapi/hapi';
import Hoek from '@hapi/hoek';
import { Lifecycle, Request, ResponseToolkit, Server, ServerOptions, Util } from '@commercial/hapi';
import Hoek from '@commercial/hoek';
import { readFileSync } from 'fs';
import { ServerOptions as TLSOptions } from 'https';
import { ValidationError } from 'joi';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/https_redirect_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Request, ResponseToolkit, Server } from '@hapi/hapi';
import { Request, ResponseToolkit, Server } from '@commercial/hapi';
import { format as formatUrl } from 'url';

import { Logger } from '../logging';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/router/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Request } from '@hapi/hapi';
import { Request } from '@commercial/hapi';
import { ObjectType, TypeOf } from '@kbn/config-schema';

import { filterHeaders, Headers } from './headers';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Request, ResponseObject, ResponseToolkit } from '@hapi/hapi';
import { Request, ResponseObject, ResponseToolkit } from '@commercial/hapi';
import { ObjectType, schema, TypeOf } from '@kbn/config-schema';

import { KibanaRequest } from './request';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/legacy_compat/legacy_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Server as HapiServer } from '@hapi/hapi';
import { Server as HapiServer } from '@commercial/hapi';
import { combineLatest, ConnectableObservable, EMPTY, Subscription } from 'rxjs';
import { first, map, mergeMap, publishReplay, tap } from 'rxjs/operators';
import { CoreContext, CoreService } from '../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

import { ServerExtType } from '@hapi/hapi';
import Podium from '@hapi/podium';
import { ServerExtType } from '@commercial/hapi';
import Podium from '@commercial/podium';
// @ts-ignore: implicit any for JS file
import { Config, transformDeprecations } from '../../../../server/config';
// @ts-ignore: implicit any for JS file
Expand Down
2 changes: 2 additions & 0 deletions src/dev/build/build_distributables.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
TranspileBabelTask,
TranspileTypescriptTask,
TranspileScssTask,
UpdateHapiCommercialLicenseTask,
UpdateLicenseFileTask,
VerifyEnvTask,
VerifyExistingNodeBuildsTask,
Expand Down Expand Up @@ -114,6 +115,7 @@ export async function buildDistributables(options) {
await run(RemoveWorkspacesTask);
await run(CleanTypescriptTask);
await run(CleanPackagesTask);
await run(UpdateHapiCommercialLicenseTask);
await run(CreateNoticeFileTask);
await run(UpdateLicenseFileTask);
await run(RemovePackageJsonDepsTask);
Expand Down
46 changes: 46 additions & 0 deletions src/dev/build/tasks/hapi_commercial_license/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { join } from 'path';
import { promises as fs } from 'fs';
import { getInstalledPackages } from '../../../npm';

export const UpdateHapiCommercialLicenseTask = {
description: 'Updating packages in the @commercial namespace with custom LICENSE file',

async run(config, log, build) {
log.info('Finding installed production packages in the @commercial namespace');
const packages = (await getInstalledPackages({ directory: build.resolvePath() }))
.filter((pkg) => pkg.name.startsWith('@commercial/'));
return Promise.all(
packages.map(async ({ directory }) => await addNewLicense(directory, log))
);
}
};

async function addNewLicense(packageDirectory, log) {
const oldPath = join(packageDirectory, 'LICENSE.md');
log.info(`Deleting old license at ${oldPath}`);
await fs.unlink(oldPath);

const templatePath = join(__dirname, 'license_template');
const newPath = join(packageDirectory, 'LICENSE');
log.info(`Adding new license at ${newPath}`);
await fs.copyFile(templatePath, newPath);
}
32 changes: 32 additions & 0 deletions src/dev/build/tasks/hapi_commercial_license/license_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Sideway Inc. grants Elasticsearch B.V. and its subsidiaries a perpetual,
nonexclusive license to the Covered Software under the 3-Clause BSD License
(https://opensource.org/licenses/BSD-3-Clause) license as follows:

Copyright 2012-2020 Sideway Inc.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of Sideway Inc. nor the names of its contributors may be
used toendorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY SIDEWAY INC. "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SIDEWAY INC. BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
1 change: 1 addition & 0 deletions src/dev/build/tasks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export * from './create_archives_task';
export * from './create_empty_dirs_and_files_task';
export * from './create_package_json_task';
export * from './create_readme_task';
export * from './hapi_commercial_license';
export * from './install_dependencies_task';
export * from './license_file_task';
export * from './nodejs';
Expand Down
34 changes: 34 additions & 0 deletions src/dev/license_checker/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,40 @@ export const LICENSE_OVERRIDES = {
'[email protected]': ['Eclipse Distribution License - v 1.0'], //cf. https://github.com/bjornharrtell/jsts
'@mapbox/[email protected]': ['MIT'], //license in readme https://github.com/tmcw/jsonlint

// Override for the commercial hapi license
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],
'@commercial/[email protected]': ['BSD-3-Clause'],

// TODO can be removed once we upgrade past [email protected]
'[email protected]': ['Apache-2.0'],

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/console/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import Boom from '@hapi/boom';
import Boom from '@commercial/boom';
import { resolve, join, sep } from 'path';
import url from 'url';
import { has, isEmpty, head } from 'lodash';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import sinon from 'sinon';
import Wreck from '@hapi/wreck';
import expect from 'expect.js';
import { Server } from '@hapi/hapi';
import { Server } from '@commercial/hapi';

import { createProxyRoute } from '../../';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { request } from 'http';
import sinon from 'sinon';
import Wreck from '@hapi/wreck';
import expect from 'expect.js';
import { Server } from '@hapi/hapi';
import { Server } from '@commercial/hapi';

import { createProxyRoute } from '../../';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Agent } from 'http';
import sinon from 'sinon';
import Wreck from '@hapi/wreck';
import expect from 'expect.js';
import { Server } from '@hapi/hapi';
import { Server } from '@commercial/hapi';

import { createProxyRoute } from '../../';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import sinon from 'sinon';
import Wreck from '@hapi/wreck';
import expect from 'expect.js';
import { Server } from '@hapi/hapi';
import { Server } from '@commercial/hapi';

import { createProxyRoute } from '../../';

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/console/server/proxy_route.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import Joi from 'joi';
import Boom from '@hapi/boom';
import Boom from '@commercial/boom';
import Wreck from '@hapi/wreck';
import { trimLeft, trimRight } from 'lodash';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import expect from 'expect.js';
import { createClusters } from '../create_clusters';
import sinon from 'sinon';
import { partial } from 'lodash';
import Hapi from '@hapi/hapi';
import Hapi from '@commercial/hapi';

import * as ClusterNS from '../cluster';

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/elasticsearch/lib/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import elasticsearch from 'elasticsearch';
import { get, set, isEmpty, cloneDeep, pick } from 'lodash';
import toPath from 'lodash/internal/toPath';
import Boom from '@hapi/boom';
import Boom from '@commercial/boom';

import filterHeaders from './filter_headers';
import { parseConfig } from './parse_config';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import Boom from '@hapi/boom';
import Boom from '@commercial/boom';
import { serializeProvider } from '@kbn/interpreter/common';
import { API_ROUTE } from '../../common/constants';
import { createHandlers } from '../lib/create_handlers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import Boom from '@hapi/boom';
import Boom from '@commercial/boom';
import _ from 'lodash';
import { errors as esErrors } from 'elasticsearch';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { exportDashboards } from '../../../lib/export/export_dashboards';
import Boom from '@hapi/boom';
import Boom from '@commercial/boom';
import Joi from 'joi';
import moment from 'moment';
export function exportApi(server) {
Expand Down
Loading

0 comments on commit 0e476e5

Please sign in to comment.