public static final class Metadata.MetadataMatcher extends com.google.protobuf.GeneratedMessageV3 implements Metadata.MetadataMatcherOrBuilder
MetadataMatcher provides a general interface to check if a given value is matched in
:ref:`Metadata <envoy_api_msg_core.Metadata>`. It uses `filter` and `path` to retrieve the value
from the Metadata and then check if it's matched to the specified value.
For example, for the following Metadata:
.. code-block:: yaml
filter_metadata:
envoy.filters.http.rbac:
fields:
a:
struct_value:
fields:
b:
struct_value:
fields:
c:
string_value: pro
t:
list_value:
values:
- string_value: m
- string_value: n
The following MetadataMatcher is matched as the path [a, b, c] will retrieve a string value "pro"
from the Metadata which is matched to the specified prefix match.
.. code-block:: yaml
filter: envoy.filters.http.rbac
path:
- key: a
- key: b
- key: c
value:
string_match:
prefix: pr
The following MetadataMatcher is matched as the code will match one of the string values in the
list at the path [a, t].
.. code-block:: yaml
filter: envoy.filters.http.rbac
path:
- key: a
- key: t
value:
list_match:
one_of:
string_match:
exact: m
An example use of MetadataMatcher is specifying additional metadata in envoy.filters.http.rbac to
enforce access control based on dynamic metadata in a request. See :ref:`Permission
<envoy_api_msg_config.rbac.v2alpha.Permission>` and :ref:`Principal
<envoy_api_msg_config.rbac.v2alpha.Principal>`.
Protobuf type envoy.type.matcher.MetadataMatcher| Modifier and Type | Class and Description |
|---|---|
static class |
Metadata.MetadataMatcher.Builder
MetadataMatcher provides a general interface to check if a given value is matched in
:ref:`Metadata <envoy_api_msg_core.Metadata>`.
|
static class |
Metadata.MetadataMatcher.PathSegment
Specifies the segment in a path to retrieve value from Metadata.
|
static interface |
Metadata.MetadataMatcher.PathSegmentOrBuilder |
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| Modifier and Type | Field and Description |
|---|---|
static int |
FILTER_FIELD_NUMBER |
static int |
PATH_FIELD_NUMBER |
static int |
VALUE_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static Metadata.MetadataMatcher |
getDefaultInstance() |
Metadata.MetadataMatcher |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
String |
getFilter()
The filter name to retrieve the Struct from the Metadata.
|
com.google.protobuf.ByteString |
getFilterBytes()
The filter name to retrieve the Struct from the Metadata.
|
com.google.protobuf.Parser<Metadata.MetadataMatcher> |
getParserForType() |
Metadata.MetadataMatcher.PathSegment |
getPath(int index)
The path to retrieve the Value from the Struct.
|
int |
getPathCount()
The path to retrieve the Value from the Struct.
|
List<Metadata.MetadataMatcher.PathSegment> |
getPathList()
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.PathSegmentOrBuilder |
getPathOrBuilder(int index)
The path to retrieve the Value from the Struct.
|
List<? extends Metadata.MetadataMatcher.PathSegmentOrBuilder> |
getPathOrBuilderList()
The path to retrieve the Value from the Struct.
|
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
Value.ValueMatcher |
getValue()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
|
Value.ValueMatcherOrBuilder |
getValueOrBuilder()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
|
int |
hashCode() |
boolean |
hasValue()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Metadata.MetadataMatcher.Builder |
newBuilder() |
static Metadata.MetadataMatcher.Builder |
newBuilder(Metadata.MetadataMatcher prototype) |
Metadata.MetadataMatcher.Builder |
newBuilderForType() |
protected Metadata.MetadataMatcher.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static Metadata.MetadataMatcher |
parseDelimitedFrom(InputStream input) |
static Metadata.MetadataMatcher |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Metadata.MetadataMatcher |
parseFrom(byte[] data) |
static Metadata.MetadataMatcher |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Metadata.MetadataMatcher |
parseFrom(ByteBuffer data) |
static Metadata.MetadataMatcher |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Metadata.MetadataMatcher |
parseFrom(com.google.protobuf.ByteString data) |
static Metadata.MetadataMatcher |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Metadata.MetadataMatcher |
parseFrom(com.google.protobuf.CodedInputStream input) |
static Metadata.MetadataMatcher |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Metadata.MetadataMatcher |
parseFrom(InputStream input) |
static Metadata.MetadataMatcher |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<Metadata.MetadataMatcher> |
parser() |
Metadata.MetadataMatcher.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newBuilderForType, 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 FILTER_FIELD_NUMBER
public static final int PATH_FIELD_NUMBER
public static final int VALUE_FIELD_NUMBER
public 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 String getFilter()
The filter name to retrieve the Struct from the Metadata.
string filter = 1 [(.validate.rules) = { ... }getFilter in interface Metadata.MetadataMatcherOrBuilderpublic com.google.protobuf.ByteString getFilterBytes()
The filter name to retrieve the Struct from the Metadata.
string filter = 1 [(.validate.rules) = { ... }getFilterBytes in interface Metadata.MetadataMatcherOrBuilderpublic List<Metadata.MetadataMatcher.PathSegment> getPathList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathList in interface Metadata.MetadataMatcherOrBuilderpublic List<? extends Metadata.MetadataMatcher.PathSegmentOrBuilder> getPathOrBuilderList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathOrBuilderList in interface Metadata.MetadataMatcherOrBuilderpublic int getPathCount()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathCount in interface Metadata.MetadataMatcherOrBuilderpublic Metadata.MetadataMatcher.PathSegment getPath(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPath in interface Metadata.MetadataMatcherOrBuilderpublic Metadata.MetadataMatcher.PathSegmentOrBuilder getPathOrBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }getPathOrBuilder in interface Metadata.MetadataMatcherOrBuilderpublic boolean hasValue()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.ValueMatcher value = 3 [(.validate.rules) = { ... }hasValue in interface Metadata.MetadataMatcherOrBuilderpublic Value.ValueMatcher getValue()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.ValueMatcher value = 3 [(.validate.rules) = { ... }getValue in interface Metadata.MetadataMatcherOrBuilderpublic Value.ValueMatcherOrBuilder getValueOrBuilder()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.ValueMatcher value = 3 [(.validate.rules) = { ... }getValueOrBuilder in interface Metadata.MetadataMatcherOrBuilderpublic 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 Metadata.MetadataMatcher parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Metadata.MetadataMatcher parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Metadata.MetadataMatcher parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Metadata.MetadataMatcher parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Metadata.MetadataMatcher parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Metadata.MetadataMatcher parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Metadata.MetadataMatcher parseFrom(InputStream input) throws IOException
IOExceptionpublic static Metadata.MetadataMatcher parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Metadata.MetadataMatcher parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static Metadata.MetadataMatcher parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static Metadata.MetadataMatcher parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static Metadata.MetadataMatcher parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic Metadata.MetadataMatcher.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static Metadata.MetadataMatcher.Builder newBuilder()
public static Metadata.MetadataMatcher.Builder newBuilder(Metadata.MetadataMatcher prototype)
public Metadata.MetadataMatcher.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected Metadata.MetadataMatcher.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static Metadata.MetadataMatcher getDefaultInstance()
public static com.google.protobuf.Parser<Metadata.MetadataMatcher> parser()
public com.google.protobuf.Parser<Metadata.MetadataMatcher> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public Metadata.MetadataMatcher getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2018 The Envoy Project. All rights reserved.