Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/root/configuration/access_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ The following command operators are supported:
where NAMESPACE is the the filter namespace used when setting the metadata, KEY is an optional
lookup up key in the namespace with the option of specifying nested keys separated by ':',
and Z is an optional parameter denoting string truncation up to Z characters long. Dynamic Metadata
can be set by filters using the :repo:`RequestInfo <include/envoy/request_info/request_info.h>` API:
can be set by filters using the :repo:`StreamInfo <include/envoy/stream_info/stream_info.h>` API:
*setDynamicMetadata*. The data will be logged as a JSON string. For example, for the following dynamic metadata:

``com.test.my_filter: {"test_key": "foo", "test_object": {"inner_key": "bar"}}``
Expand Down
2 changes: 1 addition & 1 deletion docs/root/configuration/http_conn_man/headers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ Supported variable names are:
parameters **do not** need to be escaped by doubling them.

%PER_REQUEST_STATE(reverse.dns.data.name)%
Populates the header with values set on the request info perRequestState() object. To be
Populates the header with values set on the stream info perRequestState() object. To be
usable in custom request/response headers, these values must be of type
Envoy::Router::StringAccessor. These values should be named in standard reverse DNS style,
identifying the organization that created the value and ending in a unique name for the data.
Expand Down
20 changes: 10 additions & 10 deletions docs/root/configuration/http_filters/lua_filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,16 @@ under the filter name i.e. *envoy.lua*. Below is an example of a *metadata* in a

Returns a :ref:`metadata object <config_http_filters_lua_metadata_wrapper>`.

requestInfo()
streamInfo()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize that we changed the Lua API. This is might be a change that we need to revert if people complain. In general I don't think we can make breaking changes like this but this might be OK since I'm guessing very few people use this. We will see.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yeah. I think @ramaraochavali has an idea of it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not using this right now. So good from our side.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @ramaraochavali. @yskopets I hope you're OK with this too.

^^^^^^^^^^^^^

.. code-block:: lua

requestInfo = handle:requestInfo()
streamInfo = handle:streamInfo()

Returns :repo:`information <include/request_info/request_info.h>` related to the current request.
Returns :repo:`information <include/stream_info/stream_info.h>` related to the current request.

Returns a :ref:`request info object <config_http_filters_lua_request_info_wrapper>`.
Returns a :ref:`stream info object <config_http_filters_lua_stream_info_wrapper>`.

connection()
^^^^^^^^^^^^
Expand Down Expand Up @@ -426,17 +426,17 @@ __pairs()
Iterates through every *metadata* entry. *key* is a string that supplies a *metadata*
key. *value* is *metadata* entry value.

.. _config_http_filters_lua_request_info_wrapper:
.. _config_http_filters_lua_stream_info_wrapper:

Request info object API
Stream info object API
-----------------------

protocol()
^^^^^^^^^^

.. code-block:: lua

requestInfo:protocol()
streamInfo:protocol()

Returns the string representation of :repo:`HTTP protocol <include/envoy/http/protocol.h>`
used by the current request. The possible values are: *HTTP/1.0*, *HTTP/1.1*, and *HTTP/2*.
Expand All @@ -446,11 +446,11 @@ dynamicMetadata()

.. code-block:: lua

requestInfo:dynamicMetadata()
streamInfo:dynamicMetadata()

Returns a :ref:`dynamic metadata object <config_http_filters_lua_request_info_dynamic_metadata_wrapper>`.
Returns a :ref:`dynamic metadata object <config_http_filters_lua_stream_info_dynamic_metadata_wrapper>`.

.. _config_http_filters_lua_request_info_dynamic_metadata_wrapper:
.. _config_http_filters_lua_stream_info_dynamic_metadata_wrapper:

Dynamic metadata object API
---------------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/root/intro/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Version history

1.9.0 (pending)
===============
* Renamed the `RequestInfo` namespace to `StreamInfo` to better match its
behaviour within TCP and HTTP implementations.
* stream: renamed the `RequestInfo` namespace to `StreamInfo` to better match
its behaviour within TCP and HTTP implementations.

