From 0dd1ac96f0989060adab6886edcec031192e2953 Mon Sep 17 00:00:00 2001 From: coodos Date: Tue, 10 Mar 2026 21:16:49 +0530 Subject: [PATCH 1/4] feat: relation description and fixes to social connection --- docs/docs/W3DS Basics/Binding-Documents.md | 10 ++++++-- .../gen/android/key-shitore.properties | 3 +++ .../eid-wallet/src/lib/utils/socialBinding.ts | 9 +++++++- .../src/routes/(app)/ePassport/+page.svelte | 8 +++++++ .../src/routes/(app)/scan-qr/+page.svelte | 3 +++ .../components/SocialBindingDrawer.svelte | 19 +++++++++++++++ .../src/routes/(app)/scan-qr/scanLogic.ts | 10 ++++++++ .../src/core/types/binding-document.ts | 2 ++ .../services/BindingDocumentService.spec.ts | 8 ++++--- .../src/services/BindingDocumentService.ts | 23 ++++++++++++++++++- .../ontology/schemas/binding-document.json | 13 ++++++++++- 11 files changed, 100 insertions(+), 8 deletions(-) create mode 100644 infrastructure/eid-wallet/src-tauri/gen/android/key-shitore.properties diff --git a/docs/docs/W3DS Basics/Binding-Documents.md b/docs/docs/W3DS Basics/Binding-Documents.md index 3488f4c66..b33b55efb 100644 --- a/docs/docs/W3DS Basics/Binding-Documents.md +++ b/docs/docs/W3DS Basics/Binding-Documents.md @@ -74,19 +74,25 @@ Binds an eName to a photograph (selfie or profile picture). ### social_connection -Binds an eName to a social connection or relationship claim. +Binds an eName to a social connection or relationship claim between two parties. ```json { "type": "social_connection", "data": { - "name": "Alice Smith" + "kind": "social_connection", + "name": "Alice Smith", + "parties": ["@ename-1", "@ename-2"], + "relation_description": "Known each other since university" } } ``` **Data fields:** +- `kind` — Discriminant field, always `"social_connection"` - `name` — Name of the connected person or entity +- `parties` — Array of exactly two eNames identifying both participants in the connection +- `relation_description` — Arbitrary text describing the nature of the relationship ### self diff --git a/infrastructure/eid-wallet/src-tauri/gen/android/key-shitore.properties b/infrastructure/eid-wallet/src-tauri/gen/android/key-shitore.properties new file mode 100644 index 000000000..7ebcd924e --- /dev/null +++ b/infrastructure/eid-wallet/src-tauri/gen/android/key-shitore.properties @@ -0,0 +1,3 @@ +password=$th3r3a1m3ru1 +keyAlias=key0 +storeFile=/home/merul/Stuff/msf-android-keys/Untitled diff --git a/infrastructure/eid-wallet/src/lib/utils/socialBinding.ts b/infrastructure/eid-wallet/src/lib/utils/socialBinding.ts index 9a5924575..fa84bc91f 100644 --- a/infrastructure/eid-wallet/src/lib/utils/socialBinding.ts +++ b/infrastructure/eid-wallet/src/lib/utils/socialBinding.ts @@ -296,6 +296,8 @@ export async function createSocialConnectionDoc( subject: string, subjectName: string, signatureHash: string, + parties: [string, string], + relationDescription: string, ): Promise { const normalizedSubject = subject.startsWith("@") ? subject : `@${subject}`; const normalizedSigner = signerEname.startsWith("@") @@ -310,7 +312,12 @@ export async function createSocialConnectionDoc( input: { subject: normalizedSubject, type: "social_connection", - data: { kind: "social_connection", name: subjectName }, + data: { + kind: "social_connection", + name: subjectName, + parties, + relation_description: relationDescription, + }, ownerSignature: { signer: normalizedSigner, signature: signatureHash, diff --git a/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte index 8af5076bf..25405704b 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte @@ -733,6 +733,14 @@ onMount(async () => {

{/if} + {#if socialBindingPendingDocParsed?.data?.relation_description} +
+

Relationship Description

+

+ {socialBindingPendingDocParsed.data.relation_description} +

+
+ {/if} {#if socialBindingError}

{socialBindingError}

{/if} diff --git a/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte index 9645be565..8344ce7b8 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/scan-qr/+page.svelte @@ -49,6 +49,7 @@ const { socialBindingLoading, socialBindingError, socialBindingSuccess, + socialBindingRelationDescription, } = stores; const { @@ -266,9 +267,11 @@ function handleSocialBindingOpenChange(value: boolean) { loading={$socialBindingLoading} error={$socialBindingError} success={$socialBindingSuccess} + relationDescription={$socialBindingRelationDescription} onConfirm={handleSocialBindingConfirm} onDecline={handleSocialBindingDecline} onOpenChange={handleSocialBindingOpenChange} + onDescriptionChange={(value) => socialBindingRelationDescription.set(value)} />