feat: harden plugin api for separate repos, signed updates and generic external login

This commit is contained in:
LukeGus committed 2026-09-29 18:11:59 -05:00
1 parent fb9c168b6b
commit 80944301dd
310 files changed
+6577 -4927

No files matched your search

+8 -2
View File
@@ -21,7 +21,8 @@
"credentials:use",
"hosts:write",
"ui:surface",
"events:core"
"events:core",
"db:core-refs"
],
"provides": [
{
@@ -140,6 +141,11 @@
],
"http": {
"adminImpersonation": true
}
},
"uses": [
"host-metrics.toolbar",
"terminal.sendToActive",
"terminal.sendToSession"
]
}
}
+21 -2
View File
@@ -6,10 +6,29 @@
"scripts": {
"build": "termix-plugin build",
"test": "termix-plugin test",
"typecheck": "tsc -b ../../tsconfig.plugins.backend.json ../../tsconfig.plugins.frontend.json",
"typecheck": "tsc -p .",
"validate": "termix-plugin validate"
},
"dependencies": {
"lucide-react": "^1.33.0"
},
"devDependencies": {
"@termix/plugin-sdk": "*"
"@termix/plugin-sdk": "^1.0.0",
"@testing-library/dom": "^10.4.2",
"@testing-library/react": "^16.3.3",
"@types/node": "^26.2.0",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.4",
"better-sqlite3": "^13.0.3",
"jsdom": "^30.0.1",
"vitest": "^4.1.11"
},
"peerDependencies": {
"@termix/plugin-sdk": "^1.0.0",
"drizzle-orm": "^0.45.2",
"express": "^5.2.1",
"react": "^19.2.8",
"sonner": "^2.0.8",
"ssh2": "^1.17.0"
}
}
@@ -45,12 +45,12 @@ describe("snippets activate", () => {
const service = server.mock.services.get("snippets.access") as {
list: () => Promise<unknown>;
};
const listed = await server.mock.ctx.asUser("user-1", () => service.list());
const listed = await server.mock.actAs("user-1", () => service.list());
expect(listed).toEqual([
expect.objectContaining({ name: "Deploy", content: "echo deploy" }),
]);
const otherUsersList = await server.mock.ctx.asUser("user-2", () =>
const otherUsersList = await server.mock.actAs("user-2", () =>
service.list(),
);
expect(otherUsersList).toEqual([]);
@@ -64,7 +64,7 @@ describe("snippets activate", () => {
remove: (id: number) => Promise<unknown>;
};
const asUser = <T>(fn: () => Promise<T>) =>
server!.mock.ctx.asUser("user-1", fn);
server!.mock.actAs("user-1", fn);
await expect(
asUser(() => service.create({ name: "x", content: "ls" })),