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

Message Validation #24

Open
richteer opened this issue Oct 19, 2015 · 0 comments
Open

Message Validation #24

richteer opened this issue Oct 19, 2015 · 0 comments
Labels

Comments

@richteer
Copy link
Contributor

Somewhere there should be some kind of message validator, something that ensures that a message object is properly formed. Some protocols might be stricter on what is a valid body, so should there be some kind of universal support for checking valid input?

Example implementation: add a check(msg) method to the HalAgent class. Implemention the latter as such:

class HalAgent(HalObject):
  ...
  def check(self, msg):
    return True
  ...
  def receive(self, msg):
    if self.check(msg):
      self._queue.add(msg)
      return True:
    return False
  ...

An agent implementer could then override the .check(msg) method to give it some kind of validity checking logic, if the protocol is picky. This means, scanning for UTF-8 strings, or looking for missing values that are expected.

There should also be a implicit "valid_check" option in agent configs, where these checks either fail, throw a warning, or completely skip the check.

@richteer richteer added the RFC label Oct 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant