Skip to content

Draft: Add RequestMetadataGenerator constructor for ServerContext and getter method

Jeremiah Bonney requested to merge jbonney/read-request-metadata into master

Before raising this MR, consider whether the following are required, and complete if so:

  • Unit tests

If not required, please explain in brief why not.

Description

This PR adds additional functionality to the RequestMetadataGenerator class to facilitate forwarding RequestMetadata from clients -> upstream servers in buildbox-casd. It adds a new constructor which takes a std::multimap<grpc::string_ref, grpc::string_ref> as input, which is how grpc::ServerContext.client_metadata() returns metadata sent from the client, and use that RequestMetadata to initialize itself. The second method is a getter which returns the RequestMetadata that the RequestMetadataGenerator would generate, which is useful both for testing and for buildbox-casd / other possible servers to get access to the RequestMetadata for display or other purposes.

Changes proposed in this merge request:

  • Add new constructor to RequestMetadataGenerator
  • Add get_request_metadata method

Validation

This functionality is tested by the tests

Merge request reports