Skip to content

Commit

Permalink
[feat] create additional http servers (elastic#36804)
Browse files Browse the repository at this point in the history
* [feat] create additional http servers

allow for additional http servers to be created, tracked and returned

* respond to pr feedback

* tweak test

* update documentation

* destructure port, remove unnecessary imports

* [fix] export correct type

* [feat] expose createNewServer to plugins

* [fix] respond to pr feedback

* todo: add schema validation & integration test

* use reach

* [fix] use validateKey to validate partial

* [fix] change config shadowing

* check kibana port & prevent shadowing

* centralize start/stop for servers, add integration test

* remove unnecessary property

* never forget your await

* remove option to pass config into start

* fix pr feedback

* fix documentation

* fix test failures
  • Loading branch information
toddself committed May 29, 2019
1 parent a417919 commit cbc0e91
Show file tree
Hide file tree
Showing 14 changed files with 323 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ http: {
registerOnRequest: HttpServiceSetup['registerOnRequest'];
getBasePathFor: HttpServiceSetup['getBasePathFor'];
setBasePathFor: HttpServiceSetup['setBasePathFor'];
createNewServer: HttpServiceSetup['createNewServer'];
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ export interface CoreSetup
| Property | Type | Description |
| --- | --- | --- |
| [elasticsearch](./kibana-plugin-server.coresetup.elasticsearch.md) | <code>{`<p/>` adminClient$: Observable&lt;ClusterClient&gt;;`<p/>` dataClient$: Observable&lt;ClusterClient&gt;;`<p/>` }</code> | |
<<<<<<< HEAD
| [http](./kibana-plugin-server.coresetup.http.md) | <code>{`<p/>` registerAuth: HttpServiceSetup['registerAuth'];`<p/>` registerOnRequest: HttpServiceSetup['registerOnRequest'];`<p/>` getBasePathFor: HttpServiceSetup['getBasePathFor'];`<p/>` setBasePathFor: HttpServiceSetup['setBasePathFor'];`<p/>` }</code> | |
=======
| [http](./kibana-plugin-server.coresetup.http.md) | <code>{`<p/>` registerOnPreAuth: HttpServiceSetup['registerOnPreAuth'];`<p/>` registerAuth: HttpServiceSetup['registerAuth'];`<p/>` registerOnPostAuth: HttpServiceSetup['registerOnPostAuth'];`<p/>` getBasePathFor: HttpServiceSetup['getBasePathFor'];`<p/>` setBasePathFor: HttpServiceSetup['setBasePathFor'];`<p/>` createNewServer: HttpServiceSetup['createNewServer'];`<p/>` }</code> | |
>>>>>>> 461a6c0f93... [feat] create additional http servers (#36804)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) &gt; [createNewServer](./kibana-plugin-server.httpservicesetup.createnewserver.md)

## HttpServiceSetup.createNewServer property

<b>Signature:</b>

```typescript
createNewServer: (cfg: Partial<HttpConfig>) => Promise<HttpServerSetup>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

[Home](./index) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md)

## HttpServiceSetup type
## HttpServiceSetup interface


<b>Signature:</b>

```typescript
export declare type HttpServiceSetup = HttpServerSetup;
export interface HttpServiceSetup extends HttpServerSetup
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [createNewServer](./kibana-plugin-server.httpservicesetup.createnewserver.md) | <code>(cfg: Partial&lt;HttpConfig&gt;) =&gt; Promise&lt;HttpServerSetup&gt;</code> | |
6 changes: 6 additions & 0 deletions docs/development/core/server/kibana-plugin-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [CoreStart](./kibana-plugin-server.corestart.md) | Context passed to the plugins <code>start</code> method. |
| [DiscoveredPlugin](./kibana-plugin-server.discoveredplugin.md) | Small container object used to expose information about discovered plugins that may or may not have been started. |
| [ElasticsearchServiceSetup](./kibana-plugin-server.elasticsearchservicesetup.md) | |
| [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) | |
| [HttpServiceStart](./kibana-plugin-server.httpservicestart.md) | |
| [InternalCoreStart](./kibana-plugin-server.internalcorestart.md) | |
| [Logger](./kibana-plugin-server.logger.md) | Logger exposes all the necessary methods to log any type of information and this is the interface used by the logging consumers including plugins. |
Expand All @@ -48,8 +49,13 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [AuthenticationHandler](./kibana-plugin-server.authenticationhandler.md) | |
| [ElasticsearchClientConfig](./kibana-plugin-server.elasticsearchclientconfig.md) | |
| [Headers](./kibana-plugin-server.headers.md) | |
<<<<<<< HEAD
| [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) | |
| [OnRequestHandler](./kibana-plugin-server.onrequesthandler.md) | |
=======
| [OnPostAuthHandler](./kibana-plugin-server.onpostauthhandler.md) | |
| [OnPreAuthHandler](./kibana-plugin-server.onpreauthhandler.md) | |
>>>>>>> 461a6c0f93... [feat] create additional http servers (#36804)
| [PluginInitializer](./kibana-plugin-server.plugininitializer.md) | The <code>plugin</code> export at the root of a plugin's <code>server</code> directory should conform to this interface. |
| [PluginName](./kibana-plugin-server.pluginname.md) | Dedicated type for plugin name/id that is supposed to make Map/Set/Arrays that use it as a key or value more obvious. |

Loading

0 comments on commit cbc0e91

Please sign in to comment.