Skip to content

Commit ddf8fac

Browse files
committed
add getRawRequest to pass to saved objects method
1 parent 37f6c3e commit ddf8fac

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/generate_csv_search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function generateCsvSearch(
5757
jobParams: JobParamsDiscoverCsv
5858
): Promise<CsvResultFromSearch> {
5959
const { savedObjects, uiSettingsServiceFactory } = server;
60-
const savedObjectsClient = savedObjects.getScopedSavedObjectsClient(req);
60+
const savedObjectsClient = savedObjects.getScopedSavedObjectsClient(req.getRawRequest());
6161
const { indexPatternSavedObjectId, timerange } = searchPanel;
6262
const savedSearchObjectAttr = searchPanel.attributes as SavedSearchObjectAttributes;
6363
const { indexPatternSavedObject } = await getDataSource(

x-pack/legacy/plugins/reporting/server/lib/get_user.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import { Legacy } from 'kibana';
88
import { ServerFacade } from '../../types';
99

1010
export function getUserFactory(server: ServerFacade) {
11+
/*
12+
* Legacy.Request because this is called from routing middleware
13+
*/
1114
return async (request: Legacy.Request) => {
1215
if (!server.plugins.security) {
1316
return null;

x-pack/legacy/plugins/reporting/server/routes/lib/make_request_facade.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ export function makeRequestFacade(request: Legacy.Request): RequestFacade {
2727
pre: (request.pre as Record<string, any>) as ReportingRequestPre,
2828
getBasePath: request.getBasePath,
2929
route: request.route,
30+
getRawRequest: () => request,
3031
};
3132
}

x-pack/legacy/plugins/reporting/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export interface RequestFacade {
9999
query: ReportingRequestQuery;
100100
route: Legacy.Request['route'];
101101
pre: ReportingRequestPre;
102+
getRawRequest: () => Legacy.Request;
102103
}
103104

104105
export type ResponseFacade = ResponseObject & {

0 commit comments

Comments
 (0)