public static final class Metadata.MetadataMatcher.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder> 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 | Method and Description |
|---|---|
Metadata.MetadataMatcher.Builder |
addAllPath(Iterable<? extends Metadata.MetadataMatcher.PathSegment> values)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.Builder |
addPath(int index,
Metadata.MetadataMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.Builder |
addPath(int index,
Metadata.MetadataMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.Builder |
addPath(Metadata.MetadataMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.Builder |
addPath(Metadata.MetadataMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.PathSegment.Builder |
addPathBuilder()
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.PathSegment.Builder |
addPathBuilder(int index)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
Metadata.MetadataMatcher |
build() |
Metadata.MetadataMatcher |
buildPartial() |
Metadata.MetadataMatcher.Builder |
clear() |
Metadata.MetadataMatcher.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
Metadata.MetadataMatcher.Builder |
clearFilter()
The filter name to retrieve the Struct from the Metadata.
|
Metadata.MetadataMatcher.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
Metadata.MetadataMatcher.Builder |
clearPath()
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.Builder |
clearValue()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
|
Metadata.MetadataMatcher.Builder |
clone() |
Metadata.MetadataMatcher |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
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.
|
Metadata.MetadataMatcher.PathSegment |
getPath(int index)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.PathSegment.Builder |
getPathBuilder(int index)
The path to retrieve the Value from the Struct.
|
List<Metadata.MetadataMatcher.PathSegment.Builder> |
getPathBuilderList()
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.
|
Value.ValueMatcher |
getValue()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
|
Value.ValueMatcher.Builder |
getValueBuilder()
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.
|
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() |
Metadata.MetadataMatcher.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
Metadata.MetadataMatcher.Builder |
mergeFrom(com.google.protobuf.Message other) |
Metadata.MetadataMatcher.Builder |
mergeFrom(Metadata.MetadataMatcher other) |
Metadata.MetadataMatcher.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
Metadata.MetadataMatcher.Builder |
mergeValue(Value.ValueMatcher value)
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
|
Metadata.MetadataMatcher.Builder |
removePath(int index)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
Metadata.MetadataMatcher.Builder |
setFilter(String value)
The filter name to retrieve the Struct from the Metadata.
|
Metadata.MetadataMatcher.Builder |
setFilterBytes(com.google.protobuf.ByteString value)
The filter name to retrieve the Struct from the Metadata.
|
Metadata.MetadataMatcher.Builder |
setPath(int index,
Metadata.MetadataMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.Builder |
setPath(int index,
Metadata.MetadataMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
|
Metadata.MetadataMatcher.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
Metadata.MetadataMatcher.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
Metadata.MetadataMatcher.Builder |
setValue(Value.ValueMatcher.Builder builderForValue)
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
|
Metadata.MetadataMatcher.Builder |
setValue(Value.ValueMatcher value)
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
|
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic Metadata.MetadataMatcher build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic Metadata.MetadataMatcher buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic Metadata.MetadataMatcher.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher.Builder mergeFrom(Metadata.MetadataMatcher other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public Metadata.MetadataMatcher.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<Metadata.MetadataMatcher.Builder>IOExceptionpublic 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 Metadata.MetadataMatcher.Builder setFilter(String value)
The filter name to retrieve the Struct from the Metadata.
string filter = 1 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder clearFilter()
The filter name to retrieve the Struct from the Metadata.
string filter = 1 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder setFilterBytes(com.google.protobuf.ByteString value)
The filter name to retrieve the Struct from the Metadata.
string filter = 1 [(.validate.rules) = { ... }public 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 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.Builder setPath(int index, Metadata.MetadataMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder setPath(int index, Metadata.MetadataMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder addPath(Metadata.MetadataMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder addPath(int index, Metadata.MetadataMatcher.PathSegment value)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder addPath(Metadata.MetadataMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder addPath(int index, Metadata.MetadataMatcher.PathSegment.Builder builderForValue)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder addAllPath(Iterable<? extends Metadata.MetadataMatcher.PathSegment> values)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder clearPath()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder removePath(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.PathSegment.Builder getPathBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public 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 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 Metadata.MetadataMatcher.PathSegment.Builder addPathBuilder()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.PathSegment.Builder addPathBuilder(int index)
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public List<Metadata.MetadataMatcher.PathSegment.Builder> getPathBuilderList()
The path to retrieve the Value from the Struct.
repeated .envoy.type.matcher.MetadataMatcher.PathSegment path = 2 [(.validate.rules) = { ... }public 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 Metadata.MetadataMatcher.Builder setValue(Value.ValueMatcher value)
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.ValueMatcher value = 3 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder setValue(Value.ValueMatcher.Builder builderForValue)
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.ValueMatcher value = 3 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder mergeValue(Value.ValueMatcher value)
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.ValueMatcher value = 3 [(.validate.rules) = { ... }public Metadata.MetadataMatcher.Builder clearValue()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.ValueMatcher value = 3 [(.validate.rules) = { ... }public Value.ValueMatcher.Builder getValueBuilder()
The MetadataMatcher is matched if the value retrieved by path is matched to this value.
.envoy.type.matcher.ValueMatcher value = 3 [(.validate.rules) = { ... }public 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 Metadata.MetadataMatcher.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>public final Metadata.MetadataMatcher.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Metadata.MetadataMatcher.Builder>Copyright © 2018 The Envoy Project. All rights reserved.