Skip to content

Store evidence, files and images in was#412

Merged
0marSalah merged 18 commits intodevfrom
411-store-evidence-filesimages-in-was
Sep 23, 2025
Merged

Store evidence, files and images in was#412
0marSalah merged 18 commits intodevfrom
411-store-evidence-filesimages-in-was

Conversation

@0marSalah
Copy link
Member

@0marSalah 0marSalah commented Sep 3, 2025

related issue: #411

@0marSalah 0marSalah self-assigned this Sep 3, 2025
@0marSalah 0marSalah linked an issue Sep 3, 2025 that may be closed by this pull request
2 tasks
@0marSalah 0marSalah marked this pull request as draft September 3, 2025 20:50
@vercel
Copy link

vercel bot commented Sep 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
dev.linked-claims-author Ready Ready Preview Comment Sep 23, 2025 8:31am
linked-claims-author Ready Ready Preview Comment Sep 23, 2025 8:31am
linked-claims-author-3teh Ready Ready Preview Comment Sep 23, 2025 8:31am
linked-claims-author-73r1 Ready Ready Preview Comment Sep 23, 2025 8:31am
linked-claims-author-8dp5 Ready Ready Preview Comment Sep 23, 2025 8:31am
linked-claims-author-gpm4 Ready Ready Preview Comment Sep 23, 2025 8:31am
linked-claims-author-ltir Ready Ready Preview Comment Sep 23, 2025 8:31am
linked-claims-author-mobile Ready Ready Preview Comment Sep 23, 2025 8:31am
linked-claims-author-t3 Ready Ready Preview Comment Sep 23, 2025 8:31am

}

async function makeInvocationSigner(appInstance: any) {
const key = await Ed25519VerificationKey2020.from({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const key = await Ed25519VerificationKey2020.from({
const key = await Ed25519VerificationKey2020.from(appInstance)

app/global.d.ts Outdated
@@ -0,0 +1,5 @@
declare module '@digitalcredentials/ed25519-verification-key-2020';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
declare module '@digitalcredentials/ed25519-verification-key-2020';

v5.beta-1 exports Typescript types, no need to declare it here.


useEffect(() => {
// Check for stored zCap on mount
const storedZcap = localStorage.getItem('zcap')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets give the zcap a more descriptive name. Something like 'delegatedWasZcap'

useWas &&
appInstanceDid &&
hasZcap &&
(appInstanceDid.keyPair || appInstanceDid.privateKeyMultibase)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this line is necessary -- if there's an appInstanceDid, there must always be keypair etc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah you r right

}

const uploadedFiles = await Promise.all(
filesToUpload.map(async (fileItem, index) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same upload code as in app/utils/wasUpload.ts ?
This should probably be extracted to its own function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i ma not handling which storage the app should use, so you may see GoogleStorage being used to upload the final signed VC, and the wasUpload in evidence and images step only.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useHandleUpload hook is the factory function that decides which storage the app should use depending on useWas prop (this temporarily for now).

Copy link
Collaborator

@dmitrizagidulin dmitrizagidulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store Evidence files/images in WAS

2 participants