public final class HeaderMatcher extends com.google.protobuf.GeneratedMessageV3 implements HeaderMatcherOrBuilder
.. attention::
Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 *Host*
header. Thus, if attempting to match on *Host*, match on *:authority* instead.
.. attention::
To route on HTTP method, use the special HTTP/2 *:method* header. This works for both
HTTP/1 and HTTP/2 as Envoy normalizes headers. E.g.,
.. code-block:: json
{
"name": ":method",
"exact_match": "POST"
}
.. attention::
In the absence of any header match specifier, match will default to :ref:`present_match
<envoy_api_field_config.route.v3.HeaderMatcher.present_match>`. i.e, a request that has the :ref:`name
<envoy_api_field_config.route.v3.HeaderMatcher.name>` header will match, regardless of the header's
value.
[#next-major-version: HeaderMatcher should be refactored to use StringMatcher.]
[#next-free-field: 13]
Protobuf type envoy.config.route.v3.HeaderMatcher| Modifier and Type | Class and Description |
|---|---|
static class |
HeaderMatcher.Builder
.. attention::
Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 *Host*
header.
|
static class |
HeaderMatcher.HeaderMatchSpecifierCase |
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
CONTAINS_MATCH_FIELD_NUMBER |
static int |
EXACT_MATCH_FIELD_NUMBER |
static int |
INVERT_MATCH_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
PREFIX_MATCH_FIELD_NUMBER |
static int |
PRESENT_MATCH_FIELD_NUMBER |
static int |
RANGE_MATCH_FIELD_NUMBER |
static int |
SAFE_REGEX_MATCH_FIELD_NUMBER |
static int |
SUFFIX_MATCH_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getContainsMatch()
If specified, header match will be performed based on whether the header value contains
the given value or not.
|
com.google.protobuf.ByteString |
getContainsMatchBytes()
If specified, header match will be performed based on whether the header value contains
the given value or not.
|
static HeaderMatcher |
getDefaultInstance() |
HeaderMatcher |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
String |
getExactMatch()
If specified, header match will be performed based on the value of the header.
|
com.google.protobuf.ByteString |
getExactMatchBytes()
If specified, header match will be performed based on the value of the header.
|
HeaderMatcher.HeaderMatchSpecifierCase |
getHeaderMatchSpecifierCase() |
boolean |
getInvertMatch()
If specified, the match result will be inverted before checking.
|
String |
getName()
Specifies the name of the header in the request.
|
com.google.protobuf.ByteString |
getNameBytes()
Specifies the name of the header in the request.
|
com.google.protobuf.Parser<HeaderMatcher> |
getParserForType() |
String |
getPrefixMatch()
If specified, header match will be performed based on the prefix of the header value.
|
com.google.protobuf.ByteString |
getPrefixMatchBytes()
If specified, header match will be performed based on the prefix of the header value.
|
boolean |
getPresentMatch()
If specified, header match will be performed based on whether the header is in the
request.
|
Int64Range |
getRangeMatch()
If specified, header match will be performed based on range.
|
Int64RangeOrBuilder |
getRangeMatchOrBuilder()
If specified, header match will be performed based on range.
|
RegexMatcher |
getSafeRegexMatch()
If specified, this regex string is a regular expression rule which implies the entire request
header value must match the regex.
|
RegexMatcherOrBuilder |
getSafeRegexMatchOrBuilder()
If specified, this regex string is a regular expression rule which implies the entire request
header value must match the regex.
|
int |
getSerializedSize() |
String |
getSuffixMatch()
If specified, header match will be performed based on the suffix of the header value.
|
com.google.protobuf.ByteString |
getSuffixMatchBytes()
If specified, header match will be performed based on the suffix of the header value.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
boolean |
hasRangeMatch()
If specified, header match will be performed based on range.
|
boolean |
hasSafeRegexMatch()
If specified, this regex string is a regular expression rule which implies the entire request
header value must match the regex.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static HeaderMatcher.Builder |
newBuilder() |
static HeaderMatcher.Builder |
newBuilder(HeaderMatcher prototype) |
HeaderMatcher.Builder |
newBuilderForType() |
protected HeaderMatcher.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static HeaderMatcher |
parseDelimitedFrom(InputStream input) |
static HeaderMatcher |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HeaderMatcher |
parseFrom(byte[] data) |
static HeaderMatcher |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HeaderMatcher |
parseFrom(ByteBuffer data) |
static HeaderMatcher |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HeaderMatcher |
parseFrom(com.google.protobuf.ByteString data) |
static HeaderMatcher |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HeaderMatcher |
parseFrom(com.google.protobuf.CodedInputStream input) |
static HeaderMatcher |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HeaderMatcher |
parseFrom(InputStream input) |
static HeaderMatcher |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<HeaderMatcher> |
parser() |
HeaderMatcher.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, 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, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int NAME_FIELD_NUMBER
public static final int EXACT_MATCH_FIELD_NUMBER
public static final int SAFE_REGEX_MATCH_FIELD_NUMBER
public static final int RANGE_MATCH_FIELD_NUMBER
public static final int PRESENT_MATCH_FIELD_NUMBER
public static final int PREFIX_MATCH_FIELD_NUMBER
public static final int SUFFIX_MATCH_FIELD_NUMBER
public static final int CONTAINS_MATCH_FIELD_NUMBER
public static final int INVERT_MATCH_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public HeaderMatcher.HeaderMatchSpecifierCase getHeaderMatchSpecifierCase()
getHeaderMatchSpecifierCase in interface HeaderMatcherOrBuilderpublic String getName()
Specifies the name of the header in the request.
string name = 1 [(.validate.rules) = { ... }getName in interface HeaderMatcherOrBuilderpublic com.google.protobuf.ByteString getNameBytes()
Specifies the name of the header in the request.
string name = 1 [(.validate.rules) = { ... }getNameBytes in interface HeaderMatcherOrBuilderpublic String getExactMatch()
If specified, header match will be performed based on the value of the header.
string exact_match = 4;getExactMatch in interface HeaderMatcherOrBuilderpublic com.google.protobuf.ByteString getExactMatchBytes()
If specified, header match will be performed based on the value of the header.
string exact_match = 4;getExactMatchBytes in interface HeaderMatcherOrBuilderpublic boolean hasSafeRegexMatch()
If specified, this regex string is a regular expression rule which implies the entire request header value must match the regex. The rule will not match if only a subsequence of the request header value matches the regex.
.envoy.type.matcher.v3.RegexMatcher safe_regex_match = 11;hasSafeRegexMatch in interface HeaderMatcherOrBuilderpublic RegexMatcher getSafeRegexMatch()
If specified, this regex string is a regular expression rule which implies the entire request header value must match the regex. The rule will not match if only a subsequence of the request header value matches the regex.
.envoy.type.matcher.v3.RegexMatcher safe_regex_match = 11;getSafeRegexMatch in interface HeaderMatcherOrBuilderpublic RegexMatcherOrBuilder getSafeRegexMatchOrBuilder()
If specified, this regex string is a regular expression rule which implies the entire request header value must match the regex. The rule will not match if only a subsequence of the request header value matches the regex.
.envoy.type.matcher.v3.RegexMatcher safe_regex_match = 11;getSafeRegexMatchOrBuilder in interface HeaderMatcherOrBuilderpublic boolean hasRangeMatch()
If specified, header match will be performed based on range. The rule will match if the request header value is within this range. The entire request header value must represent an integer in base 10 notation: consisting of an optional plus or minus sign followed by a sequence of digits. The rule will not match if the header value does not represent an integer. Match will fail for empty values, floating point numbers or if only a subsequence of the header value is an integer. Examples: * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9, "-1somestring"
.envoy.type.v3.Int64Range range_match = 6;hasRangeMatch in interface HeaderMatcherOrBuilderpublic Int64Range getRangeMatch()
If specified, header match will be performed based on range. The rule will match if the request header value is within this range. The entire request header value must represent an integer in base 10 notation: consisting of an optional plus or minus sign followed by a sequence of digits. The rule will not match if the header value does not represent an integer. Match will fail for empty values, floating point numbers or if only a subsequence of the header value is an integer. Examples: * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9, "-1somestring"
.envoy.type.v3.Int64Range range_match = 6;getRangeMatch in interface HeaderMatcherOrBuilderpublic Int64RangeOrBuilder getRangeMatchOrBuilder()
If specified, header match will be performed based on range. The rule will match if the request header value is within this range. The entire request header value must represent an integer in base 10 notation: consisting of an optional plus or minus sign followed by a sequence of digits. The rule will not match if the header value does not represent an integer. Match will fail for empty values, floating point numbers or if only a subsequence of the header value is an integer. Examples: * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9, "-1somestring"
.envoy.type.v3.Int64Range range_match = 6;getRangeMatchOrBuilder in interface HeaderMatcherOrBuilderpublic boolean getPresentMatch()
If specified, header match will be performed based on whether the header is in the request.
bool present_match = 7;getPresentMatch in interface HeaderMatcherOrBuilderpublic String getPrefixMatch()
If specified, header match will be performed based on the prefix of the header value. Note: empty prefix is not allowed, please use present_match instead. Examples: * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
string prefix_match = 9 [(.validate.rules) = { ... }getPrefixMatch in interface HeaderMatcherOrBuilderpublic com.google.protobuf.ByteString getPrefixMatchBytes()
If specified, header match will be performed based on the prefix of the header value. Note: empty prefix is not allowed, please use present_match instead. Examples: * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
string prefix_match = 9 [(.validate.rules) = { ... }getPrefixMatchBytes in interface HeaderMatcherOrBuilderpublic String getSuffixMatch()
If specified, header match will be performed based on the suffix of the header value. Note: empty suffix is not allowed, please use present_match instead. Examples: * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
string suffix_match = 10 [(.validate.rules) = { ... }getSuffixMatch in interface HeaderMatcherOrBuilderpublic com.google.protobuf.ByteString getSuffixMatchBytes()
If specified, header match will be performed based on the suffix of the header value. Note: empty suffix is not allowed, please use present_match instead. Examples: * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
string suffix_match = 10 [(.validate.rules) = { ... }getSuffixMatchBytes in interface HeaderMatcherOrBuilderpublic String getContainsMatch()
If specified, header match will be performed based on whether the header value contains the given value or not. Note: empty contains match is not allowed, please use present_match instead. Examples: * The value *abcd* matches the value *xyzabcdpqr*, but not for *xyzbcdpqr*.
string contains_match = 12 [(.validate.rules) = { ... }getContainsMatch in interface HeaderMatcherOrBuilderpublic com.google.protobuf.ByteString getContainsMatchBytes()
If specified, header match will be performed based on whether the header value contains the given value or not. Note: empty contains match is not allowed, please use present_match instead. Examples: * The value *abcd* matches the value *xyzabcdpqr*, but not for *xyzbcdpqr*.
string contains_match = 12 [(.validate.rules) = { ... }getContainsMatchBytes in interface HeaderMatcherOrBuilderpublic boolean getInvertMatch()
If specified, the match result will be inverted before checking. Defaults to false.
Examples:
* The regex ``\d{3}`` does not match the value *1234*, so it will match when inverted.
* The range [-10,0) will match the value -1, so it will not match when inverted.
bool invert_match = 8;getInvertMatch in interface HeaderMatcherOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static HeaderMatcher parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HeaderMatcher parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HeaderMatcher parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HeaderMatcher parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HeaderMatcher parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HeaderMatcher parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HeaderMatcher parseFrom(InputStream input) throws IOException
IOExceptionpublic static HeaderMatcher parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static HeaderMatcher parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static HeaderMatcher parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static HeaderMatcher parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static HeaderMatcher parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic HeaderMatcher.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static HeaderMatcher.Builder newBuilder()
public static HeaderMatcher.Builder newBuilder(HeaderMatcher prototype)
public HeaderMatcher.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected HeaderMatcher.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static HeaderMatcher getDefaultInstance()
public static com.google.protobuf.Parser<HeaderMatcher> parser()
public com.google.protobuf.Parser<HeaderMatcher> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public HeaderMatcher getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2018–2021 The Envoy Project. All rights reserved.