Skip to content

[WAS] Update WAS QR code to request zcap #395

@dmitrizagidulin

Description

@dmitrizagidulin

Depends on: issue #394

Currently (in draft PR #344), the VPR returned in the vprQuery() function looks like this:

    verifiablePresentationRequest: {
      query: [
        {
          type: 'QueryByExample',
          credentialQuery: {
            reason:
              'Please present your Verifiable Credential to complete the verification process.',
            example: {
              '@context': ['https://www.w3.org/2018/credentials/v1'],
              type: ['VerifiableCredential']
            }
          }
        }
      ]
    }

This was just a placeholder. Task: Update that VPR to request read/write zCaps for the VerifiableCredentials and Documents WAS Collections.

The new VPR should look like this:

    verifiablePresentationRequest: {
      // this is where the response will be sent -- the LC Author polling endpoint
      interact: {
        type: 'UnmediatedHttpPresentationService2021',
        serviceEndpoint: pollingExchangeEndpoint // from PR #344, see below
      },
      // This is the zCap request detailing which permissions the LC Author app wants
      query: [
        {
          type: 'ZcapQuery',
          capabilityQuery: {
            reason:
              'Linked Creds Author is requesting the permission to read and write to the Verifiable Credentials and VC Evidence collections.',
            allowedAction: ['GET', 'PUT', 'POST'],
            controller: appInstanceDid,  // the app's DID string, generated in issue 394. example: 'did:key:.....'
            invocationTarget: [
              { type: 'urn:was:collection', contentType: 'application/vc', name: 'VerifiableCredential collection'},
              { type: 'urn:was:collection', contentType: 'application/octet-stream', name: 'VC Evidence collection' }
            ]
          }
        }
      ]
    }

Note the two variables in the VPR above:

appInstanceDid -- this is going to be the did:key DID of the app, generated in issue #394

pollingExchangeEndpoint -- this is the {url of linked creds author}/api/exchanges/[txId] URL from PR #344. This is where the wallet will POST the resulting zCap to.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions