Class MappedAttributeBuilder
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classExtension to build custom attributes in the :ref:`request <envoy_v3_api_msg_service.ext_proc.v3.ProcessingRequest>` based on a configurable mapping.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanA map of request attributes to set in the attributes struct.booleanSimilar to ``mapped_request_attributes``, but for response attributes.booleanstatic MappedAttributeBuilderstatic final com.google.protobuf.Descriptors.DescriptorDeprecated.intA map of request attributes to set in the attributes struct.A map of request attributes to set in the attributes struct.getMappedRequestAttributesOrDefault(String key, String defaultValue) A map of request attributes to set in the attributes struct.A map of request attributes to set in the attributes struct.Deprecated.intSimilar to ``mapped_request_attributes``, but for response attributes.Similar to ``mapped_request_attributes``, but for response attributes.getMappedResponseAttributesOrDefault(String key, String defaultValue) Similar to ``mapped_request_attributes``, but for response attributes.Similar to ``mapped_request_attributes``, but for response attributes.com.google.protobuf.Parser<MappedAttributeBuilder>intinthashCode()protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableprotected com.google.protobuf.MapFieldReflectionAccessorinternalGetMapFieldReflection(int number) final booleannewBuilder(MappedAttributeBuilder prototype) protected MappedAttributeBuilder.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static MappedAttributeBuilderparseDelimitedFrom(InputStream input) static MappedAttributeBuilderparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MappedAttributeBuilderparseFrom(byte[] data) static MappedAttributeBuilderparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MappedAttributeBuilderparseFrom(com.google.protobuf.ByteString data) static MappedAttributeBuilderparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MappedAttributeBuilderparseFrom(com.google.protobuf.CodedInputStream input) static MappedAttributeBuilderparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MappedAttributeBuilderparseFrom(InputStream input) static MappedAttributeBuilderparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MappedAttributeBuilderparseFrom(ByteBuffer data) static MappedAttributeBuilderparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<MappedAttributeBuilder>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
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
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) - Overrides:
internalGetMapFieldReflectionin classcom.google.protobuf.GeneratedMessageV3
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getMappedRequestAttributesCount
public int getMappedRequestAttributesCount()Description copied from interface:MappedAttributeBuilderOrBuilderA 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:
getMappedRequestAttributesCountin interfaceMappedAttributeBuilderOrBuilder
-
containsMappedRequestAttributes
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:
containsMappedRequestAttributesin interfaceMappedAttributeBuilderOrBuilder
-
getMappedRequestAttributes
Deprecated.UsegetMappedRequestAttributesMap()instead.- Specified by:
getMappedRequestAttributesin interfaceMappedAttributeBuilderOrBuilder
-
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:
getMappedRequestAttributesMapin interfaceMappedAttributeBuilderOrBuilder
-
getMappedRequestAttributesOrDefault
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:
getMappedRequestAttributesOrDefaultin interfaceMappedAttributeBuilderOrBuilder
-
getMappedRequestAttributesOrThrow
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:
getMappedRequestAttributesOrThrowin interfaceMappedAttributeBuilderOrBuilder
-
getMappedResponseAttributesCount
public int getMappedResponseAttributesCount()Description copied from interface:MappedAttributeBuilderOrBuilderSimilar 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:
getMappedResponseAttributesCountin interfaceMappedAttributeBuilderOrBuilder
-
containsMappedResponseAttributes
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:
containsMappedResponseAttributesin interfaceMappedAttributeBuilderOrBuilder
-
getMappedResponseAttributes
Deprecated.UsegetMappedResponseAttributesMap()instead.- Specified by:
getMappedResponseAttributesin interfaceMappedAttributeBuilderOrBuilder
-
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:
getMappedResponseAttributesMapin interfaceMappedAttributeBuilderOrBuilder
-
getMappedResponseAttributesOrDefault
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:
getMappedResponseAttributesOrDefaultin interfaceMappedAttributeBuilderOrBuilder
-
getMappedResponseAttributesOrThrow
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:
getMappedResponseAttributesOrThrowin interfaceMappedAttributeBuilderOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.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
- Throws:
IOException
-
parseFrom
public static MappedAttributeBuilder parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- 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
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected MappedAttributeBuilder.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-