review fixes

This commit is contained in:
x032205
2025-10-20 19:13:14 -04:00
parent 777b67555b
commit 179380f82b
12 changed files with 176 additions and 83 deletions
@@ -204,13 +204,26 @@ export const pamResourceServiceFactory = ({
finalCredentials.password = decryptedCredentials.password;
}
const validatedRotationAccountCredentials = await factory.validateAccountCredentials(finalCredentials);
try {
const validatedRotationAccountCredentials = await factory.validateAccountCredentials(finalCredentials);
updateDoc.encryptedRotationAccountCredentials = await encryptAccountCredentials({
credentials: validatedRotationAccountCredentials,
projectId: resource.projectId,
kmsService
});
updateDoc.encryptedRotationAccountCredentials = await encryptAccountCredentials({
credentials: validatedRotationAccountCredentials,
projectId: resource.projectId,
kmsService
});
} catch (err) {
if (
err instanceof BadRequestError &&
err.message === "Account credentials invalid: Username or password incorrect"
) {
throw new BadRequestError({
message: "Rotation Account credentials invalid: Username or password incorrect"
});
}
throw err;
}
}
}