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