Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: envoy/config/rbac/v3/rbac.proto
package io.envoyproxy.envoy.config.rbac.v3;
/**
*
* Role Based Access Control (RBAC) provides service-level and method-level access control for a
* service. Requests are allowed or denied based on the ``action`` and whether a matching policy is
* found. For instance, if the action is ALLOW and a matching policy is found the request should be
* allowed.
* RBAC can also be used to make access logging decisions by communicating with access loggers
* through dynamic metadata. When the action is LOG and at least one policy matches, the
* ``access_log_hint`` value in the shared key namespace 'envoy.common' is set to ``true`` indicating
* the request should be logged.
* Here is an example of RBAC configuration. It has two policies:
* * Service account ``cluster.local/ns/default/sa/admin`` has full access to the service, and so
* does "cluster.local/ns/default/sa/superuser".
* * Any user can read (``GET``) the service at paths with prefix ``/products``, so long as the
* destination port is either 80 or 443.
* .. code-block:: yaml
* action: ALLOW
* policies:
* "service-admin":
* permissions:
* - any: true
* principals:
* - authenticated:
* principal_name:
* exact: "cluster.local/ns/default/sa/admin"
* - authenticated:
* principal_name:
* exact: "cluster.local/ns/default/sa/superuser"
* "product-viewer":
* permissions:
* - and_rules:
* rules:
* - header:
* name: ":method"
* string_match:
* exact: "GET"
* - url_path:
* path: { prefix: "/products" }
* - or_rules:
* rules:
* - destination_port: 80
* - destination_port: 443
* principals:
* - any: true
*
*
* Protobuf type {@code envoy.config.rbac.v3.RBAC}
*/
public final class RBAC extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:envoy.config.rbac.v3.RBAC)
RBACOrBuilder {
private static final long serialVersionUID = 0L;
// Use RBAC.newBuilder() to construct.
private RBAC(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private RBAC() {
action_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new RBAC();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RBAC(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
action_ = rawValue;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
policies_ = com.google.protobuf.MapField.newMapField(
PoliciesDefaultEntryHolder.defaultEntry);
mutable_bitField0_ |= 0x00000001;
}
com.google.protobuf.MapEntry
policies__ = input.readMessage(
PoliciesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
policies_.getMutableMap().put(
policies__.getKey(), policies__.getValue());
break;
}
case 26: {
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.Builder subBuilder = null;
if (auditLoggingOptions_ != null) {
subBuilder = auditLoggingOptions_.toBuilder();
}
auditLoggingOptions_ = input.readMessage(io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(auditLoggingOptions_);
auditLoggingOptions_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.config.rbac.v3.RbacProto.internal_static_envoy_config_rbac_v3_RBAC_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 2:
return internalGetPolicies();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.config.rbac.v3.RbacProto.internal_static_envoy_config_rbac_v3_RBAC_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.config.rbac.v3.RBAC.class, io.envoyproxy.envoy.config.rbac.v3.RBAC.Builder.class);
}
/**
*
* Should we do safe-list or block-list style access control?
*
* The policies grant access to principals. The rest are denied. This is safe-list style
* access control. This is the default type.
*
*
* ALLOW = 0;
*/
ALLOW(0),
/**
*
* The policies deny access to principals. The rest are allowed. This is block-list style
* access control.
*
*
* DENY = 1;
*/
DENY(1),
/**
*
* The policies set the ``access_log_hint`` dynamic metadata key based on if requests match.
* All requests are allowed.
*
*
* LOG = 2;
*/
LOG(2),
UNRECOGNIZED(-1),
;
/**
*
* The policies grant access to principals. The rest are denied. This is safe-list style
* access control. This is the default type.
*
*
* ALLOW = 0;
*/
public static final int ALLOW_VALUE = 0;
/**
*
* The policies deny access to principals. The rest are allowed. This is block-list style
* access control.
*
*
* DENY = 1;
*/
public static final int DENY_VALUE = 1;
/**
*
* The policies set the ``access_log_hint`` dynamic metadata key based on if requests match.
* All requests are allowed.
*
*
* LOG = 2;
*/
public static final int LOG_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Action valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Action forNumber(int value) {
switch (value) {
case 0: return ALLOW;
case 1: return DENY;
case 2: return LOG;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Action> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Action findValueByNumber(int number) {
return Action.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return io.envoyproxy.envoy.config.rbac.v3.RBAC.getDescriptor().getEnumTypes().get(0);
}
private static final Action[] VALUES = values();
public static Action valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Action(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:envoy.config.rbac.v3.RBAC.Action)
}
public interface AuditLoggingOptionsOrBuilder extends
// @@protoc_insertion_point(interface_extends:envoy.config.rbac.v3.RBAC.AuditLoggingOptions)
com.google.protobuf.MessageOrBuilder {
/**
*
* Condition for the audit logging to happen.
* If this condition is met, all the audit loggers configured here will be invoked.
* [#not-implemented-hide:]
*
*
* .envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition audit_condition = 1 [(.validate.rules) = { ... }
* @return The enum numeric value on the wire for auditCondition.
*/
int getAuditConditionValue();
/**
*
* Condition for the audit logging to happen.
* If this condition is met, all the audit loggers configured here will be invoked.
* [#not-implemented-hide:]
*
*
* NONE = 0;
*/
public static final int NONE_VALUE = 0;
/**
*
* Audit when RBAC denies the request.
*
*
* ON_DENY = 1;
*/
public static final int ON_DENY_VALUE = 1;
/**
*
* Audit when RBAC allows the request.
*
*
* ON_ALLOW = 2;
*/
public static final int ON_ALLOW_VALUE = 2;
/**
*
* Audit whether RBAC allows or denies the request.
*
*
* ON_DENY_AND_ALLOW = 3;
*/
public static final int ON_DENY_AND_ALLOW_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static AuditCondition valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static AuditCondition forNumber(int value) {
switch (value) {
case 0: return NONE;
case 1: return ON_DENY;
case 2: return ON_ALLOW;
case 3: return ON_DENY_AND_ALLOW;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
AuditCondition> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public AuditCondition findValueByNumber(int number) {
return AuditCondition.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.getDescriptor().getEnumTypes().get(0);
}
private static final AuditCondition[] VALUES = values();
public static AuditCondition valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private AuditCondition(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition)
}
public interface AuditLoggerConfigOrBuilder extends
// @@protoc_insertion_point(interface_extends:envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig)
com.google.protobuf.MessageOrBuilder {
/**
*
* If true, when the logger is not supported, the data plane will not NACK but simply ignore it.
*
*
* bool is_optional = 2;
* @param value The isOptional to set.
* @return This builder for chaining.
*/
public Builder setIsOptional(boolean value) {
isOptional_ = value;
onChanged();
return this;
}
/**
*
* If true, when the logger is not supported, the data plane will not NACK but simply ignore it.
*
*
* bool is_optional = 2;
* @return This builder for chaining.
*/
public Builder clearIsOptional() {
isOptional_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig)
}
// @@protoc_insertion_point(class_scope:envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig)
private static final io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig();
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public AuditLoggerConfig parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new AuditLoggerConfig(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int AUDIT_CONDITION_FIELD_NUMBER = 1;
private int auditCondition_;
/**
*
* Condition for the audit logging to happen.
* If this condition is met, all the audit loggers configured here will be invoked.
* [#not-implemented-hide:]
*
*
* .envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition audit_condition = 1 [(.validate.rules) = { ... }
* @return The enum numeric value on the wire for auditCondition.
*/
@java.lang.Override public int getAuditConditionValue() {
return auditCondition_;
}
/**
*
* Condition for the audit logging to happen.
* If this condition is met, all the audit loggers configured here will be invoked.
* [#not-implemented-hide:]
*
*
* .envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition audit_condition = 1 [(.validate.rules) = { ... }
* @return The auditCondition.
*/
@java.lang.Override public io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition getAuditCondition() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition result = io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition.valueOf(auditCondition_);
return result == null ? io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition.UNRECOGNIZED : result;
}
public static final int LOGGER_CONFIGS_FIELD_NUMBER = 2;
private java.util.List loggerConfigs_;
/**
*
* Configurations for RBAC-based authorization audit loggers.
* [#not-implemented-hide:]
*
* Configurations for RBAC-based authorization audit loggers.
* [#not-implemented-hide:]
*
*
* repeated .envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig logger_configs = 2;
*/
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfigOrBuilder getLoggerConfigsOrBuilder(
int index) {
return loggerConfigs_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (auditCondition_ != io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition.NONE.getNumber()) {
output.writeEnum(1, auditCondition_);
}
for (int i = 0; i < loggerConfigs_.size(); i++) {
output.writeMessage(2, loggerConfigs_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (auditCondition_ != io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition.NONE.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, auditCondition_);
}
for (int i = 0; i < loggerConfigs_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, loggerConfigs_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions)) {
return super.equals(obj);
}
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions other = (io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions) obj;
if (auditCondition_ != other.auditCondition_) return false;
if (!getLoggerConfigsList()
.equals(other.getLoggerConfigsList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + AUDIT_CONDITION_FIELD_NUMBER;
hash = (53 * hash) + auditCondition_;
if (getLoggerConfigsCount() > 0) {
hash = (37 * hash) + LOGGER_CONFIGS_FIELD_NUMBER;
hash = (53 * hash) + getLoggerConfigsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code envoy.config.rbac.v3.RBAC.AuditLoggingOptions}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:envoy.config.rbac.v3.RBAC.AuditLoggingOptions)
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptionsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.config.rbac.v3.RbacProto.internal_static_envoy_config_rbac_v3_RBAC_AuditLoggingOptions_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.config.rbac.v3.RbacProto.internal_static_envoy_config_rbac_v3_RBAC_AuditLoggingOptions_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.class, io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.Builder.class);
}
// Construct using io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getLoggerConfigsFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
auditCondition_ = 0;
if (loggerConfigsBuilder_ == null) {
loggerConfigs_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
loggerConfigsBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.envoyproxy.envoy.config.rbac.v3.RbacProto.internal_static_envoy_config_rbac_v3_RBAC_AuditLoggingOptions_descriptor;
}
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions getDefaultInstanceForType() {
return io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.getDefaultInstance();
}
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions build() {
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions buildPartial() {
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions result = new io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions(this);
int from_bitField0_ = bitField0_;
result.auditCondition_ = auditCondition_;
if (loggerConfigsBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
loggerConfigs_ = java.util.Collections.unmodifiableList(loggerConfigs_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.loggerConfigs_ = loggerConfigs_;
} else {
result.loggerConfigs_ = loggerConfigsBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions) {
return mergeFrom((io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions other) {
if (other == io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.getDefaultInstance()) return this;
if (other.auditCondition_ != 0) {
setAuditConditionValue(other.getAuditConditionValue());
}
if (loggerConfigsBuilder_ == null) {
if (!other.loggerConfigs_.isEmpty()) {
if (loggerConfigs_.isEmpty()) {
loggerConfigs_ = other.loggerConfigs_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureLoggerConfigsIsMutable();
loggerConfigs_.addAll(other.loggerConfigs_);
}
onChanged();
}
} else {
if (!other.loggerConfigs_.isEmpty()) {
if (loggerConfigsBuilder_.isEmpty()) {
loggerConfigsBuilder_.dispose();
loggerConfigsBuilder_ = null;
loggerConfigs_ = other.loggerConfigs_;
bitField0_ = (bitField0_ & ~0x00000001);
loggerConfigsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getLoggerConfigsFieldBuilder() : null;
} else {
loggerConfigsBuilder_.addAllMessages(other.loggerConfigs_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int auditCondition_ = 0;
/**
*
* Condition for the audit logging to happen.
* If this condition is met, all the audit loggers configured here will be invoked.
* [#not-implemented-hide:]
*
*
* .envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition audit_condition = 1 [(.validate.rules) = { ... }
* @return The enum numeric value on the wire for auditCondition.
*/
@java.lang.Override public int getAuditConditionValue() {
return auditCondition_;
}
/**
*
* Condition for the audit logging to happen.
* If this condition is met, all the audit loggers configured here will be invoked.
* [#not-implemented-hide:]
*
*
* .envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition audit_condition = 1 [(.validate.rules) = { ... }
* @param value The enum numeric value on the wire for auditCondition to set.
* @return This builder for chaining.
*/
public Builder setAuditConditionValue(int value) {
auditCondition_ = value;
onChanged();
return this;
}
/**
*
* Condition for the audit logging to happen.
* If this condition is met, all the audit loggers configured here will be invoked.
* [#not-implemented-hide:]
*
*
* .envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition audit_condition = 1 [(.validate.rules) = { ... }
* @return The auditCondition.
*/
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition getAuditCondition() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition result = io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition.valueOf(auditCondition_);
return result == null ? io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition.UNRECOGNIZED : result;
}
/**
*
* Condition for the audit logging to happen.
* If this condition is met, all the audit loggers configured here will be invoked.
* [#not-implemented-hide:]
*
*
* .envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition audit_condition = 1 [(.validate.rules) = { ... }
* @param value The auditCondition to set.
* @return This builder for chaining.
*/
public Builder setAuditCondition(io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditCondition value) {
if (value == null) {
throw new NullPointerException();
}
auditCondition_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Condition for the audit logging to happen.
* If this condition is met, all the audit loggers configured here will be invoked.
* [#not-implemented-hide:]
*
* Configurations for RBAC-based authorization audit loggers.
* [#not-implemented-hide:]
*
*
* repeated .envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig logger_configs = 2;
*/
public java.util.List
getLoggerConfigsBuilderList() {
return getLoggerConfigsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig, io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig.Builder, io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfigOrBuilder>
getLoggerConfigsFieldBuilder() {
if (loggerConfigsBuilder_ == null) {
loggerConfigsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig, io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfig.Builder, io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions.AuditLoggerConfigOrBuilder>(
loggerConfigs_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
loggerConfigs_ = null;
}
return loggerConfigsBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:envoy.config.rbac.v3.RBAC.AuditLoggingOptions)
}
// @@protoc_insertion_point(class_scope:envoy.config.rbac.v3.RBAC.AuditLoggingOptions)
private static final io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions();
}
public static io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public AuditLoggingOptions parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new AuditLoggingOptions(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int ACTION_FIELD_NUMBER = 1;
private int action_;
/**
*
* The action to take if a policy matches. Every action either allows or denies a request,
* and can also carry out action-specific operations.
* Actions:
* * ``ALLOW``: Allows the request if and only if there is a policy that matches
* the request.
* * ``DENY``: Allows the request if and only if there are no policies that
* match the request.
* * ``LOG``: Allows all requests. If at least one policy matches, the dynamic
* metadata key ``access_log_hint`` is set to the value ``true`` under the shared
* key namespace ``envoy.common``. If no policies match, it is set to ``false``.
* Other actions do not modify this key.
*
*
* .envoy.config.rbac.v3.RBAC.Action action = 1 [(.validate.rules) = { ... }
* @return The enum numeric value on the wire for action.
*/
@java.lang.Override public int getActionValue() {
return action_;
}
/**
*
* The action to take if a policy matches. Every action either allows or denies a request,
* and can also carry out action-specific operations.
* Actions:
* * ``ALLOW``: Allows the request if and only if there is a policy that matches
* the request.
* * ``DENY``: Allows the request if and only if there are no policies that
* match the request.
* * ``LOG``: Allows all requests. If at least one policy matches, the dynamic
* metadata key ``access_log_hint`` is set to the value ``true`` under the shared
* key namespace ``envoy.common``. If no policies match, it is set to ``false``.
* Other actions do not modify this key.
*
*
* .envoy.config.rbac.v3.RBAC.Action action = 1 [(.validate.rules) = { ... }
* @return The action.
*/
@java.lang.Override public io.envoyproxy.envoy.config.rbac.v3.RBAC.Action getAction() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.config.rbac.v3.RBAC.Action result = io.envoyproxy.envoy.config.rbac.v3.RBAC.Action.valueOf(action_);
return result == null ? io.envoyproxy.envoy.config.rbac.v3.RBAC.Action.UNRECOGNIZED : result;
}
public static final int POLICIES_FIELD_NUMBER = 2;
private static final class PoliciesDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, io.envoyproxy.envoy.config.rbac.v3.Policy> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
io.envoyproxy.envoy.config.rbac.v3.RbacProto.internal_static_envoy_config_rbac_v3_RBAC_PoliciesEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.MESSAGE,
io.envoyproxy.envoy.config.rbac.v3.Policy.getDefaultInstance());
}
private com.google.protobuf.MapField<
java.lang.String, io.envoyproxy.envoy.config.rbac.v3.Policy> policies_;
private com.google.protobuf.MapField
internalGetPolicies() {
if (policies_ == null) {
return com.google.protobuf.MapField.emptyMapField(
PoliciesDefaultEntryHolder.defaultEntry);
}
return policies_;
}
public int getPoliciesCount() {
return internalGetPolicies().getMap().size();
}
/**
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
*
* map<string, .envoy.config.rbac.v3.Policy> policies = 2;
*/
@java.lang.Override
public boolean containsPolicies(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetPolicies().getMap().containsKey(key);
}
/**
* Use {@link #getPoliciesMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getPolicies() {
return getPoliciesMap();
}
/**
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
*
* map<string, .envoy.config.rbac.v3.Policy> policies = 2;
*/
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.Policy getPoliciesOrThrow(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetPolicies().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int AUDIT_LOGGING_OPTIONS_FIELD_NUMBER = 3;
private io.envoyproxy.envoy.config.rbac.v3.RBAC.AuditLoggingOptions auditLoggingOptions_;
/**
*
* Audit logging options that include the condition for audit logging to happen
* and audit logger configurations.
* [#not-implemented-hide:]
*
*
* .envoy.config.rbac.v3.RBAC.AuditLoggingOptions audit_logging_options = 3;
* @return Whether the auditLoggingOptions field is set.
*/
@java.lang.Override
public boolean hasAuditLoggingOptions() {
return auditLoggingOptions_ != null;
}
/**
*
* Audit logging options that include the condition for audit logging to happen
* and audit logger configurations.
* [#not-implemented-hide:]
*
* Role Based Access Control (RBAC) provides service-level and method-level access control for a
* service. Requests are allowed or denied based on the ``action`` and whether a matching policy is
* found. For instance, if the action is ALLOW and a matching policy is found the request should be
* allowed.
* RBAC can also be used to make access logging decisions by communicating with access loggers
* through dynamic metadata. When the action is LOG and at least one policy matches, the
* ``access_log_hint`` value in the shared key namespace 'envoy.common' is set to ``true`` indicating
* the request should be logged.
* Here is an example of RBAC configuration. It has two policies:
* * Service account ``cluster.local/ns/default/sa/admin`` has full access to the service, and so
* does "cluster.local/ns/default/sa/superuser".
* * Any user can read (``GET``) the service at paths with prefix ``/products``, so long as the
* destination port is either 80 or 443.
* .. code-block:: yaml
* action: ALLOW
* policies:
* "service-admin":
* permissions:
* - any: true
* principals:
* - authenticated:
* principal_name:
* exact: "cluster.local/ns/default/sa/admin"
* - authenticated:
* principal_name:
* exact: "cluster.local/ns/default/sa/superuser"
* "product-viewer":
* permissions:
* - and_rules:
* rules:
* - header:
* name: ":method"
* string_match:
* exact: "GET"
* - url_path:
* path: { prefix: "/products" }
* - or_rules:
* rules:
* - destination_port: 80
* - destination_port: 443
* principals:
* - any: true
*
*
* Protobuf type {@code envoy.config.rbac.v3.RBAC}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:envoy.config.rbac.v3.RBAC)
io.envoyproxy.envoy.config.rbac.v3.RBACOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.config.rbac.v3.RbacProto.internal_static_envoy_config_rbac_v3_RBAC_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 2:
return internalGetPolicies();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMutableMapField(
int number) {
switch (number) {
case 2:
return internalGetMutablePolicies();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.config.rbac.v3.RbacProto.internal_static_envoy_config_rbac_v3_RBAC_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.config.rbac.v3.RBAC.class, io.envoyproxy.envoy.config.rbac.v3.RBAC.Builder.class);
}
// Construct using io.envoyproxy.envoy.config.rbac.v3.RBAC.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
action_ = 0;
internalGetMutablePolicies().clear();
if (auditLoggingOptionsBuilder_ == null) {
auditLoggingOptions_ = null;
} else {
auditLoggingOptions_ = null;
auditLoggingOptionsBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.envoyproxy.envoy.config.rbac.v3.RbacProto.internal_static_envoy_config_rbac_v3_RBAC_descriptor;
}
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC getDefaultInstanceForType() {
return io.envoyproxy.envoy.config.rbac.v3.RBAC.getDefaultInstance();
}
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC build() {
io.envoyproxy.envoy.config.rbac.v3.RBAC result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC buildPartial() {
io.envoyproxy.envoy.config.rbac.v3.RBAC result = new io.envoyproxy.envoy.config.rbac.v3.RBAC(this);
int from_bitField0_ = bitField0_;
result.action_ = action_;
result.policies_ = internalGetPolicies();
result.policies_.makeImmutable();
if (auditLoggingOptionsBuilder_ == null) {
result.auditLoggingOptions_ = auditLoggingOptions_;
} else {
result.auditLoggingOptions_ = auditLoggingOptionsBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.envoyproxy.envoy.config.rbac.v3.RBAC) {
return mergeFrom((io.envoyproxy.envoy.config.rbac.v3.RBAC)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.envoyproxy.envoy.config.rbac.v3.RBAC other) {
if (other == io.envoyproxy.envoy.config.rbac.v3.RBAC.getDefaultInstance()) return this;
if (other.action_ != 0) {
setActionValue(other.getActionValue());
}
internalGetMutablePolicies().mergeFrom(
other.internalGetPolicies());
if (other.hasAuditLoggingOptions()) {
mergeAuditLoggingOptions(other.getAuditLoggingOptions());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.envoyproxy.envoy.config.rbac.v3.RBAC parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.envoyproxy.envoy.config.rbac.v3.RBAC) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int action_ = 0;
/**
*
* The action to take if a policy matches. Every action either allows or denies a request,
* and can also carry out action-specific operations.
* Actions:
* * ``ALLOW``: Allows the request if and only if there is a policy that matches
* the request.
* * ``DENY``: Allows the request if and only if there are no policies that
* match the request.
* * ``LOG``: Allows all requests. If at least one policy matches, the dynamic
* metadata key ``access_log_hint`` is set to the value ``true`` under the shared
* key namespace ``envoy.common``. If no policies match, it is set to ``false``.
* Other actions do not modify this key.
*
*
* .envoy.config.rbac.v3.RBAC.Action action = 1 [(.validate.rules) = { ... }
* @return The enum numeric value on the wire for action.
*/
@java.lang.Override public int getActionValue() {
return action_;
}
/**
*
* The action to take if a policy matches. Every action either allows or denies a request,
* and can also carry out action-specific operations.
* Actions:
* * ``ALLOW``: Allows the request if and only if there is a policy that matches
* the request.
* * ``DENY``: Allows the request if and only if there are no policies that
* match the request.
* * ``LOG``: Allows all requests. If at least one policy matches, the dynamic
* metadata key ``access_log_hint`` is set to the value ``true`` under the shared
* key namespace ``envoy.common``. If no policies match, it is set to ``false``.
* Other actions do not modify this key.
*
*
* .envoy.config.rbac.v3.RBAC.Action action = 1 [(.validate.rules) = { ... }
* @param value The enum numeric value on the wire for action to set.
* @return This builder for chaining.
*/
public Builder setActionValue(int value) {
action_ = value;
onChanged();
return this;
}
/**
*
* The action to take if a policy matches. Every action either allows or denies a request,
* and can also carry out action-specific operations.
* Actions:
* * ``ALLOW``: Allows the request if and only if there is a policy that matches
* the request.
* * ``DENY``: Allows the request if and only if there are no policies that
* match the request.
* * ``LOG``: Allows all requests. If at least one policy matches, the dynamic
* metadata key ``access_log_hint`` is set to the value ``true`` under the shared
* key namespace ``envoy.common``. If no policies match, it is set to ``false``.
* Other actions do not modify this key.
*
*
* .envoy.config.rbac.v3.RBAC.Action action = 1 [(.validate.rules) = { ... }
* @return The action.
*/
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.RBAC.Action getAction() {
@SuppressWarnings("deprecation")
io.envoyproxy.envoy.config.rbac.v3.RBAC.Action result = io.envoyproxy.envoy.config.rbac.v3.RBAC.Action.valueOf(action_);
return result == null ? io.envoyproxy.envoy.config.rbac.v3.RBAC.Action.UNRECOGNIZED : result;
}
/**
*
* The action to take if a policy matches. Every action either allows or denies a request,
* and can also carry out action-specific operations.
* Actions:
* * ``ALLOW``: Allows the request if and only if there is a policy that matches
* the request.
* * ``DENY``: Allows the request if and only if there are no policies that
* match the request.
* * ``LOG``: Allows all requests. If at least one policy matches, the dynamic
* metadata key ``access_log_hint`` is set to the value ``true`` under the shared
* key namespace ``envoy.common``. If no policies match, it is set to ``false``.
* Other actions do not modify this key.
*
*
* .envoy.config.rbac.v3.RBAC.Action action = 1 [(.validate.rules) = { ... }
* @param value The action to set.
* @return This builder for chaining.
*/
public Builder setAction(io.envoyproxy.envoy.config.rbac.v3.RBAC.Action value) {
if (value == null) {
throw new NullPointerException();
}
action_ = value.getNumber();
onChanged();
return this;
}
/**
*
* The action to take if a policy matches. Every action either allows or denies a request,
* and can also carry out action-specific operations.
* Actions:
* * ``ALLOW``: Allows the request if and only if there is a policy that matches
* the request.
* * ``DENY``: Allows the request if and only if there are no policies that
* match the request.
* * ``LOG``: Allows all requests. If at least one policy matches, the dynamic
* metadata key ``access_log_hint`` is set to the value ``true`` under the shared
* key namespace ``envoy.common``. If no policies match, it is set to ``false``.
* Other actions do not modify this key.
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
*
* map<string, .envoy.config.rbac.v3.Policy> policies = 2;
*/
@java.lang.Override
public boolean containsPolicies(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetPolicies().getMap().containsKey(key);
}
/**
* Use {@link #getPoliciesMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getPolicies() {
return getPoliciesMap();
}
/**
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
*
* map<string, .envoy.config.rbac.v3.Policy> policies = 2;
*/
@java.lang.Override
public io.envoyproxy.envoy.config.rbac.v3.Policy getPoliciesOrThrow(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
java.util.Map map =
internalGetPolicies().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearPolicies() {
internalGetMutablePolicies().getMutableMap()
.clear();
return this;
}
/**
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
*
* map<string, .envoy.config.rbac.v3.Policy> policies = 2;
*/
public Builder removePolicies(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
internalGetMutablePolicies().getMutableMap()
.remove(key);
return this;
}
/**
* Use alternate mutation accessors instead.
*/
@java.lang.Deprecated
public java.util.Map
getMutablePolicies() {
return internalGetMutablePolicies().getMutableMap();
}
/**
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*
*
* map<string, .envoy.config.rbac.v3.Policy> policies = 2;
*/
public Builder putPolicies(
java.lang.String key,
io.envoyproxy.envoy.config.rbac.v3.Policy value) {
if (key == null) { throw new NullPointerException("map key"); }
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutablePolicies().getMutableMap()
.put(key, value);
return this;
}
/**
*
* Maps from policy name to policy. A match occurs when at least one policy matches the request.
* The policies are evaluated in lexicographic order of the policy name.
*