Skip to content

Releases: SpectoLabs/hoverfly

v0.17.6

09 Oct 13:14
Compare
Choose a tag to compare

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

11 Sep 10:12
Compare
Choose a tag to compare

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

23 Aug 17:57
Compare
Choose a tag to compare

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

08 Aug 17:41
Compare
Choose a tag to compare

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

09 Jul 13:20
Compare
Choose a tag to compare

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

27 Jun 17:41
Compare
Choose a tag to compare

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

04 Jun 18:46
Compare
Choose a tag to compare

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

19 Mar 18:33
Compare
Choose a tag to compare

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

v0.15.1

08 Feb 12:27
Compare
Choose a tag to compare

Capture all then selectively export

hoverctl now lets you selectively export simulations, instead of exporting everything into one big JSON file. You can use —url-pattern flag with a plain text string or regex string to do the filtering. It can filter on hostname(destination) and path.

$ hoverctl export echo.json --url-pattern "echo.jsontest.com"     // export simulations for echo.jsontest.com only
$ hoverctl export api.json --url-pattern "(.+).jsontest.com"      // export simulations for all jsontest.com subdomains

GetJournal API paging and filtering

The Get Journal API is default to return the last 25 journal logs only, and you can control the paging using offset and limit query parameters. You can also query the requests made within a time window using from and to query parameters. The time queries support Unix timestamp.

Bug fix and improvements

  • Includes the latest Hoverfly Dashboard, with Spy mode toggle and some optimisation and security fix.
  • Hoverfly running in Docker is now set to listen on all interface by default, solving the issue (eg. #686) some users experienced since the release of v0.15.0

v0.15.0

05 Jan 13:52
Compare
Choose a tag to compare

Spy mode

Thanks to @3sunnysideup, Hoverfly has a new spy mode. When it is set, Hoverfly will only simulate the APIs that you have defined, and call real APIs for anything else. It is deemed useful if the service under test has different external dependencies, and you want to spy on particular endpoints only. To use this new feature, simply set:

$ hoverctl mode spy

Plain HTTP tunneling

This setting allows Hoverfly to handle CONNECT requests for non-TLS tunnelling, making it possible to use Hoverly with Netty-based HTTP client such as reactor-netty.

$ hoverfly -plain-http-tunneling

Network interface binding

Hoverfly now binds to loopback interface by default and prevents firewall alerts being triggered when running on Windows machine. If you still need Hoverfly to listen on all the network interfaces, you can do so by setting:

$ hoverfly -listen-on-host 0.0.0.0

Other minor improvements

  • hoverctl statusis now showing if Hoverfly is running on proxy or webserver mode
  • You can now pass command line arguments when running Hoverfly Docker image, eg. $ docker run -d -p 8888:8888 -p 8500:8500 spectolabs/hoverfly -webserver