Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mds-audit] Extremely small audit fix. #320

Merged
merged 3 commits into from
May 15, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/mds-audit/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ function api(app: express.Express): express.Express {

// Validate input params
if (
isValidAuditEventId(audit_event_id) &&

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this was meant to validate the audit trip id?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sue what audit_event_id is used for (haven't dug into the audit code much besides /vehicles), but this line is simply a dupe of the line right below it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

audit_event_id is just a unique uuid assigned to the audit event. Probably not used for much other than tracking in the db (from back before our tables had id columns). I understand it's a dupe. My point was, that perhaps it was a copy-pasta error and should have been isValidAuditTripId(audit_trip_id) to validate the uuid in the route param, but looking at the code it appears that check already happens in some earlier middleware.

isValidAuditEventId(audit_event_id) &&
isValidTimestamp(timestamp) &&
isValidTelemetry(telemetry, { required: false })
Expand Down