Skip to content

Update zCap delegation logic for WAS #38

@dmitrizagidulin

Description

@dmitrizagidulin

This is the next step towards implementing the full WAS/LinkedCreds Author integration flow, with the aim to de-risk ZcapClient creation and usage on the LinkedCreds Author side.

  1. If the wallet receives a zCap request (so, in handleZcapRequest function), if a WAS connection has not been made (if there is no root signer basically), display a warning to the user, "This request first requires you to set up a WAS connection. Go to the dev menu and enable 'Connect to WAS.". And then cancel the workflow.

  2. Change the delegated query to something like the following:

const invocationTarget = (new URL(`/space/${spaceId}`, WAS.BASE_URL)).toString()
const allowedAction = ['GET', 'POST', 'PUT', 'DELETE']

  const delegatedZcap = await zcapClient.delegate({
    capability: parentCapability,
    controller,
    invocationTarget,
    allowedActions,
    expires: ZCAP_EXPIRES.toISOString()
  });
  1. return it in a { zcap } object, as currently.

What we're doing here is (temporarily) creating a general purpose zCap to read and write to a space, that LinkedCreds Author can use to store evidence documents.
(While we're waiting for the 'List collection contents' functionality to be available)

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