Metadata Server

This module provides Metadata Server example.

class callouts.python.extproc.example.e2e_tests.metadata_server.CalloutServerExample(*args: Any, **kwargs: Any)[source]

Bases: CalloutServer

Example callout server for use in e2e metadata testing.

process(request: envoy.service.ext_proc.v3.external_processor_pb2.ProcessingRequest, context: ServicerContext) envoy.service.ext_proc.v3.external_processor_pb2.ProcessingResponse[source]

Process the incoming request.

Parameters:
  • request (ProcessingRequest) – The processing request received.

  • context (ServicerContext) – The context object for the gRPC service.

Returns:

The processing response to be sent back.

Return type:

ProcessingResponse

callouts.python.extproc.example.e2e_tests.metadata_server.check_metadata(request: envoy.service.ext_proc.v3.external_processor_pb2.ProcessingRequest) bool[source]

Check if the request contains ‘fr’ metadata.

Parameters:

request (service_pb2.ProcessingRequest) – The processing request to check.

Returns:

True if the ‘fr’ metadata is present and has a non-empty string value, False otherwise.

Return type:

bool

callouts.python.extproc.example.e2e_tests.metadata_server.unpack_string(value: Any) str[source]

Unpacks a string value from a protobuf Any object.

Parameters:

value (google.protobuf.any_pb2.Any) – The Any object containing the string value.

Returns:

The unpacked string value.

Return type:

str