diff --git a/project.task.yaml b/project.task.yaml index 609e7c7..ab097bd 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -6,8 +6,6 @@ tasks: - fix maskable icon -- 04 generate & store next public key hash, and give to contacts for storage - - .5 If notifications are not enabled, add message to front page with link/button to enable - Release Minimum Viable Product : @@ -32,7 +30,7 @@ tasks: - record donations vs gives - make server endpoint for full English description of limits - make identicons for contacts into more-memorable faces (and maybe change project identicons, too) -- 02 watch for the service worker activation before showing the button to turn on notifications + - 01 server - show all claim details when issued by the issuer - bug - got error adding on Firefox user #0 as contact for themselves - bug (that is hard to reproduce) - back-and-forth on discovery & project pages led to "You need an identity to load your projects." error on product page when I had an identity diff --git a/src/db/tables/contacts.ts b/src/db/tables/contacts.ts index f1e1b90..2f59a41 100644 --- a/src/db/tables/contacts.ts +++ b/src/db/tables/contacts.ts @@ -1,11 +1,12 @@ export interface Contact { did: string; name?: string; + nextPublicKeyHashBase64?: string; // base64-encoded SHA256 hash of next public key publicKeyBase64?: string; seesMe?: boolean; registered?: boolean; } export const ContactSchema = { - contacts: "&did, name", // no need to key by publicKeyBase64, registered, seesMe + contacts: "&did, name", // no need to key by other things }; diff --git a/src/libs/crypto/index.ts b/src/libs/crypto/index.ts index be8ccef..e5d120e 100644 --- a/src/libs/crypto/index.ts +++ b/src/libs/crypto/index.ts @@ -173,3 +173,19 @@ export const getContactPayloadFromJwtUrl = (jwtUrlText: string) => { return jwt.payload; }; + +export const nextDerivationPath = (origDerivPath: string) => { + let lastStr = origDerivPath.split("/").slice(-1)[0]; + if (lastStr.endsWith("'")) { + lastStr = lastStr.slice(0, -1); + } + const lastNum = parseInt(lastStr, 10); + const newLastNum = lastNum + 1; + const newLastStr = newLastNum.toString() + (lastStr.endsWith("'") ? "'" : ""); + const newDerivPath = origDerivPath + .split("/") + .slice(0, -1) + .concat([newLastStr]) + .join("/"); + return newDerivPath; +}; diff --git a/src/views/ContactQRScanShowView.vue b/src/views/ContactQRScanShowView.vue index 9bef1b0..8b6d9f9 100644 --- a/src/views/ContactQRScanShowView.vue +++ b/src/views/ContactQRScanShowView.vue @@ -58,16 +58,17 @@