-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce naming rules on indexes and collections (#1531)
# Description Enforce strict naming rules on indexes and collections. This has the following effects: * index and collection creation now return dedicated error messages/ids (`index:create` and `collection:create`) * it's no longer possible to restrict a profile to an index or a collection that cannot possibly exist ([opened issue: KZL-1392](https://jira.kaliop.net/browse/KZL-1392)) The enforced rules are a stricter version of the [Elasticsearch naming rules](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-create-index.html), as Kuzzle adds a few restrictions of its own. The documentation has also been updated with these naming rules. # Architecture Naming rules have been implemented directly in the ES service, and propagated through the ClientAdapter class. I've made that choice because, to me, naming rules depend on the implemented storage service and therefore might change depending on it. That way, if we use another storage service, it simply needs to implement the new `isIndexNameValid` and `isCollectionNameValid`. This choice also explains why we have 1 dedicated function per object type (index & collection) even if this is useless with ES since we emulate collections with indexes. This paves the way for other storage engines allowing different structures and maybe different naming rules for indexes and collections.
- Loading branch information
Showing
13 changed files
with
317 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.