Skip to content

Releases: SpectoLabs/hoverfly

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

v0.14.2

29 Sep 13:32
Compare
Choose a tag to compare

Templating

  • Added helper methods to use current data time for templating.
  • State keys can now be used in the template.
    More information on templating is available here.

Hoverctl auto completion

Thanks to @joostvanwollingen, you can now add bash completion file for hoverctl by running:
hoverctl completion

v0.14.1

25 Sep 11:34
Compare
Choose a tag to compare

In this minor release, we fixed a few bugs:

  • Fix escaping bug in query params
  • Fix hoverctl middleware bug, thanks for the PR from @ooktay
  • Always sending original query to the target server in CAPTURE mode

There are some improvements including:

  • A new hoverctl status command which prints the status of Hoverfly
  • Support for TLS renegotiation

v0.14.0

15 Aug 15:53
Compare
Choose a tag to compare

State

The big addition to v0.14.0 is the introduction of state. Hoverfly stores state as a key value map, allowing for multiple states to be stored at any given time. This state can then be used as a matching requirement for requests and can be modified with successful responses served.

More information on state is available here.

Bug fixes

  • Journal latency is now recorded as a float
  • Journal startTime is now formatted to include milliseconds
  • Requests with encoded characters in the path will now be respected and proxied on in their intended format

v0.13.0

12 Jul 17:12
Compare
Choose a tag to compare

Response templates

Hoverfly finally has the ability to produce dynamic responses with the new templating feature. This feature allows for values from the original request being included in the response body through the use of template tags.

For more information on Templating

v3 Simulation

With the introduction of templating, we have bumped the simulation schema version up to v3. The two changes between v2 and v3 are that the request query field no longer requires character escaping and a new boolean template field on the response to enable templating on a per request response pair basis.

Webserver journal bugfix

It was noticed that the journal was no working when using Hoverfly as a webserver. This has been fixed and should now behave the same regardless if using Hoverfly as a webserver or a proxy.

v0.12.3

05 Jul 15:46
Compare
Choose a tag to compare

requestType field in journal API responses

In the last release, we added the journal API. This API could be used for seeing the requests and responses being served by Hoverfly. There was an old, unused field being used in the request object. This field has now been removed.

Error when importing unrecognised version

In preparation for the next big release of Hoverfly, we noticed a bug. When importing simulations, Hoverfly did not provide a useful error when importing a simulation using an unsupported schema version. This has now been fixed.