-
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
HttpService: duplicate some APIs from setup
to start
and clean mocks.
#69021
Merged
pgayvallet
merged 10 commits into
elastic:master
from
pgayvallet:kbn-xxx-add-http-start-apis
Jun 18, 2020
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
79c80e7
add apis to http start contract and clean mocks
pgayvallet d567203
add apis to http start contract and clean mocks
pgayvallet 501f01d
add `getStartContract` method
pgayvallet 405e3a1
Merge remote-tracking branch 'upstream/master' into kbn-xxx-add-http-…
pgayvallet 8e036fa
fix new calls
pgayvallet 861a39e
Merge remote-tracking branch 'upstream/master' into kbn-xxx-add-http-…
pgayvallet 1b43fb7
Merge remote-tracking branch 'upstream/master' into kbn-xxx-add-http-…
pgayvallet 278b524
remove isTlsEnabled
pgayvallet e58abbe
deprecates HttpServiceSetup.auth
pgayvallet d41d7be
Merge remote-tracking branch 'upstream/master' into kbn-xxx-add-http-…
pgayvallet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
docs/development/core/server/kibana-plugin-core-server.corestart.http.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-core-server](./kibana-plugin-core-server.md) > [CoreStart](./kibana-plugin-core-server.corestart.md) > [http](./kibana-plugin-core-server.corestart.http.md) | ||
|
||
## CoreStart.http property | ||
|
||
[HttpServiceStart](./kibana-plugin-core-server.httpservicestart.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
http: HttpServiceStart; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
docs/development/core/server/kibana-plugin-core-server.httpauth.get.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-core-server](./kibana-plugin-core-server.md) > [HttpAuth](./kibana-plugin-core-server.httpauth.md) > [get](./kibana-plugin-core-server.httpauth.get.md) | ||
|
||
## HttpAuth.get property | ||
|
||
Gets authentication state for a request. Returned by `auth` interceptor. [GetAuthState](./kibana-plugin-core-server.getauthstate.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
get: GetAuthState; | ||
``` |
13 changes: 13 additions & 0 deletions
13
docs/development/core/server/kibana-plugin-core-server.httpauth.isauthenticated.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-core-server](./kibana-plugin-core-server.md) > [HttpAuth](./kibana-plugin-core-server.httpauth.md) > [isAuthenticated](./kibana-plugin-core-server.httpauth.isauthenticated.md) | ||
|
||
## HttpAuth.isAuthenticated property | ||
|
||
Returns authentication status for a request. [IsAuthenticated](./kibana-plugin-core-server.isauthenticated.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
isAuthenticated: IsAuthenticated; | ||
``` |
20 changes: 20 additions & 0 deletions
20
docs/development/core/server/kibana-plugin-core-server.httpauth.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpAuth](./kibana-plugin-core-server.httpauth.md) | ||
|
||
## HttpAuth interface | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface HttpAuth | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [get](./kibana-plugin-core-server.httpauth.get.md) | <code>GetAuthState</code> | Gets authentication state for a request. Returned by <code>auth</code> interceptor. [GetAuthState](./kibana-plugin-core-server.getauthstate.md) | | ||
| [isAuthenticated](./kibana-plugin-core-server.httpauth.isauthenticated.md) | <code>IsAuthenticated</code> | Returns authentication status for a request. [IsAuthenticated](./kibana-plugin-core-server.isauthenticated.md) | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...re-server.httpservicestart.islistening.md → ...ugin-core-server.httpservicestart.auth.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +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) > [HttpServiceStart](./kibana-plugin-core-server.httpservicestart.md) > [isListening](./kibana-plugin-core-server.httpservicestart.islistening.md) | ||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpServiceStart](./kibana-plugin-core-server.httpservicestart.md) > [auth](./kibana-plugin-core-server.httpservicestart.auth.md) | ||
|
||
## HttpServiceStart.isListening property | ||
## HttpServiceStart.auth property | ||
|
||
Indicates if http server is listening on a given port | ||
Auth status. See [HttpAuth](./kibana-plugin-core-server.httpauth.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
isListening: (port: number) => boolean; | ||
auth: HttpAuth; | ||
``` |
13 changes: 13 additions & 0 deletions
13
.../development/core/server/kibana-plugin-core-server.httpservicestart.basepath.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-core-server](./kibana-plugin-core-server.md) > [HttpServiceStart](./kibana-plugin-core-server.httpservicestart.md) > [basePath](./kibana-plugin-core-server.httpservicestart.basepath.md) | ||
|
||
## HttpServiceStart.basePath property | ||
|
||
Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-core-server.ibasepath.md)<!-- -->. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
basePath: IBasePath; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...lopment/core/server/kibana-plugin-core-server.httpservicestart.getserverinfo.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-core-server](./kibana-plugin-core-server.md) > [HttpServiceStart](./kibana-plugin-core-server.httpservicestart.md) > [getServerInfo](./kibana-plugin-core-server.httpservicestart.getserverinfo.md) | ||
|
||
## HttpServiceStart.getServerInfo property | ||
|
||
Provides common [information](./kibana-plugin-core-server.httpserverinfo.md) about the running http server. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getServerInfo: () => HttpServerInfo; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...elopment/core/server/kibana-plugin-core-server.httpservicestart.istlsenabled.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-core-server](./kibana-plugin-core-server.md) > [HttpServiceStart](./kibana-plugin-core-server.httpservicestart.md) > [isTlsEnabled](./kibana-plugin-core-server.httpservicestart.istlsenabled.md) | ||
|
||
## HttpServiceStart.isTlsEnabled property | ||
|
||
Flag showing whether a server was configured to use TLS connection. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
isTlsEnabled: boolean; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
These test types are more complex that I'd like them to be, however no combination of
jest.Mocked
andDeeplyMockedKey
was reflecting the real mock type while respecting the 'concrete' one's signature.I also modified the mocked
createRouter
signature to explicitly return aRouterMock
(It was previously returning a plainIRouter
, forcing consumers to forcecast tojest.Mocked
in some tests). Downside is thatcreateSetupContact().createRouter.mockReturnValue(instance of IRouter)
will not be an invalid statement, but I didn't encounter any in the codebase, so I think it overall improves the testing experience.