HomePhabricator
Diffusion Comm 346965251e08

[keyserver] Improve logging in checkInputValidator

Description

[keyserver] Improve logging in checkInputValidator

Summary:
This diff does two things:

  1. Adds logging in checkInputValidator so we know what input validator is being failed.
  2. Makes sure that we don't throw a different error if sanitizeInput fails due to input validation. Instead, we'll just not include the sanitizedInput in the error.

(On the second point, I'm not entirely sure if it's ever possible for sanitizeInput to succeed input validation if it fails earlier...)

Depends on D12386

Test Plan:
Prior to this, I was seeing an input validation failure when I tested an old client initiating a session recovery with refetchUserDataAfterAcknowledgment removed from the code.

The input validation failure was triggering a second input validation failure when trying to sanitize inputs, which was resulting in a weird error being returned to the client.

Following this change, I was seeing helpful logs of the keyserver side (indicating that the input validation failure was with keyserver_auth), and the keyserver started returning the expected invalid_parameters ServerError.

Reviewers: kamil, tomek

Reviewed By: kamil, tomek

Differential Revision: https://phab.comm.dev/D12387

Details

Provenance
ashoatAuthored on Jun 10 2024, 8:50 PM
Reviewer
kamil
Differential Revision
D12387: [keyserver] Improve logging in checkInputValidator
Parents
rCOMMd37fa7389341: [native] Deprecate socket crash loop recovery specialized to policy…
Branches
Unknown
Tags
Unknown