[#4253 4/8] feat(holder): thread initialBindings through BuildSubmission#4286
Draft
stevenvegt wants to merge 1 commit into
Draft
[#4253 4/8] feat(holder): thread initialBindings through BuildSubmission#4286stevenvegt wants to merge 1 commit into
stevenvegt wants to merge 1 commit into
Conversation
…dings) Assisted-by: AI
Contributor
|
Coverage Impact This PR will not change total coverage. 🚦 See full report on Qlty Cloud »🛟 Help
|
This was referenced May 27, 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.

Parent PRD
#4253
Item 4 of 8. Depends on item #3 (#4284) — branched off
4253-3-rewire-select, retargeted up the stack as dependencies merge.Summary
Add an
initialBindings map[string]stringparameter toWallet.BuildSubmissionfor the captured cross-VP bindings (Policy 2), kept distinct from the user'scredentialSelection. Pure, behavior-neutral plumbing — every caller passesnilin this PR, so nothing changes until #5 wires the two-VP caller to pass the filtered captured bindings.Why a separate parameter (not reuse
credentialSelection)credentialSelectionis the user's explicit selection, validated as user input at the API layer (Add verifiable data registry #6).initialBindingsis the captured org-side binding from the two-VP flow, internal plumbing.They must stay separate at the
BuildSubmissionboundary. Merging captured values intocredentialSelectionat the caller is exactly theapplyCapturedFieldsToSelectionbehavior the PRD removes (PRD problem #1 / Policy 2). They travel separately and merge only inside the presenter when it buildsSelect's single bindings map. Per Policy 2 they cannot conflict (user values already filtered the org selection, so captured values agree); the merge gives the usercredentialSelectionprecedence defensively.Implementation Spec
Signature gains
initialBindings map[string]stringaftercredentialSelection, beforeparams:vcr/holder/interface.go:56— interface declaration.vcr/holder/sql_wallet.go:83— implementation; thread the param topresenter.buildSubmission.vcr/holder/memory_wallet.go:63— second implementation; same change.vcr/holder/presenter.gobuildSubmission— add the param; mergecredentialSelection+initialBindings(user precedence) and pass the merged map tobuilder.SetInitialBindings. With all callers passing nil, the merge is inert in this PR.vcr/holder/mock.go— regenerate viago generate ./vcr/holder/...(mockgen); updateMockWallet.BuildSubmissionand its recorder.Callers pass
nilfor the new parameter:auth/api/iam/openid4vp.go:321→BuildSubmission(ctx, []did.DID{walletDID}, nil, *presentationDefinition, nil, nil, buildParams).auth/client/iam/openid4vp.go:465→ addnilforinitialBindings. (Moved Nuts-Network to Nuts-Node and implemented RFC004 #5 replaces this nil with the captured org bindings filtered to the SP PD's field ids.)Testing
vcr/holderandauth/...tests pass after the signature change (call sites updated, mock regenerated). No new behavior to assert here — Moved Nuts-Network to Nuts-Node and implemented RFC004 #5 adds the behavioral test for captured bindings.initialBindingsis merged into the bindings handed to the match (so Moved Nuts-Network to Nuts-Node and implemented RFC004 #5 can rely on it) — minimal, can also live in Moved Nuts-Network to Nuts-Node and implemented RFC004 #5.Acceptance Criteria
BuildSubmission(interface +sql_wallet+memory_wallet) takesinitialBindings map[string]string; mock regenerated.credentialSelection+initialBindings(user precedence) into the builder's initial bindings.nil; no behavior change in this PR.go build ./...andgo test ./vcr/holder/... ./auth/...pass.