Update Network Traffic for CS03

- `end` must be greater than or equal to `start`
- `extensions` and `end` are now id-contributing properties
pull/1/head
Chris Lenk 2021-06-25 22:48:00 -04:00
parent 646aaa39a0
commit 7a9d052a0d
1 changed files with 3 additions and 3 deletions

View File

@ -561,7 +561,7 @@ class NetworkTraffic(_Observable):
('defanged', BooleanProperty(default=lambda: False)), ('defanged', BooleanProperty(default=lambda: False)),
('extensions', ExtensionsProperty(spec_version='2.1', enclosing_type=_type)), ('extensions', ExtensionsProperty(spec_version='2.1', enclosing_type=_type)),
]) ])
_id_contributing_properties = ["start", "src_ref", "dst_ref", "src_port", "dst_port", "protocols"] _id_contributing_properties = ["start", "end", "src_ref", "dst_ref", "src_port", "dst_port", "protocols", "extensions"]
def _check_object_constraints(self): def _check_object_constraints(self):
super(NetworkTraffic, self)._check_object_constraints() super(NetworkTraffic, self)._check_object_constraints()
@ -579,8 +579,8 @@ class NetworkTraffic(_Observable):
msg = "{0.id} if 'is_active' is True, 'end' must not be included" msg = "{0.id} if 'is_active' is True, 'end' must not be included"
raise ValueError(msg.format(self)) raise ValueError(msg.format(self))
if start and end and end <= start: if start and end and end < start:
msg = "{0.id} 'end' must be greater than 'start'" msg = "{0.id} 'end' must be greater than or equal to 'start'"
raise ValueError(msg.format(self)) raise ValueError(msg.format(self))