feat(persona): create a standalone persona DID on demand#134
Merged
Conversation
Personas could only be minted as a side effect of joining a community
(the "mint new identity" choice mid-join). There was no way to create a
persona DID up front — which you need to receive a VIC bound to a
pre-created persona DID (one that isn't your VTA DID), then join cleanly
on the join-as-subject path.
Add a "create persona DID" action reachable two ways (per request):
a new top-level menu item and the VTA panel's 'n' key. Both open a
centered overlay that prompts for a label, runs the VTA mint, then shows
the new did:webvh and copies it to the clipboard ('c' to copy again).
The minted persona is a standalone orphan listed in the VTA panel,
reusable in any later join.
Mechanics mirror the join flow's mint sub-sequence (pick a WebVH server,
create_did_via_server, persist via the shared mint_persona_into) but
without the community/submit parts, run inline-await like the join. A new
create_persona module owns the orchestration; the join path is left
untouched (its redundant pre-mint key calls and friendly_name behaviour
are a separate cleanup).
Same prerequisites/limits as join: needs the admin VTA session + a WebVH
server (serverless mint still unsupported). Adds key-handler tests for
both entry points and every overlay phase, plus reducer tests for the
overlay open/edit/close arms.
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.
Problem
Personas could only be minted as a side effect of joining a community (the "mint new identity" choice mid-join). There was no way to create a persona DID up front — which you need in order to receive a VIC (Verifiable Invitation Credential) bound to a pre-created persona DID (one that isn't your VTA DID), and then join cleanly on the join-as-subject path (no subject-linkage proof needed).
What this does
Adds a "create persona DID" action, reachable two ways (per request):
Quit).nkey, withn: new personahints (including an empty-state hint when no personas exist yet).Both open a centered overlay that:
⏎ create/esc cancel),did:webvhand copies it to the clipboard (c: copy again,⏎/esc close) — or shows the error.The minted persona is a standalone orphan, listed in the VTA panel's Context Identities and reusable in any later join (
JoinIdentityChoice::Reuse). Hand its DID to a VTC, receive a VIC bound to it, then join on the clean join-as-subject path.Implementation
state_handler/create_personamodule owns the mint orchestration: pick a WebVH server →create_did_via_server→ persist via the sharedmint_persona_into(built from a scratchSetupState, so zero edits to that proven persist code). Runs inline-await, mirroring the join flow's mint sub-sequence minus the community/submit parts.MainPageState::create_persona, like the community switcher) with phases Label → Working → Done/Failed. Editing keys are forwarded to atui_input::Inputvia an action (the main page uses the cloned-props pattern). The mint runs in the loop onCreatePersonaSubmit; the clipboard copy reusesclipboard.rs.Note on a revised design decision
While investigating I found the join flow's pre-mint
create_persona_keys/create_update_keysresults are actually discarded —create_did_via_serverrequestssigning_key_id: None/ka_key_id: None, so the WebVH server generates the keys. Rather than extract a "shared" helper that would either replicate that dead code or change the join hot path, I gave the standalone flow its own focused helper and left the join path untouched. Extracting a shared mint helper (and dropping the join's redundant key calls) is a sensible follow-up, tracked separately.Limits
Same prerequisites as join: needs the always-on admin VTA session and a WebVH server advertised by the VTA (serverless mint still unsupported — surfaced as an error).
Tests
n, menu Enter) and every overlay phase (label edit/submit/cancel, done copy/close, working swallows input).cargo build, fullcargo test(0 failures), andcargo clippy --all-targetsall clean (only a pre-existingmod.rs:138warning, untouched).