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

Validate V2 templates more strictly #56170

Merged
merged 4 commits into from
May 5, 2020

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented May 4, 2020

This commit changes the validation for V2 index and component templates to re-use the same
validation that V1 templates used. This includes things like invalid template names, index patterns,
etc.

This also adds validation that template names do not contain * and index patterns do not contain
: (index names can't contain this regardless).

Supercedes #53970
Relates to #53101
Resolves #43737
Resolves #46045

This commit changes the validation for V2 index and component templates to re-use the same
validation that V1 templates used. This includes things like invalid template names, index patterns,
etc.

This also adds validation that template names do not contain `*`.

Supercedes elastic#53970
Relates to elastic#53101
@dakrone dakrone added :Data Management/Indices APIs APIs to create and manage indices and templates v8.0.0 v7.8.0 labels May 4, 2020
@dakrone dakrone requested review from andreidan and probakowski May 4, 2020 23:10
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label May 4, 2020
@martijnvg martijnvg mentioned this pull request May 4, 2020
39 tasks
Copy link
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this Lee

@dakrone
Copy link
Member Author

dakrone commented May 5, 2020

@elasticmachine update branch

@dakrone dakrone merged commit ed271a6 into elastic:master May 5, 2020
@dakrone dakrone deleted the itv2-enhance-template-validation branch May 5, 2020 15:24
dakrone added a commit to dakrone/elasticsearch that referenced this pull request May 5, 2020
This commit changes the validation for V2 index and component templates to re-use the same
validation that V1 templates used. This includes things like invalid template names, index patterns,
etc.

This also adds validation that template names do not contain `*` and index patterns do not contain
`:` (index names can't contain this regardless).

Supercedes elastic#53970
Relates to elastic#53101
Resolves elastic#43737
Resolves elastic#46045
dakrone added a commit that referenced this pull request May 5, 2020
Backports the following commits to 7.x:
 - Validate V2 templates more strictly (#56170)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >enhancement Team:Data Management Meta label for data/management team v7.8.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disallow creating index templates with : in pattern Template can be created with wildcard * in the name
7 participants