Increasing limits for resolver (#71483)
This commit is contained in:
parent
1afb0c476b
commit
cd43bbc365
|
@ -12,10 +12,10 @@ import { schema } from '@kbn/config-schema';
|
|||
export const validateTree = {
|
||||
params: schema.object({ id: schema.string() }),
|
||||
query: schema.object({
|
||||
children: schema.number({ defaultValue: 10, min: 0, max: 100 }),
|
||||
ancestors: schema.number({ defaultValue: 3, min: 0, max: 5 }),
|
||||
events: schema.number({ defaultValue: 100, min: 0, max: 1000 }),
|
||||
alerts: schema.number({ defaultValue: 100, min: 0, max: 1000 }),
|
||||
children: schema.number({ defaultValue: 200, min: 0, max: 10000 }),
|
||||
ancestors: schema.number({ defaultValue: 200, min: 0, max: 10000 }),
|
||||
events: schema.number({ defaultValue: 1000, min: 0, max: 10000 }),
|
||||
alerts: schema.number({ defaultValue: 1000, min: 0, max: 10000 }),
|
||||
afterEvent: schema.maybe(schema.string()),
|
||||
afterAlert: schema.maybe(schema.string()),
|
||||
afterChild: schema.maybe(schema.string()),
|
||||
|
@ -29,7 +29,7 @@ export const validateTree = {
|
|||
export const validateEvents = {
|
||||
params: schema.object({ id: schema.string() }),
|
||||
query: schema.object({
|
||||
events: schema.number({ defaultValue: 100, min: 1, max: 1000 }),
|
||||
events: schema.number({ defaultValue: 1000, min: 1, max: 10000 }),
|
||||
afterEvent: schema.maybe(schema.string()),
|
||||
legacyEndpointID: schema.maybe(schema.string()),
|
||||
}),
|
||||
|
@ -41,7 +41,7 @@ export const validateEvents = {
|
|||
export const validateAlerts = {
|
||||
params: schema.object({ id: schema.string() }),
|
||||
query: schema.object({
|
||||
alerts: schema.number({ defaultValue: 100, min: 1, max: 1000 }),
|
||||
alerts: schema.number({ defaultValue: 1000, min: 1, max: 10000 }),
|
||||
afterAlert: schema.maybe(schema.string()),
|
||||
legacyEndpointID: schema.maybe(schema.string()),
|
||||
}),
|
||||
|
@ -53,7 +53,7 @@ export const validateAlerts = {
|
|||
export const validateAncestry = {
|
||||
params: schema.object({ id: schema.string() }),
|
||||
query: schema.object({
|
||||
ancestors: schema.number({ defaultValue: 0, min: 0, max: 10 }),
|
||||
ancestors: schema.number({ defaultValue: 200, min: 0, max: 10000 }),
|
||||
legacyEndpointID: schema.maybe(schema.string()),
|
||||
}),
|
||||
};
|
||||
|
@ -64,7 +64,7 @@ export const validateAncestry = {
|
|||
export const validateChildren = {
|
||||
params: schema.object({ id: schema.string() }),
|
||||
query: schema.object({
|
||||
children: schema.number({ defaultValue: 10, min: 1, max: 100 }),
|
||||
children: schema.number({ defaultValue: 200, min: 1, max: 10000 }),
|
||||
afterChild: schema.maybe(schema.string()),
|
||||
legacyEndpointID: schema.maybe(schema.string()),
|
||||
}),
|
||||
|
|
|
@ -366,7 +366,7 @@ export default function resolverAPIIntegrationTests({ getService }: FtrProviderC
|
|||
|
||||
it('should error on invalid pagination values', async () => {
|
||||
await supertest.get(`/api/endpoint/resolver/${entityID}/events?events=0`).expect(400);
|
||||
await supertest.get(`/api/endpoint/resolver/${entityID}/events?events=2000`).expect(400);
|
||||
await supertest.get(`/api/endpoint/resolver/${entityID}/events?events=20000`).expect(400);
|
||||
await supertest.get(`/api/endpoint/resolver/${entityID}/events?events=-1`).expect(400);
|
||||
});
|
||||
});
|
||||
|
@ -444,14 +444,18 @@ export default function resolverAPIIntegrationTests({ getService }: FtrProviderC
|
|||
|
||||
it('should have a populated next parameter', async () => {
|
||||
const { body }: { body: ResolverAncestry } = await supertest
|
||||
.get(`/api/endpoint/resolver/${entityID}/ancestry?legacyEndpointID=${endpointID}`)
|
||||
.get(
|
||||
`/api/endpoint/resolver/${entityID}/ancestry?legacyEndpointID=${endpointID}&ancestors=0`
|
||||
)
|
||||
.expect(200);
|
||||
expect(body.nextAncestor).to.eql('94041');
|
||||
});
|
||||
|
||||
it('should handle an ancestors param request', async () => {
|
||||
let { body }: { body: ResolverAncestry } = await supertest
|
||||
.get(`/api/endpoint/resolver/${entityID}/ancestry?legacyEndpointID=${endpointID}`)
|
||||
.get(
|
||||
`/api/endpoint/resolver/${entityID}/ancestry?legacyEndpointID=${endpointID}&ancestors=0`
|
||||
)
|
||||
.expect(200);
|
||||
const next = body.nextAncestor;
|
||||
|
||||
|
@ -579,7 +583,7 @@ export default function resolverAPIIntegrationTests({ getService }: FtrProviderC
|
|||
it('errors on invalid pagination values', async () => {
|
||||
await supertest.get(`/api/endpoint/resolver/${entityID}/children?children=0`).expect(400);
|
||||
await supertest
|
||||
.get(`/api/endpoint/resolver/${entityID}/children?children=2000`)
|
||||
.get(`/api/endpoint/resolver/${entityID}/children?children=20000`)
|
||||
.expect(400);
|
||||
await supertest
|
||||
.get(`/api/endpoint/resolver/${entityID}/children?children=-1`)
|
||||
|
|
Loading…
Reference in a new issue