Add the ctl counterpart to the revoke host action. (#528)

Resolves #512.
This commit is contained in:
Hornwitser authored and GitHub committed 2023-11-30 01:24:23 +01:00
1 parent d5bcd34cdb
commit 2c0c84b191
2 files changed
+74 -34

No files matched your search

+10
View File
@@ -247,6 +247,16 @@ hostCommands.add(new lib.Command({
},
}));
hostCommands.add(new lib.Command({
definition: ["revoke-token <host>", "Revoke all tokens for a host", (yargs) => {
yargs.positional("host", { describe: "Host to revoke tokens for", type: "string" });
}],
handler: async function(args: { host: string }, control: Control) {
let hostId = await lib.resolveHost(control, args.host);
await control.send(new lib.HostRevokeTokensRequest(hostId));
},
}));
hostCommands.add(new lib.Command({
definition: ["create-config", "Create host config", (yargs) => {
yargs.option("id", { type: "number", nargs: 1, describe: "Host id" });