Skip to content

feat: add host option to override session QR host#18

Merged
rubenhensen merged 1 commit into
mainfrom
feat/host-request-option
Jun 23, 2026
Merged

feat: add host option to override session QR host#18
rubenhensen merged 1 commit into
mainfrom
feat/host-request-option

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented Jun 19, 2026

Copy link
Copy Markdown

Summary

Adds an optional host field to the irmars session request, mirroring irmago's host field introduced in irmago v0.14.0.

The host value overrides the host used in the QR (Qr.u) and is validated server-side against the requestor's configured host_perms allowlist. This lets a requestor running behind a reverse proxy or with multiple public hostnames control which one ends up in the QR that the user's IRMA/Yivi app scans.

Changes

  • Add host: Option<String> to BaseRequest, shared by the disclosure/issuance/signature requests.
  • Serialize it as host, and only when set (skip_serializing_if = "Option::is_none") — existing request payloads are unchanged.
  • Add a .host(...) builder method to DisclosureRequestBuilder, SignatureRequestBuilder, and IssuanceRequestBuilder (backed by a private setter on BaseRequestBuilder, consistent with the existing return_url pattern).
  • Add a test_host_request unit test covering: omission when unset, correct host serialization when set across all three builder types, and a serde round-trip.

Verification

  • cargo fmt --all --check — passes
  • cargo clippy --all-targets --all-features -- -D warnings — clean
  • cargo test --all-features — all tests pass (new test_host_request included; integration tests skip without RUN_INTEGRATION_TESTS)

Note: requires irmago v0.14.0 or newer on the server side for the field to be honoured.

Closes #7

🤖 Generated with Claude Code

Add an optional `host` field to the base session request, mirroring
irmago's `host` field (irmago v0.14.0). It overrides the host used in
the QR (`Qr.u`) and is validated server-side against the requestor's
configured `host_perms` allowlist.

The field serializes as `host` only when set, and a `.host(...)` builder
method is exposed on the disclosure, signature, and issuance builders.

Closes #7

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dobby-coder dobby-coder Bot marked this pull request as ready for review June 19, 2026 23:18
@rubenhensen rubenhensen self-requested a review June 23, 2026 14:19
@rubenhensen rubenhensen merged commit 8cf18dd into main Jun 23, 2026
5 checks passed
@dobby-coder dobby-coder Bot deleted the feat/host-request-option branch June 24, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support host request option to override the session QR host

1 participant