Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[savedObjects/mappings] limit valid type names #17511

Merged
merged 1 commit into from
Apr 9, 2018

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Apr 2, 2018

Part of #17510

Limits the valid type names supported by the SavedObject mappings to ensure that users don't register type names that start with _. This is done similarly to how we verify that saved object mappings between plugins don't conflict, by checking when attempting to merge the mappings together.

Release note:
Starting in Kibana 6.3 the Saved Object API will use underscore-prefixed names for certain endpoints, so to disambiguate these endpoint names from the type parameter supported by some other Saved Object API endpoints, type names can no longer start with an underscore (_) character.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger spalger added review Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.0.0 v6.3.0 labels Apr 4, 2018
const props = formatListAsProse(illegal);
const owner = pluginId ? `registered by plugin ${pluginId} ` : '';
throw new Error(
`Property name${props.length > 1 ? 's' : ''} ${props} ${owner}are not allowed to start with an underscore (_)`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason there's no space between ${owner} and are? Also same thing on line 38.

Copy link

@rhoboat rhoboat Apr 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, lines 36 & 44 have the trailing space. Just feels wrong.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, this is fine.

Copy link

@rhoboat rhoboat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@spalger spalger force-pushed the fix/saved-objects/type-limitations branch from d4e7890 to 7df8404 Compare April 4, 2018 23:33
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger
Copy link
Contributor Author

spalger commented Apr 10, 2018

6.3/6.x: f04dcb0

@spalger spalger deleted the fix/saved-objects/type-limitations branch April 10, 2018 07:20
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:breaking review Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v6.3.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants