Repository navigation
feat(directory): verify a directory field with a credential your agent holds (window.vtaWallet.directory.presentCredential) - #375
Merged
Conversation
…t holds (window.vtaWallet.directory.presentCredential)
A member fills their card's credential-sourced fields — a verified employer, a professional registration — from a credential their own agent holds. The portal asks with one new call, window.vtaWallet.directory.presentCredential({ hostDid, member?, fields }), naming the fields and nothing else: never the claims, never the credential.
Gates: the call is well formed (1 to 16 distinct field keys); the page is the community's portal by its DID document; the member is one of the wallet's identities there. Then the wallet reads the community's field schema as the member (vtc/directory/fields/list): every named field must be active, credential-sourced and a claim field, and all of one credential type. It finds the member's credentials that answer them (vault/credentials/query, valid, active, from an issuer every field accepts) and asks the person, in the wallet's own window, which one to present — showing the community, the fields and every claim it discloses. A closed window, or an answer naming a credential the prompt did not offer, presents nothing.
The agent then presents the chosen credential (vault/credentials/present/0.1, trustoverip/dtgwg-trust-tasks-tf#871): audience the community's DID, nonce the id of the vtc/directory/card/present document that will carry it, so the community's binding check holds. A credential that cannot hide claims the fields do not read is refused by the agent with wouldOverDisclose — matched on the code, never the message — and the wallet asks again, naming those claims, before presenting with them; declined, nothing more is presented. The card/present document is signed as the member and sent; the page gets back the verified values now on the card.
A page may no longer drive vault/credentials/present through the generic task path (page-task-policy): it is a disclosure under the subject's signature to a verifier the caller names, which a generic prompt cannot show.
core: credVaultPresent (vault/credentials.ts); vtc/directory-present.ts (credentialAskFor, claimNameOf, buildCardPresent, verifiedValuesOf). @openvtc/trust-tasks 0.27.2; task-surface.json synced, family count 230 → 231.
Depends on the VTA serving vault/credentials/present/0.1 (OpenVTC/verifiable-trust-infrastructure, branch feat/vault-credentials-present, not yet merged); against a VTA without it the call fails at the agent with unsupportedType.
Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
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.
Adds
window.vtaWallet.directory.presentCredential({hostDid, member?, fields})→{verified, revision}. After the page gates, the wallet reads the community's field schema, finds valid vault credentials of the field's type from an accepted issuer, and lets the member pick one. It has the VTA present it (vault/credentials/present/0.1, audience = the community DID, nonce = the card/present document id), asking again onwouldOverDisclose, then signs and postsvtc/directory/card/presentas the member. The generic page task path refusesvault/credentials/present. Bumps@openvtc/trust-tasksto ^0.27.2.Depends on OpenVTC/verifiable-trust-infrastructure#2265 (VTA side); consumed by OpenVTC/verifiable-trust-infrastructure#2266 (portal button).
Not covered: the offscreen success path has no fake to test against; unit tests cover the gates, selection, refusals and the over-disclosure prompt.