(request: KibanaRequest | LegacyRequest) => string
| returns basePath
value, specific for an incoming request. |
+| [get](./kibana-plugin-core-server.basepath.get.md) | | (request: KibanaRequest) => string
| returns basePath
value, specific for an incoming request. |
| [prepend](./kibana-plugin-core-server.basepath.prepend.md) | | (path: string) => string
| Prepends path
with the basePath. |
| [publicBaseUrl](./kibana-plugin-core-server.basepath.publicbaseurl.md) | | string
| The server's publicly exposed base URL, if configured. Includes protocol, host, port (optional) and the [BasePath.serverBasePath](./kibana-plugin-core-server.basepath.serverbasepath.md). |
| [remove](./kibana-plugin-core-server.basepath.remove.md) | | (path: string) => string
| Removes the prepended basePath from the path
. |
| [serverBasePath](./kibana-plugin-core-server.basepath.serverbasepath.md) | | string
| returns the server's basePathSee [BasePath.get](./kibana-plugin-core-server.basepath.get.md) for getting the basePath value for a specific request |
-| [set](./kibana-plugin-core-server.basepath.set.md) | | (request: KibanaRequest | LegacyRequest, requestSpecificBasePath: string) => void
| sets basePath
value, specific for an incoming request. |
+| [set](./kibana-plugin-core-server.basepath.set.md) | | (request: KibanaRequest, requestSpecificBasePath: string) => void
| sets basePath
value, specific for an incoming request. |
diff --git a/docs/development/core/server/kibana-plugin-core-server.basepath.set.md b/docs/development/core/server/kibana-plugin-core-server.basepath.set.md
index eb355f134d562..b90767022d594 100644
--- a/docs/development/core/server/kibana-plugin-core-server.basepath.set.md
+++ b/docs/development/core/server/kibana-plugin-core-server.basepath.set.md
@@ -9,5 +9,5 @@ sets `basePath` value, specific for an incoming request.
Signature:
```typescript
-set: (request: KibanaRequest | LegacyRequest, requestSpecificBasePath: string) => void;
+set: (request: KibanaRequest, requestSpecificBasePath: string) => void;
```
diff --git a/docs/development/core/server/kibana-plugin-core-server.getauthheaders.md b/docs/development/core/server/kibana-plugin-core-server.getauthheaders.md
index c66aead4dfa9c..2f1502a5ea0ea 100644
--- a/docs/development/core/server/kibana-plugin-core-server.getauthheaders.md
+++ b/docs/development/core/server/kibana-plugin-core-server.getauthheaders.md
@@ -9,5 +9,5 @@ Get headers to authenticate a user against Elasticsearch.
Signature:
```typescript
-export declare type GetAuthHeaders = (request: KibanaRequest | LegacyRequest) => AuthHeaders | undefined;
+export declare type GetAuthHeaders = (request: KibanaRequest) => AuthHeaders | undefined;
```
diff --git a/docs/development/core/server/kibana-plugin-core-server.getauthstate.md b/docs/development/core/server/kibana-plugin-core-server.getauthstate.md
index 0fa8d745d3a44..979a6b5b5792b 100644
--- a/docs/development/core/server/kibana-plugin-core-server.getauthstate.md
+++ b/docs/development/core/server/kibana-plugin-core-server.getauthstate.md
@@ -9,7 +9,7 @@ Gets authentication state for a request. Returned by `auth` interceptor.
Signature:
```typescript
-export declare type GetAuthState = PluginInitializer
for a preboot
plugin. |
| [PrebootServicePreboot](./kibana-plugin-core-server.prebootservicepreboot.md) | Kibana Preboot Service allows to control the boot flow of Kibana. Preboot plugins can use it to hold the boot until certain condition is met. |
| [RegisterDeprecationsConfig](./kibana-plugin-core-server.registerdeprecationsconfig.md) | |
-| [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md) | Plugin specific context passed to a 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 - - The legacy 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 |
+| [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md) | Plugin specific context passed to a 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 |
| [ResolveCapabilitiesOptions](./kibana-plugin-core-server.resolvecapabilitiesoptions.md) | Defines a set of additional options for the resolveCapabilities
method of [CapabilitiesStart](./kibana-plugin-core-server.capabilitiesstart.md). |
| [RouteConfig](./kibana-plugin-core-server.routeconfig.md) | Route specific configuration. |
| [RouteConfigOptions](./kibana-plugin-core-server.routeconfigoptions.md) | Additional route options. |
diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md
index b6d78f8890b37..15a2e235fff29 100644
--- a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md
+++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md
@@ -6,7 +6,7 @@
Plugin specific context passed to a 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 - - The legacy 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
+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
Signature:
diff --git a/docs/development/core/server/kibana-plugin-core-server.scopeablerequest.md b/docs/development/core/server/kibana-plugin-core-server.scopeablerequest.md
index 67abc483e1f65..f8f05823ae81f 100644
--- a/docs/development/core/server/kibana-plugin-core-server.scopeablerequest.md
+++ b/docs/development/core/server/kibana-plugin-core-server.scopeablerequest.md
@@ -11,5 +11,5 @@ See [KibanaRequest](./kibana-plugin-core-server.kibanarequest.md).
Signature:
```typescript
-export declare type ScopeableRequest = KibanaRequest | LegacyRequest | FakeRequest;
+export declare type ScopeableRequest = KibanaRequest | FakeRequest;
```
diff --git a/src/core/server/elasticsearch/types.ts b/src/core/server/elasticsearch/types.ts
index 89a7d752f7912..1b149cebfa957 100644
--- a/src/core/server/elasticsearch/types.ts
+++ b/src/core/server/elasticsearch/types.ts
@@ -8,7 +8,7 @@
import { Observable } from 'rxjs';
import { Headers } from '../http/router';
-import { LegacyRequest, KibanaRequest } from '../http';
+import { KibanaRequest } from '../http';
import { ElasticsearchConfig } from './elasticsearch_config';
import { IClusterClient, ICustomClusterClient, ElasticsearchClientConfig } from './client';
import { NodesVersionCompatibility } from './version_check/ensure_es_version';
@@ -156,7 +156,7 @@ export interface FakeRequest {
* @public
* See {@link KibanaRequest}.
*/
-export type ScopeableRequest = KibanaRequest | LegacyRequest | FakeRequest;
+export type ScopeableRequest = KibanaRequest | FakeRequest;
/**
* A limited set of Elasticsearch configuration entries exposed to the `preboot` plugins at `setup`.
diff --git a/src/core/server/http/auth_headers_storage.test.ts b/src/core/server/http/auth_headers_storage.test.ts
index b4269a4401f50..6fb2281c81750 100644
--- a/src/core/server/http/auth_headers_storage.test.ts
+++ b/src/core/server/http/auth_headers_storage.test.ts
@@ -7,33 +7,15 @@
*/
import { AuthHeadersStorage } from './auth_headers_storage';
-import { KibanaRequest } from './router';
import { httpServerMock } from './http_server.mocks';
describe('AuthHeadersStorage', () => {
describe('stores authorization headers', () => {
it('retrieves a copy of headers associated with Kibana request', () => {
const headers = { authorization: 'token' };
const storage = new AuthHeadersStorage();
- const rawRequest = httpServerMock.createRawRequest();
- storage.set(KibanaRequest.from(rawRequest), headers);
- expect(storage.get(KibanaRequest.from(rawRequest))).toEqual(headers);
- });
-
- it('retrieves a copy of headers associated with Legacy.Request', () => {
- const headers = { authorization: 'token' };
- const storage = new AuthHeadersStorage();
- const rawRequest = httpServerMock.createRawRequest();
- storage.set(rawRequest, headers);
- expect(storage.get(rawRequest)).toEqual(headers);
- });
-
- it('retrieves a copy of headers associated with both KibanaRequest & Legacy.Request', () => {
- const headers = { authorization: 'token' };
- const storage = new AuthHeadersStorage();
- const rawRequest = httpServerMock.createRawRequest();
-
- storage.set(KibanaRequest.from(rawRequest), headers);
- expect(storage.get(rawRequest)).toEqual(headers);
+ const request = httpServerMock.createKibanaRequest();
+ storage.set(request, headers);
+ expect(storage.get(request)).toEqual(headers);
});
});
});
diff --git a/src/core/server/http/auth_headers_storage.ts b/src/core/server/http/auth_headers_storage.ts
index 34799ed753689..cddf84bfa8caf 100644
--- a/src/core/server/http/auth_headers_storage.ts
+++ b/src/core/server/http/auth_headers_storage.ts
@@ -15,7 +15,7 @@ import { AuthHeaders } from './lifecycle/auth';
* @return authentication headers {@link AuthHeaders} for - an incoming request.
* @public
* */
-export type GetAuthHeaders = (request: KibanaRequest | LegacyRequest) => AuthHeaders | undefined;
+export type GetAuthHeaders = (request: KibanaRequest) => AuthHeaders | undefined;
/** @internal */
export class AuthHeadersStorage {
diff --git a/src/core/server/http/auth_state_storage.ts b/src/core/server/http/auth_state_storage.ts
index e29742bccbaae..2dd49f8fb99cc 100644
--- a/src/core/server/http/auth_state_storage.ts
+++ b/src/core/server/http/auth_state_storage.ts
@@ -33,7 +33,7 @@ export enum AuthStatus {
* @public
*/
export type GetAuthState = = (context: Context, request: KibanaRequest
, response: ResponseFactory) => IKibanaResponse