Mockoon release v8.4.0

2024-08-06

Welcome to this new release of Mockoon. It brings new exciting features: templating support in rules property/path, new JWT templating helpers, dot notation support in the CRUD route key, random latencies, and many more improvements and fixes. Read on to learn more about this release.


 Our sponsors

GitHub Localazy

Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the Sponsors and Backers who helped this project over time!

sponsor button


 Templating support in rules property/path

Templating helpers are now available in the response rules property or path field. You can dynamically target a specific body property, header name, etc. using templating helpers:

rules target with template helper

Response rules documentation

(Issue #1443)

 New JWT templating helpers

Two new templating helpers are now available to help you decode JWT tokens in your responses: jwtPayload and jwtHeader. They let you access the payload and header objects respectively. These helpers are compatible with other templating helpers like header. They will also automatically ignore the Bearer prefix if present in the provided string, to make it easier to use them with an Authorization header.

Copy
{{jwtPayload 'abcd...' 'sub'}} {{jwtHeader 'abcd...' 'alg'}} {{jwtPayload (header 'Authorization') 'sub'}} {{jwtHeader (header 'Authorization') 'alg'}}

Check the helpers documentation for more information.

(Issue #774)

 Dot notation support in the CRUD route's key

CRUD route key now supports dot notation. It allows you to perform CRUD operations (e.g. get by id, update by id, etc.) based on nested properties:

Copy
{ "data": { "id": 1 } }

CRUD route key with property containing a dot

CRUD routes documentation

(Issue #1433)

 Random latencies

You can now randomize the latency of your route responses and environments. This feature is useful to simulate network latency variations and test your application's behavior under different network conditions. It will randomize the latency of the response between 0 and the value you set in the environment or route parameters.

The option can be found in the application settings:

Random latency settings

Options are also available in the CLI, in the form of a flag --enable-random-latency, and in the serverless package, in the form of a new enableRandomLatency option:

Copy
const mockoonServerless = new mockoon.MockoonServerless(mockEnv, { enableRandomLatency: true });

(Issue #568)

 Logs timestamp improvement

In the logs tab, the logs timestamps are now displayed in a human-readable format like 7 hours ago instead of 2024-01-01 08:00:00.123.

Human-readable logs timestamps

(Issue #1430)

 Mockoon Cloud desktop application improvements

  • Custom scheme based authentication in the desktop application was replaced by a callback-based flow. (Issue #1463)
  • Fixed account downgrading not updating the running instances list. (Issue #1461)
  • Automatically refresh the instances list when opening the instances management dialog: (Issue #1478)

 Fixes

  • Last opened environment is now correctly saved after opening. (Issue #1404)
  • Fixed a null pointer when the last saved environment was deleted. (Issue #1459)

 Chores

We updated the libraries and applications dependencies to their latest versions to fix some reported vulnerabilities.

 Thank you

A big thank you to the following people who helped to make Mockoon better: