Releases: SpectoLabs/hoverfly
v1.0.0-rc.1
Happy Friday! We are thrilled to announce an RC release of v1.0.0!
The v5 simulation schema introduced since v0.17.0 is stable and easy to extend for more powerful request matchers. It lays a good foundation for us to implement matcher chaining to solve XML/JSON matching issues without introducing breaking changes. That's when we start considering a Hoverfly v1 release.
Thank you for all your contributions, we are hoping to work with you again on more exciting features in the coming months, and make Hoverfly shines!
Adding delay based on Log-normal Distribution
Thanks to @podtserkovskiy's contribution, you can now enable random delay in a simulation based on log-normal distribution. Here is an example:
"globalActions": {
"delaysLogNormal": [
{
"urlPattern": ".",
"httpMethod": "",
"min": 100,
"max": 10000,
"mean": 5000,
"median": 500
}
]
}
where mean and median values could be calculated from your actual server response times, and Hoverfly generate random latencies that are lognormally distributed based on these parameters.
Controlling log level
Default log level of Hoverfly is info
, but if you prefer less noise or a bit concern about the performance overheads of info logging, you can control the log level with this release:
$ hoverfly -log-level warn
Which logs warning level or above (error, fatal and panic)
Bug fixes
Some long-standing bugs have been addressed in this release, such as bugs that affect multi-value query capture, config.yaml loading and plain HTTP tunnelling.
v0.17.7
This is a pure bugfix release to address the following issues:
Hoverfly crashed under heavy load in webserver mode
While we helped the community with load testing issues using hoverfly, we fixed a few bugs causing hoverfly to crash under load. This includes transistive bugs from an old version of logrus, concurrent read/write access to map, and usage counter failed to update in webserver mode(#776)
Query parameters were duplicated in the journal
This bug can be confusing when you need to debug an unmatched request. As reported by hoverfly-java users SpectoLabs/hoverfly-java#187, the query parameters are duplicated in the closest-match debug message.
v0.17.6
Two-way SSL authentication support
A huge thanks to @xiang-zhu's PR, Hoverfly finally has support for two-way SSL authentication. This new feature lets you capture or spy an HTTPS server that requires this authentication method. You can provide certificate key, client certificate and CA certificate with the following flags when starting hoverfly:
--client-authentication-client-key
--client-authentication-client-cert
--client-authentication-ca-cert
You must also provide a host pattern using --client-authentication-destination
flag to tell Hoverfly which request hosts should be called using this authentication method.
Bug fix to capturing concurrent requests with state
Thanks again to @john4744 for fixing a concurrency issue when doing stateful capture. Hoverfly should now generate the correct state values when capturing concurrent requests.
v0.17.5
Bug fix to simulating concurrent requests with state
Thanks again to @john4744 for spotting and fixing a bug in the state part of Hoverfly. Hoverfly did not use any locks on the state, meaning there could be concurrency issues with multiple requests and responses using and modifying state.
Bug fix to simulation import warnings
A bug was noticed regarding warnings when importing simulations with Content-Length headers on the responses with encoded bodies. This has now been fixed.
v0.17.4
PAC file configuration
We have added support for configuring Hoverfly with a PAC file which now allows users to dynamically change upstream proxies. Our support of PAC files is fairly primitive for now, offering support for DIRECT
and PROXY
commands. We currently do not support fallback upstream proxies such as PROXY proxy1.org.corp; PROXY proxy1.org.corp
.
The PAC file can be imported to Hoverfly through a PUT request to /api/v2/hoverfly/pac
or through the use of hoverctl.
hoverctl start --pac-file path/to/file.pac
For more information on Using Hoverfly behind a proxy
Bug fix to stateful capture
Thanks to @john4744 for spotting and fixing a bug in stateful capture. This should now be resolved.
v0.17.3
Request body templating
We have updated templating again! This time, we've the ability to use parts of the request body in your response. This is done using jsonpath and xpath.
{{ Request.Body “jsonpath” “$.test” }}
{{ Request.Body “xpath” “/root/id” }}
These templating functions will retrieve parts of the document from the request based off of the query provided.
For more information on Template helpers
Empty queries
With the introduction of the v5 schema, we temporarily lost the ability to define a request with zero query parameters, forcing users to have to remain using the deprecated query field from v4. This was captured is in issue #750. This version should now support zero query parameters correctly.
Filter out headers in diff mode
From user feedback, we found some users were struggling to make sense of the changes being outputted in diff mode due to the constantly changing headers, often headers that the user did not care had changed.
We have updated diff mode to now support the ability to filter out headers. These are defined simiarly to how you would define capturing headers when setting the mode to capture.
hoverctl mode diff --headers Content-Type,Authorization
hoverctl mode diff --all-headers
v0.17.2
More helpers for templating
We have introduced a few new template helper methods. These helpers allow you to generate date times that can be offset from the time the response is served and can also be formatted using Golang date time formats.
For more information on Template helpers
v0.17.1
Content-Length and Transfer-Encoding bug
There was regression in Hoverfly regarding the Content-Length and Transfer-Encoding headers being sent when using Hoverfly with HTTPs. This is against the HTTP specification, resulting in some clients throwing errors, such as in issue #727. This should now be resolved.
New helpers for templating
We have introduced some new template helper methods. These helpers allow you to generate random data and support several different data formats. If you have any ideas for additional template helper methods, feel free to raise an issue against Hoverfly and suggest them.
For more information on Template helpers)
v0.17.0
v5 Schema
We have introduced a new version of the schema. This new version changes both request queries and request headers.
New matcher format
We have updated the format of matchers. The reasoning behind this was to make them more flexible and easier to extend in the future.
{
"matcher": "exact",
"value": "new-matcher"
}
Request header changes
We have updated Headers to now allow for the user of matchers, previously, header values were defined as strings.
"headers": {
"Content-Type": [
"application/json"
]
}
In v5, you now use matchers, bringing it more inline with the other fields of a request.
"headers": {
"Content-Type": [
{
"matcher": "exact",
"value": "application/json"
}
]
}
Request query changes
We have also updated the request query field to match headers. Previously, queries were represented as strings, which didn't make much sense considering how we represented headers.
"query": [
{
"matcher": "exact",
"value": "testQuery=testValue"
}
]
Now, they follow the same structure as request headers. This should allow for easier matching using different matchers.
"query": {
"testQuery": [
{
"matcher": "exact",
"value": "testValue"
}
]
}
A downside to this that existing queries from older simulations will now get moved to a new query field called deprecatedQuery. We intend to remove this field at some point in time, but we hope everyone will be able to update their simulations to adopt this new query structure before we remove it.
Hoverctl warnings
With the introduction of a temporary field that is marked as deprecated, we have also updated the simulation import API and hoverctl to now warn users if their simulations contain deprecated fields. This warning is just a warning and does not interfere with the importing process, so it is possible to ignore this until a time that suits you best.
For more information on Deprecated Queries
Record sequences of requests
We have updated capture mode to now support the capturing of multiple request response pairs using the same request. This now means you can record stateful services and iterate through the recorded responses. This behaviour is not default and you will need to enable it when going into capture mode.
hoverctl mode capture --stateful
For more information on Sequences
For a tutorial on Sequences
v0.16.0
Diff Mode
Thanks to @MatousJobanek for adding a new mode to Hoverfly. By switching Hoverfly into diff mode, you can now execute requests against Hoverfly and it will work out the difference between the original service's response and the response stored in the simulation.
hoverctl mode capture
curl http://time.jsontest.com --proxy http://localhost:8500
hoverctl mode diff
curl http://time.jsontest.com --proxy http://localhost:8500
hoverctl diff get
New JSON Path Matching
We have switched all JSON path matching in Hoverfly to now use k8s.io/client-go/util/jsonpath. The end result should be better JSON path matching that should support more queries.
Fixes
- Fixed a bug where responses over HTTPS would lose their
Content-Length
header - Added listen-on-host flag to hoverctl, thanks @fuyivara
- Fixed a bug with scored matching where exactMatch scored the same as a loose matcher
- Improved error logging around JSON Path and XPath matching
- Updated build to use golang 1.10
- Now using dep instead of godeps to manage vendored dependencies