google / nogotofail

An on-path blackbox network traffic security testing tool
Apache License 2.0
2.94k stars 418 forks source link

Add precondition checks to handlers #82

Closed chadbrubaker closed 9 years ago

chadbrubaker commented 9 years ago

Add the new handler static method check_precondition which if False will cause the handler to not be used even if explicitly specified. This allows for checking for required files or other required extra things that handlers may require.

Includes a helper decorator @preconditions.requires_files(files) for handlers that require files to be present in the extras dir.

More preconditions will probably come later like requiring a library or a binary in path, etc.