mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
# Conflicts: # src/plugins/interactive_setup/server/elasticsearch_service.test.ts # src/plugins/interactive_setup/server/elasticsearch_service.ts # src/plugins/interactive_setup/server/routes/enroll.test.ts # src/plugins/interactive_setup/server/routes/enroll.ts
This commit is contained in:
parent
377760f060
commit
6fe650d303
13 changed files with 42 additions and 2 deletions
|
@ -14,5 +14,6 @@ export declare type ElasticsearchClientConfig = Pick<ElasticsearchConfig, 'custo
|
|||
requestTimeout?: ElasticsearchConfig['requestTimeout'] | ClientOptions['requestTimeout'];
|
||||
ssl?: Partial<ElasticsearchConfig['ssl']>;
|
||||
keepAlive?: boolean;
|
||||
caFingerprint?: ClientOptions['caFingerprint'];
|
||||
};
|
||||
```
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpServicePreboot](./kibana-plugin-core-server.httpservicepreboot.md) > [getServerInfo](./kibana-plugin-core-server.httpservicepreboot.getserverinfo.md)
|
||||
|
||||
## HttpServicePreboot.getServerInfo property
|
||||
|
||||
Provides common [information](./kibana-plugin-core-server.httpserverinfo.md) about the running preboot http server.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
getServerInfo: () => HttpServerInfo;
|
||||
```
|
|
@ -73,6 +73,7 @@ httpPreboot.registerRoutes('my-plugin', (router) => {
|
|||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [basePath](./kibana-plugin-core-server.httpservicepreboot.basepath.md) | <code>IBasePath</code> | Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-core-server.ibasepath.md)<!-- -->. |
|
||||
| [getServerInfo](./kibana-plugin-core-server.httpservicepreboot.getserverinfo.md) | <code>() => HttpServerInfo</code> | Provides common [information](./kibana-plugin-core-server.httpserverinfo.md) about the running preboot http server. |
|
||||
|
||||
## Methods
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ describe('CoreApp', () => {
|
|||
mockResponseFactory
|
||||
);
|
||||
|
||||
expect(mockResponseFactory.renderAnonymousCoreApp).toHaveBeenCalled();
|
||||
expect(mockResponseFactory.renderCoreApp).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ export class CoreApp {
|
|||
httpResources: corePreboot.httpResources.createRegistrar(router),
|
||||
router,
|
||||
uiPlugins,
|
||||
onResourceNotFound: (res) => res.renderAnonymousCoreApp(),
|
||||
onResourceNotFound: (res) => res.renderCoreApp(),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -163,6 +163,12 @@ describe('parseClientOptions', () => {
|
|||
]
|
||||
`);
|
||||
});
|
||||
|
||||
it('`caFingerprint` option', () => {
|
||||
const options = parseClientOptions(createConfig({ caFingerprint: 'ab:cd:ef' }), false);
|
||||
|
||||
expect(options.caFingerprint).toBe('ab:cd:ef');
|
||||
});
|
||||
});
|
||||
|
||||
describe('authorization', () => {
|
||||
|
|
|
@ -35,6 +35,7 @@ export type ElasticsearchClientConfig = Pick<
|
|||
requestTimeout?: ElasticsearchConfig['requestTimeout'] | ClientOptions['requestTimeout'];
|
||||
ssl?: Partial<ElasticsearchConfig['ssl']>;
|
||||
keepAlive?: boolean;
|
||||
caFingerprint?: ClientOptions['caFingerprint'];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -96,6 +97,10 @@ export function parseClientOptions(
|
|||
);
|
||||
}
|
||||
|
||||
if (config.caFingerprint != null) {
|
||||
clientOptions.caFingerprint = config.caFingerprint;
|
||||
}
|
||||
|
||||
return clientOptions;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ const createInternalPrebootContractMock = () => {
|
|||
csp: CspConfig.DEFAULT,
|
||||
externalUrl: ExternalUrlConfig.DEFAULT,
|
||||
auth: createAuthMock(),
|
||||
getServerInfo: jest.fn(),
|
||||
};
|
||||
return mock;
|
||||
};
|
||||
|
@ -98,6 +99,7 @@ const createPrebootContractMock = () => {
|
|||
const mock: HttpServicePrebootMock = {
|
||||
registerRoutes: internalMock.registerRoutes,
|
||||
basePath: createBasePathMock(),
|
||||
getServerInfo: jest.fn(),
|
||||
};
|
||||
|
||||
return mock;
|
||||
|
|
|
@ -379,6 +379,7 @@ test('returns `preboot` http server contract on preboot', async () => {
|
|||
auth: Symbol('auth'),
|
||||
basePath: Symbol('basePath'),
|
||||
csp: Symbol('csp'),
|
||||
getServerInfo: jest.fn(),
|
||||
};
|
||||
|
||||
mockHttpServer.mockImplementation(() => ({
|
||||
|
@ -397,6 +398,7 @@ test('returns `preboot` http server contract on preboot', async () => {
|
|||
registerRouteHandlerContext: expect.any(Function),
|
||||
registerRoutes: expect.any(Function),
|
||||
registerStaticDir: expect.any(Function),
|
||||
getServerInfo: expect.any(Function),
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@ export class HttpService
|
|||
|
||||
prebootSetup.registerRouterAfterListening(router);
|
||||
},
|
||||
getServerInfo: prebootSetup.getServerInfo,
|
||||
};
|
||||
|
||||
return this.internalPreboot;
|
||||
|
|
|
@ -142,6 +142,11 @@ export interface HttpServicePreboot {
|
|||
* See {@link IBasePath}.
|
||||
*/
|
||||
basePath: IBasePath;
|
||||
|
||||
/**
|
||||
* Provides common {@link HttpServerInfo | information} about the running preboot http server.
|
||||
*/
|
||||
getServerInfo: () => HttpServerInfo;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
|
@ -155,6 +160,7 @@ export interface InternalHttpServicePreboot
|
|||
| 'registerStaticDir'
|
||||
| 'registerRouteHandlerContext'
|
||||
| 'server'
|
||||
| 'getServerInfo'
|
||||
> {
|
||||
registerRoutes(path: string, callback: (router: IRouter) => void): void;
|
||||
}
|
||||
|
|
|
@ -115,6 +115,7 @@ export function createPluginPrebootSetupContext(
|
|||
http: {
|
||||
registerRoutes: deps.http.registerRoutes,
|
||||
basePath: deps.http.basePath,
|
||||
getServerInfo: deps.http.getServerInfo,
|
||||
},
|
||||
preboot: {
|
||||
isSetupOnHold: deps.preboot.isSetupOnHold,
|
||||
|
|
|
@ -807,6 +807,7 @@ export type ElasticsearchClientConfig = Pick<ElasticsearchConfig, 'customHeaders
|
|||
requestTimeout?: ElasticsearchConfig['requestTimeout'] | ClientOptions['requestTimeout'];
|
||||
ssl?: Partial<ElasticsearchConfig['ssl']>;
|
||||
keepAlive?: boolean;
|
||||
caFingerprint?: ClientOptions['caFingerprint'];
|
||||
};
|
||||
|
||||
// @public
|
||||
|
@ -1003,6 +1004,7 @@ export interface HttpServerInfo {
|
|||
// @public
|
||||
export interface HttpServicePreboot {
|
||||
basePath: IBasePath;
|
||||
getServerInfo: () => HttpServerInfo;
|
||||
registerRoutes(path: string, callback: (router: IRouter) => void): void;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue