-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change ContextContainer to lazily initialize providers (#129896)
* Change ContextContainer to lazily initialize providers * Introduce CustomRequestHandlerContext, start adapting usages * adapt IContextProvider's return type * start fixing violations * fixing violations - 2 * adapt home routes * fix remaining core violation * fix violations on core tests * fixing more violations * fixing more violations * update generated doc... * fix more violations * adapt remaining RequestHandlerContext * fix more violations * fix non-async method * more fixes * fix another await in non async method * add yet another missing async * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * add yet yet another missing async * update fleet's endpoints * fix telemetry endpoints * fix event_log endpoints * fix some security unit tests * adapt canvas routes * adapt alerting routes * adapt more so_tagging routes * fix data_enhanced routes * fix license_management routes * fix file_upload routes * fix index_management routes * fix lists routes * fix snapshot_restore routes * fix rule_registry routes * fix ingest_pipelines routes * fix remote_clusters routes * fix index_lifecycle_management routes * improve and fix the lazy implementation * fix triggers_actions_ui endpoints * start fixing unit tests * fix cases routes * fix transform routes * fix upgrade_assistant routes * fix uptime route wrapper * fix uptime route wrapper bis * update osquery routes * update cross_cluster_replication routes * fix some ML routes / wrappers * adapt maps routes * adapt rollup routes * fix some canvas unit tests * fix more canvas unit tests * fix observability wrapper * fix (?) infra type hell * start fixing monitoring * fix a few test plugins * woups * fix yet more violations * fixing UA tests * fix logstash handlers * fix fleet unit tests * lint? * one more batch * update security_solution endpoints * start fixing security_solution mocks * start fixing security_solution tests * fix more security_solution tests * fix more security_solution tests * just one more * fix last (?) security_solution tests * fix timelion javascript file * fix more test plugins * fix transforms context type * fix ml context type * fix context tests * fix securitySolution withEndpointAuthz tests * fix features unit tests * fix actions unit tests * fix imports * fix duplicate import * fix some merge problems * fix new usage * fix new test * introduces context.resolve * down the rabbit hole again * start fixing test type failures * more test type failures fixes * move import comment back to correct place * more test type failures fixes, bis * use context.resolve for security solution rules routes * fix new violations due to master merge * remove comment Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
706d926
commit a02c00b
Showing
699 changed files
with
4,511 additions
and
3,173 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...core/server/kibana-plugin-core-server.corerequesthandlercontext.deprecations.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) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) > [deprecations](./kibana-plugin-core-server.corerequesthandlercontext.deprecations.md) | ||
|
||
## CoreRequestHandlerContext.deprecations property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
deprecations: { | ||
client: DeprecationsClient; | ||
}; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...ore/server/kibana-plugin-core-server.corerequesthandlercontext.elasticsearch.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) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) > [elasticsearch](./kibana-plugin-core-server.corerequesthandlercontext.elasticsearch.md) | ||
|
||
## CoreRequestHandlerContext.elasticsearch property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
elasticsearch: { | ||
client: IScopedClusterClient; | ||
}; | ||
``` |
25 changes: 25 additions & 0 deletions
25
.../development/core/server/kibana-plugin-core-server.corerequesthandlercontext.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,25 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) | ||
|
||
## CoreRequestHandlerContext interface | ||
|
||
The `core` context provided to route handler. | ||
|
||
Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.client](./kibana-plugin-core-server.iscopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface CoreRequestHandlerContext | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [deprecations](./kibana-plugin-core-server.corerequesthandlercontext.deprecations.md) | { client: DeprecationsClient; } | | | ||
| [elasticsearch](./kibana-plugin-core-server.corerequesthandlercontext.elasticsearch.md) | { client: IScopedClusterClient; } | | | ||
| [savedObjects](./kibana-plugin-core-server.corerequesthandlercontext.savedobjects.md) | { client: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; getClient: (options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract; getExporter: (client: SavedObjectsClientContract) => ISavedObjectsExporter; getImporter: (client: SavedObjectsClientContract) => ISavedObjectsImporter; } | | | ||
| [uiSettings](./kibana-plugin-core-server.corerequesthandlercontext.uisettings.md) | { client: IUiSettingsClient; } | | | ||
|
17 changes: 17 additions & 0 deletions
17
...core/server/kibana-plugin-core-server.corerequesthandlercontext.savedobjects.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,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) > [savedObjects](./kibana-plugin-core-server.corerequesthandlercontext.savedobjects.md) | ||
|
||
## CoreRequestHandlerContext.savedObjects property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
savedObjects: { | ||
client: SavedObjectsClientContract; | ||
typeRegistry: ISavedObjectTypeRegistry; | ||
getClient: (options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract; | ||
getExporter: (client: SavedObjectsClientContract) => ISavedObjectsExporter; | ||
getImporter: (client: SavedObjectsClientContract) => ISavedObjectsImporter; | ||
}; | ||
``` |
13 changes: 13 additions & 0 deletions
13
...t/core/server/kibana-plugin-core-server.corerequesthandlercontext.uisettings.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) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) > [uiSettings](./kibana-plugin-core-server.corerequesthandlercontext.uisettings.md) | ||
|
||
## CoreRequestHandlerContext.uiSettings property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
uiSettings: { | ||
client: IUiSettingsClient; | ||
}; | ||
``` |
14 changes: 14 additions & 0 deletions
14
...evelopment/core/server/kibana-plugin-core-server.customrequesthandlercontext.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,14 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CustomRequestHandlerContext](./kibana-plugin-core-server.customrequesthandlercontext.md) | ||
|
||
## CustomRequestHandlerContext type | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare type CustomRequestHandlerContext<T> = RequestHandlerContext & { | ||
[Key in keyof T]: T[Key] extends Promise<unknown> ? T[Key] : Promise<T[Key]>; | ||
}; | ||
``` |
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
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
20 changes: 20 additions & 0 deletions
20
.../development/core/server/kibana-plugin-core-server.requesthandlercontextbase.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) > [RequestHandlerContextBase](./kibana-plugin-core-server.requesthandlercontextbase.md) | ||
|
||
## RequestHandlerContextBase interface | ||
|
||
\* | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface RequestHandlerContextBase | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [resolve](./kibana-plugin-core-server.requesthandlercontextbase.resolve.md) | <T extends keyof Omit<this, 'resolve'>>(parts: T\[\]) => Promise<AwaitedProperties<Pick<this, T>>> | Await all the specified context parts and return them. | | ||
|
23 changes: 23 additions & 0 deletions
23
...ment/core/server/kibana-plugin-core-server.requesthandlercontextbase.resolve.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,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [RequestHandlerContextBase](./kibana-plugin-core-server.requesthandlercontextbase.md) > [resolve](./kibana-plugin-core-server.requesthandlercontextbase.resolve.md) | ||
|
||
## RequestHandlerContextBase.resolve property | ||
|
||
Await all the specified context parts and return them. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
resolve: <T extends keyof Omit<this, 'resolve'>>(parts: T[]) => Promise<AwaitedProperties<Pick<this, T>>>; | ||
``` | ||
|
||
## Example | ||
|
||
|
||
```ts | ||
const resolved = await context.resolve(['core', 'pluginA']); | ||
const esClient = resolved.core.elasticsearch.client; | ||
const pluginAService = resolved.pluginA.someService; | ||
``` | ||
|
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.