Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/kbn-config-schema/src/types/string_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export type StringOptions = TypeOptions<string> & {

export class StringType extends Type<string> {
constructor(options: StringOptions = {}) {
// We want to allow empty strings, however calling `allow('')` casues
// Joi to whitelist the value and skip any additional validation.
// We want to allow empty strings, however calling `allow('')` causes
// Joi to allow the value and skip any additional validation.
// Instead, we reimplement the string validator manually except in the
// hostname case where empty strings aren't allowed anyways.
let schema =
Expand Down
4 changes: 2 additions & 2 deletions src/core/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ This table shows where these uiExports have moved to in the New Platform. In mos
| `hacks` | n/a | Just run the code in your plugin's `start` method. |
| `home` | [`plugins.home.featureCatalogue.register`](./src/plugins/home/public/feature_catalogue) | Must add `home` as a dependency in your kibana.json. |
| `indexManagement` | | Should be an API on the indexManagement plugin. |
| `injectDefaultVars` | n/a | Plugins will only be able to "whitelist" config values for the frontend. See [#41990](https://github.com/elastic/kibana/issues/41990) |
| `injectDefaultVars` | n/a | Plugins will only be able to allow config values for the frontend. See [#41990](https://github.com/elastic/kibana/issues/41990) |
| `inspectorViews` | | Should be an API on the data (?) plugin. |
| `interpreter` | | Should be an API on the interpreter plugin. |
| `links` | n/a | Not necessary, just register your app via `core.application.register` |
Expand Down Expand Up @@ -1389,7 +1389,7 @@ class MyPlugin {
}
```

If your plugin also have a client-side part, you can also expose configuration properties to it using a whitelisting mechanism with the configuration `exposeToBrowser` property.
If your plugin also have a client-side part, you can also expose configuration properties to it using the configuration `exposeToBrowser` allow-list property.

```typescript
// my_plugin/server/index.ts
Expand Down
8 changes: 4 additions & 4 deletions src/core/server/elasticsearch/client/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const createInternalClientMock = (): DeeplyMockedKeys<Client> => {
node: 'http://localhost',
}) as any;

const blackListedProps = [
const omittedProps = [
'_events',
'_eventsCount',
'_maxListeners',
Expand All @@ -39,9 +39,9 @@ const createInternalClientMock = (): DeeplyMockedKeys<Client> => {
'helpers',
];

const mockify = (obj: Record<string, any>, blacklist: string[] = []) => {
const mockify = (obj: Record<string, any>, omitted: string[] = []) => {
Object.keys(obj)
.filter((key) => !blacklist.includes(key))
.filter((key) => !omitted.includes(key))
.forEach((key) => {
const propType = typeof obj[key];
if (propType === 'function') {
Expand All @@ -52,7 +52,7 @@ const createInternalClientMock = (): DeeplyMockedKeys<Client> => {
});
};

mockify(client, blackListedProps);
mockify(client, omittedProps);

client.transport = {
request: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ import { getRootProperties } from './get_root_properties';
* @return {EsPropertyMappings}
*/

const blacklist = ['migrationVersion', 'references'];
const omittedRootProps = ['migrationVersion', 'references'];

export function getRootPropertiesObjects(mappings: IndexMapping) {
const rootProperties = getRootProperties(mappings);
return Object.entries(rootProperties).reduce((acc, [key, value]) => {
// we consider the existence of the properties or type of object to designate that this is an object datatype
if (
!blacklist.includes(key) &&
!omittedRootProps.includes(key) &&
((value as SavedObjectsComplexFieldMapping).properties || value.type === 'object')
) {
acc[key] = value;
Expand Down