Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The pk identities claim command should perform augmentation #267

Closed
joshuakarp opened this issue Oct 26, 2021 · 2 comments · Fixed by #278
Closed

The pk identities claim command should perform augmentation #267

joshuakarp opened this issue Oct 26, 2021 · 2 comments · Fixed by #278
Assignees
Labels
development Standard development r&d:polykey:core activity 3 Peer to Peer Federated Hierarchy

Comments

@joshuakarp
Copy link
Contributor

Specification

We need to provide support for the creation of claims between a node and digital identity in a gestalt.

An issue with the identities claim CLI command - it doesn't actually perform the augmentation. At the moment, all this command does is call await gestaltGraph.linkNodeAndIdentity(nodeInfo, identityInfo). Looking at GestaltGraph.ts, all this function does is update (or create if none exist) the ACL permissions for the node's gestalt.

In order to actually perform an identity claim/augmentation there are two more steps we need to add.

1. Create a claim on the node's sigchain

To do this, we need to construct a ClaimLinkIdentity object, which is just

type ClaimLinkIdentity = {
  type: 'identity';
  node: NodeId; // can get using nodeManager.getNodeId() since node manager is already injected into identities RPC
  provider: ProviderId; // provided in call request already
  identity: IdentityId; // provided in call request already
};

Next we would just need to call sigchain.addClaim(), passing this function the ClaimLinkIdentity object we created (unless there's a better way to do this?). Only thing is that the sigchain is not currently being injected into the identities RPC so that would need to be added.

2. Publish the claim on the DI

Once we've made a claim we just need to publish it on the provider as well. This stage requires the provider to be authenticated so it would be a good idea to check that before we even update ACL permissions/generate the claim on the sigchain (whichever comes first). We can get the provider from Identities Manager using the provided ProviderId we already have (identities.getProvider). After that we just need to call the publishClaim() method on the provider, passing it the claim we made on the Sigchain. Only problem here is that sigchain.addClaim() doesn't return the claim it generates, so we'll have to search the sigchain for the one we're looking for. This might be a little challenging unless we can assume that the most recent identity claim is the one we want.

Once we've got the claim we also need to decode it (using decodeClaim from claims utils) before we can publish it.

That's about all that needs to be done here, unless we also want to return something to the caller (e.g. the claim id and url that gets returned by publishClaim()) since right now that grpc call responds with an EmptyMessage.

Additional context

Tasks

  1. Create and add the identity claim on the node's sigchain
  2. Publish the claim on the digital identity provider
@joshuakarp joshuakarp added the development Standard development label Oct 26, 2021
@CMCDragonkai
Copy link
Member

@tegefaulkes can you help spec out what this issue is for. Recommend meeting with @joshuakarp and @emmacasolin to discuss.

@CMCDragonkai CMCDragonkai changed the title Creating a cryptolink claim from node to identity The pk identities claim command should perform augmentation Oct 26, 2021
@emmacasolin
Copy link
Contributor

I believe the majority of the code for this already exists, so this issue would mostly just be calling these existing functions inside of the pk identities claim command

emmacasolin added a commit that referenced this issue Oct 28, 2021
emmacasolin added a commit that referenced this issue Nov 2, 2021
changed message to identity_id in provider message

updating all commands that use provider message

updated everything on the agent side for augment command

started tests and debugging augment command

identities claim working in client service test

wrote test for command in identities
emmacasolin added a commit that referenced this issue Dec 2, 2021
creating new branch for #267

changed message to identity_id in provider message

updating all commands that use provider message

updated everything on the agent side for augment command

started tests and debugging augment command

identities claim working in client service test

wrote test for command in identities
emmacasolin added a commit that referenced this issue Dec 2, 2021
creating new branch for #267

changed message to identity_id in provider message

updating all commands that use provider message

updated everything on the agent side for augment command

started tests and debugging augment command

identities claim working in client service test

wrote test for command in identities
emmacasolin added a commit that referenced this issue Dec 2, 2021
creating new branch for #267

changed message to identity_id in provider message

updating all commands that use provider message

updated everything on the agent side for augment command

started tests and debugging augment command

identities claim working in client service test

wrote test for command in identities
emmacasolin added a commit that referenced this issue Dec 5, 2021
creating new branch for #267

changed message to identity_id in provider message

updating all commands that use provider message

updated everything on the agent side for augment command

started tests and debugging augment command

identities claim working in client service test

wrote test for command in identities

fixing issues from rebase

command claim fixed to match new cli style

fixing commands to match proto

add claim returns created claim

rpcIdentities using domain + client errors

identity claim rpc test fixes

identities claim bin test

clearing authenticated identities between tests

fix for identities bin test failures

lint fixed

fixes in gestalts rpc tests
@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 3 Peer to Peer Federated Hierarchy label Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:core activity 3 Peer to Peer Federated Hierarchy
Development

Successfully merging a pull request may close this issue.

3 participants