From 707388009ff1a5f7b3145fe683781ae62f030261 Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 3 Sep 2020 10:44:11 +0200 Subject: [PATCH 1/3] move prompt to cli_keystore --- src/cli_keystore/add.js | 2 +- src/cli_keystore/add.test.js | 2 +- src/cli_keystore/create.js | 2 +- src/cli_keystore/create.test.js | 2 +- src/{legacy/server => cli_keystore}/utils/index.js | 0 src/{legacy/server => cli_keystore}/utils/prompt.js | 0 src/{legacy/server => cli_keystore}/utils/prompt.test.js | 0 7 files changed, 4 insertions(+), 4 deletions(-) rename src/{legacy/server => cli_keystore}/utils/index.js (100%) rename src/{legacy/server => cli_keystore}/utils/prompt.js (100%) rename src/{legacy/server => cli_keystore}/utils/prompt.test.js (100%) diff --git a/src/cli_keystore/add.js b/src/cli_keystore/add.js index 44737e387c2d2..c77924a84b647 100644 --- a/src/cli_keystore/add.js +++ b/src/cli_keystore/add.js @@ -18,7 +18,7 @@ */ import { Logger } from '../cli_plugin/lib/logger'; -import { confirm, question } from '../legacy/server/utils'; +import { confirm, question } from './utils'; import { createPromiseFromStreams, createConcatStream } from '../legacy/utils'; /** diff --git a/src/cli_keystore/add.test.js b/src/cli_keystore/add.test.js index b5d5009667eb4..f1adee8879bc2 100644 --- a/src/cli_keystore/add.test.js +++ b/src/cli_keystore/add.test.js @@ -42,7 +42,7 @@ import { PassThrough } from 'stream'; import { Keystore } from '../legacy/server/keystore'; import { add } from './add'; import { Logger } from '../cli_plugin/lib/logger'; -import * as prompt from '../legacy/server/utils/prompt'; +import * as prompt from './utils/prompt'; describe('Kibana keystore', () => { describe('add', () => { diff --git a/src/cli_keystore/create.js b/src/cli_keystore/create.js index 8be1eb36882f1..55fe2c151dec0 100644 --- a/src/cli_keystore/create.js +++ b/src/cli_keystore/create.js @@ -18,7 +18,7 @@ */ import { Logger } from '../cli_plugin/lib/logger'; -import { confirm } from '../legacy/server/utils'; +import { confirm } from './utils'; export async function create(keystore, command, options) { const logger = new Logger(options); diff --git a/src/cli_keystore/create.test.js b/src/cli_keystore/create.test.js index f48b3775ddfff..cb85475eab1cb 100644 --- a/src/cli_keystore/create.test.js +++ b/src/cli_keystore/create.test.js @@ -41,7 +41,7 @@ import sinon from 'sinon'; import { Keystore } from '../legacy/server/keystore'; import { create } from './create'; import { Logger } from '../cli_plugin/lib/logger'; -import * as prompt from '../legacy/server/utils/prompt'; +import * as prompt from './utils/prompt'; describe('Kibana keystore', () => { describe('create', () => { diff --git a/src/legacy/server/utils/index.js b/src/cli_keystore/utils/index.js similarity index 100% rename from src/legacy/server/utils/index.js rename to src/cli_keystore/utils/index.js diff --git a/src/legacy/server/utils/prompt.js b/src/cli_keystore/utils/prompt.js similarity index 100% rename from src/legacy/server/utils/prompt.js rename to src/cli_keystore/utils/prompt.js diff --git a/src/legacy/server/utils/prompt.test.js b/src/cli_keystore/utils/prompt.test.js similarity index 100% rename from src/legacy/server/utils/prompt.test.js rename to src/cli_keystore/utils/prompt.test.js From c7fd92e3a0a4ba76cfcad88f0e4e5efe458eb72f Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 3 Sep 2020 10:48:29 +0200 Subject: [PATCH 2/3] move binder to cli --- src/{legacy/utils => cli/cluster}/binder.ts | 0 src/{legacy/utils => cli/cluster}/binder_for.ts | 0 src/cli/cluster/worker.ts | 2 +- src/legacy/utils/index.js | 2 -- 4 files changed, 1 insertion(+), 3 deletions(-) rename src/{legacy/utils => cli/cluster}/binder.ts (100%) rename src/{legacy/utils => cli/cluster}/binder_for.ts (100%) diff --git a/src/legacy/utils/binder.ts b/src/cli/cluster/binder.ts similarity index 100% rename from src/legacy/utils/binder.ts rename to src/cli/cluster/binder.ts diff --git a/src/legacy/utils/binder_for.ts b/src/cli/cluster/binder_for.ts similarity index 100% rename from src/legacy/utils/binder_for.ts rename to src/cli/cluster/binder_for.ts diff --git a/src/cli/cluster/worker.ts b/src/cli/cluster/worker.ts index 097a549187429..c8a8a067d30bf 100644 --- a/src/cli/cluster/worker.ts +++ b/src/cli/cluster/worker.ts @@ -21,7 +21,7 @@ import _ from 'lodash'; import cluster from 'cluster'; import { EventEmitter } from 'events'; -import { BinderFor } from '../../legacy/utils/binder_for'; +import { BinderFor } from './binder_for'; import { fromRoot } from '../../core/server/utils'; const cliPath = fromRoot('src/cli'); diff --git a/src/legacy/utils/index.js b/src/legacy/utils/index.js index 4274fb2e4901a..8e821a48a5882 100644 --- a/src/legacy/utils/index.js +++ b/src/legacy/utils/index.js @@ -17,8 +17,6 @@ * under the License. */ -export { BinderBase } from './binder'; -export { BinderFor } from './binder_for'; export { deepCloneWithBuffers } from './deep_clone_with_buffers'; export { unset } from './unset'; export { IS_KIBANA_DISTRIBUTABLE } from './artifact_type'; From b1e08ad46c068d4ada36e8a85ab603d79dd93540 Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 3 Sep 2020 10:49:15 +0200 Subject: [PATCH 3/3] remove unused path_contains --- src/legacy/utils/path_contains.js | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 src/legacy/utils/path_contains.js diff --git a/src/legacy/utils/path_contains.js b/src/legacy/utils/path_contains.js deleted file mode 100644 index 60d05c1099554..0000000000000 --- a/src/legacy/utils/path_contains.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 { relative } from 'path'; - -export default function pathContains(root, child) { - return relative(child, root).slice(0, 2) !== '..'; -}