Skip to content

Commit

Permalink
fix: removed identityId parameter from `polykey identities authenti…
Browse files Browse the repository at this point in the history
…cate`

[ci skip]
  • Loading branch information
tegefaulkes committed Feb 3, 2023
1 parent 96a9d04 commit c502b8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 2 additions & 8 deletions src/bin/identities/CommandAuthenticate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ class CommandAuthenticate extends CommandPolykey {
'Name of the digital identity provider',
parsers.parseProviderId,
);
this.argument(
'<identityId>',
'Digital identity to authenticate',
parsers.parseIdentityId,
);
this.addOption(binOptions.nodeId);
this.addOption(binOptions.clientHost);
this.addOption(binOptions.clientPort);
this.action(async (providerId, identityId, options) => {
this.action(async (providerId, options) => {
const { default: PolykeyClient } = await import('../../PolykeyClient');
const identitiesPB = await import(
'../../proto/js/polykey/v1/identities/identities_pb'
Expand Down Expand Up @@ -59,7 +54,6 @@ class CommandAuthenticate extends CommandPolykey {
});
const providerMessage = new identitiesPB.Provider();
providerMessage.setProviderId(providerId);
providerMessage.setIdentityId(identityId);
await binUtils.retryAuthentication(async (auth) => {
genReadable = pkClient.grpcClient.identitiesAuthenticate(
providerMessage,
Expand Down Expand Up @@ -90,7 +84,7 @@ class CommandAuthenticate extends CommandPolykey {
case identitiesPB.AuthenticationProcess.StepCase.RESPONSE: {
const authResponse = message.getResponse()!;
this.logger.info(
`Authenticated digital identity provider ${providerId} with identity ${identityId}`,
`Authenticated digital identity provider ${providerId}`,
);
process.stdout.write(
binUtils.outputFormatter({
Expand Down
6 changes: 3 additions & 3 deletions src/identities/IdentitiesManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class IdentitiesManager {
const identities = await provider.getAuthIdentityIds();
if (!identities.includes(identityId)) {
throw new identitiesErrors.ErrorProviderIdentityMissing(
`Authenticated identities: ${JSON.stringify(identities)}`
`Authenticated identities: ${JSON.stringify(identities)}`,
);
}
// Create identity claim on our node
Expand All @@ -260,11 +260,11 @@ class IdentitiesManager {
async (token) => {
// Publishing in the callback to avoid adding bad claims
const claim = token.toSigned();
const asd = await provider.publishClaim(
const identitySignedClaim = await provider.publishClaim(
identityId,
claim as SignedClaim<ClaimLinkIdentity>,
);
publishedClaimProm.resolveP(asd);
publishedClaimProm.resolveP(identitySignedClaim);
return token;
},
tran,
Expand Down

0 comments on commit c502b8e

Please sign in to comment.