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

Incoming message validation #68

Closed
3 tasks done
TimoGlastra opened this issue Jul 17, 2020 · 0 comments · Fixed by #360
Closed
3 tasks done

Incoming message validation #68

TimoGlastra opened this issue Jul 17, 2020 · 0 comments · Fixed by #360
Assignees

Comments

@TimoGlastra
Copy link
Contributor

TimoGlastra commented Jul 17, 2020

When a message from another agent is received it is transformed from JSON into a class instance of that message. Most agent message classes already contain decorators from the class-validator package that specify how we want to validate properties. For example the ConnectionInvitationMessage contains decorators to validate.

The Dispatcher class transforms the JSON of a message to a class instance. After the transformation we should use the validate function of the class-validator package to check if the message is valid.

In the future we can send a problem report message from the problem report protocol (#58) if the message is not valid according to the validation (which should be based on the requirements of the RFCs)

  • Add validation decorators to all message classes. Also check messages that already contain validation decorators.
  • Validate message class instance with class-transormer package after transformation from JSON
  • Add appropriate tests

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant