-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add getServerInfo
API to http setup contract
#56636
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerInfo](./kibana-plugin-server.httpserverinfo.md) > [host](./kibana-plugin-server.httpserverinfo.host.md) | ||
|
||
## HttpServerInfo.host property | ||
|
||
The hostname of the server | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
host: string; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerInfo](./kibana-plugin-server.httpserverinfo.md) | ||
|
||
## HttpServerInfo interface | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface HttpServerInfo | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [host](./kibana-plugin-server.httpserverinfo.host.md) | <code>string</code> | The hostname of the server | | ||
| [name](./kibana-plugin-server.httpserverinfo.name.md) | <code>string</code> | The name of the Kibana server | | ||
| [port](./kibana-plugin-server.httpserverinfo.port.md) | <code>number</code> | The port the server is listening on | | ||
| [protocol](./kibana-plugin-server.httpserverinfo.protocol.md) | <code>'http' | 'https' | 'socket'</code> | The protocol used by the server | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerInfo](./kibana-plugin-server.httpserverinfo.md) > [name](./kibana-plugin-server.httpserverinfo.name.md) | ||
|
||
## HttpServerInfo.name property | ||
|
||
The name of the Kibana server | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
name: string; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerInfo](./kibana-plugin-server.httpserverinfo.md) > [port](./kibana-plugin-server.httpserverinfo.port.md) | ||
|
||
## HttpServerInfo.port property | ||
|
||
The port the server is listening on | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
port: number; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerInfo](./kibana-plugin-server.httpserverinfo.md) > [protocol](./kibana-plugin-server.httpserverinfo.protocol.md) | ||
|
||
## HttpServerInfo.protocol property | ||
|
||
The protocol used by the server | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
protocol: 'http' | 'https' | 'socket'; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) > [getServerInfo](./kibana-plugin-server.httpservicesetup.getserverinfo.md) | ||
|
||
## HttpServiceSetup.getServerInfo property | ||
|
||
Provides common [information](./kibana-plugin-server.httpserverinfo.md) about the running http server. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getServerInfo: () => HttpServerInfo; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ import { | |
import { IsAuthenticated, AuthStateStorage, GetAuthState } from './auth_state_storage'; | ||
import { AuthHeadersStorage, GetAuthHeaders } from './auth_headers_storage'; | ||
import { BasePath } from './base_path_service'; | ||
import { HttpServiceSetup } from './types'; | ||
import { HttpServiceSetup, HttpServerInfo } from './types'; | ||
|
||
/** @internal */ | ||
export interface HttpServerSetup { | ||
|
@@ -58,6 +58,7 @@ export interface HttpServerSetup { | |
get: GetAuthState; | ||
isAuthenticated: IsAuthenticated; | ||
}; | ||
getServerInfo: () => HttpServerInfo; | ||
} | ||
|
||
/** @internal */ | ||
|
@@ -122,6 +123,12 @@ export class HttpServer { | |
isAuthenticated: this.authState.isAuthenticated, | ||
}, | ||
getAuthHeaders: this.authRequestHeaders.get, | ||
getServerInfo: () => ({ | ||
name: config.name, | ||
host: config.host, | ||
port: config.port, | ||
protocol: this.server!.info.protocol, | ||
}), | ||
isTlsEnabled: config.ssl.enabled, | ||
Comment on lines
+126
to
132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that we got this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I'll do it in a separate PR later this week |
||
// Return server instance with the connection options so that we can properly | ||
// bridge core and the "legacy" Kibana internally. Once this bridge isn't | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test for when
protocol
issocket
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will be honest, I have no idea how to configure the server to get a socket protocol (only copied the possible values from the HAPI's
config.protocol
)