-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[feat] proxy implementation #36907
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
Closed
Closed
[feat] proxy implementation #36907
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
ea8e82c
[feat] [wip] start proxy implementation
toddself be11ce9
Refactor clientDoc handler from proxy logic
toddself e406184
Use POJOs instead of Map for simplification
toddself 8804a84
Switch over to KibanaRequest and allow headers/other methods to be pa…
toddself 2c1244c
[fix] drop lastChangedTime
toddself 9ec607a
Starting tests
toddself 862b6fd
Why must you mock me
toddself e2bbcbb
got one
toddself 1eb2e9b
mock es
toddself 9d8773f
Adding mutual TLS
toddself f3808ac
SSL configuration
toddself c604078
Update mocks, verify dataClient gets called
toddself 12363ad
Add basic clusterdoc tests
toddself 54166b1
setup testing for proxy itself
toddself 8868076
renovate
toddself ef010b4
for those about to mock
toddself 834a9b1
we salute you
toddself e3edaae
mock and roll all night
toddself d871b11
i wanna mock!
toddself c7b41c4
mock you like a hurricane
toddself b47c28c
mock and roll killing machine
toddself 18a76fb
Use seq_no and primary_term
toddself 594588d
M.O.C.K. in the U.S.A.
toddself 1d41802
crocodile mock
toddself c618da6
mock and roll all night, party every day
toddself b5fcf67
we built this city on mock and roll
toddself d7170ac
Add event interface for error handling
toddself e329b43
let there be mock
toddself 1eb3bf4
syncing strat
toddself 1414812
Add handshake and node adding
toddself c884a92
update docs
toddself 7960a0b
this'll break those tests alright
toddself 0f1ddd3
Remove extraneous exports
toddself 2ad5ce6
only cull every 2x times, add closing state
toddself ffaf4c9
update docs
toddself 04fb2e4
Update sync doc
toddself ad0abae
jest timers are weird
toddself 0ba5107
update tests for new logic
toddself a3c3d8f
update proxy tests
toddself 14b6344
remove subs
toddself 83d3082
Fix test errors
toddself 770d8e0
variable naming
toddself a4b8b27
fix proxy interface for allocation table
toddself df149c0
update tsconf
toddself 3774527
satisfy the type gods
toddself fa2ccc2
respond to feedback
toddself ed6ab30
Fix rebase
toddself dd0e207
SSL config working
toddself a416ea1
make path better
toddself f60d054
fix errant keys
toddself 7de61d5
omfg linters
toddself 31713ee
fix docs
toddself f7b0062
fix mock
toddself 6dcefb6
lol source control
toddself 8f449b6
SSL is required to be optional
toddself ec49124
proxy.start can be undefined
toddself 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
15 changes: 15 additions & 0 deletions
15
docs/development/core/server/kibana-plugin-server.httpserversetup.auth.md
This file contains hidden or 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,15 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [auth](./kibana-plugin-server.httpserversetup.auth.md) | ||
|
|
||
| ## HttpServerSetup.auth property | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| auth: { | ||
| get: AuthStateStorage['get']; | ||
| isAuthenticated: AuthStateStorage['isAuthenticated']; | ||
| getAuthHeaders: AuthHeadersStorage['get']; | ||
| }; | ||
| ``` |
16 changes: 16 additions & 0 deletions
16
docs/development/core/server/kibana-plugin-server.httpserversetup.basepath.md
This file contains hidden or 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,16 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [basePath](./kibana-plugin-server.httpserversetup.basepath.md) | ||
|
|
||
| ## HttpServerSetup.basePath property | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| basePath: { | ||
| get: (request: KibanaRequest | Request) => string; | ||
| set: (request: KibanaRequest | Request, basePath: string) => void; | ||
| prepend: (url: string) => string; | ||
| remove: (url: string) => string; | ||
| }; | ||
| ``` |
11 changes: 11 additions & 0 deletions
11
docs/development/core/server/kibana-plugin-server.httpserversetup.istlsenabled.md
This file contains hidden or 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,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [isTlsEnabled](./kibana-plugin-server.httpserversetup.istlsenabled.md) | ||
|
|
||
| ## HttpServerSetup.isTlsEnabled property | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| isTlsEnabled: boolean; | ||
| ``` |
25 changes: 25 additions & 0 deletions
25
docs/development/core/server/kibana-plugin-server.httpserversetup.md
This file contains hidden or 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,25 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) | ||
|
|
||
| ## HttpServerSetup interface | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| export interface HttpServerSetup | ||
| ``` | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Description | | ||
| | --- | --- | --- | | ||
| | [auth](./kibana-plugin-server.httpserversetup.auth.md) | <code>{</code><br/><code> get: AuthStateStorage['get'];</code><br/><code> isAuthenticated: AuthStateStorage['isAuthenticated'];</code><br/><code> getAuthHeaders: AuthHeadersStorage['get'];</code><br/><code> }</code> | | | ||
| | [basePath](./kibana-plugin-server.httpserversetup.basepath.md) | <code>{</code><br/><code> get: (request: KibanaRequest | Request) => string;</code><br/><code> set: (request: KibanaRequest | Request, basePath: string) => void;</code><br/><code> prepend: (url: string) => string;</code><br/><code> remove: (url: string) => string;</code><br/><code> }</code> | | | ||
| | [isTlsEnabled](./kibana-plugin-server.httpserversetup.istlsenabled.md) | <code>boolean</code> | | | ||
| | [registerAuth](./kibana-plugin-server.httpserversetup.registerauth.md) | <code><T>(handler: AuthenticationHandler, cookieOptions: SessionStorageCookieOptions<T>) => Promise<{</code><br/><code> sessionStorageFactory: SessionStorageFactory<T>;</code><br/><code> }></code> | To define custom authentication and/or authorization mechanism for incoming requests. A handler should return a state to associate with the incoming request. The state can be retrieved later via http.auth.get(..) Only one AuthenticationHandler can be registered. | | ||
| | [registerOnPostAuth](./kibana-plugin-server.httpserversetup.registeronpostauth.md) | <code>(handler: OnPostAuthHandler) => void</code> | To define custom logic to perform for incoming requests. Runs the handler after Auth hook did make sure a user has access to the requested resource. The auth state is available at stage via http.auth.get(..) Can register any number of registerOnPreAuth, which are called in sequence (from the first registered to the last). | | ||
| | [registerOnPreAuth](./kibana-plugin-server.httpserversetup.registeronpreauth.md) | <code>(handler: OnPreAuthHandler) => void</code> | To define custom logic to perform for incoming requests. Runs the handler before Auth hook performs a check that user has access to requested resources, so it's the only place when you can forward a request to another URL right on the server. Can register any number of registerOnPostAuth, which are called in sequence (from the first registered to the last). | | ||
| | [registerRouter](./kibana-plugin-server.httpserversetup.registerrouter.md) | <code>(router: Router) => void</code> | | | ||
| | [server](./kibana-plugin-server.httpserversetup.server.md) | <code>Server</code> | | | ||
|
|
15 changes: 15 additions & 0 deletions
15
docs/development/core/server/kibana-plugin-server.httpserversetup.registerauth.md
This file contains hidden or 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,15 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [registerAuth](./kibana-plugin-server.httpserversetup.registerauth.md) | ||
|
|
||
| ## HttpServerSetup.registerAuth property | ||
|
|
||
| To define custom authentication and/or authorization mechanism for incoming requests. A handler should return a state to associate with the incoming request. The state can be retrieved later via http.auth.get(..) Only one AuthenticationHandler can be registered. | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| registerAuth: <T>(handler: AuthenticationHandler, cookieOptions: SessionStorageCookieOptions<T>) => Promise<{ | ||
| sessionStorageFactory: SessionStorageFactory<T>; | ||
| }>; | ||
| ``` |
13 changes: 13 additions & 0 deletions
13
...elopment/core/server/kibana-plugin-server.httpserversetup.registeronpostauth.md
This file contains hidden or 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-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [registerOnPostAuth](./kibana-plugin-server.httpserversetup.registeronpostauth.md) | ||
|
|
||
| ## HttpServerSetup.registerOnPostAuth property | ||
|
|
||
| To define custom logic to perform for incoming requests. Runs the handler after Auth hook did make sure a user has access to the requested resource. The auth state is available at stage via http.auth.get(..) Can register any number of registerOnPreAuth, which are called in sequence (from the first registered to the last). | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| registerOnPostAuth: (handler: OnPostAuthHandler) => void; | ||
| ``` |
13 changes: 13 additions & 0 deletions
13
...velopment/core/server/kibana-plugin-server.httpserversetup.registeronpreauth.md
This file contains hidden or 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-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [registerOnPreAuth](./kibana-plugin-server.httpserversetup.registeronpreauth.md) | ||
|
|
||
| ## HttpServerSetup.registerOnPreAuth property | ||
|
|
||
| To define custom logic to perform for incoming requests. Runs the handler before Auth hook performs a check that user has access to requested resources, so it's the only place when you can forward a request to another URL right on the server. Can register any number of registerOnPostAuth, which are called in sequence (from the first registered to the last). | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| registerOnPreAuth: (handler: OnPreAuthHandler) => void; | ||
| ``` |
11 changes: 11 additions & 0 deletions
11
.../development/core/server/kibana-plugin-server.httpserversetup.registerrouter.md
This file contains hidden or 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,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [registerRouter](./kibana-plugin-server.httpserversetup.registerrouter.md) | ||
|
|
||
| ## HttpServerSetup.registerRouter property | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| registerRouter: (router: Router) => void; | ||
| ``` |
11 changes: 11 additions & 0 deletions
11
docs/development/core/server/kibana-plugin-server.httpserversetup.server.md
This file contains hidden or 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,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [server](./kibana-plugin-server.httpserversetup.server.md) | ||
|
|
||
| ## HttpServerSetup.server property | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| server: Server; | ||
| ``` |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,26 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| declare module 'selfsigned' { | ||
| export function generate( | ||
| attrs: any[], | ||
| options: { [key: string]: any }, | ||
| done?: (err: Error, certs: any) => void | ||
| ): any; | ||
| } |
This file contains hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.