feat: add host option to override session QR host#18
Merged
Conversation
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>
rubenhensen
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
hostfield to the irmars session request, mirroring irmago'shostfield introduced in irmago v0.14.0.The
hostvalue overrides the host used in the QR (Qr.u) and is validated server-side against the requestor's configuredhost_permsallowlist. 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
host: Option<String>toBaseRequest, shared by the disclosure/issuance/signature requests.host, and only when set (skip_serializing_if = "Option::is_none") — existing request payloads are unchanged..host(...)builder method toDisclosureRequestBuilder,SignatureRequestBuilder, andIssuanceRequestBuilder(backed by a private setter onBaseRequestBuilder, consistent with the existingreturn_urlpattern).test_host_requestunit test covering: omission when unset, correcthostserialization when set across all three builder types, and a serde round-trip.Verification
cargo fmt --all --check— passescargo clippy --all-targets --all-features -- -D warnings— cleancargo test --all-features— all tests pass (newtest_host_requestincluded; integration tests skip withoutRUN_INTEGRATION_TESTS)Closes #7
🤖 Generated with Claude Code