Skip to content

Commit 50df7f3

Browse files
committed
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
1 parent 2732d79 commit 50df7f3

File tree

17 files changed

+145
-75
lines changed

17 files changed

+145
-75
lines changed

src/PolykeyAgent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ class Polykey {
464464
nodeManager: this.nodes,
465465
notificationsManager: this.notifications,
466466
sessionManager: this.sessions,
467+
sigchain: this.sigchain,
467468
vaultManager: this.vaults,
468469
fwdProxy: this.fwdProxy,
469470
revProxy: this.revProxy,

src/bin/identities/allow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ allow.action(async (id, permissions, options) => {
7070
// Setting by Identity
7171
const providerMessage = new identitiesPB.Provider();
7272
providerMessage.setProviderId(providerId!);
73-
providerMessage.setMessage(identityId!);
73+
providerMessage.setIdentityId(identityId!);
7474
setActionMessage.setIdentity(providerMessage);
7575
name = `${id}`;
7676
//Trusting.

src/bin/identities/authenticate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ commandAugmentKeynode.action(async (providerId, identitiyId, options) => {
4242
//Constructing message.
4343
const providerMessage = new identitiesPB.Provider();
4444
providerMessage.setProviderId(providerId);
45-
providerMessage.setMessage(identitiyId);
45+
providerMessage.setIdentityId(identitiyId);
4646

4747
//Sending message.
4848
const gen = grpcClient.identitiesAuthenticate(providerMessage);
@@ -57,7 +57,7 @@ commandAugmentKeynode.action(async (providerId, identitiyId, options) => {
5757
process.stdout.write(
5858
outputFormatter({
5959
type: options.format === 'json' ? 'json' : 'list',
60-
data: [`Your device code is: ${codeMessage!.getMessage()}`],
60+
data: [`Your device code is: ${codeMessage!.getIdentityId()}`],
6161
}),
6262
);
6363

@@ -67,7 +67,7 @@ commandAugmentKeynode.action(async (providerId, identitiyId, options) => {
6767
outputFormatter({
6868
type: options.format === 'json' ? 'json' : 'list',
6969
data: [
70-
`Successfully authenticated user: ${successMessage!.getMessage()}`,
70+
`Successfully authenticated user: ${successMessage!.getIdentityId()}`,
7171
],
7272
}),
7373
);

src/bin/identities/claim.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ claim.action(async (providerId, identitiyId, options) => {
4242
//Constructing message.
4343
const providerMessage = new identitiesPB.Provider();
4444
providerMessage.setProviderId(providerId);
45-
providerMessage.setMessage(identitiyId);
45+
providerMessage.setIdentityId(identitiyId);
4646

4747
//Sending message.
4848
const pCall = grpcClient.identitiesClaim(providerMessage);
@@ -51,8 +51,23 @@ claim.action(async (providerId, identitiyId, options) => {
5151
await clientUtils.refreshSession(meta, client.session);
5252
resolveP(null);
5353
});
54-
await pCall;
54+
const response = await pCall;
5555
await p;
56+
57+
const output = [`Successfully published identity claim with id: ${response.getClaimId()}
58+
on provider: ${providerId}`];
59+
60+
if (response.getUrl()) {
61+
output.push(`See claim at: ${response.getUrl()}`);
62+
}
63+
64+
process.stdout.write(
65+
outputFormatter({
66+
type: options.format === 'json' ? 'json' : 'list',
67+
data: output,
68+
}),
69+
);
70+
5671
} catch (err) {
5772
if (err instanceof errors.ErrorGRPCClientTimeout) {
5873
process.stderr.write(`${err.message}\n`);

src/bin/identities/disallow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ commandAllowGestalts.action(async (id, permissions, options) => {
7070
// Setting by Identity
7171
const providerMessage = new identitiesPB.Provider();
7272
providerMessage.setProviderId(providerId!);
73-
providerMessage.setMessage(identityId!);
73+
providerMessage.setIdentityId(identityId!);
7474
setActionMessage.setIdentity(providerMessage);
7575
name = `${id}`;
7676
//Trusting.

src/bin/identities/discover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ commandTrustGestalts.action(async (id, options) => {
5858
// Discovery by Identity
5959
const providerMessage = new identitiesPB.Provider();
6060
providerMessage.setProviderId(providerId!);
61-
providerMessage.setMessage(identityId!);
61+
providerMessage.setIdentityId(identityId!);
6262
const pCall = grpcClient.gestaltsDiscoveryByIdentity(providerMessage);
6363
const { p, resolveP } = utils.promise();
6464
pCall.call.on('metadata', async (meta) => {

src/bin/identities/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ get.action(async (id, options) => {
6161
//Getting from identity.
6262
const providerMessage = new identitiesPB.Provider();
6363
providerMessage.setProviderId(providerId!);
64-
providerMessage.setMessage(identityId!);
64+
providerMessage.setIdentityId(identityId!);
6565
const pCall = grpcClient.gestaltsGestaltGetByIdentity(providerMessage);
6666
const { p, resolveP } = utils.promise();
6767
pCall.call.on('metadata', async (meta) => {

src/bin/identities/permissions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ commandTrustGestalts.action(async (id, options) => {
5858
//Getting by Identity
5959
const providerMessage = new identitiesPB.Provider();
6060
providerMessage.setProviderId(providerId!);
61-
providerMessage.setMessage(identityId!);
61+
providerMessage.setIdentityId(identityId!);
6262
const pCall = grpcClient.gestaltsActionsGetByIdentity(providerMessage);
6363
const { p, resolveP } = utils.promise();
6464
pCall.call.on('metadata', async (meta) => {

src/bin/identities/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ commandTrustGestalts.action(async (providerId, options) => {
5050
process.stdout.write(
5151
outputFormatter({
5252
type: options.format === 'json' ? 'json' : 'list',
53-
data: [`Found identity: ${res.getProviderId()}:${res.getMessage()}`],
53+
data: [`Found identity: ${res.getProviderId()}:${res.getIdentityId()}`],
5454
}),
5555
);
5656
} catch (err) {

src/bin/identities/trust.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ trust.action(async (id, options) => {
6262
// Setting by Identity
6363
const providerMessage = new identitiesPB.Provider();
6464
providerMessage.setProviderId(providerId!);
65-
providerMessage.setMessage(identityId!);
65+
providerMessage.setIdentityId(identityId!);
6666
setActionMessage.setIdentity(providerMessage);
6767
const pCall = grpcClient.gestaltsActionsSetByIdentity(setActionMessage);
6868
const { p, resolveP } = utils.promise();

0 commit comments

Comments
 (0)