troxy-cli 1.8.5 → 1.8.6
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/package.json +1 -1
- package/src/api.js +1 -0
- package/src/uninstall.js +13 -3
package/package.json
CHANGED
package/src/api.js
CHANGED
|
@@ -72,6 +72,7 @@ export const api = {
|
|
|
72
72
|
// Evaluate + confirm (agent API key)
|
|
73
73
|
evaluate: (body, apiKey) => request('POST', '/evaluate', { apiKey, body }),
|
|
74
74
|
evaluateEmail: (body, apiKey) => request('POST', '/evaluate/email', { apiKey, body }),
|
|
75
|
+
selfRevoke: (apiKey) => request('POST', '/mcp/self-revoke', { apiKey }),
|
|
75
76
|
confirmPayment: (auditId, body, apiKey) => request('POST', `/payments/${auditId}/confirm`, { apiKey, body }),
|
|
76
77
|
waitApprovalStatus: (token) => request('GET', `/approvals/${encodeURIComponent(token)}/wait`),
|
|
77
78
|
|
package/src/uninstall.js
CHANGED
|
@@ -4,6 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import { execSync } from 'child_process';
|
|
5
5
|
import readline from 'readline';
|
|
6
6
|
import { loadConfig } from './config.js';
|
|
7
|
+
import { api } from './api.js';
|
|
7
8
|
|
|
8
9
|
const MCP_CLIENTS = [
|
|
9
10
|
{
|
|
@@ -107,12 +108,21 @@ export async function runUninstall() {
|
|
|
107
108
|
console.log('none found');
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
// 3.
|
|
111
|
+
// 3. Revoke the API key. /mcp/self-revoke only lets a key revoke the exact
|
|
112
|
+
// token it authenticates as — it can't touch or list any other token — so
|
|
113
|
+
// this doesn't need a login/JWT, the key on disk is enough.
|
|
111
114
|
const cfg = loadConfig();
|
|
112
115
|
if (cfg?.apiKey) {
|
|
113
116
|
const prefix = cfg.apiKey.slice(0, 12) + '...';
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
process.stdout.write(` Revoking API key ${prefix}... `);
|
|
118
|
+
try {
|
|
119
|
+
await api.selfRevoke(cfg.apiKey);
|
|
120
|
+
console.log('✓');
|
|
121
|
+
} catch (err) {
|
|
122
|
+
console.log('✗');
|
|
123
|
+
console.log(` Couldn't revoke automatically (${err.message}).`);
|
|
124
|
+
console.log(' Go to dash.troxy.io → Settings → API Keys to revoke it.\n');
|
|
125
|
+
}
|
|
116
126
|
}
|
|
117
127
|
|
|
118
128
|
// 4. Delete ~/.troxy config
|