java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
io.envoyproxy.envoy.extensions.http.ext_proc.processing_request_modifiers.mapped_attribute_builder.v3.MappedAttributeBuilder
All Implemented Interfaces:
com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, MappedAttributeBuilderOrBuilder, Serializable

public final class MappedAttributeBuilder extends com.google.protobuf.GeneratedMessageV3 implements MappedAttributeBuilderOrBuilder
 Extension to build custom attributes in the :ref:`request
 <envoy_v3_api_msg_service.ext_proc.v3.ProcessingRequest>` based on a configurable mapping. The
 native implementation uses the CEL expression as the key, which is not always desirable. Using this
 extension, one can re-map a CEL expression that references internal filter state into a more
 user-friendly key that decouples the value from the underlying filter implementation.

 If a given CEL expression fails to eval, it will not be present in the attributes struct.

 If this extension is configured, then the original :ref:`ProcessingRequest
 <envoy_v3_api_msg_service.ext_proc.v3.ProcessingRequest>`'s ``request_attributes`` are ignored,
 and all attributes should be explicitly set via this extension.

 An example configuration may look like so:

 .. code-block:: yaml

    mapped_request_attributes:
      "request.path": "request.path"
      "source.country": "metadata.filter_metadata['com.example.location_filter']['country_code']"

 In the above example, the complex filter_metadata expression is evaluated via CEL, and the value
 is stored under the friendlier ``source.country`` key. ``The ProcessingRequest`` would look like:

 .. code-block:: text

    attributes {
      key: "envoy.filters.http.ext_proc"
      value {
        fields {
          key: "request.path"
          value {
            string_value: "/profile"
          }
        }
        fields {
          key: "source.country"
          value {
            string_value: "US"
          }
        }
      }
    }

 .. note::
   Processing request modifiers are currently in alpha.
 
