mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 18:28:12 +00:00
misc: address backend lint
This commit is contained in:
@@ -137,6 +137,7 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
|
|||||||
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Postgres) }),
|
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Postgres) }),
|
||||||
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.MySQL) }),
|
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.MySQL) }),
|
||||||
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.SSH) }),
|
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.SSH) }),
|
||||||
|
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Kubernetes) }),
|
||||||
// AWS IAM (no gateway, returns console URL)
|
// AWS IAM (no gateway, returns console URL)
|
||||||
z.object({
|
z.object({
|
||||||
sessionId: z.string(),
|
sessionId: z.string(),
|
||||||
|
|||||||
@@ -705,6 +705,7 @@ export const pamAccountServiceFactory = ({
|
|||||||
port: portNumber
|
port: portNumber
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const gatewayConnectionDetails = await gatewayV2Service.getPAMConnectionDetails({
|
const gatewayConnectionDetails = await gatewayV2Service.getPAMConnectionDetails({
|
||||||
gatewayId,
|
gatewayId,
|
||||||
duration,
|
duration,
|
||||||
@@ -742,7 +743,7 @@ export const pamAccountServiceFactory = ({
|
|||||||
})) as TSqlAccountCredentials;
|
})) as TSqlAccountCredentials;
|
||||||
|
|
||||||
metadata = {
|
metadata = {
|
||||||
username: (credentials as TSqlAccountCredentials).username,
|
username: credentials.username,
|
||||||
database: connectionCredentials.database,
|
database: connectionCredentials.database,
|
||||||
accountName: account.name,
|
accountName: account.name,
|
||||||
accountPath: folderPath
|
accountPath: folderPath
|
||||||
@@ -758,7 +759,7 @@ export const pamAccountServiceFactory = ({
|
|||||||
})) as TSSHAccountCredentials;
|
})) as TSSHAccountCredentials;
|
||||||
|
|
||||||
metadata = {
|
metadata = {
|
||||||
username: (credentials as TSSHAccountCredentials).username
|
username: credentials.username
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ export const kubernetesResourceFactory: TPamResourceFactory<
|
|||||||
TKubernetesAccountCredentials
|
TKubernetesAccountCredentials
|
||||||
> = (resourceType, connectionDetails, gatewayId, gatewayV2Service) => {
|
> = (resourceType, connectionDetails, gatewayId, gatewayV2Service) => {
|
||||||
const validateConnection = async () => {
|
const validateConnection = async () => {
|
||||||
|
if (!gatewayId) {
|
||||||
|
throw new BadRequestError({ message: "Gateway ID is required" });
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await executeWithGateway(
|
await executeWithGateway(
|
||||||
{ connectionDetails, gatewayId, resourceType },
|
{ connectionDetails, gatewayId, resourceType },
|
||||||
@@ -119,6 +122,9 @@ export const kubernetesResourceFactory: TPamResourceFactory<
|
|||||||
const validateAccountCredentials: TPamResourceFactoryValidateAccountCredentials<
|
const validateAccountCredentials: TPamResourceFactoryValidateAccountCredentials<
|
||||||
TKubernetesAccountCredentials
|
TKubernetesAccountCredentials
|
||||||
> = async (credentials) => {
|
> = async (credentials) => {
|
||||||
|
if (!gatewayId) {
|
||||||
|
throw new BadRequestError({ message: "Gateway ID is required" });
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await executeWithGateway(
|
await executeWithGateway(
|
||||||
{ connectionDetails, gatewayId, resourceType },
|
{ connectionDetails, gatewayId, resourceType },
|
||||||
|
|||||||
Reference in New Issue
Block a user