Skip to content

Implement and enforce requirements for entity type names #58

@davemoore-

Description

@davemoore-

Currently entity type names can be any arbitrary string. As noted in another discussion, this is problematic when implementing API endpoints that could conflict with the names of entity types. There may be other unforeseen issues by using arbitrary strings. Entity type names are meant to be identifiers, not necessarily human readable descriptions, and therefore should be expected to follow some constraints.

Proposal

Enforce the same requirements as the Elasticsearch index name requirements:

Index names must meet the following criteria:

  • Lowercase only
  • Cannot include \, /, *, ?, ", <, >, |, (space character), ,, #
  • Indices prior to 7.0 could contain a colon (:), but that’s been deprecated and won’t be supported in 7.0+
  • Cannot start with -, _, +
  • Cannot be . or ..
  • Cannot be longer than 255 bytes (note it is bytes, so multi-byte characters will count towards the 255 limit faster)
  • Names starting with . are deprecated, except for hidden indices and internal indices managed by plugins

Entity type names should follow the same rules (though allowing names to start with .). This will prevent entity type names from conflicting with reserved API terms such as _bulk and may help avoid other unforeseen issues related to syntax.

This would introduce a breaking change for existing entity models whose names do not meet this criteria.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions