mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 21:03:47 +00:00
Merge commit from fork
This commit is contained in:
@@ -3,7 +3,7 @@ import type {
|
|||||||
CredentialBackend,
|
CredentialBackend,
|
||||||
} from "../../../types/index.js";
|
} from "../../../types/index.js";
|
||||||
import type { Request, RequestHandler, Response, Router } from "express";
|
import type { Request, RequestHandler, Response, Router } from "express";
|
||||||
import { eq } from "drizzle-orm";
|
import { and, eq } from "drizzle-orm";
|
||||||
import ssh2Pkg from "ssh2";
|
import ssh2Pkg from "ssh2";
|
||||||
import { db } from "../db/index.js";
|
import { db } from "../db/index.js";
|
||||||
import { hosts, sshCredentials } from "../db/schema.js";
|
import { hosts, sshCredentials } from "../db/schema.js";
|
||||||
@@ -432,7 +432,12 @@ export function registerCredentialDeployRoutes(
|
|||||||
db
|
db
|
||||||
.select()
|
.select()
|
||||||
.from(sshCredentials)
|
.from(sshCredentials)
|
||||||
.where(eq(sshCredentials.id, credentialId))
|
.where(
|
||||||
|
and(
|
||||||
|
eq(sshCredentials.id, credentialId),
|
||||||
|
eq(sshCredentials.userId, userId),
|
||||||
|
),
|
||||||
|
)
|
||||||
.limit(1),
|
.limit(1),
|
||||||
"ssh_credentials",
|
"ssh_credentials",
|
||||||
userId,
|
userId,
|
||||||
@@ -462,7 +467,11 @@ export function registerCredentialDeployRoutes(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
const targetHost = await SimpleDBOps.select(
|
const targetHost = await SimpleDBOps.select(
|
||||||
db.select().from(hosts).where(eq(hosts.id, targetHostId)).limit(1),
|
db
|
||||||
|
.select()
|
||||||
|
.from(hosts)
|
||||||
|
.where(and(eq(hosts.id, targetHostId), eq(hosts.userId, userId)))
|
||||||
|
.limit(1),
|
||||||
"ssh_data",
|
"ssh_data",
|
||||||
userId,
|
userId,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user