Skip to content

Commit

Permalink
Move validateObject to kbn-std package and add a description
Browse files Browse the repository at this point in the history
  • Loading branch information
DianaDerevyankina committed Dec 18, 2020
1 parent 82cff88 commit 0555f02
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export declare function validateObject(obj: any): void;

| Parameter | Type | Description |
| --- | --- | --- |
| obj | <code>any</code> | |
| obj | <code>any</code> | Is used to validate object properties for containing constructor and prototype with detecting circular references

<b>Returns:</b>

Expand Down
1 change: 1 addition & 0 deletions packages/kbn-std/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export { withTimeout } from './promise';
export { isRelativeUrl, modifyUrl, getUrlOrigin, URLMeaningfulParts } from './url';
export { unset } from './unset';
export { getFlattenedObject } from './get_flattened_object';
export { validateObject } from './validate_object';
export * from './rxjs_7';
File renamed without changes.
2 changes: 1 addition & 1 deletion src/core/server/http/http_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import Hoek from '@hapi/hoek';
import type { ServerOptions as TLSOptions } from 'https';
import type { ValidationError } from 'joi';
import uuid from 'uuid';
import { validateObject } from '@kbn/std';
import { HttpConfig } from './http_config';
import { validateObject } from './prototype_pollution';

const corsAllowedHeaders = ['Accept', 'Authorization', 'Content-Type', 'If-None-Match', 'kbn-xsrf'];
/**
Expand Down
1 change: 0 additions & 1 deletion src/core/server/http/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,3 @@ export {
} from './cookie_session_storage';
export * from './types';
export { BasePath, IBasePath } from './base_path_service';
export { validateObject } from './prototype_pollution';
20 changes: 0 additions & 20 deletions src/core/server/http/prototype_pollution/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/core/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export {
RouteConfigOptionsBody,
RouteContentType,
validBodyOutput,
validateObject,
RouteValidatorConfig,
RouteValidationSpec,
RouteValidationFunction,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_timeseries/server/routes/vis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

import { IRouter, KibanaRequest } from 'kibana/server';
import { schema } from '@kbn/config-schema';
import { validateObject } from '@kbn/std';
import { getVisData, GetVisDataOptions } from '../lib/get_vis_data';
import { visPayloadSchema } from '../../common/vis_schema';
import { ROUTES } from '../../common/constants';
import { ValidationTelemetryServiceSetup } from '../index';
import { Framework } from '../plugin';
import { validateObject } from '../../../../core/server';

const escapeHatch = schema.object({}, { unknowns: 'allow' });

Expand Down

0 comments on commit 0555f02

Please sign in to comment.