mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 07:26:45 +00:00
Fix: Added missing event cases
This commit is contained in:
@@ -39,6 +39,8 @@ export const LogsTableRow = ({ auditLog, isOrgAuditLogs, showActorColumn }: Prop
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderMetadata = (event: Event) => {
|
const renderMetadata = (event: Event) => {
|
||||||
|
const metadataKeys = Object.keys(event.metadata);
|
||||||
|
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case EventType.GET_SECRETS:
|
case EventType.GET_SECRETS:
|
||||||
return (
|
return (
|
||||||
@@ -476,7 +478,47 @@ export const LogsTableRow = ({ auditLog, isOrgAuditLogs, showActorColumn }: Prop
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Td>
|
</Td>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
case EventType.GET_WORKSPACE_KEY:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Key ID: ${event.metadata.keyId}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
|
||||||
|
case EventType.LOGIN_IDENTITY_UNIVERSAL_AUTH:
|
||||||
|
case EventType.ADD_IDENTITY_UNIVERSAL_AUTH:
|
||||||
|
case EventType.UPDATE_IDENTITY_UNIVERSAL_AUTH:
|
||||||
|
case EventType.GET_IDENTITY_UNIVERSAL_AUTH_CLIENT_SECRETS:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Identity ID: ${event.metadata.identityId}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
|
||||||
|
case EventType.CREATE_IDENTITY_UNIVERSAL_AUTH_CLIENT_SECRET:
|
||||||
|
case EventType.REVOKE_IDENTITY_UNIVERSAL_AUTH_CLIENT_SECRET:
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
<p>{`Identity ID: ${event.metadata.identityId}`}</p>
|
||||||
|
<p>{`Client Secret ID: ${event.metadata.clientSecretId}`}</p>
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
|
||||||
|
// ? If for some reason non the above events are matched, we will display the first 3 metadata items in the metadata object.
|
||||||
default:
|
default:
|
||||||
|
if (metadataKeys.length) {
|
||||||
|
const maxMetadataLength = metadataKeys.length > 3 ? 3 : metadataKeys.length;
|
||||||
|
return (
|
||||||
|
<Td>
|
||||||
|
{Object.entries(event.metadata)
|
||||||
|
.slice(0, maxMetadataLength)
|
||||||
|
.map(([key, value]) => {
|
||||||
|
return <p key={`audit-log-metadata-${key}`}>{`${key}: ${value}`}</p>;
|
||||||
|
})}
|
||||||
|
</Td>
|
||||||
|
);
|
||||||
|
}
|
||||||
return <Td />;
|
return <Td />;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user