diff --git a/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.host.md b/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.host.md deleted file mode 100644 index 903a5193c0383..0000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.host.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpServerInfo](./kibana-plugin-core-server.httpserverinfo.md) > [host](./kibana-plugin-core-server.httpserverinfo.host.md) - -## HttpServerInfo.host property - -The hostname of the server - -Signature: - -```typescript -host: string; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.md b/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.md index 637e8a232a9ef..3541824a2e81e 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpserverinfo.md @@ -15,7 +15,7 @@ export interface HttpServerInfo | Property | Type | Description | | --- | --- | --- | -| [host](./kibana-plugin-core-server.httpserverinfo.host.md) | string | The hostname of the server | +| [hostname](./kibana-plugin-core-server.httpserverinfo.hostname.md) | string | The hostname of the server | | [name](./kibana-plugin-core-server.httpserverinfo.name.md) | string | The name of the Kibana server | | [port](./kibana-plugin-core-server.httpserverinfo.port.md) | number | The port the server is listening on | | [protocol](./kibana-plugin-core-server.httpserverinfo.protocol.md) | 'http' | 'https' | 'socket' | The protocol used by the server | diff --git a/src/core/server/http/http_server.test.ts b/src/core/server/http/http_server.test.ts index 4520851bb460c..72cb0b2821c5c 100644 --- a/src/core/server/http/http_server.test.ts +++ b/src/core/server/http/http_server.test.ts @@ -1051,7 +1051,7 @@ describe('setup contract', () => { let { getServerInfo } = await server.setup(config); expect(getServerInfo()).toEqual({ - host: '127.0.0.1', + hostname: '127.0.0.1', name: 'kibana', port: 10002, protocol: 'http', @@ -1065,7 +1065,7 @@ describe('setup contract', () => { })); expect(getServerInfo()).toEqual({ - host: 'localhost', + hostname: 'localhost', name: 'custom-name', port: 12345, protocol: 'http', diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index d4615dd4744e5..1abf5c0c133bb 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -128,7 +128,7 @@ export class HttpServer { getAuthHeaders: this.authRequestHeaders.get, getServerInfo: () => ({ name: config.name, - host: config.host, + hostname: config.host, port: config.port, protocol: this.server!.info.protocol, }), diff --git a/src/core/server/http/http_service.mock.ts b/src/core/server/http/http_service.mock.ts index 02ae6f5d95a87..5e7ee7b658eca 100644 --- a/src/core/server/http/http_service.mock.ts +++ b/src/core/server/http/http_service.mock.ts @@ -104,7 +104,7 @@ const createInternalSetupContractMock = () => { mock.createRouter.mockImplementation(() => mockRouter.create()); mock.getAuthHeaders.mockReturnValue({ authorization: 'authorization-header' }); mock.getServerInfo.mockReturnValue({ - host: 'localhost', + hostname: 'localhost', name: 'kibana', port: 80, protocol: 'http', diff --git a/src/core/server/http/types.ts b/src/core/server/http/types.ts index 7f2e70545d015..241af1a3020cb 100644 --- a/src/core/server/http/types.ts +++ b/src/core/server/http/types.ts @@ -311,7 +311,7 @@ export interface HttpServerInfo { /** The name of the Kibana server */ name: string; /** The hostname of the server */ - host: string; + hostname: string; /** The port the server is listening on */ port: number; /** The protocol used by the server */ diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index cb413be2c19b8..c2eade5f05ccd 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -744,7 +744,7 @@ export type HttpResponsePayload = undefined | string | Record | Buf // @public (undocumented) export interface HttpServerInfo { - host: string; + hostname: string; name: string; port: number; protocol: 'http' | 'https' | 'socket'; diff --git a/x-pack/plugins/ingest_manager/server/routes/install_script/index.ts b/x-pack/plugins/ingest_manager/server/routes/install_script/index.ts index 2a8d4fdbec497..c2a5d77a39eb1 100644 --- a/x-pack/plugins/ingest_manager/server/routes/install_script/index.ts +++ b/x-pack/plugins/ingest_manager/server/routes/install_script/index.ts @@ -42,7 +42,7 @@ export const registerRoutes = ({ (await settingsService.getSettings(soClient)).kibana_url || url.format({ protocol: serverInfo.protocol, - hostname: serverInfo.host, + hostname: serverInfo.hostname, port: serverInfo.port, pathname: basePath.serverBasePath, }); diff --git a/x-pack/plugins/ingest_manager/server/services/setup.ts b/x-pack/plugins/ingest_manager/server/services/setup.ts index e5ed5c589389c..e27a5456a5a7d 100644 --- a/x-pack/plugins/ingest_manager/server/services/setup.ts +++ b/x-pack/plugins/ingest_manager/server/services/setup.ts @@ -69,7 +69,7 @@ export async function setupIngestManager( const flagsUrl = appContextService.getConfig()?.fleet?.kibana?.host; const defaultUrl = url.format({ protocol: serverInfo.protocol, - hostname: serverInfo.host, + hostname: serverInfo.hostname, port: serverInfo.port, pathname: basePath.serverBasePath, }); diff --git a/x-pack/plugins/monitoring/server/plugin.ts b/x-pack/plugins/monitoring/server/plugin.ts index ad2a5b7bb1ce2..7c346e007da23 100644 --- a/x-pack/plugins/monitoring/server/plugin.ts +++ b/x-pack/plugins/monitoring/server/plugin.ts @@ -209,10 +209,10 @@ export class Plugin { uuid: core.uuid.getInstanceUuid(), name: serverInfo.name, index: get(legacyConfig, 'kibana.index'), - host: serverInfo.host, + host: serverInfo.hostname, locale: i18n.getLocale(), port: serverInfo.port.toString(), - transport_address: `${serverInfo.host}:${serverInfo.port}`, + transport_address: `${serverInfo.hostname}:${serverInfo.port}`, version: this.initializerContext.env.packageInfo.version, snapshot: snapshotRegex.test(this.initializerContext.env.packageInfo.version), }, diff --git a/x-pack/plugins/reporting/server/config/config.ts b/x-pack/plugins/reporting/server/config/config.ts index 2a09ebea9619c..ca07fd8452372 100644 --- a/x-pack/plugins/reporting/server/config/config.ts +++ b/x-pack/plugins/reporting/server/config/config.ts @@ -72,7 +72,7 @@ export const buildConfig = async ( }, server: { basePath: core.http.basePath.serverBasePath, - host: serverInfo.host, + host: serverInfo.hostname, name: serverInfo.name, port: serverInfo.port, uuid: core.uuid.getInstanceUuid(), diff --git a/x-pack/plugins/reporting/server/config/create_config.test.ts b/x-pack/plugins/reporting/server/config/create_config.test.ts index 8ad8042a93105..f1257f51f4910 100644 --- a/x-pack/plugins/reporting/server/config/create_config.test.ts +++ b/x-pack/plugins/reporting/server/config/create_config.test.ts @@ -11,7 +11,7 @@ import { createConfig$ } from './create_config'; import { ReportingConfigType } from './schema'; interface KibanaServer { - host?: string; + hostname?: string; port?: number; protocol?: string; } @@ -41,7 +41,7 @@ describe('Reporting server createConfig$', () => { let mockLogger: LevelLogger; beforeEach(() => { - mockCoreSetup = makeMockCoreSetup({ host: 'kibanaHost', port: 5601, protocol: 'http' }); + mockCoreSetup = makeMockCoreSetup({ hostname: 'kibanaHost', port: 5601, protocol: 'http' }); mockInitContext = makeMockInitContext({ kibanaServer: {}, }); diff --git a/x-pack/plugins/reporting/server/config/create_config.ts b/x-pack/plugins/reporting/server/config/create_config.ts index 3c892fe6120af..315ac8e8549a7 100644 --- a/x-pack/plugins/reporting/server/config/create_config.ts +++ b/x-pack/plugins/reporting/server/config/create_config.ts @@ -45,7 +45,7 @@ export function createConfig$( // kibanaServer.hostname, default to server.host, don't allow "0" let kibanaServerHostname = reportingServer.hostname ? reportingServer.hostname - : serverInfo.host; + : serverInfo.hostname; if (kibanaServerHostname === '0') { logger.warn( i18n.translate('xpack.reporting.serverConfig.invalidServerHostname', { diff --git a/x-pack/plugins/security/server/plugin.test.ts b/x-pack/plugins/security/server/plugin.test.ts index a7b958ee02de5..243bad0ec3e71 100644 --- a/x-pack/plugins/security/server/plugin.test.ts +++ b/x-pack/plugins/security/server/plugin.test.ts @@ -37,7 +37,7 @@ describe('Security Plugin', () => { mockCoreSetup = coreMock.createSetup(); mockCoreSetup.http.getServerInfo.mockReturnValue({ - host: 'localhost', + hostname: 'localhost', name: 'kibana', port: 80, protocol: 'https', diff --git a/x-pack/test/functional_embedded/plugins/iframe_embedded/server/plugin.ts b/x-pack/test/functional_embedded/plugins/iframe_embedded/server/plugin.ts index 890fe14cf03cf..aaa08ec0a07f7 100644 --- a/x-pack/test/functional_embedded/plugins/iframe_embedded/server/plugin.ts +++ b/x-pack/test/functional_embedded/plugins/iframe_embedded/server/plugin.ts @@ -30,9 +30,9 @@ export class IframeEmbeddedPlugin implements Plugin { validate: false, }, async (context, request, response) => { - const { protocol, port, host } = core.http.getServerInfo(); + const { protocol, port, hostname } = core.http.getServerInfo(); - const kibanaUrl = Url.format({ protocol, hostname: host, port }); + const kibanaUrl = Url.format({ protocol, hostname, port }); return response.renderHtml({ body: renderBody(kibanaUrl), diff --git a/x-pack/test/saml_api_integration/fixtures/saml_provider/server/init_routes.ts b/x-pack/test/saml_api_integration/fixtures/saml_provider/server/init_routes.ts index 5777aa3f423f0..544d8313ef280 100644 --- a/x-pack/test/saml_api_integration/fixtures/saml_provider/server/init_routes.ts +++ b/x-pack/test/saml_api_integration/fixtures/saml_provider/server/init_routes.ts @@ -18,7 +18,7 @@ export function initRoutes(core: CoreSetup) { async (context, request, response) => { const samlResponse = await getSAMLResponse({ inResponseTo: await getSAMLRequestId(request.url.href!), - destination: `${serverInfo.protocol}://${serverInfo.host}:${serverInfo.port}/api/security/saml/callback`, + destination: `${serverInfo.protocol}://${serverInfo.hostname}:${serverInfo.port}/api/security/saml/callback`, }); return response.renderHtml({