@solongate/proxy 0.81.48 → 0.81.49
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/api-client/client.d.ts +2 -0
- package/dist/api-client/device-login.d.ts +1 -0
- package/dist/index.js +16 -15
- package/dist/login.js +1 -1
- package/dist/tui/index.js +15 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7188,7 +7188,7 @@ async function pollDeviceLogin(apiUrl, deviceCode) {
|
|
|
7188
7188
|
});
|
|
7189
7189
|
const j = await res.json().catch(() => ({}));
|
|
7190
7190
|
if (j.status === "approved" && j.api_key) {
|
|
7191
|
-
return { status: "approved", apiKey: j.api_key, project: j.project?.name, user: j.user?.name || j.user?.email };
|
|
7191
|
+
return { status: "approved", apiKey: j.api_key, project: j.project?.name, user: j.user?.name || j.user?.email, email: j.user?.email };
|
|
7192
7192
|
}
|
|
7193
7193
|
if (j.status === "expired" || j.status === "not_found") return { status: j.status };
|
|
7194
7194
|
return { status: "pending" };
|
|
@@ -10208,11 +10208,11 @@ function AccountsPanel({
|
|
|
10208
10208
|
if (abort.current) return;
|
|
10209
10209
|
const res = await pollDeviceLogin(DEFAULT_API_URL2, start.deviceCode);
|
|
10210
10210
|
if (res.status === "approved" && res.apiKey) {
|
|
10211
|
-
saveAccount({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL2, project: res.project, user: res.user });
|
|
10212
|
-
setLogin({ phase: "done", msg: `\u2713 added ${res.
|
|
10211
|
+
saveAccount({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL2, project: res.project, user: res.user, email: res.email });
|
|
10212
|
+
setLogin({ phase: "done", msg: `\u2713 added ${res.email || res.user || res.project || "account"}` });
|
|
10213
10213
|
refresh();
|
|
10214
10214
|
setViewCredentials({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL2 });
|
|
10215
|
-
onView?.({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL2, project: res.project, user: res.user });
|
|
10215
|
+
onView?.({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL2, project: res.project, user: res.user, email: res.email });
|
|
10216
10216
|
return;
|
|
10217
10217
|
}
|
|
10218
10218
|
if (res.status === "expired" || res.status === "not_found") {
|
|
@@ -10239,13 +10239,13 @@ function AccountsPanel({
|
|
|
10239
10239
|
if (a) {
|
|
10240
10240
|
setViewCredentials({ apiKey: a.apiKey, apiUrl: a.apiUrl });
|
|
10241
10241
|
onView?.(a);
|
|
10242
|
-
setMsg({ text: `viewing ${a.
|
|
10242
|
+
setMsg({ text: `viewing ${a.email || a.user || a.project || "account \u2026" + a.apiKey.slice(-4)}`, level: "ok" });
|
|
10243
10243
|
}
|
|
10244
10244
|
} else if (input === "m") {
|
|
10245
10245
|
const a = accounts[sel];
|
|
10246
10246
|
if (a) {
|
|
10247
10247
|
const ok = setActiveAccount({ apiKey: a.apiKey, apiUrl: a.apiUrl });
|
|
10248
|
-
setMsg(ok ? { text: `\u2713 ${a.
|
|
10248
|
+
setMsg(ok ? { text: `\u2713 ${a.email || a.user || a.project || "account"} is now the ACTIVE key (guard + logging)`, level: "ok" } : { text: "\u2717 could not set active", level: "bad" });
|
|
10249
10249
|
refresh();
|
|
10250
10250
|
}
|
|
10251
10251
|
} else if (input === "n") beginLogin();
|
|
@@ -10288,10 +10288,10 @@ function AccountsPanel({
|
|
|
10288
10288
|
const isActive = isActiveAccount(a.apiKey);
|
|
10289
10289
|
return /* @__PURE__ */ jsxs8(Text8, { wrap: "truncate", backgroundColor: isSel ? "#333333" : void 0, bold: isSel, children: [
|
|
10290
10290
|
/* @__PURE__ */ jsx8(Text8, { color: isSel ? theme.accentBright : theme.dim, children: isSel ? "\u25B8 " : " " }),
|
|
10291
|
-
/* @__PURE__ */ jsx8(Text8, { color: theme.accent, children: truncate2(a.
|
|
10291
|
+
/* @__PURE__ */ jsx8(Text8, { color: theme.accent, children: truncate2(a.email || a.user || "account \u2026" + a.apiKey.slice(-4), 30).padEnd(31) }),
|
|
10292
10292
|
isView ? /* @__PURE__ */ jsx8(Text8, { color: theme.ok, children: "\u25CF viewing " }) : /* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: " " }),
|
|
10293
10293
|
isActive ? /* @__PURE__ */ jsx8(Text8, { color: theme.warn, children: "ACTIVE " }) : /* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: " " }),
|
|
10294
|
-
/* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: a.
|
|
10294
|
+
/* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: a.project ? truncate2(a.project, 24) : "" })
|
|
10295
10295
|
] }, a.apiKey);
|
|
10296
10296
|
}) }),
|
|
10297
10297
|
/* @__PURE__ */ jsx8(Box8, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: "\u25CF viewing = the account the dataroom is showing \xB7 ACTIVE = the key the guard hooks + logging use" }) })
|
|
@@ -10358,15 +10358,16 @@ function App() {
|
|
|
10358
10358
|
}, []);
|
|
10359
10359
|
const acctIdx = Math.max(0, accounts.findIndex((a) => a.apiKey === viewKey));
|
|
10360
10360
|
const cur = accounts[acctIdx];
|
|
10361
|
-
const acctLabel = cur ? cur.
|
|
10361
|
+
const acctLabel = cur ? cur.email || cur.user || cur.project || `account \u2026${cur.apiKey.slice(-4)}` : "not logged in";
|
|
10362
10362
|
useEffect7(() => {
|
|
10363
|
-
if (!cur || cur.
|
|
10363
|
+
if (!cur || cur.email) return;
|
|
10364
10364
|
let alive = true;
|
|
10365
10365
|
api.auth.me().then((r) => {
|
|
10366
|
-
const project = r.project?.name ||
|
|
10367
|
-
const user = r.user?.name ||
|
|
10368
|
-
|
|
10369
|
-
|
|
10366
|
+
const project = r.project?.name || cur.project;
|
|
10367
|
+
const user = r.user?.name || cur.user;
|
|
10368
|
+
const email = r.user?.email || void 0;
|
|
10369
|
+
if (!alive || !project && !user && !email) return;
|
|
10370
|
+
saveAccount({ ...cur, project, user, email });
|
|
10370
10371
|
setAccounts(listAccounts());
|
|
10371
10372
|
}).catch(() => {
|
|
10372
10373
|
});
|
|
@@ -12036,7 +12037,7 @@ async function main() {
|
|
|
12036
12037
|
if (data?.project?.name) {
|
|
12037
12038
|
console.log(` ${c.dim}Project:${c.reset} ${c.cyan}${data.project.name}${c.reset}`);
|
|
12038
12039
|
}
|
|
12039
|
-
saveAccount({ apiKey, apiUrl, project: data?.project?.name, user: data?.user?.name || data?.user?.email });
|
|
12040
|
+
saveAccount({ apiKey, apiUrl, project: data?.project?.name, user: data?.user?.name || data?.user?.email, email: data?.user?.email });
|
|
12040
12041
|
break;
|
|
12041
12042
|
}
|
|
12042
12043
|
if (data?.status === "expired" || data?.status === "not_found") {
|
package/dist/login.js
CHANGED
|
@@ -383,7 +383,7 @@ async function main() {
|
|
|
383
383
|
if (data?.project?.name) {
|
|
384
384
|
console.log(` ${c.dim}Project:${c.reset} ${c.cyan}${data.project.name}${c.reset}`);
|
|
385
385
|
}
|
|
386
|
-
saveAccount({ apiKey, apiUrl, project: data?.project?.name, user: data?.user?.name || data?.user?.email });
|
|
386
|
+
saveAccount({ apiKey, apiUrl, project: data?.project?.name, user: data?.user?.name || data?.user?.email, email: data?.user?.email });
|
|
387
387
|
break;
|
|
388
388
|
}
|
|
389
389
|
if (data?.status === "expired" || data?.status === "not_found") {
|
package/dist/tui/index.js
CHANGED
|
@@ -462,7 +462,7 @@ async function pollDeviceLogin(apiUrl, deviceCode) {
|
|
|
462
462
|
});
|
|
463
463
|
const j = await res.json().catch(() => ({}));
|
|
464
464
|
if (j.status === "approved" && j.api_key) {
|
|
465
|
-
return { status: "approved", apiKey: j.api_key, project: j.project?.name, user: j.user?.name || j.user?.email };
|
|
465
|
+
return { status: "approved", apiKey: j.api_key, project: j.project?.name, user: j.user?.name || j.user?.email, email: j.user?.email };
|
|
466
466
|
}
|
|
467
467
|
if (j.status === "expired" || j.status === "not_found") return { status: j.status };
|
|
468
468
|
return { status: "pending" };
|
|
@@ -3333,11 +3333,11 @@ function AccountsPanel({
|
|
|
3333
3333
|
if (abort.current) return;
|
|
3334
3334
|
const res = await pollDeviceLogin(DEFAULT_API_URL, start.deviceCode);
|
|
3335
3335
|
if (res.status === "approved" && res.apiKey) {
|
|
3336
|
-
saveAccount({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL, project: res.project, user: res.user });
|
|
3337
|
-
setLogin({ phase: "done", msg: `\u2713 added ${res.
|
|
3336
|
+
saveAccount({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL, project: res.project, user: res.user, email: res.email });
|
|
3337
|
+
setLogin({ phase: "done", msg: `\u2713 added ${res.email || res.user || res.project || "account"}` });
|
|
3338
3338
|
refresh();
|
|
3339
3339
|
setViewCredentials({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL });
|
|
3340
|
-
onView?.({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL, project: res.project, user: res.user });
|
|
3340
|
+
onView?.({ apiKey: res.apiKey, apiUrl: DEFAULT_API_URL, project: res.project, user: res.user, email: res.email });
|
|
3341
3341
|
return;
|
|
3342
3342
|
}
|
|
3343
3343
|
if (res.status === "expired" || res.status === "not_found") {
|
|
@@ -3364,13 +3364,13 @@ function AccountsPanel({
|
|
|
3364
3364
|
if (a) {
|
|
3365
3365
|
setViewCredentials({ apiKey: a.apiKey, apiUrl: a.apiUrl });
|
|
3366
3366
|
onView?.(a);
|
|
3367
|
-
setMsg({ text: `viewing ${a.
|
|
3367
|
+
setMsg({ text: `viewing ${a.email || a.user || a.project || "account \u2026" + a.apiKey.slice(-4)}`, level: "ok" });
|
|
3368
3368
|
}
|
|
3369
3369
|
} else if (input === "m") {
|
|
3370
3370
|
const a = accounts[sel];
|
|
3371
3371
|
if (a) {
|
|
3372
3372
|
const ok = setActiveAccount({ apiKey: a.apiKey, apiUrl: a.apiUrl });
|
|
3373
|
-
setMsg(ok ? { text: `\u2713 ${a.
|
|
3373
|
+
setMsg(ok ? { text: `\u2713 ${a.email || a.user || a.project || "account"} is now the ACTIVE key (guard + logging)`, level: "ok" } : { text: "\u2717 could not set active", level: "bad" });
|
|
3374
3374
|
refresh();
|
|
3375
3375
|
}
|
|
3376
3376
|
} else if (input === "n") beginLogin();
|
|
@@ -3413,10 +3413,10 @@ function AccountsPanel({
|
|
|
3413
3413
|
const isActive = isActiveAccount(a.apiKey);
|
|
3414
3414
|
return /* @__PURE__ */ jsxs8(Text8, { wrap: "truncate", backgroundColor: isSel ? "#333333" : void 0, bold: isSel, children: [
|
|
3415
3415
|
/* @__PURE__ */ jsx8(Text8, { color: isSel ? theme.accentBright : theme.dim, children: isSel ? "\u25B8 " : " " }),
|
|
3416
|
-
/* @__PURE__ */ jsx8(Text8, { color: theme.accent, children: truncate(a.
|
|
3416
|
+
/* @__PURE__ */ jsx8(Text8, { color: theme.accent, children: truncate(a.email || a.user || "account \u2026" + a.apiKey.slice(-4), 30).padEnd(31) }),
|
|
3417
3417
|
isView ? /* @__PURE__ */ jsx8(Text8, { color: theme.ok, children: "\u25CF viewing " }) : /* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: " " }),
|
|
3418
3418
|
isActive ? /* @__PURE__ */ jsx8(Text8, { color: theme.warn, children: "ACTIVE " }) : /* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: " " }),
|
|
3419
|
-
/* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: a.
|
|
3419
|
+
/* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: a.project ? truncate(a.project, 24) : "" })
|
|
3420
3420
|
] }, a.apiKey);
|
|
3421
3421
|
}) }),
|
|
3422
3422
|
/* @__PURE__ */ jsx8(Box8, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ jsx8(Text8, { color: theme.dim, children: "\u25CF viewing = the account the dataroom is showing \xB7 ACTIVE = the key the guard hooks + logging use" }) })
|
|
@@ -3603,15 +3603,16 @@ function App() {
|
|
|
3603
3603
|
}, []);
|
|
3604
3604
|
const acctIdx = Math.max(0, accounts.findIndex((a) => a.apiKey === viewKey));
|
|
3605
3605
|
const cur = accounts[acctIdx];
|
|
3606
|
-
const acctLabel = cur ? cur.
|
|
3606
|
+
const acctLabel = cur ? cur.email || cur.user || cur.project || `account \u2026${cur.apiKey.slice(-4)}` : "not logged in";
|
|
3607
3607
|
useEffect7(() => {
|
|
3608
|
-
if (!cur || cur.
|
|
3608
|
+
if (!cur || cur.email) return;
|
|
3609
3609
|
let alive = true;
|
|
3610
3610
|
api.auth.me().then((r) => {
|
|
3611
|
-
const project = r.project?.name ||
|
|
3612
|
-
const user = r.user?.name ||
|
|
3613
|
-
|
|
3614
|
-
|
|
3611
|
+
const project = r.project?.name || cur.project;
|
|
3612
|
+
const user = r.user?.name || cur.user;
|
|
3613
|
+
const email = r.user?.email || void 0;
|
|
3614
|
+
if (!alive || !project && !user && !email) return;
|
|
3615
|
+
saveAccount({ ...cur, project, user, email });
|
|
3615
3616
|
setAccounts(listAccounts());
|
|
3616
3617
|
}).catch(() => {
|
|
3617
3618
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.49",
|
|
4
4
|
"description": "AI tool security proxy: protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. No code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|