introduces the config package to refactor the way the config is obtained #582
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit refactors the ffuf code to simplify the configuration
process. ffuf's configuration has become complex, since it takes configurations
from multiple configuration sources like the commandline, multiple configuration
files and HTTP request files (sometimes called HTTP templates). Inputs from
these configuration sources have to be merged into one coherent configuration
and it's consistency validated. ffuf lacked a clear way to obtain it's
configuration easily and clearly. Any contributor who wanted to introduce a new
feature had to study the configuration code and insert his or modify the
configuration process with the hopes of not breaking anything.
The config package aims to simplify and formalize the configuration of ffuf,
while making it flexible and extensible. It provides:
of all configurations sources
to the caller
base
A pkg/config/README.md is provided to further explain the configuration
process. Additionally, the core functionality is of this package is tested an
examples as Go code are provided.
This commit had to make changes to code outside the main package to untangle the
imports, which were causing import cycles.