Skip to content
32 changes: 22 additions & 10 deletions api/envoy/extensions/filters/http/ext_authz/v3/ext_authz.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import "envoy/config/core/v3/http_uri.proto";
import "envoy/type/matcher/v3/string.proto";
import "envoy/type/v3/http_status.proto";

import "google/protobuf/wrappers.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
Expand Down Expand Up @@ -134,6 +136,10 @@ message BufferSettings {
// The authorization request will be dispatched and no 413 HTTP error will be returned by the
// filter.
bool allow_partial_message = 2;

// If true, the body sent to the external authorization service is set with raw bytes, instead of
// UTF-8 string.
Comment thread
dio marked this conversation as resolved.
Outdated
bool pack_as_bytes = 3;
Comment thread
dio marked this conversation as resolved.
}

// HttpService is used for raw HTTP communication between the filter and the authorization service.
Expand Down Expand Up @@ -243,23 +249,29 @@ message ExtAuthzPerRoute {
}
}

// Extra settings for the check request. You can use this to provide extra context for the
// external authorization server on specific virtual hosts \ routes. For example, adding a context
// extension on the virtual host level can give the ext-authz server information on what virtual
// host is used without needing to parse the host header. If CheckSettings is specified in multiple
// per-filter-configs, they will be merged in order, and the result will be used.
// Extra settings for the check request.
//
// .. note::
//
// These settings are only applied to a filter configured with a
// :ref:`grpc_service<envoy_api_field_extensions.filters.http.ext_authz.v3.ExtAuthz.grpc_service>`.
message CheckSettings {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.http.ext_authz.v2.CheckSettings";

// Context extensions to set on the CheckRequest's
// :ref:`AttributeContext.context_extensions<envoy_api_field_service.auth.v3.AttributeContext.context_extensions>`
//
// Merge semantics for this field are such that keys from more specific configs override.
//
// .. note::
// You can use this to provide extra context for the external authorization server on specific
// virtual hosts/routes. For example, adding a context extension on the virtual host level can
// give the external authorization server information on what virtual host is used without needing
// to parse the host header. If CheckSettings is specified in multiple per-filter-configs, they
// will be merged in order, and the result will be used.
//
// These settings are only applied to a filter configured with a
// :ref:`grpc_service<envoy_api_field_extensions.filters.http.ext_authz.v3.ExtAuthz.grpc_service>`.
// Merge semantics for this field are such that keys from more specific configs override.
map<string, string> context_extensions = 1;

// Allow to override how request body is packed. If true, the body sent to the external
// authorization service is set with raw bytes, instead of UTF-8 string.
google.protobuf.BoolValue pack_as_bytes = 2;
Comment thread
dio marked this conversation as resolved.
Outdated
}
32 changes: 22 additions & 10 deletions api/envoy/extensions/filters/http/ext_authz/v4alpha/ext_authz.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion api/envoy/service/auth/v3/attribute_context.proto
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ message AttributeContext {

// This message defines attributes for an HTTP request.
// HTTP/1.x, HTTP/2, gRPC are all considered as HTTP requests.
// [#next-free-field: 12]
// [#next-free-field: 13]
message HttpRequest {
option (udpa.annotations.versioning).previous_message_type =
"envoy.service.auth.v2.AttributeContext.HttpRequest";
Expand Down Expand Up @@ -145,6 +145,12 @@ message AttributeContext {

// The HTTP request body.
string body = 11;

// The HTTP request body in bytes. This is used instead of
// :ref:`body <envoy_v3_api_field_service.auth.v3.AttributeContext.HttpRequest.body>` when
// :ref:`pack_as_bytes <envoy_api_field_extensions.filters.http.ext_authz.v3.BufferSettings.pack_as_bytes>`
// is set to true.
bytes raw_body = 12;
}

// The source of a network activity, such as starting a TCP connection.
Expand Down
8 changes: 7 additions & 1 deletion api/envoy/service/auth/v4alpha/attribute_context.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ New Features
* dynamic_forward_proxy: added :ref:`use_tcp_for_dns_lookups<envoy_v3_api_field_extensions.common.dynamic_forward_proxy.v3.DnsCacheConfig.use_tcp_for_dns_lookups>` option to use TCP for DNS lookups in order to match the DNS options for :ref:`Clusters<envoy_v3_api_msg_config.cluster.v3.Cluster>`.
* ext_authz filter: added support for emitting dynamic metadata for both :ref:`HTTP <config_http_filters_ext_authz_dynamic_metadata>` and :ref:`network <config_network_filters_ext_authz_dynamic_metadata>` filters.
The emitted dynamic metadata is set by :ref:`dynamic metadata <envoy_v3_api_field_service.auth.v3.CheckResponse.dynamic_metadata>` field in a returned :ref:`CheckResponse <envoy_v3_api_msg_service.auth.v3.CheckResponse>`.
* ext_authz filter: added support for sending :ref:`raw bytes as request body <envoy_v3_api_field_service.auth.v3.AttributeContext.HttpRequest.raw_body>` of a gRPC check request by setting :ref:`pack_as_bytes <envoy_v3_api_field_extensions.filters.http.ext_authz.v3.BufferSettings.pack_as_bytes>` to true, which is also overridable via the same flag in :ref:`ExtAuthzPerRoute.check_settings <envoy_v3_api_field_extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute.check_settings>`.
Comment thread
dio marked this conversation as resolved.
Outdated
* grpc-json: support specifying `response_body` field in for `google.api.HttpBody` message.
* hds: added :ref:`cluster_endpoints_health <envoy_v3_api_field_service.health.v3.EndpointHealthResponse.cluster_endpoints_health>` to HDS responses, keeping endpoints in the same groupings as they were configured in the HDS specifier by cluster and locality instead of as a flat list.
* hds: added :ref:`transport_socket_matches <envoy_v3_api_field_service.health.v3.ClusterHealthCheck.transport_socket_matches>` to HDS cluster health check specifier, so the existing match filter :ref:`transport_socket_match_criteria <envoy_v3_api_field_config.core.v3.HealthCheck.transport_socket_match_criteria>` in the repeated field :ref:`health_checks <envoy_v3_api_field_service.health.v3.ClusterHealthCheck.health_checks>` has context to match against. This unblocks support for health checks over HTTPS and HTTP/2.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions source/common/protobuf/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
DurationUtil::durationToMilliseconds((message).field_name())) \
: absl::nullopt)

// Obtain the optional_type value of a wrapped field (e.g. google.protobuf.BoolValue) if set.
// Otherwise, return the absl::nullopt.
#define PROTOBUF_GET_OPTIONAL_WRAPPED(message, field_name, optional_type) \
((message).has_##field_name() ? absl::optional<optional_type>((message).field_name().value()) \
: absl::nullopt)

// Obtain the milliseconds value of a google.protobuf.Duration field if set. Otherwise, throw a
// MissingFieldException.
#define PROTOBUF_GET_MS_REQUIRED(message, field_name) \
Expand Down
Loading