Skip to content
Merged
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@

Certinfo: multi-sink output — typed Result as source of truth, console via internal/view Doc + lipgloss renderer, and `--format json` (schemaVersion, no ANSI). MCP certinfo returns JSON.

Jwtinfo: multi-sink output — typed Result as source of truth, console via internal/view Doc, and `--format json` (schemaVersion, no ANSI). MCP jwtinfo returns JSON.

Requests: multi-sink output — typed Result as source of truth, console via internal/view Doc, and `--format json` (schemaVersion, no ANSI). MCP requests returns JSON.

Requests: add `followRedirects` configuration option (defaulting to false) in JSON schema and Go client to control HTTP 3xx redirection.

Requests: adopt traffic-light color progression for HTTP status codes (2xx green, 3xx yellow, 4xx peach, 5xx red).

Requests: pin Go 1.27 ML-KEM hybrid CurvePreferences (including P-521 fallback) and print the negotiated key exchange.

Jwtinfo: add sentinel and typed errors for errors.Is/As, and route CLI/MCP display through errdisp domain leaves.
Expand All @@ -28,6 +36,14 @@

### Fix

Cmd: write JSON output to cmd.OutOrStdout() directly via fmt.Fprintln instead of cmd.Println to ensure payloads go to stdout.

Requests: gate response body output on `printResponseBody` so configuring `responseBodyMatchRegexp` does not inadvertently dump the response body.

Requests: reject duplicate request names with DuplicateRequestNameError in ExecuteWithWriter and BuildResult to preserve distinct response data.

Certinfo: safely handle nil SerialNumber in FromX509.

Certinfo: read the CA bundle once in SetCaPoolFromFile and derive both CertPool and certificate slice from the same PEM bytes.

Certinfo: omit protocol/cipher scan sections until ProbeTLSInfo has completed; keep negotiated TLS output when requested.
Expand All @@ -40,8 +56,16 @@

Certinfo: collapse styled and plain cert printers onto CertsDoc + view.Render; separate collect from present (cache CA certs, probe TLS before sinks).

Jwtinfo: separate collect from present onto BuildDoc + view.Render; route `--format json` token persistence and refresh progress to stderr to keep stdout machine-readable.

Requests: separate HTTP/TLS execution from presentation onto BuildDoc + view.Render; route `--format json` output purely to stdout with debug logs routed to stderr.

View: centralize Chroma syntax highlighting on Code nodes with line boundary preservation.

### Tests

Devenv: expand requests test suite to cover all schema settings combinations including responseHeadersFilter, responseCertificatesFilter, request/response debug dumps, baseRequest YAML anchors, userAgent and custom headers, multi-host with default URI fallback, regex matching without body printing, quiet mode, and --format json schema validation.

Certinfo: assert PrivateKey match label and value together under plain PrintData rendering.

Certinfo and requests: share CA/leaf certificate generation and custom TLS httptest servers via internal/tlstest.
Expand Down
44 changes: 22 additions & 22 deletions assets/examples/https-wrench-http-methods.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
debug: false
verbose: true
requests:
- name: httpBunGetDefault
- name: httpBinGetDefault

requestHeaders:
- key: x-custom-header
Expand All @@ -14,11 +14,11 @@ requests:
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /get?method=DefaultGet

- name: httpBunGetDeclared
- name: httpBinGetDeclared
requestMethod: GET

requestHeaders:
Expand All @@ -29,11 +29,11 @@ requests:
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /get?clientMethod=GET

- name: httpBunPost
- name: httpBinPost
requestMethod: POST

requestHeaders:
Expand All @@ -44,11 +44,11 @@ requests:
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /post

- name: httpBunPostBodyText
- name: httpBinPostBodyText
requestMethod: POST

requestHeaders:
Expand All @@ -60,11 +60,11 @@ requests:
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /post

- name: httpBunPostBodyJson
- name: httpBinPostBodyJson
requestMethod: POST

requestHeaders:
Expand All @@ -76,40 +76,40 @@ requests:
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /post

- name: httpBunPut
- name: httpBinPut
requestMethod: PUT

# printResponseHeaders: true
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /put

- name: httpBunDelete
- name: httpBinDelete
requestMethod: DELETE

# printResponseHeaders: true
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /delete

- name: httpBunPatch
- name: httpBinPatch
requestMethod: PATCH

# printResponseHeaders: true
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /patch

Expand All @@ -131,33 +131,33 @@ requests:
uriList:
- /api/v1/requests

- name: httpBunTraceNotAllowed
- name: httpBinTraceNotAllowed
requestMethod: TRACE

# printResponseHeaders: true
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /get

- name: httpBunTrace
- name: httpBinTrace
requestMethod: TRACE

# printResponseHeaders: true
# printResponseBody: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
uriList:
- /any

