Input Validation
Ideally do this as a sort of middleware between transport and storage drivers, to ensure that the ball doesn't get dropped by either of those once we start to have multiple drivers for operators to choose from.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- High
- Drafter:
- None
- Direction:
- Approved
- Assignee:
- Zhihao Yuan
- Definition:
- Approved
- Series goal:
- Accepted for havana
- Implementation:
- Implemented
- Milestone target:
- havana-2
- Started by
- Kurt Griffiths
- Completed by
- Kurt Griffiths
Related branches
Related bugs
Sprints
Whiteboard
DESIGN/
-*- Single DRY approach for validation of semantic limits that are common to all drivers (e.g., max length for queue metadata, etc.). Driver-specific validation (e.g., stuff specific to WSGI) can be done within the drivers themselves.
-*- Validation that "just happens" (or can't be forgotten) when new drivers are created.
-*- Minimal performance impact. Ideally, performing a validation doesn't introduce an extra unpacking or parsing of message payloads.
OPTIONS
--1-- Introduce validation into Controller base classes
Pros: Seems to be the logical place for this to happen.
Cons: Compromises the "abstractness" of these classes, and requires descendant classes to call the super-class (a step which can be forgotten)
--2-- Introduce Validation Drivers as middleware in-between Storage and Transport. Storage drivers hand their controllers to a Validation driver, and the Validation driver hands a validator to Transport.
Pros: Enforces the validation step, and puts the logic all in one place.
Cons: Requires the validator to wrap each and every controller call, even if validation isn't required.
--3-- Instantiate Controllers with some sort of Validation mix-in class.
(I haven't really thought this one through yet).
Gerrit topic: https:/
Addressed by: https:/
Adds a framework for input-validation
Gerrit topic: https:/
Addressed by: https:/
WIP(
Addressed by: https:/
Update Tests for Input Validation
Gerrit topic: https:/