@@ -164,7 +164,7 @@ message ProcessingRequest {
164164// the server must send back exactly one ProcessingResponse message.
165165// * If it is set to ``FULL_DUPLEX_STREAMED``, the server must follow the API defined
166166// for this mode to send the ProcessingResponse messages.
167- // [#next-free-field: 11 ]
167+ // [#next-free-field: 12 ]
168168message ProcessingResponse {
169169 // The response type that is sent by the server.
170170 oneof response {
@@ -224,6 +224,19 @@ message ProcessingResponse {
224224 // is set to true.
225225 envoy.extensions.filters.http.ext_proc.v3.ProcessingMode mode_override = 9 ;
226226
227+ // [#not-implemented-hide:]
228+ // Used only in ``FULL_DUPLEX_STREAMED`` and ``GRPC`` body send modes.
229+ // Instructs the data plane to stop sending body data and to send a
230+ // half-close on the ext_proc stream. The ext_proc server should then echo
231+ // back all subsequent body contents as-is until it sees the client's
232+ // half-close, at which point the ext_proc server can terminate the stream
233+ // with an OK status. This provides a safe way for the ext_proc server
234+ // to indicate that it does not need to see the rest of the stream;
235+ // without this, the ext_proc server could not terminate the stream
236+ // early, because it would wind up dropping any body contents that the
237+ // client had already sent before it saw the ext_proc stream termination.
238+ bool request_drain = 11 ;
239+
227240 // When ext_proc server receives a request message, in case it needs more
228241 // time to process the message, it sends back a ProcessingResponse message
229242 // with a new timeout value. When the data plane receives this response
@@ -268,11 +281,27 @@ message HttpHeaders {
268281message HttpBody {
269282 // The contents of the body in the HTTP request/response. Note that in
270283 // streaming mode multiple ``HttpBody`` messages may be sent.
284+ //
285+ // In ``GRPC`` body send mode, a separate ``HttpBody`` message will be
286+ // sent for each message in the gRPC stream.
271287 bytes body = 1 ;
272288
273289 // If ``true``, this will be the last ``HttpBody`` message that will be sent and no
274290 // trailers will be sent for the current request/response.
275291 bool end_of_stream = 2 ;
292+
293+ // This field is used in ``GRPC`` body send mode when ``end_of_stream`` is
294+ // true and ``body`` is empty. Those values would normally indicate an
295+ // empty message on the stream with the end-of-stream bit set.
296+ // However, if the half-close happens after the last message on the
297+ // stream was already sent, then this field will be true to indicate an
298+ // end-of-stream with *no* message (as opposed to an empty message).
299+ bool end_of_stream_without_message = 3 ;
300+
301+ // This field is used in ``GRPC`` body send mode to indicate whether
302+ // the message is compressed. This will never be set to true by gRPC
303+ // but may be set to true by a proxy like Envoy.
304+ bool grpc_message_compressed = 4 ;
276305}
277306
278307// This message is sent to the external server when the HTTP request and
@@ -331,6 +360,8 @@ message CommonResponse {
331360 //
332361 // In other words, this response makes it possible to turn an HTTP GET
333362 // into a POST, PUT, or PATCH.
363+ //
364+ // Not supported if the body send mode is ``GRPC``.
334365 CONTINUE_AND_REPLACE = 1 ;
335366 }
336367
@@ -415,15 +446,34 @@ message HeaderMutation {
415446 repeated string remove_headers = 2 ;
416447}
417448
418- // The body response message corresponding to FULL_DUPLEX_STREAMED body mode .
449+ // The body response message corresponding to `` FULL_DUPLEX_STREAMED`` or ``GRPC`` body modes .
419450message StreamedBodyResponse {
420- // The body response chunk that will be passed to the upstream/downstream by the data plane.
451+ // In ``FULL_DUPLEX_STREAMED`` body send mode, contains the body response chunk that will be
452+ // passed to the upstream/downstream by the data plane. In ``GRPC`` body send mode, contains
453+ // a serialized gRPC message to be passed to the upstream/downstream by the data plane.
421454 bytes body = 1 ;
422455
423456 // The server sets this flag to true if it has received a body request with
424457 // :ref:`end_of_stream <envoy_v3_api_field_service.ext_proc.v3.HttpBody.end_of_stream>` set to true,
425458 // and this is the last chunk of body responses.
459+ // Note that in ``GRPC`` body send mode, this allows the ext_proc
460+ // server to tell the data plane to send a half close after a client
461+ // message, which will result in discarding any other messages sent by
462+ // the client application.
426463 bool end_of_stream = 2 ;
464+
465+ // This field is used in ``GRPC`` body send mode when ``end_of_stream`` is
466+ // true and ``body`` is empty. Those values would normally indicate an
467+ // empty message on the stream with the end-of-stream bit set.
468+ // However, if the half-close happens after the last message on the
469+ // stream was already sent, then this field will be true to indicate an
470+ // end-of-stream with *no* message (as opposed to an empty message).
471+ bool end_of_stream_without_message = 3 ;
472+
473+ // This field is used in ``GRPC`` body send mode to indicate whether
474+ // the message is compressed. This will never be set to true by gRPC
475+ // but may be set to true by a proxy like Envoy.
476+ bool grpc_message_compressed = 4 ;
427477}
428478
429479// This message specifies the body mutation the server sends to the data plane.
@@ -433,19 +483,19 @@ message BodyMutation {
433483 // The entire body to replace.
434484 // Should only be used when the corresponding ``BodySendMode`` in the
435485 // :ref:`processing_mode <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.processing_mode>`
436- // is not set to ``FULL_DUPLEX_STREAMED``.
486+ // is not set to ``FULL_DUPLEX_STREAMED`` or ``GRPC`` .
437487 bytes body = 1 ;
438488
439489 // Clear the corresponding body chunk.
440490 // Should only be used when the corresponding ``BodySendMode`` in the
441491 // :ref:`processing_mode <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.processing_mode>`
442- // is not set to ``FULL_DUPLEX_STREAMED``.
492+ // is not set to ``FULL_DUPLEX_STREAMED`` or ``GRPC`` .
443493 // Clear the corresponding body chunk.
444494 bool clear_body = 2 ;
445495
446496 // Must be used when the corresponding ``BodySendMode`` in the
447497 // :ref:`processing_mode <envoy_v3_api_field_extensions.filters.http.ext_proc.v3.ExternalProcessor.processing_mode>`
448- // is set to ``FULL_DUPLEX_STREAMED``.
498+ // is set to ``FULL_DUPLEX_STREAMED`` or ``GRPC`` .
449499 StreamedBodyResponse streamed_response = 3
450500 [(xds.annotations.v3.field_status ).work_in_progress = true ];
451501 }
0 commit comments