aws-samples / pcluster-manager

Manage AWS ParallelCluster through an easy to use web interface
https://pcluster.cloud
Apache License 2.0
65 stars 27 forks source link

Fix logger pushing non-string payloads to remote logging system #484

Closed mendaomn closed 1 year ago

mendaomn commented 1 year ago

Description

This PR fixes an issue allowing any payload to be sent as message to the remote logging system.

This is mostly related to the fact that rejected promises can contain any value, thus by blindly logging the event.reason of the PromiseRejectionEvent we risk to push non-string values to the remote logging system

This could also occur in the future, by logging values that have been typed as any (which would defeat the type checking), therefore the guard is place inside the RemoteLogger

Changes

How Has This Been Tested?

Log entry to be sent to the remote logging system, in case of an uncaught axios error: image

PR Quality Checklist

In order to increase the likelihood of your contribution being accepted, please make sure you have read both the Contributing Guidelines and the Project Guidelines

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.