github unkn0wn-root/resterm v1.18.2

one hour ago

Mostly a settings fix + examples on resterm.app/examples.

Settings fix

insecure and http-insecure are the same setting. So are http-root-ca and http-root-cas, and grpc-root-ca and grpc-root-cas. Settings stack: the request beats the file and the file beats the environment. That only worked when every layer used the same name.

Say your dev environment turns certificate checks off, and one request turns them back on:

{
  "dev": {
    "settings.insecure": "true"
  }
}
### Payments health
# @name health
# @setting http-insecure false
GET https://localhost:8443/health

Previous versions always let insecure win, wherever it was set. The certificate was never checked:

Name: health
Request: GET https://localhost:8443/health
Environment: dev
Status: 200 OK

Now the request-level setting wins, and TLS verification fails as expected::

Errors:
  Request error:
    error[tls]: request failed
    perform request
    ╰─> Get "https://localhost:8443/health"
        ╰─> tls: failed to verify certificate
            ╰─> x509: “localhost” certificate is not trusted

Other places that follow the order now:

  • $shared is the lowest layer. "settings.http-insecure" in an environment overrides "settings.insecure" in $shared.
  • An @apply patch sits above the request, and a null in it removes both names from the request.
  • SSE and WebSocket requests use the same rules.

The full layer order is on the HTTP settings page.

Both names in one place

When one layer sets both names, Resterm can't know which one you meant, so the request stops with exit code 26:

error[protocol]: http-insecure and insecure are the same setting. Use one of them.

Before, insecure would win. The request still runs if a higher layer sets the value, or an @apply patch removes it. With grouped environments you'll get the same error when profiles from two groups each set one of the names. The grpc- pair only stops gRPC requests.

Variables in proxy

# @setting proxy {{proxy.url}}

Older versions didn't expand this and refused to send the request:

error[protocol]: invalid proxy "{{proxy.url}}" (use a URL such as http://host:8080)

Variables now work in request-level proxy settings, file defaults, and settings.proxy in environment files. If the variable isn't defined, nothing is sent and you get expand proxy: undefined variable: proxy.url.

Examples

All examples are now mirrored on the web: resterm.app/examples

Upgrading

  1. Look for files and environments that set both insecure and http-insecure in the same place, or both names of a root CA setting. Keep one.
  2. If a request starts failing TLS checks after the update, check its certificate or CA path. That check was being skipped before.

Coming from something older than 1.18.1? Read the 1.18.1 and 1.18.0 notes.

Don't miss a new resterm release

NewReleases is sending notifications on new releases.