Yelp / fuzz-lightyear

A pytest-inspired, DAST framework, capable of identifying vulnerabilities in a distributed, micro-service ecosystem through chaos engineering testing and stateful, Swagger fuzzing.
Other
205 stars 25 forks source link

Endpoint specific fixtures cannot be called by generic fixtures #63

Open tanx16 opened 3 years ago

tanx16 commented 3 years ago

fuzz-lightyear has a test case,test_nested_endpoint_dependency_uses_default, which currently fails. We want to support this case in the future, but making this change is somewhat difficult. Here's the problem:

Consider the following:

Now, when we call nested_dependency with the new_opid endpoint, we get 4 instead of 6. This is because nested_dependency is generic, so when we call register_factory it doesn't call inject_user_defined_variables with the list of operation_ids, since there is no list. Fixing this issue will require us to pass in the endpoint called into the wrapped function, and selecting which caller to use at that time.