* Return codes for encode/decode headers filter invocations. The connection manager bases further
// continueDecoding()/continueEncoding() MUST be called if continued filter iteration is desired.
// Continue headers iteration to remaining filters, but delay ending the stream. This status MUST
// Used when a filter wants to add a body to a headers-only request/response, but this body is not
// continueDecoding()/continueEncoding() is currently NOT supported and causes an assert failure.
// TODO(yosrym93): Support adding a body in this case by calling addDecodedData()/addEncodedData()
// then continueDecoding()/continueEncoding(). To support this a new FilterManager::IterationState
// Do not iterate for headers as well as data and trailers for the current filter and the filters
// If buffering the request causes buffered data to exceed the configured buffer limit, a 413 will
// Do not iterate for headers as well as data and trailers for the current filter and the filters
// This will cause the flow of incoming data to cease until continueDecoding() function is called.
// will be sent first via decodeHeaders()/encodeHeaders(). If data has previously been buffered,
// the data in this callback will be added to the buffer before the entirety is sent to the next
// continueDecoding()/continueEncoding() MUST be called if continued filter iteration is desired.
// If buffering the request causes buffered data to exceed the configured buffer limit, a 413 will
// continueDecoding()/continueEncoding() MUST be called if continued filter iteration is desired.
// This will cause the flow of incoming data to cease until one of the continue.*() functions is
// This should be returned by filters which can nominally stream data but have a transient back-up
// such as the configured delay of the fault filter, or if the router filter is still fetching an
* Return codes for encode/decode trailers filter invocations. The connection manager bases further
// continueDecoding()/continueEncoding() MUST be called if continued filter iteration is desired.
// Continue filter chain iteration for metadata only. Does not unblock returns of StopIteration*
// Continue sending onLocalReply to all filters, but reset the stream once all filters have been
virtual const Http::ConnectionPool::Instance::StreamOptions& upstreamStreamOptions() const PURE;
* RouteConfigUpdatedCallback is used to notify an OnDemandRouteUpdate filter about completion of a
* OnDemandRouteUpdate filter instance holds a RouteConfigUpdatedCallbackSharedPtr to a callback.
* Envoy::Router::RdsRouteConfigProviderImpl holds a weak pointer to the RouteConfigUpdatedCallback
* In RdsRouteConfigProviderImpl::onConfigUpdate(), before invoking the callback, a check is made to
// This class allows entities caching a route (e.g.) ActiveStream to delegate route clearing to xDS
* overridden by clearRouteCache() in subsequent filters. Usage is intended for filters at the end
* RouteConstSharedPtr route(const RouteCallback& cb, const Http::RequestHeaderMap& headers, const
* NOTE: clearRouteCache() must be called before invoking this method otherwise cached route will
* Currently a route callback's decision is overridden by clearRouteCache() / route() call in the
* subsequent filters. We may want to persist callbacks so they always participate in later route
* resolution or make it an independent entity like filters that gets called on route resolution.
* Clears the route cache for the current request. This must be called when a filter has modified
* Should be used when we continue processing a request or response by invoking a filter directly
* @param tracked_object_stack ScopeTrackedObjectStack where relevant ScopeTrackedObjects will be
* Return a handle to the upstream callbacks. This is valid for upstream HTTP filters, and nullopt
* headers have been received but before headers have been encoded), so it is not safe in general
* headers have been received but before headers have been encoded), so it is not safe in general
* called in the context of the callback. All further filters will receive decodeData(..., false)
* @param streaming_filter boolean supplies if this filter streams data or buffers the full body.
* FilterDataStatus::StopIterationNoBuffer from their decodeData() call, since use of this method
* the assumption that standard HTTP connection manager buffering and continuation are being used.
* @param end_stream boolean supplies whether this is the last data frame, and no trailers behind.
* When called in decodeData, the trailers map will be initialized to an empty map and returned by
* Attempts to create a locally generated response using the provided response_code and body_text
* response with a 200 HTTP response code and grpc-status and grpc-message headers mapped from the
* headers) this will either ship the reply directly to the downstream codec, or reset the stream.
* This is not folded into encodeHeaders because most Envoy users and filters will not be proxying
* The only 1xx that may be provided to encodeHeaders() is a 101 upgrade, which will be the final
* connection etc.) this may be called multiple times. Any such filter is responsible for calling
* sure that any async events are cleaned up in the context of this routine. This includes timers,
* complications. Filters must not invoke either encoder or decoder filter callbacks after having
* terminal filter (generally the router filter) and working towards the first filter configured.
* Note: decodeMetadata() currently cannot stop the filter iteration, and always returns Continue.
* That means metadata will go through the complete filter chain at once, even if the other frame
* Stream encoder filter callbacks add additional callbacks that allow a encoding filter to restart
* can only be called if the filter has previously returned StopIteration from encodeHeaders() AND
* The connection manager will dispatch headers and any buffered body data to the next filter in
* 1) If a headers only response needs to be turned into a response with a body, this method can
* 3) If additional buffered body data needs to be added by a filter before continuation of data
* called in the context of the callback. All further filters will receive encodeData(..., false)
* @param streaming_filter boolean supplies if this filter streams data or buffers the full body.
* FilterDataStatus::StopIterationNoBuffer from their encodeData() call, since use of this method
* from addEncodedData() where data is added to the HTTP connection manager's buffered data with
* the assumption that standard HTTP connection manager buffering and continuation are being used.
* @param end_stream boolean supplies whether this is the last data frame, and no trailers behind.
* When called in encodeData, the trailers map will be initialized to an empty map and returned by
* Attempts to create a locally generated response using the provided response_code and body_text
* response with a 200 HTTP response code and grpc-status and grpc-message headers mapped from the
* headers) this will either ship the reply directly to the downstream codec, or reset the stream.
* The only 1xx that may be provided to encodeHeaders() is a 101 upgrade, which will be the final
* Called with metadata to be encoded. New metadata should be added directly to metadata_map. DO
class StreamFilter : public virtual StreamDecoderFilter, public virtual StreamEncoderFilter {};
Ssl::ConnectionInfoConstSharedPtr ssl() const { return connectionInfoProvider().sslConnection(); }
* These callbacks are provided by the connection manager to the factory so that the factory can