Skip to content

Validate payload data types #5

@Steditor

Description

@Steditor

The current typing of the optional validate method of commands assumes that the payload data is already checked for correct data types. As incoming messages by clients must never be trusted without data type checking, there should be a canonical way of doing so, e.g.

  • have the dispatcher call validate before setting the payload and have validate receive the payload as unknown data type. If the method returns true, the data can be trusted and is of the specified payload data type.
  • add a separate (optional) method to commands for checking the payload data, that is called by the dispatcher before setting the payload.

Either way the interface of Dispatcher.dispatch should then allow to pass unknown data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions