Skip to content

Commit 7c296ac

Browse files
authored
Merge branch 'master' into feat/ast-builder
2 parents 61d3508 + 7f39cb5 commit 7c296ac

515 files changed

Lines changed: 12516 additions & 5239 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getquerylog.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
| --- | --- |
3939
| [getDefaultQuery(language)](./kibana-plugin-plugins-data-public.getdefaultquery.md) | |
4040
| [getEsPreference(uiSettings, sessionId)](./kibana-plugin-plugins-data-public.getespreference.md) | |
41-
| [getQueryLog(uiSettings, storage, appName, language)](./kibana-plugin-plugins-data-public.getquerylog.md) | |
4241
| [getSearchErrorType({ message })](./kibana-plugin-plugins-data-public.getsearcherrortype.md) | |
4342
| [getSearchParamsFromRequest(searchRequest, dependencies)](./kibana-plugin-plugins-data-public.getsearchparamsfromrequest.md) | |
4443
| [getTime(indexPattern, timeRange, options)](./kibana-plugin-plugins-data-public.gettime.md) | |

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<b>Signature:</b>
88

99
```typescript
10-
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "placeholder" | "onChange" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition">>
10+
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition">>
1111
```

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.search.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ search: {
2121
})[];
2222
InvalidEsCalendarIntervalError: typeof InvalidEsCalendarIntervalError;
2323
InvalidEsIntervalFormatError: typeof InvalidEsIntervalFormatError;
24+
Ipv4Address: typeof Ipv4Address;
2425
isDateHistogramBucketAggConfig: typeof isDateHistogramBucketAggConfig;
2526
isNumberType: (agg: import("./search").AggConfig) => boolean;
2627
isStringType: (agg: import("./search").AggConfig) => boolean;

docs/development/plugins/data/server/kibana-plugin-plugins-data-server.search.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ search: {
1212
dateHistogramInterval: typeof dateHistogramInterval;
1313
InvalidEsCalendarIntervalError: typeof InvalidEsCalendarIntervalError;
1414
InvalidEsIntervalFormatError: typeof InvalidEsIntervalFormatError;
15+
Ipv4Address: typeof Ipv4Address;
1516
isValidEsInterval: typeof isValidEsInterval;
1617
isValidInterval: typeof isValidInterval;
1718
parseEsInterval: typeof parseEsInterval;

examples/alerting_example/public/components/view_alert.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ export const ViewAlertPage = withRouter(({ http, id }: Props) => {
4949

5050
useEffect(() => {
5151
if (!alert) {
52-
http.get(`${BASE_ALERT_API_PATH}/${id}`).then(setAlert);
52+
http.get(`${BASE_ALERT_API_PATH}/alert/${id}`).then(setAlert);
5353
}
5454
if (!alertState) {
55-
http.get(`${BASE_ALERT_API_PATH}/${id}/state`).then(setAlertState);
55+
http.get(`${BASE_ALERT_API_PATH}/alert/${id}/state`).then(setAlertState);
5656
}
5757
}, [alert, alertState, http, id]);
5858

examples/alerting_example/public/components/view_astros_alert.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ export const ViewPeopleInSpaceAlertPage = withRouter(({ http, id }: Props) => {
5555

5656
useEffect(() => {
5757
if (!alert) {
58-
http.get(`${BASE_ALERT_API_PATH}/${id}`).then(setAlert);
58+
http.get(`${BASE_ALERT_API_PATH}/alert/${id}`).then(setAlert);
5959
}
6060
if (!alertState) {
61-
http.get(`${BASE_ALERT_API_PATH}/${id}/state`).then(setAlertState);
61+
http.get(`${BASE_ALERT_API_PATH}/alert/${id}/state`).then(setAlertState);
6262
}
6363
}, [alert, alertState, http, id]);
6464

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
124124
"@babel/register": "^7.10.1",
125125
"@elastic/apm-rum": "^5.2.0",
126-
"@elastic/charts": "19.8.0",
126+
"@elastic/charts": "19.8.1",
127127
"@elastic/datemath": "5.0.3",
128128
"@elastic/ems-client": "7.9.3",
129129
"@elastic/eui": "24.1.0",

packages/kbn-ui-shared-deps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"kbn:watch": "node scripts/build --dev --watch"
1010
},
1111
"dependencies": {
12-
"@elastic/charts": "19.8.0",
12+
"@elastic/charts": "19.8.1",
1313
"@elastic/eui": "24.1.0",
1414
"@elastic/numeral": "^2.5.0",
1515
"@kbn/i18n": "1.0.0",

src/core/server/http/integration_tests/lifecycle.test.ts

Lines changed: 136 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import supertest from 'supertest';
2121
import request from 'request';
22+
import { schema } from '@kbn/config-schema';
2223

2324
import { ensureRawRequest } from '../router';
2425
import { HttpService } from '../http_service';
@@ -222,6 +223,39 @@ describe('OnPreAuth', () => {
222223

223224
await supertest(innerServer.listener).get('/').expect(200, { customField: 'undefined' });
224225
});
226+
227+
it('has no access to request body', async () => {
228+
const { registerOnPreAuth, server: innerServer, createRouter } = await server.setup(setupDeps);
229+
const router = createRouter('/');
230+
let requestBody = null;
231+
registerOnPreAuth((req, res, t) => {
232+
requestBody = req.body;
233+
return t.next();
234+
});
235+
236+
router.post(
237+
{
238+
path: '/',
239+
validate: {
240+
body: schema.object({
241+
term: schema.string(),
242+
}),
243+
},
244+
},
245+
(context, req, res) => res.ok({ body: req.body.term })
246+
);
247+
248+
await server.start();
249+
250+
await supertest(innerServer.listener)
251+
.post('/')
252+
.send({
253+
term: 'foo',
254+
})
255+
.expect(200, 'foo');
256+
257+
expect(requestBody).toStrictEqual({});
258+
});
225259
});
226260

227261
describe('OnPostAuth', () => {
@@ -356,6 +390,39 @@ describe('OnPostAuth', () => {
356390

357391
await supertest(innerServer.listener).get('/').expect(200, { customField: 'undefined' });
358392
});
393+
394+
it('has no access to request body', async () => {
395+
const { registerOnPostAuth, server: innerServer, createRouter } = await server.setup(setupDeps);
396+
const router = createRouter('/');
397+
let requestBody = null;
398+
registerOnPostAuth((req, res, t) => {
399+
requestBody = req.body;
400+
return t.next();
401+
});
402+
403+
router.post(
404+
{
405+
path: '/',
406+
validate: {
407+
body: schema.object({
408+
term: schema.string(),
409+
}),
410+
},
411+
},
412+
(context, req, res) => res.ok({ body: req.body.term })
413+
);
414+
415+
await server.start();
416+
417+
await supertest(innerServer.listener)
418+
.post('/')
419+
.send({
420+
term: 'foo',
421+
})
422+
.expect(200, 'foo');
423+
424+
expect(requestBody).toStrictEqual({});
425+
});
359426
});
360427

361428
describe('Auth', () => {
@@ -852,10 +919,43 @@ describe('Auth', () => {
852919

853920
await supertest(innerServer.listener).get('/').expect(200, { customField: 'undefined' });
854921
});
922+
923+
it('has no access to request body', async () => {
924+
const { registerAuth, server: innerServer, createRouter } = await server.setup(setupDeps);
925+
const router = createRouter('/');
926+
let requestBody = null;
927+
registerAuth((req, res, t) => {
928+
requestBody = req.body;
929+
return t.authenticated({});
930+
});
931+
932+
router.post(
933+
{
934+
path: '/',
935+
validate: {
936+
body: schema.object({
937+
term: schema.string(),
938+
}),
939+
},
940+
},
941+
(context, req, res) => res.ok({ body: req.body.term })
942+
);
943+
944+
await server.start();
945+
946+
await supertest(innerServer.listener)
947+
.post('/')
948+
.send({
949+
term: 'foo',
950+
})
951+
.expect(200, 'foo');
952+
953+
expect(requestBody).toStrictEqual({});
954+
});
855955
});
856956

857957
describe('OnPreResponse', () => {
858-
it('supports registering response inceptors', async () => {
958+
it('supports registering response interceptors', async () => {
859959
const { registerOnPreResponse, server: innerServer, createRouter } = await server.setup(
860960
setupDeps
861961
);
@@ -1001,4 +1101,39 @@ describe('OnPreResponse', () => {
10011101

10021102
await supertest(innerServer.listener).get('/').expect(200);
10031103
});
1104+
1105+
it('has no access to request body', async () => {
1106+
const { registerOnPreResponse, server: innerServer, createRouter } = await server.setup(
1107+
setupDeps
1108+
);
1109+
const router = createRouter('/');
1110+
let requestBody = null;
1111+
registerOnPreResponse((req, res, t) => {
1112+
requestBody = req.body;
1113+
return t.next();
1114+
});
1115+
1116+
router.post(
1117+
{
1118+
path: '/',
1119+
validate: {
1120+
body: schema.object({
1121+
term: schema.string(),
1122+
}),
1123+
},
1124+
},
1125+
(context, req, res) => res.ok({ body: req.body.term })
1126+
);
1127+
1128+
await server.start();
1129+
1130+
await supertest(innerServer.listener)
1131+
.post('/')
1132+
.send({
1133+
term: 'foo',
1134+
})
1135+
.expect(200, 'foo');
1136+
1137+
expect(requestBody).toStrictEqual({});
1138+
});
10041139
});

0 commit comments

Comments
 (0)