add resource type to error log

This commit is contained in:
x032205
2025-10-20 21:09:01 -04:00
parent bf1bdf93ec
commit bdbec5b158
2 changed files with 5 additions and 1 deletions

View File

@@ -3841,6 +3841,7 @@ interface PamAccountCredentialRotationFailedEvent {
accountName: string;
accountId: string;
resourceId: string;
resourceType: string;
errorMessage: string;
};
}

View File

@@ -554,9 +554,11 @@ export const pamAccountServiceFactory = ({
const batch = accounts.slice(i, i + ROTATION_CONCURRENCY_LIMIT);
const rotationPromises = batch.map(async (account) => {
let logResourceType = "unknown";
try {
const resource = await pamResourceDAL.findById(account.resourceId);
if (!resource || !resource.encryptedRotationAccountCredentials) return;
logResourceType = resource.resourceType;
const { connectionDetails, rotationAccountCredentials, gatewayId, resourceType } = await decryptResource(
resource,
@@ -604,7 +606,7 @@ export const pamAccountServiceFactory = ({
accountId: account.id,
accountName: account.name,
resourceId: resource.id,
resourceType: resource.resourceType
resourceType: logResourceType
}
}
});
@@ -623,6 +625,7 @@ export const pamAccountServiceFactory = ({
accountId: account.id,
accountName: account.name,
resourceId: account.resourceId,
resourceType: logResourceType,
errorMessage
}
}