Dynamic Modules Early Header Mutation (proto)

This extension has the qualified name envoy.http.early_header_mutation.dynamic_modules

Note

This extension is functional but has not had substantial production burn time, use only with this caveat.

This extension is not hardened and should only be used in deployments where both the downstream and upstream are trusted.

Tip

This extension extends and can be used with the following extension category:

This extension must be configured with one of the following type URLs:

extensions.http.early_header_mutation.dynamic_modules.v3.DynamicModuleEarlyHeaderMutation

[extensions.http.early_header_mutation.dynamic_modules.v3.DynamicModuleEarlyHeaderMutation proto]

Configuration for the Dynamic Modules Early Header Mutation. This extension allows loading shared object files via dlopen to rewrite request headers before routing, tracing, request ID generation and any HTTP filter runs.

Exactly one instance is created per configured entry, on the main thread, and it is shared by every worker thread for the lifetime of the connection manager configuration. The module is therefore invoked concurrently and must treat its configuration as read-only.

The module can read and rewrite the request headers, and read the stream info attributes, dynamic metadata and filter state. Because the extension runs before routing and before the upstream request, the route, the response and every upstream attribute are not yet populated. The stream info is read-only at this point, so a module that needs to publish state for later extensions should do so from an HTTP filter instead.

When multiple early header mutation extensions are configured, they run in order and the module controls whether the ones after it run: see early_header_mutation_extensions.

{
  "dynamic_module_config": {...},
  "early_header_mutation_name": ...,
  "early_header_mutation_config": {...}
}
dynamic_module_config

(extensions.dynamic_modules.v3.DynamicModuleConfig, REQUIRED) Specifies the shared-object level configuration. This field is required.

Only sources that are available synchronously are supported, i.e. name, module.local, and a module.remote that is already present in the on-disk cache. A remote source that would need to be fetched is rejected, since the extension must be usable for the first request the connection manager serves.

early_header_mutation_name

(string) The name for this early header mutation configuration. If not specified, defaults to an empty string.

This can be used to distinguish between different early header mutation implementations inside a dynamic module. When Envoy receives this configuration, it passes the early_header_mutation_name to the dynamic module’s early header mutation config init function together with the early_header_mutation_config. That way a module can decide which in-module implementation to use based on the name at load time.

This is also used as the config_name tag of the dynamic_modules.module_load_error and dynamic_modules.config_init_error counters.

early_header_mutation_config

(Any) The configuration for the early header mutation chosen by early_header_mutation_name. If not specified, an empty configuration is passed to the module.

This is passed to the module’s early header mutation initialization function. Together with the early_header_mutation_name, the module can decide which in-module implementation to use and fine-tune its behavior.

google.protobuf.Struct is serialized as JSON before passing it to the module. google.protobuf.BytesValue and google.protobuf.StringValue are passed directly without the wrapper.

# Passing a JSON struct configuration
early_header_mutation_config:
  "@type": "type.googleapis.com/google.protobuf.Struct"
  value:
    copy_headers:
    - x-original-authority

# Passing a simple string configuration
early_header_mutation_config:
  "@type": "type.googleapis.com/google.protobuf.StringValue"
  value: "x-tenant-id"