feat: support chained sessions (nextSession) on ExtendedIrmaRequest#19
Merged
Conversation
Closes #9. Since irmago v0.10.0 a requestor request can declare a `nextSession` block pointing at a follow-up requestor URL, and the server links the two sessions so the second runs immediately after the first succeeds. - Add `NextSessionData { url: String }`, mirroring irmago's `RequestorBaseRequest.NextSession` struct. Confirmed against the irmago v0.19.2 `requests.go`: the JSON field is `nextSession` and the only sub-field is `url` (the `authmethod`/`key` fields floated in the issue do not exist upstream, so they are intentionally omitted). - Add `next_session: Option<NextSessionData>` to `ExtendedIrmaRequest`, serialized as `nextSession` and omitted when `None`. - Add `ExtendedIrmaRequest::new` and a chainable `next_session(url)` builder method; export `NextSessionData`. - Document chained sessions in the README, noting the recommended minimum irmago server version v0.19.0 (GHSA-pv8v-c99h-c5q4). - Add `test_next_session` covering omission, serialization and roundtrip. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
There was a problem hiding this comment.
✅ Verdict: approve — posted as COMMENT only because GitHub blocks self-approval on a bot-authored PR (dobby-coder[bot] is both author and reviewer); treat this as a clean sign-off, not a withheld review. Merge is gated by @rubenhensen's maintainer review.
Rule-compliance + code review complete, no blocking findings:
- Field name & shape verified against irmago v0.19.2
requests.go: serialized asnextSessionwith a soleurlsub-field;authmethod/keyare correctly omitted (server-side only). - Builder + field added on
ExtendedIrmaRequest(.next_session(url)),Option,skip_serializing_ifso it's omitted when unset — mirrors theskipExpiryCheckpattern from #16. - Tests:
test_next_sessioncovers omitted, set, and serde round-trip; full suite (11 unit incl. new test + 5 integration) passes, clippy/fmt clean. - README: documents chained sessions and the ≥ v0.19.0 irmago server recommendation (GHSA-pv8v-c99h-c5q4).
- Delivers exactly what #9 requested.
Per-rule Haiku checks flagged fmt/test/readme/draft items; all reconciled as false positives or out-of-scope on review (rustfmt-correct imports, no in-crate validation to reject-test, PostGuard README-template restructure is pre-existing & out of scope for this feature PR, draft state is correct mid-pipeline).
rubenhensen
approved these changes
Jun 26, 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.
Closes #9.
Since irmago v0.10.0 a requestor request can declare a
nextSessionblock pointing at a follow-up requestor URL; the server links the two sessions so the second runs immediately after the first succeeds. See chained-sessions docs. This was wire-compatible already, but the typed builders didn't expose it.Field name confirmation
Verified against the irmago
RequestorRequest/RequestorBaseRequestGo struct at v0.19.2requests.go:So the JSON field is
nextSessionand the only sub-field isurl. Theauthmethod/keysub-fields floated in the issue do not exist on the upstream struct, so they are intentionally omitted to stay wire-faithful.Changes
NextSessionData { url: String }(serialized as{ "url": ... }) with aNextSessionData::new(url)constructor, mirroring irmago.next_session: Option<NextSessionData>toExtendedIrmaRequest, serialized asnextSessionand omitted whenNone(skip_serializing_if = "Option::is_none") — same pattern asskipExpiryCheckin feat: support skipExpiryCheck on disclosure requests #16.ExtendedIrmaRequest::new(request)and a chainablenext_session(url)builder method; exportNextSessionDatafrom the crate root.test_next_sessioncovering omission when unset, serialization asnextSession, and JSON roundtrip.Verification
cargo fmt --all -- --check— cleancargo test— all tests pass (incl. the newtest_next_session)cargo clippy --all-targets— cleanReferences
🤖 Generated with Claude Code