misc: address backend lint

This commit is contained in:
Sheen Capadngan
2025-12-11 01:25:05 +08:00
parent 178989d4a3
commit d1d435d929
3 changed files with 10 additions and 2 deletions

View File

@@ -137,6 +137,7 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Postgres) }),
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.MySQL) }),
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.SSH) }),
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Kubernetes) }),
// AWS IAM (no gateway, returns console URL)
z.object({
sessionId: z.string(),

View File

@@ -705,6 +705,7 @@ export const pamAccountServiceFactory = ({
port: portNumber
};
})();
const gatewayConnectionDetails = await gatewayV2Service.getPAMConnectionDetails({
gatewayId,
duration,
@@ -742,7 +743,7 @@ export const pamAccountServiceFactory = ({
})) as TSqlAccountCredentials;
metadata = {
username: (credentials as TSqlAccountCredentials).username,
username: credentials.username,
database: connectionCredentials.database,
accountName: account.name,
accountPath: folderPath
@@ -758,7 +759,7 @@ export const pamAccountServiceFactory = ({
})) as TSSHAccountCredentials;
metadata = {
username: (credentials as TSSHAccountCredentials).username
username: credentials.username
};
}
break;

View File

@@ -75,6 +75,9 @@ export const kubernetesResourceFactory: TPamResourceFactory<
TKubernetesAccountCredentials
> = (resourceType, connectionDetails, gatewayId, gatewayV2Service) => {
const validateConnection = async () => {
if (!gatewayId) {
throw new BadRequestError({ message: "Gateway ID is required" });
}
try {
await executeWithGateway(
{ connectionDetails, gatewayId, resourceType },
@@ -119,6 +122,9 @@ export const kubernetesResourceFactory: TPamResourceFactory<
const validateAccountCredentials: TPamResourceFactoryValidateAccountCredentials<
TKubernetesAccountCredentials
> = async (credentials) => {
if (!gatewayId) {
throw new BadRequestError({ message: "Gateway ID is required" });
}
try {
await executeWithGateway(
{ connectionDetails, gatewayId, resourceType },