Skip to content

Consider server interceptor to check for unknown fields #5067

@niloc132

Description

@niloc132

GrpcErrorHelper.checkHasNoUnkownFields/Recursive exists as a utility for validating protobuf messages from the client and ensuring that no tags are included in the payload that the server couldn't decode - presumably from future clients, or otherwise slightly-incompatible clients. Only a few grpc calls run this validation today, and many of those non-recursively.

This ticket is to propose adding a server interceptor that validates all already-marshalled messages to ensure they only have known fields. Checking this could be as simple as req instanceof Message, to ensure that any protobuf marshalling has already taken place before validating (we have cases such as barrage/flight where messages are not marshalled yet, and it is up to the service impl to validate payloads).

This change would require no client changes, only a new interceptor added in the server, for all messages.

Metadata

Metadata

Labels

coreCore development tasksgrpc

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions