diff --git a/src/plugins/interactive_setup/server/config.ts b/src/plugins/interactive_setup/server/config.ts index 426789dba1a77..b16c51bcbda09 100644 --- a/src/plugins/interactive_setup/server/config.ts +++ b/src/plugins/interactive_setup/server/config.ts @@ -13,5 +13,4 @@ export type ConfigType = TypeOf<typeof ConfigSchema>; export const ConfigSchema = schema.object({ enabled: schema.boolean({ defaultValue: false }), - forceSetup: schema.boolean({ defaultValue: false }), }); diff --git a/src/plugins/interactive_setup/server/plugin.ts b/src/plugins/interactive_setup/server/plugin.ts index 5f529739820b2..6b2a12bad76bc 100644 --- a/src/plugins/interactive_setup/server/plugin.ts +++ b/src/plugins/interactive_setup/server/plugin.ts @@ -46,12 +46,10 @@ export class UserSetupPlugin implements PrebootPlugin { // We shouldn't activate interactive setup mode if we detect that user has already configured // Elasticsearch connection manually: either if Kibana system user credentials are specified or // user specified non-default host for the Elasticsearch. - // User can also set `interactiveSetup.forceSetup` config to `true` to force interactive setup mode. const shouldActiveSetupMode = - this.#getConfig().forceSetup || - (!core.elasticsearch.config.credentialsSpecified && - core.elasticsearch.config.hosts.length === 1 && - core.elasticsearch.config.hosts[0] === 'http://localhost:9200'); + !core.elasticsearch.config.credentialsSpecified && + core.elasticsearch.config.hosts.length === 1 && + core.elasticsearch.config.hosts[0] === 'http://localhost:9200'; if (!shouldActiveSetupMode) { this.#logger.debug( 'Interactive setup mode will not be activated since Elasticsearch connection is already configured.' diff --git a/src/plugins/interactive_setup/server/routes/enrollment/enroll.ts b/src/plugins/interactive_setup/server/routes/enroll.ts similarity index 88% rename from src/plugins/interactive_setup/server/routes/enrollment/enroll.ts rename to src/plugins/interactive_setup/server/routes/enroll.ts index b3f6f006629b0..a600d18109760 100644 --- a/src/plugins/interactive_setup/server/routes/enrollment/enroll.ts +++ b/src/plugins/interactive_setup/server/routes/enroll.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; -import type { RouteDefinitionParams } from '../'; +import type { RouteDefinitionParams } from './'; /** * Defines routes to deal with Elasticsearch `enroll_kibana` APIs. @@ -16,7 +16,7 @@ import type { RouteDefinitionParams } from '../'; export function defineEnrollRoutes({ router }: RouteDefinitionParams) { router.post( { - path: '/internal/interactive_setup/enrollment/enroll', + path: '/internal/interactive_setup/enroll', validate: { body: schema.object({ token: schema.string() }), }, diff --git a/src/plugins/interactive_setup/server/routes/enrollment/index.ts b/src/plugins/interactive_setup/server/routes/enrollment/index.ts deleted file mode 100644 index e8dda0c25ac17..0000000000000 --- a/src/plugins/interactive_setup/server/routes/enrollment/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import type { RouteDefinitionParams } from '../'; -import { defineEnrollRoutes } from './enroll'; -import { defineValidateTokenRoutes } from './validate_token'; - -export function defineEnrollmentRoutes(params: RouteDefinitionParams) { - defineEnrollRoutes(params); - defineValidateTokenRoutes(params); -} diff --git a/src/plugins/interactive_setup/server/routes/enrollment/validate_token.ts b/src/plugins/interactive_setup/server/routes/enrollment/validate_token.ts deleted file mode 100644 index c38372fd59f8a..0000000000000 --- a/src/plugins/interactive_setup/server/routes/enrollment/validate_token.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { schema } from '@kbn/config-schema'; - -import type { RouteDefinitionParams } from '../'; - -/** - * Defines routes to parse and validate Elasticsearch enrollment token. - */ -export function defineValidateTokenRoutes({ router }: RouteDefinitionParams) { - router.post( - { - path: '/internal/interactive_setup/enrollment/validate_token', - validate: { - body: schema.object({ token: schema.string() }), - }, - options: { authRequired: false }, - }, - async (context, request, response) => { - return response.forbidden({ - body: { message: `API is not implemented yet.` }, - }); - } - ); -} diff --git a/src/plugins/interactive_setup/server/routes/index.ts b/src/plugins/interactive_setup/server/routes/index.ts index 23d6077b5a7fd..988b6245b1879 100644 --- a/src/plugins/interactive_setup/server/routes/index.ts +++ b/src/plugins/interactive_setup/server/routes/index.ts @@ -10,7 +10,7 @@ import type { IBasePath, IRouter, Logger } from 'src/core/server'; import type { ElasticsearchConnectionStatus } from '../../common'; import type { ConfigType } from '../config'; -import { defineEnrollmentRoutes } from './enrollment'; +import { defineEnrollRoutes } from './enroll'; import { defineViewRoutes } from './views'; /** @@ -25,6 +25,6 @@ export interface RouteDefinitionParams { } export function defineRoutes(params: RouteDefinitionParams) { - defineEnrollmentRoutes(params); + defineEnrollRoutes(params); defineViewRoutes(params); }