1.8.0 (Oct 4, 2018)
===================
Expand Down Expand Up @@ -71,8 +71,8 @@ Version history
:ref:`destination_port <envoy_api_field_listener.FilterChainMatch.destination_port>` and
:ref:`prefix_ranges <envoy_api_field_listener.FilterChainMatch.prefix_ranges>`.
* lua: added :ref:`connection() <config_http_filters_lua_connection_wrapper>` wrapper and *ssl()* API.
* lua: added :ref:`requestInfo() <config_http_filters_lua_request_info_wrapper>` wrapper and *protocol()* API.
* lua: added :ref:`requestInfo():dynamicMetadata() <config_http_filters_lua_request_info_dynamic_metadata_wrapper>` API.
* lua: added :ref:`streamInfo() <config_http_filters_lua_stream_info_wrapper>` wrapper and *protocol()* API.
* lua: added :ref:`streamInfo():dynamicMetadata() <config_http_filters_lua_stream_info_dynamic_metadata_wrapper>` API.
* network: introduced :ref:`sni_cluster <config_network_filters_sni_cluster>` network filter that forwards connections to the
upstream cluster specified by the SNI value presented by the client during a TLS handshake.
* proxy_protocol: added support for HAProxy Proxy Protocol v2 (AF_INET/AF_INET6 only).
Expand Down
2 changes: 1 addition & 1 deletion source/common/access_log/access_log_formatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class FormatterImpl : public Formatter {
};

/**
* Formatter for string literal. It ignores headers and request info and returns string by which it
* Formatter for string literal. It ignores headers and stream info and returns string by which it
* was initialized.
*/
class PlainStringFormatter : public Formatter {
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/async_client_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ AsyncStreamImpl::AsyncStreamImpl(AsyncClientImpl& parent, AsyncClient::StreamCal
}

router_.setDecoderFilterCallbacks(*this);
// TODO(mattklein123): Correctly set protocol in request info when we support access logging.
// TODO(mattklein123): Correctly set protocol in stream info when we support access logging.
}

void AsyncStreamImpl::encodeHeaders(HeaderMapPtr&& headers, bool end_stream) {
Expand Down
2 changes: 1 addition & 1 deletion source/extensions/filters/http/lua/lua_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class StreamHandleWrapper : public Filters::Common::Lua::BaseLuaObject<StreamHan
DECLARE_LUA_FUNCTION(StreamHandleWrapper, luaMetadata);

/**
* @return a handle to the request info.
* @return a handle to the stream info.
*/
DECLARE_LUA_FUNCTION(StreamHandleWrapper, luaStreamInfo);

Expand Down
6 changes: 3 additions & 3 deletions source/extensions/filters/http/lua/wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class DynamicMetadataMapWrapper
iterator_.reset();
}

// To get reference to parent's (StreamInfoWrapper) request info member.
// To get reference to parent's (StreamInfoWrapper) stream info member.
StreamInfo::StreamInfo& streamInfo();

StreamInfoWrapper& parent_;
Expand All @@ -170,7 +170,7 @@ class DynamicMetadataMapWrapper
};

/**
* Lua wrapper for a request info.
* Lua wrapper for a stream info.
*/
class StreamInfoWrapper : public Filters::Common::Lua::BaseLuaObject<StreamInfoWrapper> {
public:
Expand All @@ -187,7 +187,7 @@ class StreamInfoWrapper : public Filters::Common::Lua::BaseLuaObject<StreamInfoW
DECLARE_LUA_FUNCTION(StreamInfoWrapper, luaProtocol);

/**
* Get reference to request info dynamic metadata object.
* Get reference to stream info dynamic metadata object.
* @return DynamicMetadataMapWrapper representation of StreamInfo dynamic metadata.
*/
DECLARE_LUA_FUNCTION(StreamInfoWrapper, luaDynamicMetadata);
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/http/lua/lua_filter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ TEST_F(LuaHttpFilterTest, GetCurrentProtocol) {
EXPECT_EQ(Http::FilterHeadersStatus::Continue, filter_->decodeHeaders(request_headers, true));
}

// Set and get request info dynamic metadata.
// Set and get stream info dynamic metadata.
TEST_F(LuaHttpFilterTest, SetGetDynamicMetadata) {
const std::string SCRIPT{R"EOF(
function envoy_on_request(request_handle)
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/http/lua/wrappers_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ TEST_F(LuaStreamInfoWrapperTest, ReturnCurrentProtocol) {
expectToPrintCurrentProtocol(Http::Protocol::Http2);
}

// Set, get and iterate request info dynamic metadata.
// Set, get and iterate stream info dynamic metadata.
TEST_F(LuaStreamInfoWrapperTest, SetGetAndIterateDynamicMetadata) {
const std::string SCRIPT{R"EOF(
function callMe(object)
Expand Down