#424·xh

Plugin system for extending supported auth methods

Author: ducaaleCreated Jun 11, 2025Updated Jun 1, 2026

The goal is to allow users to implement custom auth strategies that aren't currently supported. This would also serve as a substitute for HTTPie's auth plugin system.

Related issues that might benefit from this:

  1. https://github.com/ducaale/xh/issues/284
  2. https://github.com/ducaale/xh/issues/328
  3. https://github.com/ducaale/xh/issues/414

I thought about relying on inline shell invocation (--auth-type=bearer --auth=$(get-oauth-token qa)), but that wouldn't work if the auth needs access to the request itself (e.g cURL's --aws-sigv4).

One possible approach is to support:

xh --auth-type=plugin:hmac-sha256 --auth=signature-secret

This would look for an executable like xh-hmac-sha256 (similar to how cargo handles custom commands) and pass it the request details (i.e URL, headers, body, content of --auth). The plugin would output headers to include in the final request.

I would like to hear if this direction makes sense and any other alternatives we should consider.