Protobuf type envoy.extensions.http.ext_proc.processing_request_modifiers.mapped_attribute_builder.v3.MappedAttributeBuilder
See Also:
  • Field Details

    • MAPPED_REQUEST_ATTRIBUTES_FIELD_NUMBER

      public static final int MAPPED_REQUEST_ATTRIBUTES_FIELD_NUMBER
      See Also:
    • MAPPED_RESPONSE_ATTRIBUTES_FIELD_NUMBER

      public static final int MAPPED_RESPONSE_ATTRIBUTES_FIELD_NUMBER
      See Also:
  • Method Details

    • newInstance

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance in class com.google.protobuf.GeneratedMessageV3
    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessageV3
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
    • getMappedRequestAttributesCount

      public int getMappedRequestAttributesCount()
      Description copied from interface: MappedAttributeBuilderOrBuilder
       A map of request attributes to set in the attributes struct.
       The key is the attribute name, the value is the attribute value,
       interpretable by CEL. This allows for the re-mapping of attributes, which is not supported
       by the native attribute building logic.
       
      map<string, string> mapped_request_attributes = 1;
      Specified by:
      getMappedRequestAttributesCount in interface MappedAttributeBuilderOrBuilder
    • containsMappedRequestAttributes

      public boolean containsMappedRequestAttributes(String key)
       A map of request attributes to set in the attributes struct.
       The key is the attribute name, the value is the attribute value,
       interpretable by CEL. This allows for the re-mapping of attributes, which is not supported
       by the native attribute building logic.
       
      map<string, string> mapped_request_attributes = 1;
      Specified by:
      containsMappedRequestAttributes in interface MappedAttributeBuilderOrBuilder
    • getMappedRequestAttributes

      @Deprecated public Map<String,String> getMappedRequestAttributes()
      Deprecated.
      Specified by:
      getMappedRequestAttributes in interface MappedAttributeBuilderOrBuilder
    • getMappedRequestAttributesMap

      public Map<String,String> getMappedRequestAttributesMap()
       A map of request attributes to set in the attributes struct.
       The key is the attribute name, the value is the attribute value,
       interpretable by CEL. This allows for the re-mapping of attributes, which is not supported
       by the native attribute building logic.
       
      map<string, string> mapped_request_attributes = 1;
      Specified by:
      getMappedRequestAttributesMap in interface MappedAttributeBuilderOrBuilder
    • getMappedRequestAttributesOrDefault

      public String getMappedRequestAttributesOrDefault(String key, String defaultValue)
       A map of request attributes to set in the attributes struct.
       The key is the attribute name, the value is the attribute value,
       interpretable by CEL. This allows for the re-mapping of attributes, which is not supported
       by the native attribute building logic.
       
      map<string, string> mapped_request_attributes = 1;
      Specified by:
      getMappedRequestAttributesOrDefault in interface MappedAttributeBuilderOrBuilder
    • getMappedRequestAttributesOrThrow

      public String getMappedRequestAttributesOrThrow(String key)
       A map of request attributes to set in the attributes struct.
       The key is the attribute name, the value is the attribute value,
       interpretable by CEL. This allows for the re-mapping of attributes, which is not supported
       by the native attribute building logic.
       
      map<string, string> mapped_request_attributes = 1;
      Specified by:
      getMappedRequestAttributesOrThrow in interface MappedAttributeBuilderOrBuilder
    • getMappedResponseAttributesCount

      public int getMappedResponseAttributesCount()
      Description copied from interface: MappedAttributeBuilderOrBuilder
       Similar to ``mapped_request_attributes``, but for response attributes. The
       response nomenclature here just indicates that the attributes, whatever they may be, are sent
       with a response headers, body, or trailers ext_proc call.
       If a value contains a request key, e.g., ``request.host``, then the attribute would
       just be sent along in the response. This is useful if a given ext_proc extension is only
       enabled for response handling, e.g., ``RESPONSE_HEADERS`` but the backend wants to access request
       metadata.
       
      map<string, string> mapped_response_attributes = 2;
      Specified by:
      getMappedResponseAttributesCount in interface MappedAttributeBuilderOrBuilder
    • containsMappedResponseAttributes

      public boolean containsMappedResponseAttributes(String key)
       Similar to ``mapped_request_attributes``, but for response attributes. The
       response nomenclature here just indicates that the attributes, whatever they may be, are sent
       with a response headers, body, or trailers ext_proc call.
       If a value contains a request key, e.g., ``request.host``, then the attribute would
       just be sent along in the response. This is useful if a given ext_proc extension is only
       enabled for response handling, e.g., ``RESPONSE_HEADERS`` but the backend wants to access request
       metadata.
       
      map<string, string> mapped_response_attributes = 2;
      Specified by:
      containsMappedResponseAttributes in interface MappedAttributeBuilderOrBuilder
    • getMappedResponseAttributes

      @Deprecated public Map<String,String> getMappedResponseAttributes()
      Deprecated.
      Specified by:
      getMappedResponseAttributes in interface MappedAttributeBuilderOrBuilder
    • getMappedResponseAttributesMap

      public Map<String,String> getMappedResponseAttributesMap()
       Similar to ``mapped_request_attributes``, but for response attributes. The
       response nomenclature here just indicates that the attributes, whatever they may be, are sent
       with a response headers, body, or trailers ext_proc call.
       If a value contains a request key, e.g., ``request.host``, then the attribute would
       just be sent along in the response. This is useful if a given ext_proc extension is only
       enabled for response handling, e.g., ``RESPONSE_HEADERS`` but the backend wants to access request
       metadata.
       
      map<string, string> mapped_response_attributes = 2;
      Specified by:
      getMappedResponseAttributesMap in interface MappedAttributeBuilderOrBuilder
    • getMappedResponseAttributesOrDefault

      public String getMappedResponseAttributesOrDefault(String key, String defaultValue)
       Similar to ``mapped_request_attributes``, but for response attributes. The
       response nomenclature here just indicates that the attributes, whatever they may be, are sent
       with a response headers, body, or trailers ext_proc call.
       If a value contains a request key, e.g., ``request.host``, then the attribute would
       just be sent along in the response. This is useful if a given ext_proc extension is only
       enabled for response handling, e.g., ``RESPONSE_HEADERS`` but the backend wants to access request
       metadata.
       
      map<string, string> mapped_response_attributes = 2;
      Specified by:
      getMappedResponseAttributesOrDefault in interface MappedAttributeBuilderOrBuilder
    • getMappedResponseAttributesOrThrow

      public String getMappedResponseAttributesOrThrow(String key)
       Similar to ``mapped_request_attributes``, but for response attributes. The
       response nomenclature here just indicates that the attributes, whatever they may be, are sent
       with a response headers, body, or trailers ext_proc call.
       If a value contains a request key, e.g., ``request.host``, then the attribute would
       just be sent along in the response. This is useful if a given ext_proc extension is only
       enabled for response handling, e.g., ``RESPONSE_HEADERS`` but the backend wants to access request
       metadata.
       
      map<string, string> mapped_response_attributes = 2;
      Specified by:
      getMappedResponseAttributesOrThrow in interface MappedAttributeBuilderOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessageV3
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessageV3
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static MappedAttributeBuilder parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MappedAttributeBuilder parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MappedAttributeBuilder parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MappedAttributeBuilder parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MappedAttributeBuilder parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MappedAttributeBuilder parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MappedAttributeBuilder parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static MappedAttributeBuilder parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static MappedAttributeBuilder parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static MappedAttributeBuilder parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static MappedAttributeBuilder parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static MappedAttributeBuilder parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public MappedAttributeBuilder.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static MappedAttributeBuilder.Builder newBuilder()
    • newBuilder

      public static MappedAttributeBuilder.Builder newBuilder(MappedAttributeBuilder prototype)
    • toBuilder

      public MappedAttributeBuilder.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected MappedAttributeBuilder.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
      Specified by:
      newBuilderForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstance

      public static MappedAttributeBuilder getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<MappedAttributeBuilder> parser()
    • getParserForType

      public com.google.protobuf.Parser<MappedAttributeBuilder> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstanceForType

      public MappedAttributeBuilder getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder