tuum-tech / identify

MIT License
7 stars 3 forks source link

Modify syncGoogleVCs API behavior so it doesn't display the VCs not associated with your did #43

Closed kpachhai closed 1 year ago

kpachhai commented 1 year ago

The syncGoogleVCs API currently tries to import the VCs that are not associated with my currently connected account. We shouldn't even display this on the metamask snap popup.

For instance, my current account did is did:pkh:eip155:1:0x9da3b1acfec871e668b51828faedb607e37609f9 however the VC I have on my google drive belongs to a different account did(did:pkh:eip155:1:0xa33eceaf3e42fd9f946a10237378e60b36af60fd). Look at an example below:

{
  "fb77eb53-ac93-4255-8f30-060f235859a3": {
    "credentialSubject": {
      "profile": { "name": "Kiran Pachhai", "nickname": "KP Woods" },
      "id": "did:pkh:eip155:1:0xa33eceaf3e42fd9f946a10237378e60b36af60fd"
    },
    "issuer": {
      "id": "did:pkh:eip155:1:0xa33eceaf3e42fd9f946a10237378e60b36af60fd"
    },
    "type": ["VerifiableCredential", "ProfileNamesCredential"],
    "@context": ["https://www.w3.org/2018/credentials/v1"],
    "issuanceDate": "2023-02-28T22:03:10.000Z",
    "expirationDate": "2024-02-28T22:03:10.000Z",
    "proof": {
      "type": "JwtProof2020",
      "jwt": "eyJhbGciOiJFUzI1NksiLCJ0eXAiOiJKV1QifQ.eyJleHAiOjE3MDkxNTc3OTAsInZjIjp7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIl0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJQcm9maWxlTmFtZXNDcmVkZW50aWFsIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7InByb2ZpbGUiOnsibmFtZSI6IktpcmFuIFBhY2hoYWkiLCJuaWNrbmFtZSI6IktQIFdvb2RzIn19fSwic3ViIjoiZGlkOnBraDplaXAxNTU6MToweGEzM2VjZWFmM2U0MmZkOWY5NDZhMTAyMzczNzhlNjBiMzZhZjYwZmQiLCJuYmYiOjE2Nzc2MjE3OTAsImlzcyI6ImRpZDpwa2g6ZWlwMTU1OjE6MHhhMzNlY2VhZjNlNDJmZDlmOTQ2YTEwMjM3Mzc4ZTYwYjM2YWY2MGZkIn0.8hwmQHRpVDua891Ovm7-r8mMwRGZQsRB9J2qMVenQW6jlbXSAXwTTSV4hyKrAN5c5L4xfJQDCLoLpTVaeJhMvQ"
    }
  }

Now, when I try to sync my VCs, the popup shows me this VC that will be imported. This should NOT happen because the VC doesn't even belong to my currently connected did. Click here for screenshot