@jclvsh/iris 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/keys.js +11 -0
- package/dist/tools/keys.js +11 -0
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/commands/keys.js
CHANGED
|
@@ -62,4 +62,15 @@ export function registerKeyCommands(program, client) {
|
|
|
62
62
|
handleError(error);
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
+
keys.command("rotate <id>")
|
|
66
|
+
.description("rotate an API key — revokes the old key and returns a new one with the same name and scopes (requires admin scope; cannot rotate the key being used for this call). The new raw key is shown once — store it immediately.")
|
|
67
|
+
.action(async (id) => {
|
|
68
|
+
try {
|
|
69
|
+
const result = await client.post(`/keys/${id}/rotate`);
|
|
70
|
+
formatOutput(result, getFormat(program.opts()));
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
handleError(error);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
65
76
|
}
|
package/dist/tools/keys.js
CHANGED
|
@@ -65,4 +65,15 @@ export function registerKeyTools(server, client) {
|
|
|
65
65
|
return formatMcpError(error);
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
+
server.tool("rotate_api_key", "rotate an API key — revokes the old key and returns a new one with the same name and scopes. The new raw key is shown once; store it immediately. The old key stops authenticating as soon as this returns. (requires admin scope; cannot rotate the key being used for this call)", {
|
|
69
|
+
id: z.string().uuid().describe("API key ID to rotate"),
|
|
70
|
+
}, async ({ id }) => {
|
|
71
|
+
try {
|
|
72
|
+
const result = await client.post(`/keys/${id}/rotate`);
|
|
73
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
return formatMcpError(error);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
68
79
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -237,6 +237,8 @@ export interface Webhook {
|
|
|
237
237
|
export interface CreateApiKeyResponse extends ApiKey {
|
|
238
238
|
key: string;
|
|
239
239
|
}
|
|
240
|
+
/** Response when rotating an API key. Same shape as create — the new raw key is shown once. */
|
|
241
|
+
export type RotateApiKeyResponse = CreateApiKeyResponse;
|
|
240
242
|
export interface WebhookDelivery {
|
|
241
243
|
id: string;
|
|
242
244
|
webhook_id: string;
|