- name: httpBunHead
- name: httpBinHead
requestMethod: HEAD

# requestDebug: true
# printResponseHeaders: true

hosts:
- name: httpbun.com
- name: httpbin.os76.xyz
4 changes: 2 additions & 2 deletions assets/examples/https-wrench-httpbin-os76.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ baseRequest: &httpbin
requests:
- <<: *httpbin
name: httpbin-443
responseBodyMatchRegexp: go-httpbin
responseBodyMatchRegexp: teapot
hosts:
- name: httpbin.os76.xyz
uriList:
- /
- /status/418

- <<: *httpbin
name: httpbin-transportOverride
Expand Down
29 changes: 29 additions & 0 deletions assets/examples/tests-configs/base-request-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# yaml-language-server: $schema=../../../https-wrench.schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
---
debug: false
verbose: true

baseRequest: &base
transportOverrideUrl: https://localhost:9443
insecure: true
userAgent: wrench-base-template
printResponseBody: true

requests:
- <<: *base
name: BaseTemplateReq1
hosts:
- name: localhost
uriList:
- /user-agent

- <<: *base
name: BaseTemplateReq2
requestHeaders:
- key: X-Merged-Template
value: Active
hosts:
- name: localhost
uriList:
- /headers
1 change: 1 addition & 0 deletions assets/examples/tests-configs/body-regexp-match.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ requests:
transportOverrideUrl: https://localhost:9443
responseBodyMatchRegexp: <a\shref="https://github\.com\/\w+\/httpbin"\s.*
printResponseBody: false
insecure: true
hosts:
- name: localhost
14 changes: 14 additions & 0 deletions assets/examples/tests-configs/body-regexp-no-print.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=../../../https-wrench.schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
---
debug: false
verbose: true
requests:
- name: BodyRegexpNoPrint
transportOverrideUrl: https://localhost:9443
responseBodyMatchRegexp: .*headers.*
printResponseBody: false
hosts:
- name: localhost
uriList:
- /headers
58 changes: 58 additions & 0 deletions assets/examples/tests-configs/http-status-codes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# yaml-language-server: $schema=../../../https-wrench.schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
---
debug: false
verbose: true
requests:
- name: statusCodes2xx
transportOverrideUrl: https://localhost:9443
hosts:
- name: localhost
uriList:
- /status/200
- /status/201
- /status/202
- /status/204

- name: statusCodes3xxNoFollow
followRedirects: false
transportOverrideUrl: https://localhost:9443
hosts:
- name: localhost
uriList:
- /status/301
- /status/302
- /status/304
- /status/307
- /status/308

- name: statusCodes3xxFollow
followRedirects: true
transportOverrideUrl: https://localhost:9443
hosts:
- name: localhost
uriList:
- /status/302

- name: statusCodes4xx
transportOverrideUrl: https://localhost:9443
hosts:
- name: localhost
uriList:
- /status/400
- /status/401
- /status/403
- /status/404
- /status/405
- /status/418
- /status/429

- name: statusCodes5xx
transportOverrideUrl: https://localhost:9443
hosts:
- name: localhost
uriList:
- /status/500
- /status/502
- /status/503
- /status/504
13 changes: 13 additions & 0 deletions assets/examples/tests-configs/multiple-hosts-default-uri.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# yaml-language-server: $schema=../../../https-wrench.schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
---
debug: false
verbose: true
requests:
- name: MultipleHostsDefaultURI
transportOverrideUrl: https://localhost:9443
hosts:
- name: localhost
uriList:
- /get
- name: example.com
1 change: 1 addition & 0 deletions assets/examples/tests-configs/proxy-protocol-ipv4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ requests:
printResponseCertificates: true
printResponseBody: true
enableProxyProtocolV2: true
insecure: true

hosts:
- name: localhost
Expand Down
1 change: 1 addition & 0 deletions assets/examples/tests-configs/proxy-protocol-ipv6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ requests:
printResponseCertificates: true
printResponseBody: true
enableProxyProtocolV2: true
insecure: true

hosts:
- name: localhost
Expand Down
12 changes: 12 additions & 0 deletions assets/examples/tests-configs/quiet-mode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# yaml-language-server: $schema=../../../https-wrench.schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
---
debug: false
verbose: false
requests:
- name: QuietModeReq
transportOverrideUrl: https://localhost:9443
hosts:
- name: localhost
uriList:
- /get
14 changes: 14 additions & 0 deletions assets/examples/tests-configs/request-response-debug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=../../../https-wrench.schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
---
debug: false
verbose: true
requests:
- name: RequestResponseDebug
transportOverrideUrl: https://localhost:9443
requestDebug: true
responseDebug: true
hosts:
- name: localhost
uriList:
- /get
Loading