feat: expose frontendRequest block on SessionData#17
Merged
Conversation
Since irmago v0.14.0, POST /session returns a frontendRequest block carrying an authorization token (and protocol version bounds) used to drive the IRMA/Yivi frontend directly — most importantly to complete the pairing handshake, which is mandatory by default since v0.13.0. This block was previously dropped by serde. Add an optional frontend_request: Option<FrontendRequest> field to SessionData and a FrontendRequest struct exposing authorization, min_protocol_version and max_protocol_version. The field is absent-tolerant (older servers) and skipped on serialization when None. Closes #6 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rubenhensen
approved these changes
Jun 19, 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
Since irmago v0.14.0,
POST /sessionreturns an extrafrontendRequestblock carrying anauthorizationtoken (plus protocol-version bounds). irmars previously dropped this field silently via serde. This PR exposes it so downstream consumers can drive the IRMA/Yivi frontend directly — most importantly to complete the pairing handshake, which has been mandatory by default for IRMA clients since v0.13.0.Changes
frontend_request: Option<FrontendRequest>toSessionData(serderename = "frontendRequest", absent-tolerant viadefault, omitted on serialization whenNone).FrontendRequeststruct exposing:authorization: Stringmin_protocol_version: Option<String>(minProtocolVersion)max_protocol_version: Option<String>(maxProtocolVersion)FrontendRequestfrom the crate root.Compatibility
Fully backwards compatible: servers older than v0.14.0 that omit the block deserialize to
None. The optional protocol-version fields also tolerate servers that send onlyauthorization.Testing
frontendRequestblock, an absent block (older servers, asserts the field is skipped on serialize), and a block with onlyauthorization.test_full_client_interactionintegration test to assertfrontend_request.authorizationis present and non-empty.cargo test(unit),cargo clippy --all-targets, andcargo fmt --checkall pass.Closes #6